android wallet: self-heal the stored wallet_rpc_bin, gate Start/Create, one info banner #202

Merged
sirius merged 2 commits from wt/t_d63f9279 into main 2026-10-31 05:33:18 +00:00
Owner

Android-only fix for the two dead ends in the device report (v0.7.0).

What changed

  1. Self-heal the stored binary. WireViewModel.healStoredWalletBin() reads chainSource() and, when walletRpcBin is not an existing executable file while bundledBinaries().walletRpc is non-null, re-saves the record with the resolved absolute path. Kind, mode, host/port, datadir, filename and arti path are preserved; receive-only (ChainChoice.NONE) is skipped; a stored path that is a real executable file is never overwritten. Runs on wallet-screen open and again at the top of startWalletChild().
  2. Gate on the stored bin. startGateReason() = existing startBlockedReason() (unchanged copy/order) plus storedWalletBinBlockedReason(), which names the stored path, the resolved path, or returns the unchanged NO_WALLET_RPC_MESSAGE when nothing is bundled. startWalletChild() re-reads the stored record after the heal and refuses to spawn a path this device cannot run, writing the named reason rather than the core's opaque spawn monero-wallet-rpc: ….
  3. No auto-start that bypasses the gate. shouldStartAfterSelectingChain(storageBlocked, starting, startBlocked) now takes the same reason Start is disabled by; a mode tap stores the source and only launches when the gate agrees.
  4. Create/Import gating + phone copy. walletSetupBlockedReason() disables Create/Import with a sentence (node card pointer) until the child answers. walletFailureText maps the TUI's wallet not configured — open F7 / ONIONWIRE_WALLET_RPC copy to a phone sentence; F7 can no longer render.
  5. One banner for a no-wallet-open state. walletFailureBanner() paints WALLET_NOT_OPEN_TEXT as info (or suppresses it when the existing No wallet open hint already says it) instead of the red Wallet error; the sticky error is cleared when a wallet opens. Connect refusals and exited still paint red.

Verification

  • ./gradlew :app:testDebugUnitTest — 241 tests, 0 failures (includes the four required cases: heal path, stored-bin gate with named path, mode-tap auto-start refusal, open F7 mapped; plus no-wallet-open info-only and real-failure-still-red).
  • ./gradlew :app:assembleDebug — BUILD SUCCESSFUL, 40,894,470 B app-debug.apk.
  • Not verified on a device: no adb/device on this host. On-device steps afterwards: tap Receive-Only once, then re-tap the NETWORK MODE button, then Create wallet.

No changes under src/, crates/, packaging, jniLibs, or signing. The spawn() path-in-message change is the separate rust-dev card (t_af5bbc1a).

Android-only fix for the two dead ends in the device report (v0.7.0). ## What changed 1. **Self-heal the stored binary.** `WireViewModel.healStoredWalletBin()` reads `chainSource()` and, when `walletRpcBin` is not an existing executable file while `bundledBinaries().walletRpc` is non-null, re-saves the record with the resolved absolute path. Kind, mode, host/port, datadir, filename and arti path are preserved; receive-only (`ChainChoice.NONE`) is skipped; a stored path that is a real executable file is never overwritten. Runs on wallet-screen open and again at the top of `startWalletChild()`. 2. **Gate on the stored bin.** `startGateReason()` = existing `startBlockedReason()` (unchanged copy/order) plus `storedWalletBinBlockedReason()`, which names the stored path, the resolved path, or returns the unchanged `NO_WALLET_RPC_MESSAGE` when nothing is bundled. `startWalletChild()` re-reads the stored record after the heal and refuses to spawn a path this device cannot run, writing the named reason rather than the core's opaque `spawn monero-wallet-rpc: …`. 3. **No auto-start that bypasses the gate.** `shouldStartAfterSelectingChain(storageBlocked, starting, startBlocked)` now takes the same reason Start is disabled by; a mode tap stores the source and only launches when the gate agrees. 4. **Create/Import gating + phone copy.** `walletSetupBlockedReason()` disables Create/Import with a sentence (node card pointer) until the child answers. `walletFailureText` maps the TUI's `wallet not configured — open F7 / ONIONWIRE_WALLET_RPC` copy to a phone sentence; `F7` can no longer render. 5. **One banner for a no-wallet-open state.** `walletFailureBanner()` paints `WALLET_NOT_OPEN_TEXT` as info (or suppresses it when the existing `No wallet open` hint already says it) instead of the red `Wallet error`; the sticky error is cleared when a wallet opens. Connect refusals and `exited` still paint red. ## Verification - `./gradlew :app:testDebugUnitTest` — **241 tests, 0 failures** (includes the four required cases: heal path, stored-bin gate with named path, mode-tap auto-start refusal, `open F7` mapped; plus no-wallet-open info-only and real-failure-still-red). - `./gradlew :app:assembleDebug` — BUILD SUCCESSFUL, 40,894,470 B `app-debug.apk`. - **Not verified on a device:** no adb/device on this host. On-device steps afterwards: tap Receive-Only once, then re-tap the NETWORK MODE button, then Create wallet. No changes under `src/`, `crates/`, packaging, `jniLibs`, or signing. The `spawn()` path-in-message change is the separate rust-dev card (t_af5bbc1a).
android wallet: self-heal the stored wallet_rpc_bin, gate Start/Create, one info banner
All checks were successful
android-ci / android (pull_request) Successful in 11m51s
3cd70ca9b5
Device report (v0.7.0): Start died with `spawn monero-wallet-rpc: No such
file or directory`, and Create answered with the desktop TUI's `wallet not
configured — open F7 …`. Both were reachable states on the phone, so the
screen offered two dead ends.

- WireViewModel: `healStoredWalletBin()` re-points a stored wallet_rpc_bin
  that this device cannot execute at the resolved nativeLibraryDir path,
  preserving kind/mode/host/port/datadir/filename, skipping receive-only,
  and never overwriting a stored path that is a real executable file. It
  runs on wallet-screen open and again at the top of `startWalletChild()`,
  which then re-reads the stored record and refuses to spawn when the path
  still cannot run — writing the named path instead of ENOENT.
- Gate: `startGateReason()` = existing `startBlockedReason()` plus
  `storedWalletBinBlockedReason()`, which names the stored path, the
  resolved path, or the absent-binary message (unchanged strings).
  `shouldStartAfterSelectingChain()` now takes that reason, so a mode tap
  stores the source but cannot launch what Start would refuse.
- Create/Import: `walletSetupBlockedReason()` disables both controls with a
  sentence until the child answers; the TUI's unconfigured copy is mapped by
  `walletFailureText` to a phone sentence, so `open F7` and
  ONIONWIRE_WALLET_RPC never render.
- Banner: `walletFailureBanner()` paints `WALLET_NOT_OPEN_TEXT` as one info
  banner (or nothing when the No-wallet-open hint is already up), never as
  the red `Wallet error`; the sticky error is cleared when a wallet opens.
  Real failures (connect refusals, exited) still paint red.

Tests: 241/241 `:app:testDebugUnitTest`, including the four required cases.
Not verified on a device — no adb/device on this host.
Merge branch 'main' into wt/t_d63f9279
Some checks failed
android-ci / android (pull_request) Has been cancelled
a0b704cd09
sirius merged commit dddf74f274 into main 2026-10-31 05:33:18 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sirius/onionwire!202
No description provided.