From 68dbd91152d051d4b7efc20017f0e59e9d8a6b84 Mon Sep 17 00:00:00 2001 From: Anton Chekulaev Date: Wed, 4 Nov 2020 23:29:47 +1100 Subject: [PATCH] Backup exporter ported to Kotlin with adjustments. Important preferences included in the backup. Private chat sessions get reset after backup import. --- res/layout-sw400dp/activity_landing.xml | 10 + res/values/strings.xml | 1 + .../securesms/ApplicationContext.java | 1 + .../securesms/backup/BackupDialog.java | 3 +- .../securesms/backup/FullBackupBase.java | 26 +- .../securesms/backup/FullBackupExporter.java | 429 ----------------- .../securesms/backup/FullBackupExporter.kt | 440 ++++++++++++++++++ .../securesms/backup/FullBackupImporter.java | 30 +- .../securesms/crypto/IdentityKeyUtil.java | 27 +- .../securesms/database/DraftDatabase.java | 10 +- .../securesms/database/JobDatabase.java | 12 +- .../securesms/database/PushDatabase.java | 20 +- .../securesms/database/ThreadDatabase.java | 31 ++ .../migration/WorkManagerFactoryMappings.java | 2 + .../securesms/jobs/JobManagerFactories.java | 2 + .../loki/activities/BackupRestoreActivity.kt | 31 +- .../securesms/loki/activities/HomeActivity.kt | 35 +- .../loki/api/ResetThreadSessionJob.kt | 71 +++ .../loki/database/LokiAPIDatabase.kt | 2 +- .../loki/database/LokiBackupFilesDatabase.kt | 2 +- .../preferences/ChatsPreferenceFragment.java | 11 +- .../securesms/util/TextSecurePreferences.java | 40 ++ 22 files changed, 742 insertions(+), 494 deletions(-) delete mode 100644 src/org/thoughtcrime/securesms/backup/FullBackupExporter.java create mode 100644 src/org/thoughtcrime/securesms/backup/FullBackupExporter.kt create mode 100644 src/org/thoughtcrime/securesms/loki/api/ResetThreadSessionJob.kt diff --git a/res/layout-sw400dp/activity_landing.xml b/res/layout-sw400dp/activity_landing.xml index 7ecae1b271..9c9da30088 100644 --- a/res/layout-sw400dp/activity_landing.xml +++ b/res/layout-sw400dp/activity_landing.xml @@ -49,6 +49,16 @@ android:layout_marginRight="@dimen/massive_spacing" android:text="@string/activity_landing_restore_button_title" /> +