chore: trim unnecessary Arti features to reduce binary size

- Set default-features = false on arti-client and tor-rtcompat
- Removed bridge-client (UI doesn't expose bridge config yet)
- Narrowed tokio features from "full" to only what the SOCKS proxy
  needs: rt-multi-thread, net, io-util, time, macros

Kept: tokio, rustls, compression, onion-service-client, static-sqlite
(all required for Amethyst's .onion relay support)

https://claude.ai/code/session_01BApgDd5udqBzMqysSRMpZu
This commit is contained in:
Claude
2026-04-01 17:12:35 +00:00
parent 35bf16b63e
commit 53ae87aa9d
2 changed files with 20 additions and 11 deletions
+3 -4
View File
@@ -9,17 +9,16 @@ crate-type = ["cdylib"]
[workspace]
[dependencies]
arti-client = { version = "0.38", features = [
arti-client = { version = "0.38", default-features = false, features = [
"tokio",
"rustls",
"compression",
"bridge-client",
"onion-service-client",
"static-sqlite",
] }
tor-rtcompat = { version = "0.38", features = ["tokio", "rustls"] }
tor-rtcompat = { version = "0.38", default-features = false, features = ["tokio", "rustls"] }
jni = "0.21"
tokio = { version = "1", features = ["full"] }
tokio = { version = "1", features = ["rt-multi-thread", "net", "io-util", "time", "macros"] }
anyhow = "1"
[profile.release]
+17 -7
View File
@@ -148,14 +148,24 @@ The Rust wrapper (`src/lib.rs`) exposes these JNI functions to Kotlin:
## Cargo.toml features
| Feature | Purpose |
Default features are disabled (`default-features = false`) to minimize binary size.
| Feature | Purpose | Why included |
|---|---|---|
| `tokio` | Async runtime | Required by our SOCKS proxy |
| `rustls` | TLS via pure Rust | No OpenSSL dependency, smaller binary |
| `compression` | zstd/deflate relay traffic | Reduces bandwidth on Tor circuits |
| `onion-service-client` | Access .onion addresses | Amethyst routes .onion relay connections through Tor |
| `static-sqlite` | Bundled SQLite | Android native code can't use system SQLite |
**Not included:**
| Feature | Why excluded |
|---|---|
| `tokio` | Async runtime |
| `rustls` | TLS without OpenSSL (smaller, no system dependency) |
| `compression` | Tor relay compression support |
| `bridge-client` | Connect via Tor bridges |
| `onion-service-client` | Access .onion addresses |
| `static-sqlite` | Bundled SQLite for state storage |
| `native-tls` | Using `rustls` instead (smaller, no system dependency) |
| `bridge-client` | Amethyst doesn't expose bridge configuration in UI yet. Add back if needed. |
| `pt-client` | Pluggable transports — same reason as bridges |
| `onion-service-service` | We only connect to .onion, we don't host them |
### Release profile