2 Commits

Author SHA1 Message Date
LIAUD Corentin
aa3943f21f wip: add wasm target support 2025-05-24 14:57:17 +02:00
LIAUD Corentin
4ebbd99607 chore: bump criterion + pyo3 2025-05-24 13:47:46 +02:00
4 changed files with 48 additions and 26 deletions

View File

@@ -10,37 +10,44 @@ repository.workspace = true
version.workspace = true version.workspace = true
[dependencies] [dependencies]
base64 = { version = "0.22.1" } getrandom = { version = "*", features = ["js"] }
ring = { version = "*", features = ["wasm32_unknown_unknown_js"] }
bincode = { version = "1.3.3" } bincode = { version = "1.3.3" }
byteorder = { version = "1.5.0" } base64 = { version = "0.22.1", optional = true }
byteorder = { version = "1.5.0", optional = true }
chrono = { version = "0.4.40", default-features = false, features = ["std"] } chrono = { version = "0.4.40", default-features = false, features = ["std"] }
homedir = { version = "0.3.4" } homedir = { version = "0.3.4", optional = true }
image = { version = "0.25.5", default-features = false } image = { version = "0.25.5", default-features = false }
log = { version = "0.4.26" } log = { version = "0.4.26" }
mdns-sd = { version = "0.13.9", default-features = false, features = [ mdns-sd = { version = "0.13.9", default-features = false, features = [
"logging", "logging",
] } ], optional = true }
num-bigint = { version = "0.8.4", package = "num-bigint-dig" } num-bigint = { version = "0.8.4", package = "num-bigint-dig", optional = true }
num-traits = { version = "0.2.19" } num-traits = { version = "0.2.19", optional = true }
quick-protobuf = { version = "0.8.1" } quick-protobuf = { version = "0.8.1", optional = true }
rand = { version = "0.9.0" } rand = { version = "0.8.5", optional = true }
rcgen = { version = "0.13.1", default-features = false, features = [ rcgen = { version = "0.13.1", default-features = false, features = [
"aws_lc_rs", "aws_lc_rs",
"pem", "pem",
] } ], optional = true }
regex = { version = "1.11.1", features = ["perf", "std", "unicode"] } regex = { version = "1.11.1", features = [
rsa = { version = "0.9.7" } "perf",
rusb = { version = "0.9.4", features = ["vendored"] } "std",
rustls = { version = "0.23.27" } "unicode",
rustls-pki-types = { version = "1.11.0" } ], optional = true }
rsa = { version = "0.9.7", optional = true }
rusb = { version = "0.9.4", features = ["vendored"], optional = true }
rustls = { version = "0.23.27", optional = true }
rustls-pki-types = { version = "1.11.0", optional = true }
serde = { version = "1.0.216", features = ["derive"] } serde = { version = "1.0.216", features = ["derive"] }
serde_repr = { version = "0.1.19" } serde_repr = { version = "0.1.19", optional = true }
sha1 = { version = "0.10.6", features = ["oid"] } sha1 = { version = "0.10.6", features = ["oid"], optional = true }
thiserror = { version = "2.0.7" } thiserror = { version = "2.0.7" }
[dev-dependencies] [dev-dependencies]
anyhow = { version = "1.0.93" } anyhow = { version = "1.0.93" }
criterion = { version = "0.5.1" } # Used for benchmarks criterion = { version = "0.6.0" } # Used for benchmarks
[[bench]] [[bench]]
harness = false harness = false

View File

@@ -7,21 +7,37 @@
mod adb_device_ext; mod adb_device_ext;
mod constants; mod constants;
mod device; mod device;
mod emulator_device;
mod error; mod error;
mod mdns;
mod models; mod models;
mod server;
mod server_device;
mod transports; mod transports;
#[cfg(not(target_arch = "wasm32"))]
mod emulator_device;
#[cfg(not(target_arch = "wasm32"))]
mod mdns;
#[cfg(not(target_arch = "wasm32"))]
mod server;
#[cfg(not(target_arch = "wasm32"))]
mod server_device;
#[cfg(not(target_arch = "wasm32"))]
mod utils; mod utils;
pub use adb_device_ext::ADBDeviceExt; pub use adb_device_ext::ADBDeviceExt;
pub use device::{ADBTcpDevice, ADBUSBDevice}; pub use device::ADBUSBDevice;
pub use emulator_device::ADBEmulatorDevice;
pub use error::{Result, RustADBError}; pub use error::{Result, RustADBError};
pub use mdns::*;
pub use models::{AdbStatResponse, RebootType}; pub use models::{AdbStatResponse, RebootType};
pub use transports::{ADBMessageTransport, ADBTransport};
#[cfg(not(target_arch = "wasm32"))]
pub use device::ADBTcpDevice;
#[cfg(not(target_arch = "wasm32"))]
pub use emulator_device::ADBEmulatorDevice;
#[cfg(not(target_arch = "wasm32"))]
pub use mdns::*;
#[cfg(not(target_arch = "wasm32"))]
pub use server::*; pub use server::*;
#[cfg(not(target_arch = "wasm32"))]
pub use server_device::ADBServerDevice; pub use server_device::ADBServerDevice;
#[cfg(not(target_arch = "wasm32"))]
pub use transports::*; pub use transports::*;

View File

@@ -21,6 +21,6 @@ name = "stub_gen"
[dependencies] [dependencies]
adb_client = { path = "../adb_client" } adb_client = { path = "../adb_client" }
anyhow = { version = "1.0.95" } 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 = "0.7.0"
pyo3-stub-gen-derive = "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 ```bash
# Create Python virtual environment # Create Python virtual environment
cd pyadb_client
python3 -m venv .venv python3 -m venv .venv
source .venv/bin/activate source .venv/bin/activate