fix critical data-loss bug: SAF file pickers silently wiped the vault mid-export/import - ProcessLifecycleOwner.onStop() called vault.lock() (zeroing keys, clearing entryList) whenever the WHOLE PROCESS backgrounds, which fires not just on genuine user backgrounding but also whenever a system Activity (SAF save/open dialog, share sheet) takes foreground as an expected, momentary part of an in-app flow. Result: CSV export always produced a 35-byte header-only file with zero entry rows, silently discarding all vault data, and the app dropped to the lock screen right after - confirmed via temporary logcat instrumentation showing entries.size=0 at buildCsv() time despite 5 real entries existing seconds earlier. Added VaultRepository.expectTransientBackground()/consumeTransientBackgroundSuppression() (a single-use flag) and wired it into PeachApplication's onStop to skip the lock when set. Applied at all 6 external-activity launch sites found across the app: CSV export, PeachScript export, CSV/JSON import picker, recovery-words save-as-text, Codex PDF save, Codex PDF share, and all 3 Codex PDF-restore picker launches. Live-verified the fix end to end: re-ran the exact same CSV export flow, confirmed via logcat entries.size=4 (real count) and isUnlocked=true at export time (previously 0/would-have-locked), pulled the resulting file and confirmed real entry rows (GitHub/Google/Old Bank/Fastmail with real usernames, passwords, urls) instead of just the header, and confirmed the app no longer drops to the lock screen after export.

dev · 7 weeks ago · 2026-07-24 · 2.6 MB

session: critical-corrections-c1-c7 ยท agent: claude-sonnet-5

$ koh steal kepr.uk/peach-android@73d0f6503c8a
·
← b2f98db39dab 5349e6a72626 →
⇓ download .face