Skip to content

Conversation

@yet300
Copy link
Contributor

@yet300 yet300 commented Jan 18, 2026

Summary:

  • Replace EncryptedSharedPreferences with Tink-backed encrypted storage for identity data.
  • Add one-time migration from legacy EncryptedSharedPreferences to Tink storage.
  • Run migration during Application startup.

Implementation details:

  • Tink AEAD initialized via AndroidKeysetManager with Android Keystore master key.
  • Ciphertext stored in standard SharedPreferences; key name used as AAD.
  • Migration copies string/string-set values, then deletes legacy prefs.

Notes:

  • Keep androidx.security:security-crypto for the migration release; remove after migration is confirmed.

Checklist

actions-user and others added 30 commits September 21, 2025 06:21
# 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
callebtc and others added 9 commits January 14, 2026 14:53
* 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
…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
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines 47 to 48
context.deleteSharedPreferences(OLD_PREFS_NAME)
markerPrefs.edit { putBoolean(MIGRATION_FLAG, true) }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants