android: optional seed-offset passphrase on wallet import #157
Loading…
Reference in a new issue
No description provided.
Delete branch "onionwire/t_a6258883-onionwire-android-seed-offset-field-on-w"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Android half of the optional seed-offset passphrase. Core parent: #156 (
import_wallet_with_offset). This PR is based on that branch, not onmain.Import card
offset passphrase (optional),PasswordVisualTransformation, plusre-type offset passphrase. One quiet outlined field and its re-type under the seed; the existing wallet-file passphrase field is untouched.bodySmall/onSurfaceVariant), not a placeholder:Not the wallet file passphrase. Leave blank if this seed has none. A wrong offset does not fail — it opens a different wallet.importWallet(password, seed). Same success path as before.offset passphrases do not matchon the card.importWalletWithOffset(password, seed, offset), the UniFFI name forimport_wallet_with_offset, confirmed against the generated binding (sdk/build/generated/uniffi/uniffi/onionwire_sdk/onionwire_sdk.kt:1778and:2499).Offset was not saved
The offset is not sealed and never stored, so an offset import is not an ordinary import that is already backed up — a later "Back up seed" returns the derived mnemonic, which opens this wallet only without the offset.
WireViewModel.importWalletdoes not callsetWalletSeedConfirmed(...Imported)on the offset path. It sets a new pending flag instead.SEED_BACKUP_PREFS:offset_pending, notbacked_up. Not a store column, not SDK state. A process kill before the acknowledgement still shows the card.this offset was not saved. write it down. a later seed backup is a different 25 words that open this wallet without the offset.SeedBackupGate.CONFIRM_WORD(SEEN), case-insensitive. No second word. Before it, the card is the whole body and Done is dead.SEEN: clear pending, then mark the seed confirmed as an import. A wrong word changes neither flag and cannot un-confirm a confirmed wallet.SeedBackupGate.receiveAddressVisible(..., offsetPending), not arememberflag.OFFSET_WARNING), because the create-seed words are the wrong fact here.Decisions in
SeedBackupGate(pure Kotlin)card(confirmed, walletReadable, offsetPending)is now the single place that says which blocking card the screen is under (None/UnbackedSeed/OffsetNotSaved).receiveAddressVisible(...)takesoffsetPendingand delegates tocard(...).offsetPendingAfterImport(offset)is the blank-means-no rule.offsetAck(typed, pending, confirmed)is the confirm step, returning both flags —nullstaysnull, so nothing is written for an install that never stored a value.Visual
One quiet outlined field plus its re-type, no new filled button. The card's Done is an
OutlinedButton, deliberately quieter than the seed card's filledDone— the card is the block, not the button. Import stays the existing Import action; no restyle of the screen.Verify
android-ci.ymldoes not run Kotlin unit tests, so a green Android check is not evidence.24/24, including the seven new cases:
only_a_real_offset_leaves_an_acknowledgement_pending,an_unacknowledged_offset_hides_the_receive_address,a_pending_offset_is_the_card_the_screen_is_under,the_right_word_clears_the_pending_flag_and_backs_the_import_up,a_wrong_word_changes_neither_flag,the_offset_card_does_not_reuse_the_seed_warnings_words, plus the untouched create/import cases. (The full run also cross-compiled the SDK forarm64-v8aand generated the bindings:cargoBuildAndroid+uniffiBindgen+verifyDynamicLibcall green.)Not verified on a device. No release cut.