diff --git a/adb_client/Cargo.toml b/adb_client/Cargo.toml index 2e63047d..bfcaa020 100644 --- a/adb_client/Cargo.toml +++ b/adb_client/Cargo.toml @@ -10,37 +10,44 @@ repository.workspace = true version.workspace = true [dependencies] -base64 = { version = "0.22.1" } +getrandom = { version = "*", features = ["js"] } +ring = { version = "*", features = ["wasm32_unknown_unknown_js"] } + 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"] } -homedir = { version = "0.3.4" } +homedir = { version = "0.3.4", optional = true } image = { version = "0.25.5", default-features = false } log = { version = "0.4.26" } mdns-sd = { version = "0.13.9", default-features = false, features = [ "logging", -] } -num-bigint = { version = "0.8.4", package = "num-bigint-dig" } -num-traits = { version = "0.2.19" } -quick-protobuf = { version = "0.8.1" } -rand = { version = "0.9.0" } +], optional = true } +num-bigint = { version = "0.8.4", package = "num-bigint-dig", optional = true } +num-traits = { version = "0.2.19", optional = true } +quick-protobuf = { version = "0.8.1", optional = true } +rand = { version = "0.8.5", optional = true } rcgen = { version = "0.13.1", default-features = false, features = [ "aws_lc_rs", "pem", -] } -regex = { version = "1.11.1", features = ["perf", "std", "unicode"] } -rsa = { version = "0.9.7" } -rusb = { version = "0.9.4", features = ["vendored"] } -rustls = { version = "0.23.27" } -rustls-pki-types = { version = "1.11.0" } +], optional = true } +regex = { version = "1.11.1", features = [ + "perf", + "std", + "unicode", +], 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_repr = { version = "0.1.19" } -sha1 = { version = "0.10.6", features = ["oid"] } +serde_repr = { version = "0.1.19", optional = true } +sha1 = { version = "0.10.6", features = ["oid"], optional = true } 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 diff --git a/adb_client/src/lib.rs b/adb_client/src/lib.rs index fa509b85..25829669 100644 --- a/adb_client/src/lib.rs +++ b/adb_client/src/lib.rs @@ -7,21 +7,37 @@ mod adb_device_ext; mod constants; mod device; -mod emulator_device; mod error; -mod mdns; mod models; +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; -mod transports; +#[cfg(not(target_arch = "wasm32"))] mod utils; pub use adb_device_ext::ADBDeviceExt; -pub use device::{ADBTcpDevice, ADBUSBDevice}; -pub use emulator_device::ADBEmulatorDevice; +pub use device::ADBUSBDevice; pub use error::{Result, RustADBError}; -pub use mdns::*; 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::*; +#[cfg(not(target_arch = "wasm32"))] pub use server_device::ADBServerDevice; +#[cfg(not(target_arch = "wasm32"))] pub use transports::*; diff --git a/pyadb_client/Cargo.toml b/pyadb_client/Cargo.toml index d53a5196..6e860cb0 100644 --- a/pyadb_client/Cargo.toml +++ b/pyadb_client/Cargo.toml @@ -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" diff --git a/pyadb_client/README.md b/pyadb_client/README.md index 83b22d56..c3d21108 100644 --- a/pyadb_client/README.md +++ b/pyadb_client/README.md @@ -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