Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Create and restore backup (AR-1421) (#1097)
* empty commit * feat: Add a new ChaCha20 encryption class for backup files (#1098) * feat: add ChaCha20 encrypting class * Added ChaCha20Test class * Added libsodium library * Moved ChaCha20Utils class to commonMain * Refactored Backup object and reworked encryption/decryption methods * Fixed issues not hashing password correctly * Passed backup version as additional data to encrypt/decrypt processes * fix: wip but works * Fixed tests with big files * Renamings * Bumped minimum Android version * Addressed PR requests * Revert changes * Code cleaning * Revert okio to 3.0.0 * Flushing to write the header data * Fix issue with clashing libs * Added mechanism to map a Backup.Header object from buffered source * Fixed detekt issues * detekt * Added manual buffer reading operations * More detekt * More detekt * solved libsodium conflicts on Core * Last final touches * Removed suspendable modifiers Co-authored-by: Jacob Persson <7156+typfel@users.noreply.github.com> * feat: perform the restore of the database data from another database file (AR-2668) (#1096) * feat: [WIP] import backed up database * feat: [WIP] Import data from an older database backup * work on unit testing * in progress * work in progress on unit tests * unit tests in progress * cover assets * revert * test * address the comments * add the comments * address the pr comments * address the changes * add remaining test * all is looking fine * chore: edit auth tokens refresh tokens (#1125) * chore: add http method network logs (#1126) * chore: add http method network logs * fix add missing " * fix: MaxLineLength - (#1127) * ready for review * suppress * fix * fix * Empty-Commit * Empty-Commit * suppress * push * test * suppress file * fix * further fix * bump up android version * Trigger notification * add arch * fix the import * fix * fix * add dispatcher * Update persistence/src/commonTest/kotlin/com/wire/kalium/persistence/backup/UserDatabaseDataGenerator.kt Co-authored-by: Gonzo <gongracr@gmail.com> * Update persistence/src/commonTest/kotlin/com/wire/kalium/persistence/backup/UserDatabaseDataGenerator.kt Co-authored-by: Gonzo <gongracr@gmail.com> * Update persistence/src/commonTest/kotlin/com/wire/kalium/persistence/backup/UserDatabaseDataGenerator.kt Co-authored-by: Gonzo <gongracr@gmail.com> * test * fix it * fix * fix * fix * fix * fix * fix * Empty-Commit * change * fix detekt * done Co-authored-by: Vitor Hugo Schwaab <vitor@schwaab.xyz> Co-authored-by: mateusz.pachulski <mateusz.pachulski@appunite.com> Co-authored-by: Gonzalo Gran Crespo <gongracr@gmail.com> Co-authored-by: Mohamad Jaara <mohamad.jaara@wire.com> * added libsodium bindings library to catalogue * feat: Wire all needed logic to create and restore backups [AR-1421] [AR-1422] (#1158) * Added ClientPlatform class * feat: glued logic to enable encryption mechanism for backups * Added final compression for encrypted backup file * Added method to extract compressed files * Added logic to restore encrypted backup files * Forwarding invalid password error * Fixed detekt issues * refactor: share token cache among all http clients (#1159) * refactor: share token cache among all http clients * fix tests * fix styling * Address PR comments * fix: session upgrade (#1156) * fix: clear cached token after upgrading the session * fix: start slow sync after we've upgraded the session * refactor: rename PersistRegisteredClientIdUseCase to VerifyExistingClientUseCase since it's no longer persists anything * test: verify that client id gets persisted in GetOrRegisterClientUseCase * fix: don't expose RegisterClientUseCase, it should be considered an internal use case * test: update test since RegisterClientUseCase no longer persist the client id * chore: fix detekt * chore: fix test service * refactor: clear cached token on shared auth bearer provider * fix: assets download silently failing (#1162) * fix: assets download silently failing * fix: assets download silently failing * fix tests * revert ApiTest back to interface * fix tests with non json response expecting json string * fix styling * Improved read and write compression methods for large files * chore: obfuscate conversation ids for calling (#1166) Co-authored-by: Mohamad Jaara <mohamad.jaara@wire.com> * fix: introduce ImportClientUseCase for importing an existing client (#1165) * fix: introduce ImportClientUseCase for importing an existing client * test: add test for persisting retained client id * test: add ImportClientUseCaseTest * feat(mls): join self & team conversation (#1157) * feat: add support for global team conversation type * feat: distinguish between MLS and proteus self conversations * feat: establish group if necessary when joining * feat: fetch global team conversation during slow sync * chore: cleanup * refactor: take group info as a parameter instead of fetching it * test: update tests * chore: fix detekt * test: add tests for establishing self / team conversation when epoch is zero * revert: accidental key press * chore: return proper API not supported response * chore: update comment with issue links * Update network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/conversation/ConversationResponse.kt Co-authored-by: Mojtaba Chenani <chenani@outlook.com> * chore: disable fetching GTC * chore: fix detekt Co-authored-by: Mojtaba Chenani <chenani@outlook.com> * Added more granular error handling * Detekt fixes * More detekt fixes * feat: multi account persistence web socket [AR-2257] (#1147) * persistent web socket for multiple account * delete duplicated function * update the sync repo * fix some tests * update tests * generate db schema * resolve pr comment s * update ObservePersistentWebSocketConnectionStatusUseCase * import boolean in the migration file * fix detekt * update the logic for connection policy * fix detekt Co-authored-by: Mohamad Jaara <mohamad.jaara@wire.com> * Moved BackupUtils to common jvm android folder * Fixed final detekt issue Co-authored-by: Mohamad Jaara <mohamad.jaara@wire.com> Co-authored-by: Jacob Persson <7156+typfel@users.noreply.github.com> Co-authored-by: Oussama Hassine <oussama.has100@gmail.com> Co-authored-by: Mojtaba Chenani <chenani@outlook.com> Co-authored-by: Mohammed Mokresh <mokresh.mohammed@gmail.com> * Added extra exclusion rules for generated code * Added extract initial backup file use case class * Renamed use case to make it more generic * detekt issue * Addressed PR comments * Added tests * Added more tests * Detekt issues * Updated detekt config file to ignore build types * Improved readability * Addressed some requested comments * Fixed test issues * Added extractCompressedBackupUseCaseTest * Fixed more tests * Added comment * Detekt issues * Removed spaces from unit tests * Removed more spaces * run android CI on 30 * fix * fix * fix * refactor - implement IsBackupEncryptedUseCase * Added mechanism to provide passphrase for encrypted db * Simplified code * is database encrypted flag should come from kalium configs * postpone passphrase reading from metadata and change to bytearray * Added createBackupUseCase tests * changed IsBackupEncryptedUseCase to VerifyBackupUseCase, added tests * test: don't create a static test file system * partially fix RestoreBackupUseCaseTest * partially fix RestoreBackupUseCaseTest * partially fix RestoreBackupUseCaseTest * Fixed CreateBackupUseCaseTest * Fixed tests * fix unit test failing * Fixed test * Fixed detekt issue * More detekt * Final touch Co-authored-by: Gonzalo Gran Crespo <gongracr@gmail.com> Co-authored-by: Jacob Persson <7156+typfel@users.noreply.github.com> Co-authored-by: Vitor Hugo Schwaab <vitor@schwaab.xyz> Co-authored-by: mateusz.pachulski <mateusz.pachulski@appunite.com> Co-authored-by: Mohamad Jaara <mohamad.jaara@wire.com> Co-authored-by: Oussama Hassine <oussama.has100@gmail.com> Co-authored-by: Mojtaba Chenani <chenani@outlook.com> Co-authored-by: Mohammed Mokresh <mokresh.mohammed@gmail.com> Co-authored-by: Jakub 呕erko <zerasop@gmail.com> Co-authored-by: Micha艂 Saleniuk <saleniuk@gmail.com>
- Loading branch information