Commit graph onionwire/android/app/src/main
Author SHA1 Message Date
agent
0d0b0b975d
ui: saved-wallets screen and profile copy on the shared components (plan P4.1)
All checks were successful
android-ci / android (pull_request) Successful in 14m2s
The catalogue screen was still the alpha build: a TopAppBar with a text "Back"
and a text "Refresh", eight hand-rolled Cards on Material's surfaceVariant,
outlined twins for the two secret actions, and every failure — including "no
wallet is open", which is a state the app is in, not a failure — printed as a
raw red Text. It now uses the shared components: a chevron top bar, OwCard rows
with an "In use" pill, and OwButton tiers.

Copy, verbatim from the plan:

  "No wallet is open in the wallet child yet. Open a saved wallet on the Saved
   wallets screen, or create or import one here."
      -> "Select a saved wallet or create a new one to view your balance and
         transact."

  "No wallet is open in the wallet child yet. Open one from the list below — a
   wallet that needs a passphrase asks for it here — and the balance, address
   and backups work again."
      -> "Open or create a wallet to enable balance, address, and backup
         controls."

WALLET_NOT_OPEN_TEXT is now rendered as an info banner with its own title, not
as an error; ErrorText picks the variant from the text, so the same string
cannot read as a crash on one screen and a state on the other. The "no wallet
open" hint, the passphrase prompt's blocked reasons and its "wallet is not
running" line, and the catalogue/keys failures are banners too.

The two remaining user-facing mentions of the daemon process are gone: the
passphrase card says "the wallet is pointed at <file>" and the secrets block
reason says "the wallet is not running". ProfileScreen's empty-address notice
loses its copy of the same phrase ("then comes from the running wallet"), and
its test now asserts the consequence instead of the internal name.

No behaviour change: every predicate (walletSecretsEnabled,
walletPassphraseSubmitEnabled, walletChildReadable, walletFailureText,
displayLastError) is the same function with the same branches; only strings and
layout moved. The four WalletManagerTest assertions that pinned the old strings
are updated here, in the same commit, as the card requires.
2026-10-29 01:01:50 -04:00
agent
1d7cbd8503
ui: hero wallet card and node card, and the status copy behind them (plan P4)
The wallet tab was nine equal boxes: a balance card, a daemon card, and then
four outlined twins (Invoice/Tip, Create/Import) pushed below the fold under a
wall of grey helper text. This rebuilds it as two cards.

Hero card. While no wallet file is open the card says "No Wallet Active" with
the plan's subtitle and puts Create Wallet (primary) / Import Wallet
(secondary) first, with Saved wallets in the card header. Once a wallet is
open the balance is the headline at 28sp bold with a sync-state pill, then the
gated receive address and its QR, then Receive / Invoice and Send / Tip, and a
destructive Lock Wallet. Creating and importing a further wallet stay reachable
in both states, and so does invoicing in the no-wallet state: the core resolves
a payee address from the profile, so hiding the action there would drop a path
that works ("no receive address - set profile xmr or ONIONWIRE_WALLET_RPC" is
the both-missing case). A tip really does need the wallet, so it appears only
when one is open.

Node card. The raw "connecting . in-process mainnet pruned . node starting .
sync 485253/3794383" line is replaced by a status sentence, a percentage, a 6dp
progress track and "Block 485,253 of 3,794,383" with the free disk on the
right; the full line is still the header's contentDescription, so a screen
reader loses nothing. The three stacked mode buttons become one segmented
control, Remote vs On-Device is a second one, and the lifecycle is a single
context-aware control (Start Node and Wallet, or Stop Node while it runs)
instead of a permanently disabled twin. Every raw paragraph (no binary, no
wallet open, start blocked, core error) is now an AlertBanner.

Fail-closed rules are unchanged and now tested: target_height == 0 prints no
percentage (it is "no target reported", never "caught up", which is what
Cuprate reports at the tip), a height past the target clamps at 100.0%, and an
unrecognised state is never green. The wallet off / err sentinels still come
back from the core untouched; only their display changed, to "No Wallet Loaded"
and "Balance unavailable".

Deliberate, and named in the handoff: WalletScreen drops its onBack parameter
because Wallet is a top-level tab now (MainActivity updated; Chats and Settings
already have no back affordance), and OwSegmentedControl gains an optional
testTags list - additive, defaulting to empty, so no existing call site
changes.
2026-10-29 01:01:39 -04:00
apk-dev
dc45d9cb81
ui: route the last raw buttons through OwButton, with a content slot
All checks were successful
android-ci / android (pull_request) Successful in 14m48s
Chat's send, Profile's save, and both Rotate actions were still material
Buttons — the 50%-rounded pill the design pass exists to remove. They now
take the design-system shape and height.

OwButton gains an optional RowScope content slot so a caller that needs a
spinner beside its label (chat send while a message is pending) keeps that
behaviour without dropping back to a raw Button. The slot is additive: the
existing text/leading-icon path is unchanged for every other caller.

Rotate's confirm is the Destructive tier — it destroys the current onion —
and the post-rotation action is labelled "Share the new invite" instead of
"Back — share the new invite": the top bar already owns the chevron back.
2026-10-29 00:44:22 -04:00
apk-dev
5a4701992e
ui: mute the empty-state shield and set its heading to the plan's 18sp
All checks were successful
android-ci / android (pull_request) Successful in 14m56s
The plan asks for a *muted* mint/grey icon inside the subtle surface circle and
an 18px/600 heading. The first pass drew the shield in full accent at 16sp
SemiBold, which made the empty state read as a warning and competed with the
primary CTA under it. The accent now stays on the button only.
2026-10-29 00:22:16 -04:00
apk-dev
7d86fd6a03
ui: drop the stale key-type phrase and pin the DrawableRes param target
All checks were successful
android-ci / android (pull_request) Successful in 14m54s
Two nits the plan's own greps would have flagged:

- `ChatScreen`'s `peer` KDoc still spelled out the key type. It is an
  internal comment, but the acceptance grep for the removed identity copy
  (`ed25519 pubkey`) should come back empty across `ui/`, not empty-except-
  a-comment.
- `OwTab`'s `@DrawableRes` is now `@param:`-targeted, which silences Kotlin's
  KT-73255 warning about the annotation moving to the backing field.
2026-10-29 00:15:47 -04:00
agent
a7b7792b3f
ui: About rows, and drop the removed copy from the roster's own KDoc
The SDK/key-type footnote moved to Node and Settings, so it should not survive
as a quoted string in ui/ either — the About card now shows IDENTITY ed25519 and
SDK <version> as label plus mono value, which is the design system's idiom for a
machine fact. Same reasoning for the KDoc: it describes the change instead of
pasting the strings that were removed.
2026-10-29 00:06:07 -04:00
agent
b65c990014
ui: cap the invite payload card and shorten the settings tab label
Two things the emulator run surfaced:

- The invite payload is about a kilobyte, so the plain Text card grew past the
  screen and pushed Copy invite / Done below the fold on a phone. Four lines
  with an ellipsis: the copy button carries the whole string, and the QR is the
  primary path anyway.
- "Node & Settings" as a 10sp label in a third of the bottom bar is one OEM font
  scale away from wrapping. The tab says "Settings"; the destination screen keeps
  its "Node & Settings" title.
2026-10-29 00:05:17 -04:00
agent
0283e6bf48
ui: app shell, messenger and invite refresh (plan P2 and P3)
Plans P2 and P3 are one change: the shell decides who calls the roster, so the
roster cannot land before it. The tree is green at this commit, which is why
they are not split.

Shell (P2)
- The horizontal text-link bar is gone. Three top-level destinations hang off a
  persistent 64dp bottom bar — Chats (default), Wallet, Node and Settings — and
  everything else is a sub-screen behind a chevron.
- MainActivity owns the shell: a Scaffold with the tab bar around a NavHost of
  chats / wallet / settings plus share, paste, chat, profile, wallets and
  rotate. Tab selection pops back to the start destination and restores saved
  state, so a chat left open behind the Wallet tab survives a trip to Settings.
- The node keeps living on the wallet screen, where its card already is, so the
  third tab is the security surface: profile, saved wallets, rotate identity,
  delete message history, the keep-alive status row, and — disclosed here
  instead of under the roster — the identity/SDK lines that made the home screen
  read as a test build.
- OwTopBar: 20sp bold title, optional "Tor active" pill beneath it, a 36dp
  padlock surface for Lock, and the overflow. Rotate identity, saved wallets and
  delete history live in the overflow; the destructive two go through a typed
  confirmation dialog or the typed ROTATE screen, never a single tap.
- Insets: the tab bar consumes the navigation-bar inset and
  LocalBottomBarPresent tells screens inside the shell not to pad for it again,
  so there is no double gap above the tabs and the IME still wins when the
  keyboard is up.
- window.isNavigationBarContrastEnforced = false on Q+, so the system's
  translucent scrim does not draw a second band over the canvas.

Messenger (P3)
- The identity block is one bar: identicon, "Your identity", the truncated
  fingerprint in mono, a copy-invite icon and a QR icon. Gone from here: the
  YOU (stable forever) card, the "sdk … · identity = ed25519 pubkey" line and
  the keep-alive paragraph. The full fingerprint and locator stay on the profile
  and invite screens.
- The empty state says what to do and offers both ways out ("Add contact",
  "Share my invite"), and keeps the honest sentence: invites are not
  discoverable.
- Friend rows: petname, short mono fingerprint, and a locator shortened as
  head…tail.onion — the suffix is never the part that is cut, and a v3 onion is
  never soft-wrapped.
- Invite sharing shows a QR of the payload beside the copyable text; the clip is
  marked sensitive on API 33+.

No ViewModel, SDK, Tor or wallet call changed. Every callback is the call the
old screens made; the wallet screens are untouched for the next card.
2026-10-28 23:51:51 -04:00
agent
5f2a6a184f
ui: design tokens and the shared component set (plan P1)
One palette, one geometry, one button. The alpha build had a four-colour
darkColorScheme and every screen inventing its own pill, which is why the app
read as a debug harness; `ui/Theme.kt` now carries the tokens and new UI takes
them from `OwColors` / `OwRadius` / `OwSize` instead of Material defaults.

Tokens (§1.1, §1.2): canvas #0A0C0E, surface #12161A, interactive #1C2228,
border #262E36, mint accent #2EE59D, text #F3F5F7 / #9BA3AE / #5E6773, and the
amber/crimson status triples. Cards are 16dp; buttons and inputs are 12dp
squircles; 999dp survives only for status pills. Typography is system sans for
chrome, and `MonoStyle` is the single mono style, reserved for pubkeys,
truncated locators, seeds, host:port and block heights.

Primitives (§1.3), in `ui/components/`:
- OwButton — primary / secondary / outline / destructive, exact heights and
  radii, no elevation;
- OwSegmentedControl — one track, accent selected segment, animated;
- OwAlertBanner — warning / error / info with a status icon and a tinted
  surface;
- OwCard, OwDivider, OwPill, OwStatusDot, TorStatusPill, OwSectionTitle,
  OwIconButton (36dp), Identicon, OwConfirmDialog (typed confirmation),
  OwQrCode (zxing, light plate for scanning).

Fourteen single-colour vector icons, so no `material-icons-extended` (a
multi-MB dependency) and no icon font. `Label`/`Mono` moved here from the
roster so the design system is not owned by one screen.

Behaviour: none. These are pure view helpers.
2026-10-28 23:51:29 -04:00
apk-dev
d64114ca1c
android: gate the Keystore passphrase key on device unlock, and migrate old installs
All checks were successful
android-ci / android (pull_request) Successful in 11m41s
`setUnlockedDeviceRequired(true)` is now set on the key that wraps the store
passphrase (API 28+; below that the pre-gate path is unchanged and logs which
branch ran). `setUserAuthenticationRequired(false)` is untouched: the gate only
refuses while the lock screen is up, it is not a biometric prompt, so an
unattended unlock on an unlocked device still works.

A Keystore key cannot be retrofitted, so the gate needs a second alias:
`onionwire.store.unlock-gated` is generated with the flag and is the only key a
fresh install creates; `onionwire.store` is the pre-gate key and exists only on
installs that stored a passphrase earlier. Migration runs the next time the
passphrase is in hand (save(), or a successful load() — never inside open(),
which must not generate keys):

  1. seal under the unlock-gated key (created here if needed)
  2. write the blob to `…bin.tmp`
  3. read those bytes back, open them with the gated key alone, compare to the
     passphrase in hand — failure drops the temp file, throws SecretUnavailable
     with the reason, and leaves the previous blob and key untouched
  4. rename the temp file over the blob
  5. only now delete the pre-gate alias

A crash before 4 leaves the old blob and key intact; a crash between 4 and 5
leaves a working gated blob plus a stale alias the next save/unlock retires.
`open()` tries the gated key first and falls back to the pre-gate key, so that
window is harmless. `forget()` deletes both aliases.

Reporting is honest about a platform limit: `KeyInfo` exposes
`isUserAuthenticationRequired` but has no getter for the unlock requirement, so
nothing can ask the Keystore whether the flag stuck.
`KeystorePassphraseCipher.unlockGateReport()` reports our own bookkeeping (which
alias the live key was generated under) plus `platformReportsGate = false`, and
a device whose Keystore refuses the flag falls back to the ungated alias and
says so instead of claiming the gate. A locked device that makes the gated key
unusable is reported as "the device is locked", not as a GCM tag failure.

Instrumentation: migration happy path (gated key appears, pre-gate alias gone
only after the on-disk blob opens under the new key), a failed re-wrap (old key
and blob byte-identical, no temp file), the gated proof refusing a pre-gate
blob, and the crash window still unlocking. Logcat lines print
MANUFACTURER/MODEL/SDK_INT and the branch taken. Not run here: no device or
emulator on this host. JVM suite still 213 tests / 0 failures; androidTest
sources compile.
2026-10-22 22:08:06 -04:00
agent
971d8b3894
android: reload wallet reads when the child starts answering
All checks were successful
android-ci / android (pull_request) Successful in 12m46s
2026-09-23 19:50:18 -04:00
agent
9eb054b10f
android: do not paint a connect refusal while the wallet is connecting 2026-09-23 19:48:52 -04:00
agent
b4f8bb809c
android: filter the wallet child's last_error where the SDK record becomes the model
All checks were successful
android-ci / android (pull_request) Successful in 12m53s
The status line renders WalletChildInput.lastError through walletChildLine,
and the same field feeds walletChildStatusDescription for the screen reader.
The filter added in 3f84021 sat on the sticky error card only, so in exactly
the state this card targets — a live child with no wallet file open answering
-13 No wallet file — the raw daemon sentence still reached the line and the
screen-reader sentence.

Move it to the producer: WalletChildStatus.toInput() now runs lastError
through walletFailureText, the one seam where the SDK record becomes the
Kotlin model. Idempotent on its own replacement texts, so the error card's
second pass is stable.

New JVM tests build the SDK record and assert on the rendered line (and its
description), not on walletFailureText in isolation: with the filter removed
they fail on the raw 'No wallet file'.
2026-09-22 14:11:34 -04:00
apk-dev
3f84021abb
android: ask for the wallet passphrase, and stop printing RPC errors
All checks were successful
android-ci / android (pull_request) Successful in 12m38s
The wallet manager could not open a wallet it holds no passphrase for: the
child came up pointed at the file with no wallet open, `needs_passphrase`
was true, and every read answered the daemon's `-13 No wallet file`. The
screen rendered that string.

Phone side of t_67879b98:

* WalletManagerScreen asks for the passphrase when the child reports
  `needs_passphrase` and no wallet is open, and submits it through the
  parent's `Wire::open_wallet_with_passphrase` on the file the child is
  already pointed at. Masked field, no copy action (same rule as the seed
  card), wiped on success and on dispose, FLAG_SECURE while the screen is
  up.
* `walletFailureText` filters every user-visible wallet failure: the
  daemon's `No wallet file`, a bare `-13`, and any JSON envelope become a
  plain sentence that says whether a wallet is open and what to do next.
  Applied at every site that renders a wallet error, in both wallet
  screens and the wallet-child error flow in the ViewModel.
* The wallet screen says "no wallet is open in the child" and where to fix
  it, instead of leaving it to surface later as the daemon's own words.

Tests: WalletManagerTest covers the new decisions (prompt shown / not
shown, submit gate and its reasons, the failure-text filter, the open
hint) on the JVM. 203 unit tests green.
2026-09-22 13:30:08 -04:00
dc8c3933cd Merge branch 'main' into onionwire/t_54329f2b-android-profile-screen-nickname-monero-r
All checks were successful
android-ci / android (pull_request) Successful in 12m30s
2026-09-22 12:09:33 +00:00
agent
775f2e88be
android: profile screen — nickname + Monero receiving address
All checks were successful
android-ci / android (pull_request) Successful in 12m27s
The phone's half of the TUI's `/profile`. A `Profile` action on the roster's
app bar opens `ui/ProfileScreen.kt`: nickname, bio, and the Monero address
friends pay to, all three loaded from the store and written back through the
core's own validation.

- The address is checked with `uniffi.onionwire_sdk.checkAddress` *before* the
  write, so a typo is refused with the typed text still in the field instead of
  surfacing as a store error afterwards. An empty address is allowed and is
  labelled with its consequence: with no profile address and no running wallet
  child the core has nothing to hand a payer.
- The bio is carried, not owned: a save that did not touch the field writes
  back the value read from the store immediately before the write, so a bio set
  in the TUI cannot be blanked from the phone.
- On save the profile is pushed to **every** friend in the roster, one-shot and
  fail-closed per friend like the TUI's `save_profile`. A push failure is not a
  save failure: the status line always starts with `profile saved` and names the
  count, with each failure listed by petname (else shortened fingerprint).

Every decision the screen makes is a pure function in the new file, covered by
`ProfileDraftTest` (21 cases) on the JVM: the save-button rule (dead until the
read lands, dead while the form is unchanged), the address branch, the bio rule,
label selection and the status-line aggregation.

Verified on AVD ow35 (x86_64 slice, emulator-5560): the roster app bar carries
`Profile`; nickname/bio/address survive `am force-stop` + relaunch; an invalid
address is refused before the write; a save with an empty roster reports
`profile saved`; with one (self-)peer in the roster a save reports
`profile saved · sent to 1 friend`, and with the emulator's network cut the same
save reports `profile saved · sent to 0 of 1 friend · failed: <label>: <tor err>`.
2026-09-22 02:12:32 -04:00
apk-dev
812c259f46
android: saved-wallets screen (list, select, back up the open wallet)
All checks were successful
android-ci / android (pull_request) Successful in 10m37s
The app could hold several wallets and show none of them. Add the screen
that lists the store's catalogue, marks the one the wallet child has open,
switches to another on a tap, and — for the open one only — shows its
recovery phrase and private keys.

Everything secret here belongs to the file the child currently has open:
`query_key` is answered by that file and no other, so the seed card and the
keys card hang off `active_wallet_filename()`, not off a row. On a row that
is not the open one both actions are dead and say why ("open this wallet to
view its backup") instead of opening it under the user — switching wallets
is a deliberate tap, because `open_wallet` stops and restarts a running
child.

The phrase keeps the existing treatment: the wallet screen's own
`SeedBackupCard`, widened from `private` to `internal` rather than copied,
so the gate constants are still the one `SeedBackupGate`. The keys card
shows the view key always and the spend key when there is one; a view-only
wallet says "view-only wallet — no spend key" in words, because `null` is
the wallet's own answer and not a failure. Neither value is logged,
persisted, tagged, or held in saved state, and both are dropped on dispose.

The catalogue is re-read on entry and on Refresh, never cached from app
start, so a wallet created on the wallet screen after this one was first
opened shows up without restarting the app. An empty catalogue ("No saved
wallets yet") and a read failure ("could not read the wallet catalogue" +
the core's text) are rendered as the two different states they are.

The gate is pure Kotlin in the new file and `WalletManagerTest` covers it on
the JVM (17 cases): the row label's name/blank/whitespace fallback, which
child states count as readable, and whether the secret actions are offered
for a row.
2026-09-22 01:23:47 -04:00
agent
b6447f76d6
android: collapse the roster identity block into a dropdown
All checks were successful
android-ci / android (pull_request) Successful in 12m26s
The identity card's full fingerprint wraps to several lines on a phone and
pushes the friend list off the first screen. Collapse it: one line by
default (label + `shortId(fingerprint)` + chevron), the full fingerprint and
the full onion behind a tap, in the order they already had.

The `sdk …` line and `keepAliveNote` stay outside the disclosure — the
keep-alive denial is the only place that note appears, so hanging it off a
collapsed block would hide it.

`shortId` is a pure top-level function (`head … tail`, unchanged when the
value is no longer than the abbreviation, empty stays empty) so the collapsed
line is a slice of the value shown expanded, not a parallel encoding. The
expand state is `rememberSaveable`: a rotation keeps what the user chose, and
nothing about it belongs in the store.

RosterIdTest covers the abbreviation on the JVM (7 cases: the 64-hex
fingerprint, the head/tail boundary, custom head/tail, shorter-than-input,
empty, single-char ellipsis).
2026-09-22 00:28:39 -04:00
agent
118191c541
android: block the wallet screen on an unbacked seed, and make it re-showable
All checks were successful
android-ci / android (pull_request) Successful in 10m35s
A created wallet's seed was two lines of small text at the bottom of the
wallet page, dismissed by one tap, gone for good once the screen was left.
A real user created a wallet, never saw the seed, and the app had no way to
show it again.

- `SeedBackupGate` (new, pure Kotlin): the confirm word `SEEN` and its
  case-insensitive match mirror the TUI's own `WalletSetup::CreateSeed`
  gate; create starts unbacked, import is backed up without the gate, and
  only a correct word can confirm.
- The seed card is the whole body until the word is typed and Done is
  tapped: no Cancel, no copy button (the Android clipboard is readable by
  every other app), Done dead until `SEEN`.
- "Back up seed" re-reads the seed through the new `Wire::wallet_seed()`
  (`WireViewModel.walletSeed()`), so a seed missed the first time is not
  lost. Its failure is shown next to the button, not at the bottom of a
  long scroll.
- While unconfirmed: a warning strip stays at the top of the wallet screen
  and the receive address and Show QR are hidden — XMR received into a
  wallet whose 25 words were never written down is unrecoverable.
- The flag lives in app-local prefs (`wallet_seed_backup`), not in the
  Keystore-wrapped store, and is reset by `createWallet` itself so no
  caller can forget it.

The stored flag is nullable, and the null is load-bearing. `false` means
this install created a wallet and nobody has confirmed the seed, so the
strip is up whether or not the balance reads. `null` means nothing is
stored — an install that predates the flag, or one that has never created
a wallet here — and there the strip waits for `wallet_balance` to return a
real amount, the core's own evidence that the child has a wallet open.
Without that distinction a first-run user who had configured a chain
source but not yet created a wallet (`wallet_balance` returns "err") would
be warned about a seed they do not have.

The app-bar Back still leaves the screen, deliberately — it is the TUI's
`Esc`. It costs nothing now, because leaving no longer loses the seed.

Verification: `./gradlew :app:testDebugUnitTest` green, 135 tests
(`SeedBackupGateTest` 18 of them).
2026-09-20 12:15:47 -04:00
Lance
4d2528351b
android: poll the live wallet-child probe so the sync line moves
All checks were successful
android-ci / android (pull_request) Successful in 10m51s
The wallet screen's 2s loop read Wire::wallet_status, which only re-reads the
snapshot the last probe left in the store — so the `sync h/t` segment sat frozen
until a chain-mode tap ran start_wallet_child (which probes on its way out).

The loop now paints once from the cached read (non-dialing, so the screen has a
record immediately) and then calls Wire::wallet_child_refresh for every tick:
one live probe of the child's loopback wallet RPC, and of the configured local
daemon's get_info when that RPC does not answer. Same 2s cadence, same
Dispatchers.IO, same sticky walletChildError, same one-poller guarantee.

The loop is a top-level function taking its two reads as parameters, which is
the only seam a JVM test has — requireWire() is NodeHost.requireOpen(), a
process-global only a real Arti bootstrap sets. WalletChildRefreshLoopTest pins
that the cached read paints exactly once and every tick after it is the live
probe, that a probe slower than the tick is never overlapped, and that
cancelling the loop (leaving the screen) stops the dialing.
2026-09-20 00:48:57 -04:00
agent
e697045515
android: show the chain daemon's sync height on the wallet status line
All checks were successful
android-ci / android (pull_request) Successful in 12m45s
The SDK surface from the rust-dev parent (#129) carries `WalletChildStatus.height`
and `target_height` (Rust `u64` → generated Kotlin `ULong`), so the wallet status
line can say how far the chain daemon has got instead of only naming it.

* `WalletChildInput` mirrors both fields as `ULong` — checked against the
  generated `uniffi.onionwire_sdk.WalletChildStatus`, not assumed. Defaults stay
  `0uL` so every existing fixture is unchanged.
* `walletChildLine` appends ` · sync h/t` after the source and the `node` segment,
  before the error em-dash, and only when either value is non-zero: `0/0` is
  unknown (probe failed, daemon not up), not `0%`, and a zero target still prints
  as `/0`. No percent, no progress bar, no ETA.
* `WalletScreen.toInput()` copies both fields field-for-field; the status row's
  screen-reader sentence moved into `walletChildStatusDescription`, which carries
  the same `sync h/t` the eye reads. One line, still no second widget.
* Tests cover the three sync cases plus the spoken row; the old exact-line
  assertions (`off · receive-only`, `connecting · local node`,
  `ready · remote onion daemon`) are untouched. `:app:testDebugUnitTest`: 114
  tests, 0 failures.
* `android/CUPRATE_DAEMON.md` no longer claims the record has no height field.
2026-09-19 22:59:09 -04:00
agent
3868452a4a
fix(android): tapping a Cuprate mode starts the node
All checks were successful
android-ci / android (pull_request) Successful in 12m50s
Selecting mainnet pruned only persisted ChainConfig, so the screen
updated the storage line and nothing else. Store, then Start when the
storage floor allows. Filled button is the stored choice.
2026-09-19 14:33:30 -04:00
agent
5080652e3b
feat(wallet): mainnet pruned and full on-device chain modes
All checks were successful
ci / test (pull_request) Successful in 5m45s
ci / sdk (pull_request) Successful in 1m34s
ci / fuzz (pull_request) Successful in 4m51s
android-ci / android (pull_request) Successful in 13m2s
Cuprate in-process and TUI keys 1/2/3 pick mainnet pruned, mainnet
full, or experimental testnet. Datadirs are split so a prune store
cannot mix with a full one. Android storage floors scale with the
choice. Cuprate remains pre-production; mainnet is unvalidated.
2026-09-19 12:54:35 -04:00
agent
0acf89a0b4
android: Start wallet no longer looks like a no-op while Cuprate launches
All checks were successful
ci / test (pull_request) Successful in 5m34s
ci / sdk (pull_request) Successful in 1m22s
android-ci / android (pull_request) Successful in 10m48s
ci / fuzz (pull_request) Successful in 4m52s
Tapping Start held the SQLCipher mutex for the whole in-process Node::launch
and blocked the UniFFI tokio worker, so wallet_status stayed off with no
error. Drop the store lock until creds are needed, spawn_blocking the sync
start, and show that Start is in flight.

The APK still runs Cuprate testnet only; this does not add mainnet or prune.
2026-09-19 12:03:01 -04:00
apk-dev
519f0e66c3
fix(android): link the SDK against the dynamic libc, not static bionic
All checks were successful
android-ci / android (pull_request) Successful in 30m59s
`openWire` segfaults at `dlopen` on every ABI, so the app dies the moment the
passphrase is submitted and the onion never publishes. The tombstone:

    signal 11 (SIGSEGV), fault addr 0x0
    #00 libonionwire_sdk.so (getauxval+21)
    #01 libonionwire_sdk.so (__cxa_atexit+604)
    #02 libonionwire_sdk.so (_GLOBAL__sub_I_superscalar.cpp+891)
    #06 libjnidispatch.so (Java_com_sun_jna_Native_open+68)
    #42 uniffi.onionwire_sdk.Onionwire_sdkKt.openWire+0

`_GLOBAL__sub_I_superscalar.cpp` is RandomX's, and RandomX arrived with the
`cuprate-daemon` feature (#113). It calls `getauxval` from a static
initializer — and `libonionwire_sdk.so` had linked bionic **statically**, so
that `getauxval` read an auxv vector only the dynamic linker ever fills in.
The first SDK call is the first `dlopen`, which is the first time anything
touches the library: the crash lands exactly on "user typed the password".

The static libc came in with the same commit that added the C++ link flags.
`linkFlags()` passes `-L<ndk>/sysroot/usr/lib/<triple>` for the libc++
archives; that directory also holds the static `libc.a`, while the dynamic
`libc.so` stub lives in the per-API subdirectory that cargo-ndk's linker
wrapper normally supplies — and that wrapper is bypassed on purpose here, so
the per-API directory was no longer on the search path at all and `-lc`
resolved to `libc.a`. Both directories are now passed, the per-API one first,
and `verifyDynamicLibc` fails the build if `libc.so` ever leaves DT_NEEDED
again.

    before (v0.9.0 arm64): NEEDED liblog.so only, local getauxval/__cxa_atexit
    after:                 NEEDED libstdc++.so, libdl, liblog, libm, libc.so, no local libc

Also: the keep-alive notice is re-announced with the locator once the node
publishes. It is anchored at the Open tap with an empty onion (so the shade
does not claim a reachable node while Tor bootstraps), and only the
POST_NOTIFICATIONS callback ever replaced it — on a device that already
granted notifications there is no callback at all, so the notice claimed
"OnionWire is starting" forever.
2026-09-19 00:40:02 -04:00
agent
396e468f1a
fix(android): keep Tor bootstrap alive after the unlock activity dies
Some checks failed
android-ci / android (pull_request) Has been cancelled
Open set Phase.Opening then ran openWire on viewModelScope, and the
keep-alive refused to start until Wire existed. Closing the activity
cancelled bootstrap, so the spinner vanished and the lock screen came
back idle. Run openWire on NodeHost's process scope, start the FGS on
the Open tap, and treat in-flight bootstrap as keep-alive work. IME Go
also submits unlock the same way as the Open button.
2026-09-18 21:46:34 -04:00
sirius
e6b6bc8dd6
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 17:16:05 -04:00
apk-dev
0134396588
android: start/stop the monero-wallet-rpc child from WalletScreen, bundle the binary
All checks were successful
android-ci / android (pull_request) Successful in 8m59s
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:20:08 -04:00
agent
dff37fe00e
docs+tui: reachability stance (no sealed mailbox) and peer-unreachable queued footer
Some checks failed
ci / test (pull_request) Has been cancelled
ci / sdk (pull_request) Has been cancelled
android-ci / android (pull_request) Has been cancelled
Add a Reachability section to docs/THREAT_MODEL.md: no sealed mailbox or
server-side message store, the chat outbox is local-device retry only, and
there is no mutual-online indicator — a send is a one-shot Noise IK session
and an unanswered dial queues locally with the retry clock shown.

OutboxSummary now carries the outstanding row's attempt count and soonest
retry, so the footer reads 'peer unreachable, queued (n/8, retry 45s)'
instead of a bare 'n queued'. Tests updated to the real outbox wording; the
Android KDoc note stops claiming the footer copy is mirrored (Android shows
per-row 'queued (try n/8, retry …)' via OutboxDetail).
2026-09-17 20:44:28 -04:00
6f69d629fb Merge branch 'main' into wt/app-icon-adaptive
All checks were successful
ci / test (pull_request) Successful in 4m19s
ci / sdk (pull_request) Successful in 1m14s
android-ci / android (pull_request) Successful in 8m19s
2026-09-15 02:25:12 +00:00
agent
faf4d1bb15
fix(android): make the new launcher icon actually show up as an adaptive icon
The icon change landed as a bitmap dropped straight into
res/mipmap-anydpi-v26/ and wired to android:icon only, so the installed app
kept showing the old art:

- android:roundIcon still pointed at @mipmap/ic_launcher (the old vector
  adaptive icon). Launchers that prefer roundIcon — Pixel Launcher, Samsung
  One UI — render it in preference to android:icon, so the new bitmap never
  appeared. Verified on the ow35 emulator drawer: old cyan/green line-art
  onion while android:icon was already the new PNG.
- a bitmap under mipmap-anydpi-v26 is a legacy icon, not an adaptive one: the
  launcher pads it into the mask itself and it is not density-aware.

Now:
- drawable-nodpi/onionwire_app_icon.png: the artwork squared to 432x432 with
  the logo at 62% of the canvas (inside the 66dp/108dp safe zone) over a
  seamless blurred backdrop of itself, so no launcher mask clips the logo.
- mipmap-anydpi-v26/ic_launcher.xml and ic_launcher_round.xml: adaptive icons
  with that bitmap as the background layer and a transparent foreground.
- AndroidManifest.xml: icon=@mipmap/ic_launcher, roundIcon=@mipmap/ic_launcher_round.
- Delete the retired vectors (ic_launcher_background/foreground.xml) and the
  misplaced mipmap-anydpi-v26/onionwire_app_icon.png.
2026-09-14 22:16:24 -04:00
0150261da2 Merge branch 'main' into wt/t_7db68274 2026-09-14 15:51:43 +00:00
77428789cb Merge branch 'main' into wt/t_3a094045 2026-09-14 15:51:24 +00:00
agent
04c993862c
android: one chat poller owned by the ViewModel, gated auto-scroll, Enter-to-send
The chat screen owned a LaunchedEffect(Unit) that fetched maxAttempts once and
then called loadMessages/loadOutbox every 2s forever, fed by three suspend
lambdas from MainActivity — one SDK poller per composition. The cadence now
lives in WireViewModel: openChat(peer) starts one 2s loop in viewModelScope
(closeChat stops it, re-entering the same peer is a no-op), exposed as
ChatState(messages, outbox, maxAttempts, error) and collected with
collectAsStateWithLifecycle. Same 2s cadence, maxAttempts read once, messages
and outbox refreshed together, load failures sticky on ChatState.error, and
the QUEUED notice unchanged; a send clears the load error.

Auto-scroll no longer steals the reader's place: the tail is followed only when
the last visible index is >= count - 2 (or the list has not filled yet), while
the user's own send still scrolls their message into view. The first fill keeps
its one jump to the bottom. A delivery-only change (same size) still does not
re-run the effect — documented in a comment rather than changed.

The composer keeps ImeAction.Send with maxLines = 4, documented as a deliberate
wrap limit rather than a newline affordance: the action key sends (hardware
Enter still inserts a newline inside the field).

No polling LaunchedEffect remains in ChatScreen.kt.
2026-09-14 02:54:33 -04:00
apk-dev
535a2baff9
android: wallet + roster bottom actions clipped while the keyboard is up
The two screens whose action row lives inside a non-scrollable Column could
not be un-covered by insets alone: the container had no scroll range at all.

- WalletScreen: root Column is now a verticalScroll viewport that consumes
  systemBars ∪ ime itself (screenContentInsets()) before the scroll, paired
  with Scaffold(contentWindowInsets = 0). The nested LazyColumn becomes a
  plain Column (a lazy list cannot be measured inside a scroll container with
  unbounded height) and the weight(1f) bottom spacer goes with it: a weighted
  spacer cannot live in a scrollable Column.
- RosterScreen: same inset treatment; the friends LazyColumn drops
  fillMaxSize() for weight(1f) so the wipe-confirm strip above it keeps its
  height when the IME shrinks the window.
- Insets.kt is PR #67's helper, taken verbatim (this branch does not carry #67).

Stacked on PR #67 (wt/chat-ime-insets, 08381c4) for ui/Insets.kt.
2026-09-14 02:05:03 -04:00
agent
9c36814eb3
android: copy the invite with LocalClipboard, not the deprecated LocalClipboardManager
LocalClipboardManager is deprecated in compose ui 1.10; the warning was the
only one in :app:compileDebugKotlin. Switch ShareInviteScreen to
LocalClipboard.setClipEntry(ClipEntry(ClipData.newPlainText(...))) on a
rememberCoroutineScope, since the new API is suspend. Same text, same
copied-state flip, same label, no permission change.
2026-09-14 00:49:49 -04:00
agent
08381c47be
android: keep the chat composer above the keyboard (ime insets)
enableEdgeToEdge() sets decorFitsSystemWindows=false, so on API 30+ the framework
no longer resizes the window for the soft keyboard. The manifest's
android:windowSoftInputMode="adjustResize" therefore has nothing to resize and the
IME arrives as an unconsumed window inset; Scaffold's contentWindowInsets covers
systemBars only. Result: the composer row, its Send button and the typed body were
drawn underneath the keyboard and only reachable by dismissing it.

- ui/Insets.kt (new): screenContentInsets() applies systemBars ∪ ime once, at the
  screen's content root. union is per-side max, so the keyboard and the navigation
  bar are never summed; the Top side is excluded because a Scaffold's pad.top is
  already the app bar's measured height (the app bar carries its own status-bar
  inset). @Composable because WindowInsets.ime is a composable read.
- ChatScreen: Scaffold(contentWindowInsets = 0) plus the root consuming the inset;
  the body region holds weight(1f) in every branch (loading and empty included) so
  the composer can never be squeezed off the bottom; Send is always drawn instead
  of being swapped for a spinner (no layout jump under the thumb); the field sets
  ImeAction.Send so the keyboard's own action key sends; focus returns to the
  field after a send; testTag on the composer/input/send.
- InviteScreens (both screens) and RotateScreen: same inset handoff, so the
  Verify / Approve / confirm buttons under a text field stay reachable by scrolling.
- UnlockScreen: safeDrawingPadding(). It had no system-bar insets at all (title
  drawn under the status bar) and its Open button sat under the keyboard while a
  passphrase was being typed.

Verified on emulator-5554 (ow35, x86_64, API 35) with the debug build whose sources
are byte-identical to this commit:

  element        keyboard closed   keyboard open
  composer       y=2232            y=1380
  Send button    y=2253            y=1433
  keyboard top   -                 y≈1500

mInputShown=true while the draft text was visible; the message sent both via the
Send button and via the keyboard's action key (paper-plane = ImeAction.Send), each
landing with the ✓✓ delivery marker. :app:testDebugUnitTest green.

Note: no CI job covers this — ci.yml's path allowlist is src/**, crates/**,
tests/**, Cargo.*, so an android-only change runs nothing, and android-release.yml
only fires on v*.*.* tags.
2026-09-14 00:26:14 -04:00
Lance Walters
cf0a517cd2
wallet: create/import in-app (no key paste on create) + opt-in spend
All checks were successful
ci / test (pull_request) Successful in 4m15s
ci / sdk (pull_request) Successful in 1m12s
/ wallet create generates a wallet on the RPC and shows the 25-word seed
once for backup; /wallet import is the only path that takes an existing
seed, and it is collected on a dedicated screen so it never reaches the
composer line or chat history.

Threat model now states the real policy: payments are opt-in, default is
no spend key, spend is a local authority at create/restore, and the chain
source is the user's choice (spawned local monerod or a daemon address
they supply). WALLET.md and README follow.

Tests: canned-RPC create/restore, slash parse, help overlay.
2026-09-13 23:25:25 -04:00
agent
7ad3679b51
change app icon 2026-09-13 21:23:27 -04:00
agent
1aecbbee72
change app icon 2026-09-13 21:15:16 -04:00
agent
7cf98bb9fe
feat(android): wallet screen and SDK payment surface
Some checks failed
ci / test (pull_request) Failing after 4m1s
ci / sdk (pull_request) Successful in 1m27s
Expose wallet balance/address/transfers plus one-shot invoice and tip on
the UniFFI SDK. Wire a Compose wallet route (QR, composers) without dropping
wipe-chat. Ignore machine-local android/.cargo NDK paths.
2026-09-13 15:27:57 -04:00
t
fc2b2197c7
feat(android): chat row renders queued (try 3/8, retry 45s) from the SDK's outbox rows
All checks were successful
ci / test (pull_request) Successful in 3m55s
ci / sdk (pull_request) Successful in 1m2s
Consumes the SDK surface from PR #58 (`Wire.outbox(pubkeyHex)` →
`OutboxRow { messageId, status, attempts, nextAttemptAt, lastError }` and
`outboxMaxAttempts()`): a queued chat row now says *why* it is still queued
instead of a flat `queued`.

* `OutboxDetail.kt` — `retryInText` mirrors `src/tui.rs::retry_in_text`
  (`<= 0` → `retry now`; `< 60` → `retry {n}s`; else `retry {ceil-minutes}m`),
  and `outboxDetails` joins the SDK's rows onto the chat rows. The denominator
  is the core's `outboxMaxAttempts()`/`Rust` budget, fetched once — never 8.
* A terminal `"failed"` row keeps the marker's own `failed: <reason>` and gets
  **no** countdown: `nextAttemptAt` on a failed row is the last time it was
  scheduled for, so a countdown there would promise an attempt that never comes.
  `"sending"` stays bare, matching the TUI.
* `ChatScreen` polls the outbox rows on the same 2s cadence as the bodies and
  renders the countdown against an injectable `nowSeconds` (the store holds an
  absolute instant, the app computes the age).
* The join is positional — `ChatMessage` carries no `messages.id` — and
  fail-closed: mismatched row counts, an unknown status, or a status that
  contradicts the one the SDK resolved for that message drops every detail and
  leaves the flat markers. `ChatMessage.id` would remove the positional part;
  filed as follow-up.
* `OutboxDetailTest` (17 tests) asserts the three `retry_in_text` buckets, the
  `queued (try 3/8, retry 45s)` wording, that a failed row shows no countdown,
  that the denominator comes from the caller, and the three fail-closed cases.
  32 unit tests, 0 failures.

Android base: PR #56 (`feat/android-outbox-state`, t_f46a9863) — the Android
half of the #52/#56 duplicate pair, which is not merged here. SDK base: PR #58
on PR #51.
2026-09-12 19:16:45 -04:00
apk-dev
c4b824a83d
feat(android): surface outbox delivery state in chat
Renders the core's own Queued/Sending/Sent/Failed per outgoing row instead of
implying a message either sent or did not: a clock for queued, a progress
spinner for sending, a double-check for delivered and an error marker with the
short reason for a terminal failure, plus a chat-level `N queued` footer that
keeps a fail-closed `send failed: <reason>` statement on screen.

States are read verbatim from ChatMessage.delivery (Node::outbox_status_of_message
over UniFFI) — no parallel enum, nothing guessed from a timeout. A missing or
unrecognised status renders as queued, never delivered.

WireViewModel.send() now returns the SDK SendState instead of dropping it, so the
composer can say a send is queued rather than pretend it landed, and the empty-chat
copy no longer claims 'there is no outbox in v1'.

Accessibility: every marker carries an explicit contentDescription sentence and a
test tag; the glyph is never what a screen reader announces.
2026-09-12 19:16:44 -04:00
apk-dev
e923e06891
feat(android): keep the onion published through Doze with a foreground service
WireViewModel owned the single Wire node and called shutdown() from
onCleared(), so a backgrounded node died with the UI. Node lifetime is now
arbitrated by a pure policy (NodeLifetime) with two anchors — UI and
keep-alive — and one process-wide owner (NodeHost) that is the only caller
of flush()/shutdown() in the app.

KeepAliveService holds the process in the foreground behind an ongoing
notification from the "keep-alive" channel, started on unlock and stopped
by Lock or the notification action, so peers can still reach the device
while the screen is off.

- foregroundServiceType="specialUse": dataSync is documented as a finite
  transfer (upload/download/backup) and this is an always-on node
- POST_NOTIFICATIONS requested when the node becomes reachable; denial
  keeps the service running with no visible notice instead of failing
- re-unlock with a node the service kept alive adopts it rather than
  reopening the store the live node still holds
- 9 device-free unit tests for the start/stop/re-unlock state machine
2026-09-12 16:34:40 -04:00
apk-dev
c068e292a0
feat(android): stop the node when the UI goes away
`WireViewModel.lock()` set `wire = null` and `onCleared()` did not exist at all,
so neither the user pressing Lock nor the Activity finishing stopped anything:
Arti kept its client and the hosted onion service, the outbox worker kept
dialing, and the sqlite connection stayed open behind the JNI handle.

Both paths now go through `stopNode(Wire)`:

1. `flush()` — one last bounded drain, so a queued message gets its chance
   before the process may lose its socket.
2. `shutdown()` — drain again with a shorter budget, stop the onion service,
   abort the retry worker, checkpoint the WAL, and take the node handle out of
   the `Wire` (which is what releases the last Arc to the Tor client and the
   store).

Both run on a process-scoped `TEARDOWN` scope (`SupervisorJob` + `Dispatchers.IO`)
because `onCleared()` runs *after* `viewModelScope` is already cancelled. Errors
are deliberately swallowed there: the UI is gone, and the SDK reports a second
teardown as the typed `WireException.Stopped` rather than a panic.

`unlock()` joins any in-flight teardown before opening again. The old node holds
the sqlite file and Arti's state lock until its teardown returns, and racing it
makes the next `openWire` fail.

A process killed outright (Doze, background-process killer, force-stop) still
never runs any of this — that is what the sqlite outbox and the new `flush()`
are for. The foreground-service card (`t_5bf32cd3`) moves this ownership from
the ViewModel to the service.
2026-09-12 15:10:29 -04:00
Sirius DevOps
2fd640e230
feat(android): wrap the store passphrase in the Android Keystore
Typing the passphrase on every launch was the v1 posture. It stays the
fallback, but it is no longer required: on first unlock the passphrase can be
remembered (checkbox, on by default) and is stored as an AES-256-GCM blob
wrapped by a key that never leaves the Android Keystore.

- crypto/StoreSecret.kt: the OWSEAL1 envelope (magic + IV + ciphertext + GCM
  tag) and the wipe helpers. No android.* imports, so the code that runs on a
  device is the code the unit tests exercise, with a JVM AES key standing in
  for the Keystore key.
- crypto/KeystorePassphraseCipher.kt: AES-256-GCM key under alias
  `onionwire.store`, StrongBox requested first (API 28+) with a graceful
  fallback on ProviderException (StrongBoxUnavailableException is one), and an
  honest KeyInfo-backed report of where the key actually lives.
  setUserAuthenticationRequired(false) stays the default on purpose.
- crypto/StoredPassphraseStore.kt: ciphertext only, at
  filesDir/secrets/store-passphrase.bin, written tmp+rename. A failed decrypt
  reports Unavailable and does NOT delete the blob.
- WireViewModel: unlock(passphrase, remember), unlockStored(),
  forgetStoredPassphrase(); the secret CharArray is zeroed in `finally`; the
  Keystore probe runs off the main thread at ViewModel construction.
- UnlockScreen: one-tap when a stored blob exists, the typed passphrase is
  dropped from Compose state as soon as it is handed over and is never put in
  saved instance state; "Forget stored passphrase" deletes blob and key.
- androidTest: the device-only half (AndroidKeyStore, StrongBox, KeyInfo),
  which cannot run in the unit-test JVM.

Verified: ./gradlew :app:assembleDebug and :app:testDebugUnitTest green,
25 tests / 0 failures (11 new StoreSecretTest, 9 new StoredPassphraseStoreTest).
2026-09-12 13:55:07 -04:00
Sirius DevOps
f6ac5ea738
fix(android): Approve & add no-op from shared Compose busy flag
All checks were successful
ci / test (pull_request) Successful in 2m32s
PasteInviteScreen drove Verify and Approve from one busy boolean plus
LaunchedEffect(busy). Tapping Approve relaunched decode, which cleared
busy and cancelled add — so the roster never updated.

Extract InviteAddFlow with separate verifying/adding flags and launch
each action from its click handler. Unit tests were red against the
shared-busy state machine (4/5 failed) and green after the split (5/5).
2026-09-11 21:57:21 -04:00
apk-dev
672f2c9990
feat(android): SDK AAR (UniFFI) + Compose APK, Arti rustls feature split
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.
2026-09-10 18:20:19 -04:00