onionwire/android/MONERO_BINARIES.md

191 lines
10 KiB
Markdown
Raw Normal View History

android: start/stop the monero-wallet-rpc child from WalletScreen, bundle the binary Implements the Android half of issue #107. Stacked on `wt/t_8a8ff353` (PR #108) because the UniFFI wallet-child surface is not on `main` yet. Binary ------ `android/app/src/main/jniLibs/arm64-v8a/libmonerowalletrpc.so` is a real `monero-wallet-rpc` cross-compiled for `aarch64-linux-android` from monero-project/monero v0.18.4.4 (516e5355) via upstream's own `contrib/depends` + toolchain.cmake path, then stripped with the target's own strip. 19 954 224 bytes, sha256 d9126788030ecd1ccdb40c7764e66e9a14d158a147ad335b256f0577681b5ad4. It ships through `jniLibs` and not as an asset on purpose: since API 29 the kernel refuses `exec()` on a file in the app's data directory, so the only executable directory an app has is `applicationInfo.nativeLibraryDir`, which the package manager fills from `lib/<abi>/` at install time. That requires `android:extractNativeLibs="true"` (`packaging.jniLibs.useLegacyPackaging`), which `app/build.gradle.kts` now sets, plus `keepDebugSymbols` for this one entry so AGP's strip pass cannot rewrite the bytes CI verifies. `scripts/build-monero-wallet-rpc-android.sh` reproduces the build and `android/MONERO_BINARIES.md` records the four host quirks that cost the most time (CMake must be 3.x; NDK r17b clang60 needs a libtinfo.so.5 shim; the generated toolchain.cmake puts the HOST `/usr` in CMAKE_FIND_ROOT_PATH, which breaks the link with a host libpgm.so and defines HAVE_HIDAPI against host headers; the CMake target is `wallet_rpc_server`, not `monero-wallet-rpc`). CI re-verifies the blob rather than taking it on trust: `scripts/build-android-local.sh` checks `android/monero-binaries.sha256` before Gradle, and after packaging pulls `lib/<abi>/libmonerowalletrpc.so` back out of the APK and compares its sha256 with the committed file. `arti` is NOT bundled, so a `.onion` daemon cannot be started yet. The app says that instead of pretending: `arti_bin` is set to the path the binary would occupy, and the screen refuses an `.onion` daemon while it is absent. Loopback and clearnet daemons work. UI -- `WalletScreen` gains a "wallet daemon" card above the existing Create / Import / Invoice / Tip actions, which are untouched: * a status line from `Wire::wallet_status()` rendered verbatim — `off` / `connecting` / `syncing` / `ready` / `exited` plus the core's chain-source label (`receive-only` / `local node` / `remote onion daemon` / `remote daemon`). A died child reads `exited`; it is never folded into `off` and never into `ready`; * Start / Stop calling `start_wallet_child` / `stop_wallet_child` through `WireViewModel`, on `Dispatchers.IO` (the spawn is synchronous inside the node and the status read re-decrypts the sealed record); * a `host:port` field that saves a remote daemon via `set_chain_source`, plus a Receive-only button; * honest failure states instead of a spinner: no bundled binary, no chain source, a `.onion` daemon with no arti, or a start that failed — each gets its own sentence, and Start is disabled with the reason on screen. `WireViewModel` owns the 2s wallet-child poller, the same way it owns the chat poller, so leaving the wallet screen and coming back cannot stack a second loop. `ui/WalletChildStatusText.kt` is the pure model (mirrors the `ChatRowInput`/`OutboxRowInput` convention) and carries the state mapping, the status line and the Start/Stop gates; `WalletChildStatusTextTest` covers them on the JVM. Verified -------- `./gradlew :app:testDebugUnitTest` passes, `scripts/build-android-local.sh` produces `dist/onionwire-0.1.0-android-arm64-v8a.apk` (27 884 277 bytes, versionName 0.1.0 / versionCode 100) with `lib/arm64-v8a/libmonerowalletrpc.so` inside it at the committed sha256, and `extractNativeLibs="true"` in the merged release manifest. NOT verified: the binary was never executed. The build host has no arm64-v8a AVD (all three existing AVDs are x86_64) and no aarch64 sysroot for qemu-user, so nothing here proves `monero-wallet-rpc` starts, opens its wallet file and answers JSON-RPC under Android's runtime. `android/MONERO_BINARIES.md` says so plainly and lists the emulator steps to close the gap.
2026-09-18 10:19:18 -04:00
# Bundled native executables (`jniLibs`)
The wallet screen starts an **app-owned `monero-wallet-rpc` child** (issue #107,
[`src/wallet_child.rs`](../src/wallet_child.rs)). Monero ships no Android
binaries, so this repository carries one, built here.
android: start/stop the monero-wallet-rpc child from WalletScreen, bundle the binary Implements the Android half of issue #107. Stacked on `wt/t_8a8ff353` (PR #108) because the UniFFI wallet-child surface is not on `main` yet. Binary ------ `android/app/src/main/jniLibs/arm64-v8a/libmonerowalletrpc.so` is a real `monero-wallet-rpc` cross-compiled for `aarch64-linux-android` from monero-project/monero v0.18.4.4 (516e5355) via upstream's own `contrib/depends` + toolchain.cmake path, then stripped with the target's own strip. 19 954 224 bytes, sha256 d9126788030ecd1ccdb40c7764e66e9a14d158a147ad335b256f0577681b5ad4. It ships through `jniLibs` and not as an asset on purpose: since API 29 the kernel refuses `exec()` on a file in the app's data directory, so the only executable directory an app has is `applicationInfo.nativeLibraryDir`, which the package manager fills from `lib/<abi>/` at install time. That requires `android:extractNativeLibs="true"` (`packaging.jniLibs.useLegacyPackaging`), which `app/build.gradle.kts` now sets, plus `keepDebugSymbols` for this one entry so AGP's strip pass cannot rewrite the bytes CI verifies. `scripts/build-monero-wallet-rpc-android.sh` reproduces the build and `android/MONERO_BINARIES.md` records the four host quirks that cost the most time (CMake must be 3.x; NDK r17b clang60 needs a libtinfo.so.5 shim; the generated toolchain.cmake puts the HOST `/usr` in CMAKE_FIND_ROOT_PATH, which breaks the link with a host libpgm.so and defines HAVE_HIDAPI against host headers; the CMake target is `wallet_rpc_server`, not `monero-wallet-rpc`). CI re-verifies the blob rather than taking it on trust: `scripts/build-android-local.sh` checks `android/monero-binaries.sha256` before Gradle, and after packaging pulls `lib/<abi>/libmonerowalletrpc.so` back out of the APK and compares its sha256 with the committed file. `arti` is NOT bundled, so a `.onion` daemon cannot be started yet. The app says that instead of pretending: `arti_bin` is set to the path the binary would occupy, and the screen refuses an `.onion` daemon while it is absent. Loopback and clearnet daemons work. UI -- `WalletScreen` gains a "wallet daemon" card above the existing Create / Import / Invoice / Tip actions, which are untouched: * a status line from `Wire::wallet_status()` rendered verbatim — `off` / `connecting` / `syncing` / `ready` / `exited` plus the core's chain-source label (`receive-only` / `local node` / `remote onion daemon` / `remote daemon`). A died child reads `exited`; it is never folded into `off` and never into `ready`; * Start / Stop calling `start_wallet_child` / `stop_wallet_child` through `WireViewModel`, on `Dispatchers.IO` (the spawn is synchronous inside the node and the status read re-decrypts the sealed record); * a `host:port` field that saves a remote daemon via `set_chain_source`, plus a Receive-only button; * honest failure states instead of a spinner: no bundled binary, no chain source, a `.onion` daemon with no arti, or a start that failed — each gets its own sentence, and Start is disabled with the reason on screen. `WireViewModel` owns the 2s wallet-child poller, the same way it owns the chat poller, so leaving the wallet screen and coming back cannot stack a second loop. `ui/WalletChildStatusText.kt` is the pure model (mirrors the `ChatRowInput`/`OutboxRowInput` convention) and carries the state mapping, the status line and the Start/Stop gates; `WalletChildStatusTextTest` covers them on the JVM. Verified -------- `./gradlew :app:testDebugUnitTest` passes, `scripts/build-android-local.sh` produces `dist/onionwire-0.1.0-android-arm64-v8a.apk` (27 884 277 bytes, versionName 0.1.0 / versionCode 100) with `lib/arm64-v8a/libmonerowalletrpc.so` inside it at the committed sha256, and `extractNativeLibs="true"` in the merged release manifest. NOT verified: the binary was never executed. The build host has no arm64-v8a AVD (all three existing AVDs are x86_64) and no aarch64 sysroot for qemu-user, so nothing here proves `monero-wallet-rpc` starts, opens its wallet file and answers JSON-RPC under Android's runtime. `android/MONERO_BINARIES.md` says so plainly and lists the emulator steps to close the gap.
2026-09-18 10:19:18 -04:00
| | |
|---|---|
| File in the tree | `android/app/src/main/jniLibs/arm64-v8a/libmonerowalletrpc.so` |
| Bytes | 19 954 224 (stripped) |
| sha256 | `d9126788030ecd1ccdb40c7764e66e9a14d158a147ad335b256f0577681b5ad4` |
| Format | `ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /system/bin/linker64, for Android 21, built by NDK r17b (4828580), stripped` |
android: start/stop the monero-wallet-rpc child from WalletScreen, bundle the binary Implements the Android half of issue #107. Stacked on `wt/t_8a8ff353` (PR #108) because the UniFFI wallet-child surface is not on `main` yet. Binary ------ `android/app/src/main/jniLibs/arm64-v8a/libmonerowalletrpc.so` is a real `monero-wallet-rpc` cross-compiled for `aarch64-linux-android` from monero-project/monero v0.18.4.4 (516e5355) via upstream's own `contrib/depends` + toolchain.cmake path, then stripped with the target's own strip. 19 954 224 bytes, sha256 d9126788030ecd1ccdb40c7764e66e9a14d158a147ad335b256f0577681b5ad4. It ships through `jniLibs` and not as an asset on purpose: since API 29 the kernel refuses `exec()` on a file in the app's data directory, so the only executable directory an app has is `applicationInfo.nativeLibraryDir`, which the package manager fills from `lib/<abi>/` at install time. That requires `android:extractNativeLibs="true"` (`packaging.jniLibs.useLegacyPackaging`), which `app/build.gradle.kts` now sets, plus `keepDebugSymbols` for this one entry so AGP's strip pass cannot rewrite the bytes CI verifies. `scripts/build-monero-wallet-rpc-android.sh` reproduces the build and `android/MONERO_BINARIES.md` records the four host quirks that cost the most time (CMake must be 3.x; NDK r17b clang60 needs a libtinfo.so.5 shim; the generated toolchain.cmake puts the HOST `/usr` in CMAKE_FIND_ROOT_PATH, which breaks the link with a host libpgm.so and defines HAVE_HIDAPI against host headers; the CMake target is `wallet_rpc_server`, not `monero-wallet-rpc`). CI re-verifies the blob rather than taking it on trust: `scripts/build-android-local.sh` checks `android/monero-binaries.sha256` before Gradle, and after packaging pulls `lib/<abi>/libmonerowalletrpc.so` back out of the APK and compares its sha256 with the committed file. `arti` is NOT bundled, so a `.onion` daemon cannot be started yet. The app says that instead of pretending: `arti_bin` is set to the path the binary would occupy, and the screen refuses an `.onion` daemon while it is absent. Loopback and clearnet daemons work. UI -- `WalletScreen` gains a "wallet daemon" card above the existing Create / Import / Invoice / Tip actions, which are untouched: * a status line from `Wire::wallet_status()` rendered verbatim — `off` / `connecting` / `syncing` / `ready` / `exited` plus the core's chain-source label (`receive-only` / `local node` / `remote onion daemon` / `remote daemon`). A died child reads `exited`; it is never folded into `off` and never into `ready`; * Start / Stop calling `start_wallet_child` / `stop_wallet_child` through `WireViewModel`, on `Dispatchers.IO` (the spawn is synchronous inside the node and the status read re-decrypts the sealed record); * a `host:port` field that saves a remote daemon via `set_chain_source`, plus a Receive-only button; * honest failure states instead of a spinner: no bundled binary, no chain source, a `.onion` daemon with no arti, or a start that failed — each gets its own sentence, and Start is disabled with the reason on screen. `WireViewModel` owns the 2s wallet-child poller, the same way it owns the chat poller, so leaving the wallet screen and coming back cannot stack a second loop. `ui/WalletChildStatusText.kt` is the pure model (mirrors the `ChatRowInput`/`OutboxRowInput` convention) and carries the state mapping, the status line and the Start/Stop gates; `WalletChildStatusTextTest` covers them on the JVM. Verified -------- `./gradlew :app:testDebugUnitTest` passes, `scripts/build-android-local.sh` produces `dist/onionwire-0.1.0-android-arm64-v8a.apk` (27 884 277 bytes, versionName 0.1.0 / versionCode 100) with `lib/arm64-v8a/libmonerowalletrpc.so` inside it at the committed sha256, and `extractNativeLibs="true"` in the merged release manifest. NOT verified: the binary was never executed. The build host has no arm64-v8a AVD (all three existing AVDs are x86_64) and no aarch64 sysroot for qemu-user, so nothing here proves `monero-wallet-rpc` starts, opens its wallet file and answers JSON-RPC under Android's runtime. `android/MONERO_BINARIES.md` says so plainly and lists the emulator steps to close the gap.
2026-09-18 10:19:18 -04:00
| Needed libs | `libc.so`, `libm.so`, `libdl.so` — everything else is static |
| Source | `https://github.com/monero-project/monero` |
| Tag | `v0.18.4.4` |
| Commit | `516e5355a103a2bf0b7e10328ebcaa2945019445` (peeled annotated tag) |
android: start/stop the monero-wallet-rpc child from WalletScreen, bundle the binary Implements the Android half of issue #107. Stacked on `wt/t_8a8ff353` (PR #108) because the UniFFI wallet-child surface is not on `main` yet. Binary ------ `android/app/src/main/jniLibs/arm64-v8a/libmonerowalletrpc.so` is a real `monero-wallet-rpc` cross-compiled for `aarch64-linux-android` from monero-project/monero v0.18.4.4 (516e5355) via upstream's own `contrib/depends` + toolchain.cmake path, then stripped with the target's own strip. 19 954 224 bytes, sha256 d9126788030ecd1ccdb40c7764e66e9a14d158a147ad335b256f0577681b5ad4. It ships through `jniLibs` and not as an asset on purpose: since API 29 the kernel refuses `exec()` on a file in the app's data directory, so the only executable directory an app has is `applicationInfo.nativeLibraryDir`, which the package manager fills from `lib/<abi>/` at install time. That requires `android:extractNativeLibs="true"` (`packaging.jniLibs.useLegacyPackaging`), which `app/build.gradle.kts` now sets, plus `keepDebugSymbols` for this one entry so AGP's strip pass cannot rewrite the bytes CI verifies. `scripts/build-monero-wallet-rpc-android.sh` reproduces the build and `android/MONERO_BINARIES.md` records the four host quirks that cost the most time (CMake must be 3.x; NDK r17b clang60 needs a libtinfo.so.5 shim; the generated toolchain.cmake puts the HOST `/usr` in CMAKE_FIND_ROOT_PATH, which breaks the link with a host libpgm.so and defines HAVE_HIDAPI against host headers; the CMake target is `wallet_rpc_server`, not `monero-wallet-rpc`). CI re-verifies the blob rather than taking it on trust: `scripts/build-android-local.sh` checks `android/monero-binaries.sha256` before Gradle, and after packaging pulls `lib/<abi>/libmonerowalletrpc.so` back out of the APK and compares its sha256 with the committed file. `arti` is NOT bundled, so a `.onion` daemon cannot be started yet. The app says that instead of pretending: `arti_bin` is set to the path the binary would occupy, and the screen refuses an `.onion` daemon while it is absent. Loopback and clearnet daemons work. UI -- `WalletScreen` gains a "wallet daemon" card above the existing Create / Import / Invoice / Tip actions, which are untouched: * a status line from `Wire::wallet_status()` rendered verbatim — `off` / `connecting` / `syncing` / `ready` / `exited` plus the core's chain-source label (`receive-only` / `local node` / `remote onion daemon` / `remote daemon`). A died child reads `exited`; it is never folded into `off` and never into `ready`; * Start / Stop calling `start_wallet_child` / `stop_wallet_child` through `WireViewModel`, on `Dispatchers.IO` (the spawn is synchronous inside the node and the status read re-decrypts the sealed record); * a `host:port` field that saves a remote daemon via `set_chain_source`, plus a Receive-only button; * honest failure states instead of a spinner: no bundled binary, no chain source, a `.onion` daemon with no arti, or a start that failed — each gets its own sentence, and Start is disabled with the reason on screen. `WireViewModel` owns the 2s wallet-child poller, the same way it owns the chat poller, so leaving the wallet screen and coming back cannot stack a second loop. `ui/WalletChildStatusText.kt` is the pure model (mirrors the `ChatRowInput`/`OutboxRowInput` convention) and carries the state mapping, the status line and the Start/Stop gates; `WalletChildStatusTextTest` covers them on the JVM. Verified -------- `./gradlew :app:testDebugUnitTest` passes, `scripts/build-android-local.sh` produces `dist/onionwire-0.1.0-android-arm64-v8a.apk` (27 884 277 bytes, versionName 0.1.0 / versionCode 100) with `lib/arm64-v8a/libmonerowalletrpc.so` inside it at the committed sha256, and `extractNativeLibs="true"` in the merged release manifest. NOT verified: the binary was never executed. The build host has no arm64-v8a AVD (all three existing AVDs are x86_64) and no aarch64 sysroot for qemu-user, so nothing here proves `monero-wallet-rpc` starts, opens its wallet file and answers JSON-RPC under Android's runtime. `android/MONERO_BINARIES.md` says so plainly and lists the emulator steps to close the gap.
2026-09-18 10:19:18 -04:00
| Reproduce with | `scripts/build-monero-wallet-rpc-android.sh` |
| Verified by | `android/monero-binaries.sha256`, checked by `scripts/build-android-local.sh` on every build (local and CI) |
Re-checked on this tree (`fa0e4b2`): `stat -c %s` is 19954224; `sha256sum` of the
blob equals the hash above and equals the line in `android/monero-binaries.sha256`
(that file's path is relative to `android/`:
`app/src/main/jniLibs/arm64-v8a/libmonerowalletrpc.so`). `readelf -d` NEEDED is
`libdl.so`, `libm.so`, `libc.so`.
android: start/stop the monero-wallet-rpc child from WalletScreen, bundle the binary Implements the Android half of issue #107. Stacked on `wt/t_8a8ff353` (PR #108) because the UniFFI wallet-child surface is not on `main` yet. Binary ------ `android/app/src/main/jniLibs/arm64-v8a/libmonerowalletrpc.so` is a real `monero-wallet-rpc` cross-compiled for `aarch64-linux-android` from monero-project/monero v0.18.4.4 (516e5355) via upstream's own `contrib/depends` + toolchain.cmake path, then stripped with the target's own strip. 19 954 224 bytes, sha256 d9126788030ecd1ccdb40c7764e66e9a14d158a147ad335b256f0577681b5ad4. It ships through `jniLibs` and not as an asset on purpose: since API 29 the kernel refuses `exec()` on a file in the app's data directory, so the only executable directory an app has is `applicationInfo.nativeLibraryDir`, which the package manager fills from `lib/<abi>/` at install time. That requires `android:extractNativeLibs="true"` (`packaging.jniLibs.useLegacyPackaging`), which `app/build.gradle.kts` now sets, plus `keepDebugSymbols` for this one entry so AGP's strip pass cannot rewrite the bytes CI verifies. `scripts/build-monero-wallet-rpc-android.sh` reproduces the build and `android/MONERO_BINARIES.md` records the four host quirks that cost the most time (CMake must be 3.x; NDK r17b clang60 needs a libtinfo.so.5 shim; the generated toolchain.cmake puts the HOST `/usr` in CMAKE_FIND_ROOT_PATH, which breaks the link with a host libpgm.so and defines HAVE_HIDAPI against host headers; the CMake target is `wallet_rpc_server`, not `monero-wallet-rpc`). CI re-verifies the blob rather than taking it on trust: `scripts/build-android-local.sh` checks `android/monero-binaries.sha256` before Gradle, and after packaging pulls `lib/<abi>/libmonerowalletrpc.so` back out of the APK and compares its sha256 with the committed file. `arti` is NOT bundled, so a `.onion` daemon cannot be started yet. The app says that instead of pretending: `arti_bin` is set to the path the binary would occupy, and the screen refuses an `.onion` daemon while it is absent. Loopback and clearnet daemons work. UI -- `WalletScreen` gains a "wallet daemon" card above the existing Create / Import / Invoice / Tip actions, which are untouched: * a status line from `Wire::wallet_status()` rendered verbatim — `off` / `connecting` / `syncing` / `ready` / `exited` plus the core's chain-source label (`receive-only` / `local node` / `remote onion daemon` / `remote daemon`). A died child reads `exited`; it is never folded into `off` and never into `ready`; * Start / Stop calling `start_wallet_child` / `stop_wallet_child` through `WireViewModel`, on `Dispatchers.IO` (the spawn is synchronous inside the node and the status read re-decrypts the sealed record); * a `host:port` field that saves a remote daemon via `set_chain_source`, plus a Receive-only button; * honest failure states instead of a spinner: no bundled binary, no chain source, a `.onion` daemon with no arti, or a start that failed — each gets its own sentence, and Start is disabled with the reason on screen. `WireViewModel` owns the 2s wallet-child poller, the same way it owns the chat poller, so leaving the wallet screen and coming back cannot stack a second loop. `ui/WalletChildStatusText.kt` is the pure model (mirrors the `ChatRowInput`/`OutboxRowInput` convention) and carries the state mapping, the status line and the Start/Stop gates; `WalletChildStatusTextTest` covers them on the JVM. Verified -------- `./gradlew :app:testDebugUnitTest` passes, `scripts/build-android-local.sh` produces `dist/onionwire-0.1.0-android-arm64-v8a.apk` (27 884 277 bytes, versionName 0.1.0 / versionCode 100) with `lib/arm64-v8a/libmonerowalletrpc.so` inside it at the committed sha256, and `extractNativeLibs="true"` in the merged release manifest. NOT verified: the binary was never executed. The build host has no arm64-v8a AVD (all three existing AVDs are x86_64) and no aarch64 sysroot for qemu-user, so nothing here proves `monero-wallet-rpc` starts, opens its wallet file and answers JSON-RPC under Android's runtime. `android/MONERO_BINARIES.md` says so plainly and lists the emulator steps to close the gap.
2026-09-18 10:19:18 -04:00
Only `arm64-v8a` is built. `-Ponionwire.abis=x86_64` produces an APK with no
wallet binary in it — the screen says so (`NO_WALLET_RPC_MESSAGE`) instead of
offering a Start that cannot work.
## How it is built
`scripts/build-monero-wallet-rpc-android.sh` runs upstream's own Android
cross-compile path — `contrib/depends` (boost, openssl, libunbound, libzmq,
libsodium, ncurses, readline, libiconv, expat for `aarch64-linux-android`) plus
the `toolchain.cmake` it emits — and then builds the single CMake target
`wallet_rpc_server`. It takes ~40 min on 12 cores and needs ~15 GB of scratch
space. It is **not** part of the CI path: the Android Gradle jobs already run
on `docker-amd64` for ~9 minutes with warm volumes, and rebuilding Monero's C++
tree is a separate 30–45 min host job. CI verifies the committed bytes instead
(`sha256sum -c` plus the APK-entry check in `scripts/build-android-local.sh`).
android: start/stop the monero-wallet-rpc child from WalletScreen, bundle the binary Implements the Android half of issue #107. Stacked on `wt/t_8a8ff353` (PR #108) because the UniFFI wallet-child surface is not on `main` yet. Binary ------ `android/app/src/main/jniLibs/arm64-v8a/libmonerowalletrpc.so` is a real `monero-wallet-rpc` cross-compiled for `aarch64-linux-android` from monero-project/monero v0.18.4.4 (516e5355) via upstream's own `contrib/depends` + toolchain.cmake path, then stripped with the target's own strip. 19 954 224 bytes, sha256 d9126788030ecd1ccdb40c7764e66e9a14d158a147ad335b256f0577681b5ad4. It ships through `jniLibs` and not as an asset on purpose: since API 29 the kernel refuses `exec()` on a file in the app's data directory, so the only executable directory an app has is `applicationInfo.nativeLibraryDir`, which the package manager fills from `lib/<abi>/` at install time. That requires `android:extractNativeLibs="true"` (`packaging.jniLibs.useLegacyPackaging`), which `app/build.gradle.kts` now sets, plus `keepDebugSymbols` for this one entry so AGP's strip pass cannot rewrite the bytes CI verifies. `scripts/build-monero-wallet-rpc-android.sh` reproduces the build and `android/MONERO_BINARIES.md` records the four host quirks that cost the most time (CMake must be 3.x; NDK r17b clang60 needs a libtinfo.so.5 shim; the generated toolchain.cmake puts the HOST `/usr` in CMAKE_FIND_ROOT_PATH, which breaks the link with a host libpgm.so and defines HAVE_HIDAPI against host headers; the CMake target is `wallet_rpc_server`, not `monero-wallet-rpc`). CI re-verifies the blob rather than taking it on trust: `scripts/build-android-local.sh` checks `android/monero-binaries.sha256` before Gradle, and after packaging pulls `lib/<abi>/libmonerowalletrpc.so` back out of the APK and compares its sha256 with the committed file. `arti` is NOT bundled, so a `.onion` daemon cannot be started yet. The app says that instead of pretending: `arti_bin` is set to the path the binary would occupy, and the screen refuses an `.onion` daemon while it is absent. Loopback and clearnet daemons work. UI -- `WalletScreen` gains a "wallet daemon" card above the existing Create / Import / Invoice / Tip actions, which are untouched: * a status line from `Wire::wallet_status()` rendered verbatim — `off` / `connecting` / `syncing` / `ready` / `exited` plus the core's chain-source label (`receive-only` / `local node` / `remote onion daemon` / `remote daemon`). A died child reads `exited`; it is never folded into `off` and never into `ready`; * Start / Stop calling `start_wallet_child` / `stop_wallet_child` through `WireViewModel`, on `Dispatchers.IO` (the spawn is synchronous inside the node and the status read re-decrypts the sealed record); * a `host:port` field that saves a remote daemon via `set_chain_source`, plus a Receive-only button; * honest failure states instead of a spinner: no bundled binary, no chain source, a `.onion` daemon with no arti, or a start that failed — each gets its own sentence, and Start is disabled with the reason on screen. `WireViewModel` owns the 2s wallet-child poller, the same way it owns the chat poller, so leaving the wallet screen and coming back cannot stack a second loop. `ui/WalletChildStatusText.kt` is the pure model (mirrors the `ChatRowInput`/`OutboxRowInput` convention) and carries the state mapping, the status line and the Start/Stop gates; `WalletChildStatusTextTest` covers them on the JVM. Verified -------- `./gradlew :app:testDebugUnitTest` passes, `scripts/build-android-local.sh` produces `dist/onionwire-0.1.0-android-arm64-v8a.apk` (27 884 277 bytes, versionName 0.1.0 / versionCode 100) with `lib/arm64-v8a/libmonerowalletrpc.so` inside it at the committed sha256, and `extractNativeLibs="true"` in the merged release manifest. NOT verified: the binary was never executed. The build host has no arm64-v8a AVD (all three existing AVDs are x86_64) and no aarch64 sysroot for qemu-user, so nothing here proves `monero-wallet-rpc` starts, opens its wallet file and answers JSON-RPC under Android's runtime. `android/MONERO_BINARIES.md` says so plainly and lists the emulator steps to close the gap.
2026-09-18 10:19:18 -04:00
Four things about the build are worth writing down, because each one is a
failure that looks like something else:
1. **CMake must be 3.x.** `contrib/depends` emits a *standalone-NDK-toolchain*
`toolchain.cmake` (`CMAKE_ANDROID_STANDALONE_TOOLCHAIN`). CMake 4.x no longer
honours that, silently falls back to the host `clang`, and the configure step
dies with `ld.lld: cannot open /usr/lib/clang/.../libclang_rt.builtins.a`.
The script installs 3.22.6 into a venv when the host CMake is 4.x.
2. **The NDK r17b prebuilt `clang60` needs `libtinfo.so.5`.** `android_ndk.mk`
pins NDK r17b and drives the long-removed `make_standalone_toolchain.py`
(r17b still has it). Its `clang60` binary is linked against ncurses 5;
current distros ship ncurses 6 only, so every compile fails with
`error while loading shared libraries: libtinfo.so.5`. A shim directory with
`libtinfo.so.5 -> libtinfo.so.6` on `LD_LIBRARY_PATH` fixes it. The script
creates it.
3. **`/usr` is in `CMAKE_FIND_ROOT_PATH`, and `/usr` is the host.** This is the
one that costs the most time. `CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY` does
not help: `/usr` is listed as a root, so `find_library()` returns host
libraries. Two consequences in this tree:
* `find_package(HIDAPI)` finds the **host** hidapi, defines `HAVE_HIDAPI`,
and `src/device` then fails to compile `hidapi/hidapi.h` — the include dir
it found is `/usr/include/hidapi`, so `<hidapi/hidapi.h>` resolves to
`/usr/include/hidapi/hidapi/hidapi.h`.
* Monero's optional zmq extras (`pgm`, `norm`, `gssapi_krb5`, `protolib`,
`bsd`, `md`, `protokit`) are probed with `find_library` and appended to
`ZMQ_LIB`, so the final link gets `/usr/lib/libpgm.so` — an x86-64 shared
object in an aarch64 link line: `error adding symbols: File in wrong
format`. `libzmq.a` does not actually reference openpgm.
The script rewrites the generated `toolchain.cmake` to
`SET(CMAKE_FIND_ROOT_PATH <depends-prefix>)`. This is also why upstream's
`make depends target=aarch64-linux-android` is not reproducible: it happens
to work only on a build host with none of those libraries installed.
A stale `CMakeCache.txt` keeps the host paths after the toolchain is fixed,
and nothing complains until the link, so the script also passes
`-U PGM_LIBRARY -U GSSAPI_LIBRARY …` and configures in a fresh build dir.
4. **The CMake target is `wallet_rpc_server`, not `monero-wallet-rpc`.** The
latter is the *output* name. `make monero-wallet-rpc` fails with
`No rule to make target`.
### Not bit-reproducible
Build paths and timestamps land in the binary, so a fresh run of the script
will not reproduce the sha256 above. That hash is a **provenance record of the
shipped blob** and the thing CI re-verifies — not a reproducible-build
assertion. If you rebuild, update both `android/monero-binaries.sha256` and this
table in the same commit, and say what changed in the tag or the toolchain.
The reproduce script pins **the tag** (`MONERO_TAG=v0.18.4.4`, shallow clone).
The commit in the table is the peeled object of that annotated tag on GitHub,
recorded here so a rebuild can be compared; it is not a second pin in the
script.
android: start/stop the monero-wallet-rpc child from WalletScreen, bundle the binary Implements the Android half of issue #107. Stacked on `wt/t_8a8ff353` (PR #108) because the UniFFI wallet-child surface is not on `main` yet. Binary ------ `android/app/src/main/jniLibs/arm64-v8a/libmonerowalletrpc.so` is a real `monero-wallet-rpc` cross-compiled for `aarch64-linux-android` from monero-project/monero v0.18.4.4 (516e5355) via upstream's own `contrib/depends` + toolchain.cmake path, then stripped with the target's own strip. 19 954 224 bytes, sha256 d9126788030ecd1ccdb40c7764e66e9a14d158a147ad335b256f0577681b5ad4. It ships through `jniLibs` and not as an asset on purpose: since API 29 the kernel refuses `exec()` on a file in the app's data directory, so the only executable directory an app has is `applicationInfo.nativeLibraryDir`, which the package manager fills from `lib/<abi>/` at install time. That requires `android:extractNativeLibs="true"` (`packaging.jniLibs.useLegacyPackaging`), which `app/build.gradle.kts` now sets, plus `keepDebugSymbols` for this one entry so AGP's strip pass cannot rewrite the bytes CI verifies. `scripts/build-monero-wallet-rpc-android.sh` reproduces the build and `android/MONERO_BINARIES.md` records the four host quirks that cost the most time (CMake must be 3.x; NDK r17b clang60 needs a libtinfo.so.5 shim; the generated toolchain.cmake puts the HOST `/usr` in CMAKE_FIND_ROOT_PATH, which breaks the link with a host libpgm.so and defines HAVE_HIDAPI against host headers; the CMake target is `wallet_rpc_server`, not `monero-wallet-rpc`). CI re-verifies the blob rather than taking it on trust: `scripts/build-android-local.sh` checks `android/monero-binaries.sha256` before Gradle, and after packaging pulls `lib/<abi>/libmonerowalletrpc.so` back out of the APK and compares its sha256 with the committed file. `arti` is NOT bundled, so a `.onion` daemon cannot be started yet. The app says that instead of pretending: `arti_bin` is set to the path the binary would occupy, and the screen refuses an `.onion` daemon while it is absent. Loopback and clearnet daemons work. UI -- `WalletScreen` gains a "wallet daemon" card above the existing Create / Import / Invoice / Tip actions, which are untouched: * a status line from `Wire::wallet_status()` rendered verbatim — `off` / `connecting` / `syncing` / `ready` / `exited` plus the core's chain-source label (`receive-only` / `local node` / `remote onion daemon` / `remote daemon`). A died child reads `exited`; it is never folded into `off` and never into `ready`; * Start / Stop calling `start_wallet_child` / `stop_wallet_child` through `WireViewModel`, on `Dispatchers.IO` (the spawn is synchronous inside the node and the status read re-decrypts the sealed record); * a `host:port` field that saves a remote daemon via `set_chain_source`, plus a Receive-only button; * honest failure states instead of a spinner: no bundled binary, no chain source, a `.onion` daemon with no arti, or a start that failed — each gets its own sentence, and Start is disabled with the reason on screen. `WireViewModel` owns the 2s wallet-child poller, the same way it owns the chat poller, so leaving the wallet screen and coming back cannot stack a second loop. `ui/WalletChildStatusText.kt` is the pure model (mirrors the `ChatRowInput`/`OutboxRowInput` convention) and carries the state mapping, the status line and the Start/Stop gates; `WalletChildStatusTextTest` covers them on the JVM. Verified -------- `./gradlew :app:testDebugUnitTest` passes, `scripts/build-android-local.sh` produces `dist/onionwire-0.1.0-android-arm64-v8a.apk` (27 884 277 bytes, versionName 0.1.0 / versionCode 100) with `lib/arm64-v8a/libmonerowalletrpc.so` inside it at the committed sha256, and `extractNativeLibs="true"` in the merged release manifest. NOT verified: the binary was never executed. The build host has no arm64-v8a AVD (all three existing AVDs are x86_64) and no aarch64 sysroot for qemu-user, so nothing here proves `monero-wallet-rpc` starts, opens its wallet file and answers JSON-RPC under Android's runtime. `android/MONERO_BINARIES.md` says so plainly and lists the emulator steps to close the gap.
2026-09-18 10:19:18 -04:00
## Why it is a `jniLibs` `.so` and not an asset
Since Android 10 (API 29) an app may not `exec()` a file in its own data
directory: the SELinux policy carries no `execute` on `app_data_file`, so the
familiar "ship it in `assets/`, copy it to `filesDir`, `chmod 700`" recipe is
refused by the kernel regardless of the mode bits. The one directory Android
hands out executable is `ApplicationInfo.nativeLibraryDir`, which the package
manager populates from the APK's `lib/<abi>/` entries at install time.
So the executable is named `libmonerowalletrpc.so` and shipped through
`jniLibs`, and the path the core is handed is
```
<applicationInfo.nativeLibraryDir>/libmonerowalletrpc.so
```
resolved at runtime by `wallet/WalletChildBinaries.kt`. This only works with
`android:extractNativeLibs="true"`; with the AGP 8 default
(`extractNativeLibs="false"`) the file stays inside the APK and there is nothing
on disk to run. `app/build.gradle.kts` sets `packaging.jniLibs.useLegacyPackaging
= true` for exactly that reason, and `keepDebugSymbols` for this one entry so
AGP's strip pass cannot rewrite the bytes that CI verifies.
Cost: the release APK grows from ~9 MB to ~28 MB (the binary is deflate-stored
at 6.9 MB) and installs ~20 MB into the app's native library directory.
(Those packaging sizes are the original measurement when the blob landed; the
committed blob's **uncompressed** size is the 19 954 224 bytes above.)
android: start/stop the monero-wallet-rpc child from WalletScreen, bundle the binary Implements the Android half of issue #107. Stacked on `wt/t_8a8ff353` (PR #108) because the UniFFI wallet-child surface is not on `main` yet. Binary ------ `android/app/src/main/jniLibs/arm64-v8a/libmonerowalletrpc.so` is a real `monero-wallet-rpc` cross-compiled for `aarch64-linux-android` from monero-project/monero v0.18.4.4 (516e5355) via upstream's own `contrib/depends` + toolchain.cmake path, then stripped with the target's own strip. 19 954 224 bytes, sha256 d9126788030ecd1ccdb40c7764e66e9a14d158a147ad335b256f0577681b5ad4. It ships through `jniLibs` and not as an asset on purpose: since API 29 the kernel refuses `exec()` on a file in the app's data directory, so the only executable directory an app has is `applicationInfo.nativeLibraryDir`, which the package manager fills from `lib/<abi>/` at install time. That requires `android:extractNativeLibs="true"` (`packaging.jniLibs.useLegacyPackaging`), which `app/build.gradle.kts` now sets, plus `keepDebugSymbols` for this one entry so AGP's strip pass cannot rewrite the bytes CI verifies. `scripts/build-monero-wallet-rpc-android.sh` reproduces the build and `android/MONERO_BINARIES.md` records the four host quirks that cost the most time (CMake must be 3.x; NDK r17b clang60 needs a libtinfo.so.5 shim; the generated toolchain.cmake puts the HOST `/usr` in CMAKE_FIND_ROOT_PATH, which breaks the link with a host libpgm.so and defines HAVE_HIDAPI against host headers; the CMake target is `wallet_rpc_server`, not `monero-wallet-rpc`). CI re-verifies the blob rather than taking it on trust: `scripts/build-android-local.sh` checks `android/monero-binaries.sha256` before Gradle, and after packaging pulls `lib/<abi>/libmonerowalletrpc.so` back out of the APK and compares its sha256 with the committed file. `arti` is NOT bundled, so a `.onion` daemon cannot be started yet. The app says that instead of pretending: `arti_bin` is set to the path the binary would occupy, and the screen refuses an `.onion` daemon while it is absent. Loopback and clearnet daemons work. UI -- `WalletScreen` gains a "wallet daemon" card above the existing Create / Import / Invoice / Tip actions, which are untouched: * a status line from `Wire::wallet_status()` rendered verbatim — `off` / `connecting` / `syncing` / `ready` / `exited` plus the core's chain-source label (`receive-only` / `local node` / `remote onion daemon` / `remote daemon`). A died child reads `exited`; it is never folded into `off` and never into `ready`; * Start / Stop calling `start_wallet_child` / `stop_wallet_child` through `WireViewModel`, on `Dispatchers.IO` (the spawn is synchronous inside the node and the status read re-decrypts the sealed record); * a `host:port` field that saves a remote daemon via `set_chain_source`, plus a Receive-only button; * honest failure states instead of a spinner: no bundled binary, no chain source, a `.onion` daemon with no arti, or a start that failed — each gets its own sentence, and Start is disabled with the reason on screen. `WireViewModel` owns the 2s wallet-child poller, the same way it owns the chat poller, so leaving the wallet screen and coming back cannot stack a second loop. `ui/WalletChildStatusText.kt` is the pure model (mirrors the `ChatRowInput`/`OutboxRowInput` convention) and carries the state mapping, the status line and the Start/Stop gates; `WalletChildStatusTextTest` covers them on the JVM. Verified -------- `./gradlew :app:testDebugUnitTest` passes, `scripts/build-android-local.sh` produces `dist/onionwire-0.1.0-android-arm64-v8a.apk` (27 884 277 bytes, versionName 0.1.0 / versionCode 100) with `lib/arm64-v8a/libmonerowalletrpc.so` inside it at the committed sha256, and `extractNativeLibs="true"` in the merged release manifest. NOT verified: the binary was never executed. The build host has no arm64-v8a AVD (all three existing AVDs are x86_64) and no aarch64 sysroot for qemu-user, so nothing here proves `monero-wallet-rpc` starts, opens its wallet file and answers JSON-RPC under Android's runtime. `android/MONERO_BINARIES.md` says so plainly and lists the emulator steps to close the gap.
2026-09-18 10:19:18 -04:00
## `arti` is NOT bundled
`WalletChild` runs `arti proxy -p <port>` as the SOCKS child for a **`.onion`**
daemon, and `ChildConfig::validate` requires a non-empty `arti_bin` for any
chain source that is not receive-only. There is no `arti` executable in this
build, and producing one (a standalone `arti` binary for
`aarch64-linux-android`, from a crate the Rust side does not currently build as
a bin) is a follow-up, not something this document can invent.
android: start/stop the monero-wallet-rpc child from WalletScreen, bundle the binary Implements the Android half of issue #107. Stacked on `wt/t_8a8ff353` (PR #108) because the UniFFI wallet-child surface is not on `main` yet. Binary ------ `android/app/src/main/jniLibs/arm64-v8a/libmonerowalletrpc.so` is a real `monero-wallet-rpc` cross-compiled for `aarch64-linux-android` from monero-project/monero v0.18.4.4 (516e5355) via upstream's own `contrib/depends` + toolchain.cmake path, then stripped with the target's own strip. 19 954 224 bytes, sha256 d9126788030ecd1ccdb40c7764e66e9a14d158a147ad335b256f0577681b5ad4. It ships through `jniLibs` and not as an asset on purpose: since API 29 the kernel refuses `exec()` on a file in the app's data directory, so the only executable directory an app has is `applicationInfo.nativeLibraryDir`, which the package manager fills from `lib/<abi>/` at install time. That requires `android:extractNativeLibs="true"` (`packaging.jniLibs.useLegacyPackaging`), which `app/build.gradle.kts` now sets, plus `keepDebugSymbols` for this one entry so AGP's strip pass cannot rewrite the bytes CI verifies. `scripts/build-monero-wallet-rpc-android.sh` reproduces the build and `android/MONERO_BINARIES.md` records the four host quirks that cost the most time (CMake must be 3.x; NDK r17b clang60 needs a libtinfo.so.5 shim; the generated toolchain.cmake puts the HOST `/usr` in CMAKE_FIND_ROOT_PATH, which breaks the link with a host libpgm.so and defines HAVE_HIDAPI against host headers; the CMake target is `wallet_rpc_server`, not `monero-wallet-rpc`). CI re-verifies the blob rather than taking it on trust: `scripts/build-android-local.sh` checks `android/monero-binaries.sha256` before Gradle, and after packaging pulls `lib/<abi>/libmonerowalletrpc.so` back out of the APK and compares its sha256 with the committed file. `arti` is NOT bundled, so a `.onion` daemon cannot be started yet. The app says that instead of pretending: `arti_bin` is set to the path the binary would occupy, and the screen refuses an `.onion` daemon while it is absent. Loopback and clearnet daemons work. UI -- `WalletScreen` gains a "wallet daemon" card above the existing Create / Import / Invoice / Tip actions, which are untouched: * a status line from `Wire::wallet_status()` rendered verbatim — `off` / `connecting` / `syncing` / `ready` / `exited` plus the core's chain-source label (`receive-only` / `local node` / `remote onion daemon` / `remote daemon`). A died child reads `exited`; it is never folded into `off` and never into `ready`; * Start / Stop calling `start_wallet_child` / `stop_wallet_child` through `WireViewModel`, on `Dispatchers.IO` (the spawn is synchronous inside the node and the status read re-decrypts the sealed record); * a `host:port` field that saves a remote daemon via `set_chain_source`, plus a Receive-only button; * honest failure states instead of a spinner: no bundled binary, no chain source, a `.onion` daemon with no arti, or a start that failed — each gets its own sentence, and Start is disabled with the reason on screen. `WireViewModel` owns the 2s wallet-child poller, the same way it owns the chat poller, so leaving the wallet screen and coming back cannot stack a second loop. `ui/WalletChildStatusText.kt` is the pure model (mirrors the `ChatRowInput`/`OutboxRowInput` convention) and carries the state mapping, the status line and the Start/Stop gates; `WalletChildStatusTextTest` covers them on the JVM. Verified -------- `./gradlew :app:testDebugUnitTest` passes, `scripts/build-android-local.sh` produces `dist/onionwire-0.1.0-android-arm64-v8a.apk` (27 884 277 bytes, versionName 0.1.0 / versionCode 100) with `lib/arm64-v8a/libmonerowalletrpc.so` inside it at the committed sha256, and `extractNativeLibs="true"` in the merged release manifest. NOT verified: the binary was never executed. The build host has no arm64-v8a AVD (all three existing AVDs are x86_64) and no aarch64 sysroot for qemu-user, so nothing here proves `monero-wallet-rpc` starts, opens its wallet file and answers JSON-RPC under Android's runtime. `android/MONERO_BINARIES.md` says so plainly and lists the emulator steps to close the gap.
2026-09-18 10:19:18 -04:00
What the app does about it, honestly:
* `arti_bin` is set to `<nativeLibraryDir>/libarti.so` — the path the binary
*would* occupy. For a loopback or clearnet daemon the core never spawns it, so
the value is inert. It is deliberately **not** set to a real binary:
`monero-wallet-rpc` named as the SOCKS child would be spawned as the proxy the
moment the user typed an `.onion` host.
* The wallet screen refuses an `.onion` daemon while `libarti.so` is absent, and
says why (`ONION_NEEDS_ARTI_NOTICE`) instead of letting the spawn fail.
So today: **loopback and clearnet daemons work; `.onion` daemons do not.**
## Verification in CI
`.forgejo/workflows/android-ci.yml` (and `android-release.yml`) build the APK on
`docker-amd64` and `scripts/build-android-local.sh` does the checking, so both
CI jobs and local builds get it:
android: start/stop the monero-wallet-rpc child from WalletScreen, bundle the binary Implements the Android half of issue #107. Stacked on `wt/t_8a8ff353` (PR #108) because the UniFFI wallet-child surface is not on `main` yet. Binary ------ `android/app/src/main/jniLibs/arm64-v8a/libmonerowalletrpc.so` is a real `monero-wallet-rpc` cross-compiled for `aarch64-linux-android` from monero-project/monero v0.18.4.4 (516e5355) via upstream's own `contrib/depends` + toolchain.cmake path, then stripped with the target's own strip. 19 954 224 bytes, sha256 d9126788030ecd1ccdb40c7764e66e9a14d158a147ad335b256f0577681b5ad4. It ships through `jniLibs` and not as an asset on purpose: since API 29 the kernel refuses `exec()` on a file in the app's data directory, so the only executable directory an app has is `applicationInfo.nativeLibraryDir`, which the package manager fills from `lib/<abi>/` at install time. That requires `android:extractNativeLibs="true"` (`packaging.jniLibs.useLegacyPackaging`), which `app/build.gradle.kts` now sets, plus `keepDebugSymbols` for this one entry so AGP's strip pass cannot rewrite the bytes CI verifies. `scripts/build-monero-wallet-rpc-android.sh` reproduces the build and `android/MONERO_BINARIES.md` records the four host quirks that cost the most time (CMake must be 3.x; NDK r17b clang60 needs a libtinfo.so.5 shim; the generated toolchain.cmake puts the HOST `/usr` in CMAKE_FIND_ROOT_PATH, which breaks the link with a host libpgm.so and defines HAVE_HIDAPI against host headers; the CMake target is `wallet_rpc_server`, not `monero-wallet-rpc`). CI re-verifies the blob rather than taking it on trust: `scripts/build-android-local.sh` checks `android/monero-binaries.sha256` before Gradle, and after packaging pulls `lib/<abi>/libmonerowalletrpc.so` back out of the APK and compares its sha256 with the committed file. `arti` is NOT bundled, so a `.onion` daemon cannot be started yet. The app says that instead of pretending: `arti_bin` is set to the path the binary would occupy, and the screen refuses an `.onion` daemon while it is absent. Loopback and clearnet daemons work. UI -- `WalletScreen` gains a "wallet daemon" card above the existing Create / Import / Invoice / Tip actions, which are untouched: * a status line from `Wire::wallet_status()` rendered verbatim — `off` / `connecting` / `syncing` / `ready` / `exited` plus the core's chain-source label (`receive-only` / `local node` / `remote onion daemon` / `remote daemon`). A died child reads `exited`; it is never folded into `off` and never into `ready`; * Start / Stop calling `start_wallet_child` / `stop_wallet_child` through `WireViewModel`, on `Dispatchers.IO` (the spawn is synchronous inside the node and the status read re-decrypts the sealed record); * a `host:port` field that saves a remote daemon via `set_chain_source`, plus a Receive-only button; * honest failure states instead of a spinner: no bundled binary, no chain source, a `.onion` daemon with no arti, or a start that failed — each gets its own sentence, and Start is disabled with the reason on screen. `WireViewModel` owns the 2s wallet-child poller, the same way it owns the chat poller, so leaving the wallet screen and coming back cannot stack a second loop. `ui/WalletChildStatusText.kt` is the pure model (mirrors the `ChatRowInput`/`OutboxRowInput` convention) and carries the state mapping, the status line and the Start/Stop gates; `WalletChildStatusTextTest` covers them on the JVM. Verified -------- `./gradlew :app:testDebugUnitTest` passes, `scripts/build-android-local.sh` produces `dist/onionwire-0.1.0-android-arm64-v8a.apk` (27 884 277 bytes, versionName 0.1.0 / versionCode 100) with `lib/arm64-v8a/libmonerowalletrpc.so` inside it at the committed sha256, and `extractNativeLibs="true"` in the merged release manifest. NOT verified: the binary was never executed. The build host has no arm64-v8a AVD (all three existing AVDs are x86_64) and no aarch64 sysroot for qemu-user, so nothing here proves `monero-wallet-rpc` starts, opens its wallet file and answers JSON-RPC under Android's runtime. `android/MONERO_BINARIES.md` says so plainly and lists the emulator steps to close the gap.
2026-09-18 10:19:18 -04:00
1. before Gradle, `sha256sum -c android/monero-binaries.sha256` against the
committed blob;
2. after packaging, `unzip -p` the `lib/<abi>/libmonerowalletrpc.so` entry out
of the produced APK and compare its sha256 with the committed file. A
mismatch fails the build — the bytes that ship are the bytes that were
verified, not the bytes that were hoped for.
## Not verified
The binary was **not executed on a device or emulator**. There is no
`arm64-v8a` AVD on the build host (all three existing AVDs are `x86_64`), and no
aarch64 sysroot to run it under `qemu-user`. What is proven: it cross-compiles,
it is a valid `aarch64` Android PIE executable, it packages into the APK with
the expected bytes, and the Kotlin that drives it compiles. What is not:
that `monero-wallet-rpc` starts, opens its wallet file and answers JSON-RPC
under Android's runtime.
To close that gap:
```bash
sdkmanager "system-images;android-35;google_apis;arm64-v8a"
avdmanager create avd -n ow-arm64 -k "system-images;android-35;google_apis;arm64-v8a"
emulator -avd ow-arm64 # software-emulated on an x86_64 host: slow
adb install -r dist/onionwire-<version>-android-arm64-v8a.apk
```
then unlock the node, open Wallet, type a daemon as `host:port`, Save, and watch
the status line for `connecting → syncing → ready`. A `.onion` daemon will stop
at the arti notice above.
android: build the SDK with cuprate-daemon and offer the on-device node Part 3 of "cuprated built in": the chain daemon now ships inside the APK and the wallet screen can pick it. Build (android/sdk/build.gradle.kts) - `cargoBuildAndroid` runs `cargo ndk … build --release --lib --features cuprate-daemon`. The Android target only: `cargoHostLib` / `uniffiBindgen` stay feature-free, because the host cdylib exists only so `uniffi-bindgen --library` can dlopen it and the UniFFI surface does not fork on a cargo feature. - The link needs the NDK's libc++ and compiler-rt builtins explicitly (RandomX is C++ and its aarch64 JIT calls `__clear_cache`; `randomx-rs` links the NDK's stub `libstdc++.a`). `cargo ndk --link-builtins` covers the builtins only, so the whole set is spelled out as per-ABI `CARGO_TARGET_<TRIPLE>_RUSTFLAGS` — a global `RUSTFLAGS` would break the host build scripts. The linker is the NDK clang driver at the app's API level, named explicitly, because the dev machines pin the API 21 wrapper for `aarch64-linux-android` and API 21 fails this link. - `ANDROID_NDK` is exported alongside `ANDROID_NDK_HOME`/`NDK_HOME`: without it `cmake-rs` aborts and `randomx-rs`'s build script panics. - The task logs the feature it builds with, so CI carries the request, not just the task name. Wallet screen - Third chain source, **On-device node (Cuprate)**, beside the daemon field and Receive-only. Stored as `ChainChoice.InProcessCuprate` with an empty `monerod_datadir`, which the SDK resolves to `$ONIONWIRE_HOME/chain`. Existing Save daemon / Receive-only / Start / Stop behaviour is unchanged. - The status line grows `· node <word>` from `WalletChildStatus.node_state` for this source only, fail-closed on an unrecognised word. No sync height: the SDK exposes none, so the screen does not show a number it cannot get. - Storage honesty: free space on the chain store's filesystem, and Start is refused below a 3 GiB floor or when that filesystem cannot be read. The floor is a floor, not a sync estimate — nothing here exposes one. - The pre-production warning (quoted user book, testnet only, Cuprate issue #278) is a sentence above Start, assertable in a test. Opt-in, never a default. - The daemon field's hint no longer suggests a loopback daemon on the phone. CI - `android-ci.yml` extracts `lib/<abi>/libonionwire_sdk.so` from the built APK and fails the job unless it contains `target_max_memory`, a rodata literal compiled only under `cuprate-daemon`. v0.7.0's shipped `.so` has zero of them, so this separates "in the artifact" from "requested". Docs - `android/CUPRATE_DAEMON.md`: the build wiring, the link line, the CI gate, and an explicit "not verified on a device" section. `MONERO_BINARIES.md` points at it for the chain source that is not a binary.
2026-09-18 15:34:30 -04:00
## The other chain source: an in-process daemon, not a binary
The third chain source — Cuprate's chain daemon running inside the OnionWire
process — is a **linked feature of the SDK's `.so`**, not a `jniLibs` executable,
so it has its own record: [CUPRATE_DAEMON.md](CUPRATE_DAEMON.md) (feature wiring,
the NDK C++ / compiler-rt link line, the CI check that greps the shipped `.so`
for a cuprated-only string, and what has not been verified). `monero-wallet-rpc`
above stays a child process for it — Cuprate has no wallet layer.