6 Commits

Author SHA1 Message Date
LIAUD Corentin
81829c1523 chore: v2.1.14 2025-07-07 08:21:22 +02:00
LIAUD Corentin
b9d2b8374f dep(homedir): fix to 0.3.4 to fix windows build 2025-07-06 20:00:24 +02:00
LIAUD Corentin
5716784f5d deps(homedir): fix version 0.3.5 because of hard rust 1.88 dep 2025-07-06 19:42:15 +02:00
LIAUD Corentin
b6ddc720d8 chore(clippy): run linter 2025-07-06 19:41:58 +02:00
Sashanoraa
5438e53361 Support devices that don't do auth (#124) 2025-07-06 19:34:34 +02:00
cocool97
39a7f0a8cf chore: bump criterion + pyo3 (#122) 2025-05-24 14:56:34 +02:00
7 changed files with 19 additions and 18 deletions

View File

@@ -9,7 +9,7 @@ homepage = "https://github.com/cocool97/adb_client"
keywords = ["adb", "android", "tcp", "usb"]
license = "MIT"
repository = "https://github.com/cocool97/adb_client"
version = "2.1.13"
version = "2.1.14"
# To build locally when working on a new release
[patch.crates-io]

View File

@@ -14,7 +14,7 @@ base64 = { version = "0.22.1" }
bincode = { version = "1.3.3" }
byteorder = { version = "1.5.0" }
chrono = { version = "0.4.40", default-features = false, features = ["std"] }
homedir = { version = "0.3.4" }
homedir = { version = "= 0.3.4" }
image = { version = "0.25.5", default-features = false }
log = { version = "0.4.26" }
mdns-sd = { version = "0.13.9", default-features = false, features = [
@@ -40,7 +40,7 @@ thiserror = { version = "2.0.7" }
[dev-dependencies]
anyhow = { version = "1.0.93" }
criterion = { version = "0.5.1" } # Used for benchmarks
criterion = { version = "0.6.0" } # Used for benchmarks
[[bench]]
harness = false

View File

@@ -180,6 +180,11 @@ impl ADBUSBDevice {
self.get_transport_mut().write_message(message)?;
let message = self.get_transport_mut().read_message()?;
// If the device returned CNXN instead of AUTH it does not require authentication,
// so we can skip the auth steps.
if message.header().command() == MessageCommand::Cnxn {
return Ok(());
}
message.assert_command(MessageCommand::Auth)?;
// At this point, we should have receive an AUTH message with arg0 == 1

View File

@@ -35,10 +35,10 @@ impl<T: ADBMessageTransport> Write for MessageWriter<T> {
Ok(response) => {
response
.assert_command(MessageCommand::Okay)
.map_err(|e| Error::new(ErrorKind::Other, e))?;
.map_err(Error::other)?;
Ok(buf.len())
}
Err(e) => Err(Error::new(ErrorKind::Other, e)),
Err(e) => Err(Error::other(e)),
}
}

View File

@@ -42,18 +42,15 @@ impl<R: Read> Read for ADBRecvCommandReader<R> {
let mut error_msg = vec![0; length];
self.inner.read_exact(&mut error_msg)?;
Err(std::io::Error::new(
std::io::ErrorKind::Other,
format!(
"ADB request failed: {}",
String::from_utf8_lossy(&error_msg)
),
))
Err(std::io::Error::other(format!(
"ADB request failed: {}",
String::from_utf8_lossy(&error_msg)
)))
}
_ => Err(std::io::Error::new(
std::io::ErrorKind::Other,
format!("Unknown response from device {:#?}", header),
)),
_ => Err(std::io::Error::other(format!(
"Unknown response from device {:#?}",
header
))),
}
} else {
// Computing minimum to ensure to stop reading before next header...

View File

@@ -21,6 +21,6 @@ name = "stub_gen"
[dependencies]
adb_client = { path = "../adb_client" }
anyhow = { version = "1.0.95" }
pyo3 = { version = "0.24.1", features = ["abi3-py37", "anyhow"] }
pyo3 = { version = "0.25.0", features = ["abi3-py37", "anyhow"] }
pyo3-stub-gen = "0.7.0"
pyo3-stub-gen-derive = "0.7.0"

View File

@@ -47,7 +47,6 @@ usb_device.push("file.txt", "/data/local/tmp/file.txt")
```bash
# Create Python virtual environment
cd pyadb_client
python3 -m venv .venv
source .venv/bin/activate