Migrate identity storage to Tink with one-time legacy migration#648
Migrate identity storage to Tink with one-time legacy migration#648yet300 wants to merge 43 commits intopermissionlesstech:mainfrom
Conversation
# Conflicts: # app/src/main/assets/nostr_relays.csv
# Conflicts: # app/src/main/assets/nostr_relays.csv
* geohash announce * only for some geohashes * global presence right away * jitter delays * show ? people for high-precision geohashes * 1000 events
* wip mesh graph * gossip fix * gossip works * source-based routing wip * log * update spec to be explicit about intermediate hops only * drop duplicate hops * add to spec * test * forgot comma * source routing v2 * add compression bomb protection * v2 source routing * fragmented packets inherit route * update spec * Gossip routing tmp with connection limit fixed (permissionlesstech#569) * fix: r8 exception for LocationManager (permissionlesstech#566) * fragmented packets inherit route * update spec * fix connection limits * fix: deserialization issue with routed packets * log * dynamic fragment size * fragment size * add tests * feat(gossip): implement two-way handshake for source routing edges - Update MeshGraphService to track directed announcements - Require bidirectional announcements for a 'confirmed' edge - Update RoutePlanner to strictly use confirmed edges - Update Mesh Topology debug view to show confirmed vs unconfirmed edges (solid vs dotted) * docs: update SOURCE_ROUTING.md with two-way handshake requirement * evict stale peers from mesh graph service * better logging * fix announce spe * fix: empty route * fix spec * fix: compile error in DebugSettingsSheet and potential NPE in RoutePlanner * revert * try again
* mesh topology wip * graph * graph animated
* x86 * update arti to 1.9.0
…ermissionlesstech#586) * Automated update of relay data - Sun Sep 21 06:21:05 UTC 2025 * Automated update of relay data - Sun Sep 28 06:20:40 UTC 2025 * refactor: new close button like ios(but not liquid glass) * Automated update of relay data - Sun Oct 5 06:20:09 UTC 2025 * Automated update of relay data - Sun Oct 12 06:20:12 UTC 2025 * Automated update of relay data - Sun Oct 19 06:21:51 UTC 2025 * Automated update of relay data - Sun Oct 26 06:21:31 UTC 2025 * Automated update of relay data - Sun Nov 2 06:22:16 UTC 2025 * Automated update of relay data - Sun Nov 9 06:21:43 UTC 2025 * Automated update of relay data - Sun Nov 16 06:22:37 UTC 2025 * Automated update of relay data - Sun Nov 23 06:22:51 UTC 2025 * Automated update of relay data - Sun Nov 30 06:24:08 UTC 2025 * Automated update of relay data - Sun Dec 7 06:22:59 UTC 2025 * Automated update of relay data - Sun Dec 14 06:24:33 UTC 2025 * Automated update of relay data - Sun Dec 21 06:24:49 UTC 2025 * Automated update of relay data - Sun Dec 28 06:25:38 UTC 2025 * Automated update of relay data - Sun Jan 4 06:26:28 UTC 2026 * Automated update of relay data - Sun Jan 11 06:26:19 UTC 2026 * feat: Show private chat in sheet from notification * Refactor: Hoist private chat sheet state to ChatViewModel * remove icon * remove old bottom sheet --------- Co-authored-by: GitHub Action <action@github.com> Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
* nostr in new dm sheets * open sheet for nostr peers
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e95023eda0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| context.deleteSharedPreferences(OLD_PREFS_NAME) | ||
| markerPrefs.edit { putBoolean(MIGRATION_FLAG, true) } |
There was a problem hiding this comment.
Commit migrated prefs before deleting legacy storage
The migration deletes bitchat_identity immediately after copying values, but the copy uses TinkSecurePreferences.putString/putStringSet, which rely on SharedPreferences.edit { ... } (apply = async). If the process is killed after the deletes and before those async writes flush, the legacy data is gone and the new prefs may be partially/entirely missing, causing irreversible identity loss on next launch. Consider batching writes with a single editor + commit() (or otherwise ensuring persistence) before deleting the old prefs.
Useful? React with 👍 / 👎.
This commit migrates all app preferences from `SharedPreferences` to Jetpack `DataStore.Preferences`. - Introduces `BitchatDataStore.kt` to define the DataStore instance. - Replaces direct `SharedPreferences` access with `DataStore`. - Implements an in-memory cache layer for improved performance and responsiveness, synchronizing with the DataStore in the background. - Adds encryption for all stored preferences using `TinkAEAD` for enhanced security. - Implements a one-time migration logic to securely move data from legacy `SharedPreferences` to the new encrypted DataStore. - Refactors data management to be asynchronous and coroutine-based. - Improves data integrity by clearing corrupted preferences on decryption failure.
Summary:
Implementation details:
Notes:
Checklist