feat(android): SDK AAR (UniFFI) + Compose APK, Arti rustls feature split
All checks were successful
ci / test (pull_request) Successful in 3m22s
All checks were successful
ci / test (pull_request) Successful in 3m22s
Adds the Android product alongside the existing Linux TUI, in one repo. SDK — crates/onionwire-sdk is a UniFFI facade over the very same `onionwire` crate the TUI runs on. Identity, invite, friend upsert, send/receive, rotate and wipe all delegate; no protocol is reimplemented, so an Android peer and a Linux peer interoperate. It is its own Cargo workspace because Arti's TLS backends are non-additive: the TUI keeps native-tls (OpenSSL), Android needs rustls + static-sqlite (no OpenSSL, no system libsqlite3 in the NDK). android/ — Gradle project. :sdk produces the AAR (Kotlin bindings generated at build time + libonionwire_sdk.so via cargo-ndk), :app is a Kotlin/Compose/M3 messenger depending on :sdk only. minSdk 26, targetSdk/compileSdk 36, INTERNET-only, data in filesDir, backups excluded. Root Cargo.toml grows `native-tls` (default) and `rustls` features so exactly one Arti TLS backend is selected per build graph. The default build is unchanged: same backend, ratatui still a normal dependency, src/tui.rs untouched. Also: Store::self_fingerprint/set_petname + Node wrappers (additive only), scripts/build-android-local.sh, README sections, .gitignore for local SDK paths.
This commit is contained in:
parent
2b42864eba
commit
672f2c9990
41 changed files with 9387 additions and 1 deletions
17
src/store.rs
17
src/store.rs
|
|
@ -385,6 +385,23 @@ impl Store {
|
|||
.map_err(Into::into)
|
||||
}
|
||||
|
||||
/// Display fingerprint of our own identity key (identity = pubkey).
|
||||
pub fn self_fingerprint(&self) -> Result<String> {
|
||||
Ok(fingerprint(&self.self_identity()?.identity_pk))
|
||||
}
|
||||
|
||||
/// Local petname only. Never part of the wire protocol.
|
||||
pub fn set_petname(&self, pubkey: &[u8], petname: Option<&str>) -> Result<()> {
|
||||
let n = self.conn.execute(
|
||||
"UPDATE friends SET petname = ?1 WHERE pubkey = ?2",
|
||||
params![petname, pubkey],
|
||||
)?;
|
||||
if n == 0 {
|
||||
return Err(Error("friend not found".into()));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn upsert_friend(&self, pubkey: &[u8], onion: &str, petname: Option<&str>) -> Result<()> {
|
||||
let now = unix_now();
|
||||
let fp = fingerprint(pubkey);
|
||||
|
|
|
|||
Loading…
Reference in a new issue