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
[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

View File

@@ -7,21 +7,37 @@
mod adb_device_ext;
mod constants;
mod device;
mod emulator_device;
mod error;
mod mdns;
mod models;
mod server;
mod server_device;
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;
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::*;

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