Skip to content

Commit

Permalink
Two wallets (#233)
Browse files Browse the repository at this point in the history
### Overall
- Added the concept of an app wallet and the corresponding code and UI to create the second wallet and switch between them
- Split persistence into app-wide and wallet-wide
- [Modernized the data encryption strategy](https://concordium.atlassian.net/wiki/x/BwBJWw)
- Disabled the ability to create new accounts and identities in file-based wallets
- Added storage migrations for full backward compatibility

### In details
- Introduced the app-wide database, `AppDatabase`, while the current one, wallet-wide, is called `WalletDatabase`
- Introduced the concept of app wallet, which is stored in `AppDatabase` and accessible through `AppWalletRepository`
- Introduced the concept of the active wallet, which is defined by `Session`
- `AppCore.session` now can be reinitialized with the `startNewSession()` method
- All the wallet-wide persistence classes (DB, preferences) now have `Wallet` prefix (`WalletNotificationsPreferences`, `WalletSendFundsPreferences`, etc.)
- Instances of wallet-wide persistence classes are now managed by `WalletStorage`, which is accessible through `Session` and is aware of the current active wallet. Instances are no longer created in ViewModels
- All the wallet-wide persistence files now have name suffixes. The suffix corresponds to the related app wallet. This way, files and databases for different wallets can be stored independently within the same directory
- Encryption IV reuse is ended – now, all the encrypted data is stored in a container (`EncryptedData`) which holds not only the ciphertext, but also the cipher transformation and IV
- Use of AES CBC for identity and account secrets is ended – from now on, GCM mode is used
- From now on, all the data is encrypted with a randomly generated master key, which is stored encrypted with a password-derived key. Therefore, when the password is being changed, only the master key gets re-encrypred
- Cleaned up, refactored, documented `AuthenticationManager` and turned it into `AppAuth`, which handles app-wide password auth and encryption
- Cleaned up and refactored `EncryptionHelper`
- Passcode setup screens are now also used to change the passcode. Old passcode/password change screens have been removed
- `AuthPreferences` split into `AppSetupPreferences` and `WalletSetupPreferences`
- Implemented `TwoWalletsMigration` which migrates existing DB and preferences for full backward compatibility
  • Loading branch information
Radiokot authored Jan 13, 2025
1 parent 6fdacda commit 75bd046
Show file tree
Hide file tree
Showing 182 changed files with 6,091 additions and 3,932 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## [Unreleased]

### Added

- Ability to have both file and seed phrase wallets in the app and switch between them

### Removed

- Ability to create new accounts and identities in a file wallet.
We recommend that you migrate to a seed phrase wallet
in order to make use of the full range of CryptoX features.

## [1.4.0] - 2024-12-16

### Added
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ dependencies {
implementation 'androidx.browser:browser:1.4.0'

implementation 'com.github.Redman1037:TSnackBar:V2.0.0'
implementation 'com.github.Dimezis:BlurView:version-2.0.3'
implementation 'com.github.Dimezis:BlurView:version-2.0.6'

// OkHttp/Retrofit
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1'
Expand Down
Loading

0 comments on commit 75bd046

Please sign in to comment.