From 1cd3a3a0e6d458627ef77d8624b9eb4e9c940880 Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Tue, 16 Feb 2021 15:44:08 -0300 Subject: [PATCH 01/50] Fix log message when canceling full backup --- .../stevesoltys/seedvault/transport/backup/BackupCoordinator.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/stevesoltys/seedvault/transport/backup/BackupCoordinator.kt b/app/src/main/java/com/stevesoltys/seedvault/transport/backup/BackupCoordinator.kt index fd4bd5e4..69c4cd8f 100644 --- a/app/src/main/java/com/stevesoltys/seedvault/transport/backup/BackupCoordinator.kt +++ b/app/src/main/java/com/stevesoltys/seedvault/transport/backup/BackupCoordinator.kt @@ -321,7 +321,7 @@ internal class BackupCoordinator( ?: throw AssertionError("Cancelling full backup, but no current package") Log.i( TAG, "Cancel full backup of ${packageInfo.packageName}" + - " because of $state.cancelReason" + " because of ${state.cancelReason}" ) onPackageBackupError(packageInfo) full.cancelFullBackup() From 6c633b70c32cad05bb1d818a8312d891c61a37c5 Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Tue, 19 Jan 2021 09:14:52 -0300 Subject: [PATCH 02/50] Add storage library (and demo app) and use for periodic files backup --- .gitignore | 8 +- .idea/runConfigurations/All_unit_tests.xml | 8 + ...sts.xml => Instrumentation_tests__app.xml} | 2 +- .../{Unit_Tests.xml => Unit_tests__app.xml} | 2 +- .../Unit_tests__contactsbackup.xml | 15 + .../Unit_tests__storage_lib.xml | 15 + ...eedvault_storage_lib__assembleRelease_.xml | 21 + Android.bp | 7 + README.md | 3 + app/build.gradle | 75 +++- app/src/main/AndroidManifest.xml | 13 + .../java/com/stevesoltys/seedvault/App.kt | 6 +- .../seedvault/settings/AppStatusFragment.kt | 2 +- .../seedvault/settings/SettingsFragment.kt | 59 ++- .../seedvault/settings/SettingsViewModel.kt | 41 +- .../storage/SeedvaultStoragePlugin.kt | 20 + .../stevesoltys/seedvault/storage/Services.kt | 30 ++ .../seedvault/storage/StorageModule.kt | 10 + .../ui/RequireProvisioningViewModel.kt | 2 +- .../ui/files/FileSelectionFragment.kt | 32 ++ .../ui/files/FileSelectionViewModel.kt | 18 + .../recoverycode/RecoveryCodeInputFragment.kt | 4 +- app/src/main/res/drawable/ic_library_add.xml | 10 + app/src/main/res/drawable/ic_save_alt.xml | 10 + app/src/main/res/drawable/ic_vpn_key.xml | 2 +- app/src/main/res/values/strings.xml | 15 +- app/src/main/res/xml/settings.xml | 88 ++-- .../seedvault/plugins/saf/DocumentFileTest.kt | 10 + build.gradle | 16 +- contactsbackup/build.gradle | 6 +- gradle.properties | 2 + gradle/dependencies.gradle | 205 ++++----- permissions_com.stevesoltys.seedvault.xml | 1 + settings.gradle | 2 + storage/.gitignore | 1 + storage/demo/.gitignore | 2 + storage/demo/build.gradle | 57 +++ storage/demo/proguard-rules.pro | 23 + storage/demo/src/main/AndroidManifest.xml | 43 ++ storage/demo/src/main/assets/test.jpg | Bin 0 -> 1523 bytes .../demo/src/main/ic_launcher-playstore.png | Bin 0 -> 7073 bytes .../java/de/grobox/storagebackuptester/App.kt | 40 ++ .../java/de/grobox/storagebackuptester/Job.kt | 46 ++ .../grobox/storagebackuptester/LogAdapter.kt | 43 ++ .../grobox/storagebackuptester/LogFragment.kt | 142 ++++++ .../storagebackuptester/MainActivity.kt | 31 ++ .../storagebackuptester/MainViewModel.kt | 133 ++++++ .../storagebackuptester/backup/BackupStats.kt | 182 ++++++++ .../storagebackuptester/crypto/KeyManager.kt | 53 +++ .../plugin/TestSafStoragePlugin.kt | 49 ++ .../restore/DemoSnapshotFragment.kt | 42 ++ .../restore/RestoreFragment.kt | 68 +++ .../restore/RestoreStats.kt | 84 ++++ .../scanner/DocumentScanFragment.kt | 21 + .../scanner/DocumentScanner.kt | 56 +++ .../scanner/MediaScanFragment.kt | 108 +++++ .../scanner/MediaScanner.kt | 74 ++++ .../settings/InfoFragment.kt | 84 ++++ .../settings/SettingsFragment.kt | 152 +++++++ .../settings/SettingsManager.kt | 37 ++ .../demo/src/main/res/drawable/ic_info.xml | 10 + .../res/drawable/ic_launcher_background.xml | 170 +++++++ .../res/drawable/ic_launcher_foreground.xml | 16 + .../demo/src/main/res/drawable/ic_refresh.xml | 10 + .../src/main/res/drawable/ic_settings.xml | 10 + .../demo/src/main/res/drawable/ic_share.xml | 10 + .../src/main/res/layout/activity_main.xml | 7 + .../src/main/res/layout/footer_snapshot.xml | 16 + .../src/main/res/layout/fragment_content.xml | 29 ++ .../demo/src/main/res/layout/fragment_log.xml | 53 +++ .../src/main/res/layout/fragment_scan.xml | 40 ++ storage/demo/src/main/res/layout/item_log.xml | 13 + .../demo/src/main/res/menu/fragment_main.xml | 17 + .../demo/src/main/res/menu/fragment_scan.xml | 17 + .../src/main/res/menu/fragment_settings.xml | 31 ++ .../res/mipmap-anydpi-v26/ic_launcher.xml | 5 + .../mipmap-anydpi-v26/ic_launcher_round.xml | 5 + .../demo/src/main/res/values-night/themes.xml | 17 + storage/demo/src/main/res/values/colors.xml | 11 + storage/demo/src/main/res/values/strings.xml | 3 + storage/demo/src/main/res/values/themes.xml | 13 + storage/lib/.gitignore | 2 + storage/lib/Android.bp | 15 + storage/lib/build.gradle | 92 ++++ storage/lib/build/outputs/aar/lib-release.aar | Bin 0 -> 398228 bytes storage/lib/consumer-rules.pro | 0 storage/lib/libs/storage.aar | 1 + storage/lib/libs/tink-android-1.5.0.jar | Bin 0 -> 1422247 bytes storage/lib/proguard-rules.pro | 23 + .../org.calyxos.backup.storage.db.Db/1.json | 128 ++++++ .../backup/storage/db/ChunksCacheTest.kt | 125 ++++++ .../backup/storage/db/FilesCacheTest.kt | 60 +++ .../calyxos/backup/storage/db/UriStoreTest.kt | 60 +++ storage/lib/src/main/AndroidManifest.xml | 34 ++ .../calyxos/backup/storage/ByteArrayUtils.kt | 5 + .../org/calyxos/backup/storage/TimeUtils.kt | 38 ++ .../org/calyxos/backup/storage/UriUtils.kt | 57 +++ .../backup/storage/api/BackupContentType.kt | 86 ++++ .../calyxos/backup/storage/api/BackupFile.kt | 14 + .../backup/storage/api/BackupObserver.kt | 54 +++ .../backup/storage/api/RestoreObserver.kt | 15 + .../calyxos/backup/storage/api/Snapshot.kt | 38 ++ .../backup/storage/api/StorageBackup.kt | 194 ++++++++ .../backup/storage/api/StoragePlugin.kt | 57 +++ .../calyxos/backup/storage/backup/Backup.kt | 180 ++++++++ .../backup/storage/backup/BackupJobService.kt | 62 +++ .../backup/storage/backup/BackupService.kt | 53 +++ .../backup/storage/backup/ChunkWriter.kt | 131 ++++++ .../calyxos/backup/storage/backup/Chunker.kt | 56 +++ .../storage/backup/ChunksCacheRepopulater.kt | 96 ++++ .../backup/storage/backup/FileBackup.kt | 102 +++++ .../backup/NotificationBackupObserver.kt | 98 ++++ .../backup/storage/backup/SmallFileBackup.kt | 151 +++++++ .../backup/storage/backup/ZipChunker.kt | 79 ++++ .../backup/storage/content/ContentFile.kt | 134 ++++++ .../backup/storage/crypto/ChunkCrypto.kt | 42 ++ .../org/calyxos/backup/storage/crypto/Hkdf.kt | 54 +++ .../backup/storage/crypto/StreamCrypto.kt | 88 ++++ .../calyxos/backup/storage/db/ChunksCache.kt | 70 +++ .../java/org/calyxos/backup/storage/db/Db.kt | 46 ++ .../calyxos/backup/storage/db/FilesCache.kt | 45 ++ .../org/calyxos/backup/storage/db/UriStore.kt | 29 ++ .../storage/plugin/SnapshotRetriever.kt | 27 ++ .../storage/plugin/saf/DocumentFileExt.kt | 188 ++++++++ .../storage/plugin/saf/SafStoragePlugin.kt | 192 ++++++++ .../calyxos/backup/storage/prune/Pruner.kt | 74 ++++ .../backup/storage/prune/RetentionManager.kt | 89 ++++ .../storage/restore/AbstractChunkRestore.kt | 43 ++ .../backup/storage/restore/FileRestore.kt | 188 ++++++++ .../backup/storage/restore/FileSplitter.kt | 148 +++++++ .../storage/restore/MultiChunkRestore.kt | 99 +++++ .../restore/NotificationRestoreObserver.kt | 41 ++ .../calyxos/backup/storage/restore/Restore.kt | 124 ++++++ .../backup/storage/restore/RestoreService.kt | 54 +++ .../storage/restore/SingleChunkRestore.kt | 39 ++ .../backup/storage/restore/ZipChunkRestore.kt | 84 ++++ .../backup/storage/scanner/DocumentScanner.kt | 84 ++++ .../backup/storage/scanner/FileScanner.kt | 90 ++++ .../backup/storage/scanner/MediaScanner.kt | 124 ++++++ .../backup/storage/ui/Notifications.kt | 149 +++++++ .../storage/ui/backup/BackupContentAdapter.kt | 92 ++++ .../ui/backup/BackupContentFragment.kt | 116 +++++ .../storage/ui/backup/BackupContentItem.kt | 17 + .../ui/backup/BackupContentViewModel.kt | 60 +++ .../storage/ui/restore/SnapshotAdapter.kt | 64 +++ .../storage/ui/restore/SnapshotFragment.kt | 63 +++ .../src/main/proto/backup_document_file.proto | 32 ++ .../src/main/proto/backup_media_file.proto | 70 +++ .../lib/src/main/proto/backup_snapshot.proto | 18 + storage/lib/src/main/res/drawable/ic_add.xml | 10 + .../src/main/res/drawable/ic_auto_delete.xml | 16 + .../src/main/res/drawable/ic_cloud_done.xml | 10 + .../main/res/drawable/ic_cloud_restore.xml | 10 + .../src/main/res/drawable/ic_cloud_upload.xml | 10 + .../main/res/drawable/ic_download_library.xml | 13 + .../lib/src/main/res/drawable/ic_folder.xml | 10 + .../src/main/res/drawable/ic_more_vert.xml | 10 + .../main/res/drawable/ic_music_library.xml | 10 + .../main/res/drawable/ic_photo_library.xml | 10 + .../main/res/drawable/ic_video_library.xml | 10 + .../res/layout/fragment_backup_content.xml | 27 ++ .../src/main/res/layout/fragment_snapshot.xml | 67 +++ .../lib/src/main/res/layout/item_custom.xml | 51 +++ .../lib/src/main/res/layout/item_media.xml | 50 +++ .../lib/src/main/res/layout/item_snapshot.xml | 53 +++ storage/lib/src/main/res/menu/item_custom.xml | 8 + storage/lib/src/main/res/values/strings.xml | 20 + .../backup/storage/BackupRestoreTest.kt | 419 ++++++++++++++++++ .../org/calyxos/backup/storage/TestUtils.kt | 64 +++ .../backup/storage/backup/ChunkWriterTest.kt | 214 +++++++++ .../backup/storage/backup/ChunkerTest.kt | 125 ++++++ .../backup/ChunksCacheRepopulaterTest.kt | 85 ++++ .../storage/backup/SmallFileBackupTest.kt | 213 +++++++++ .../backup/storage/backup/ZipChunkerTest.kt | 127 ++++++ .../calyxos/backup/storage/crypto/HkdfTest.kt | 74 ++++ .../backup/storage/prune/PrunerTest.kt | 99 +++++ .../storage/prune/RetentionManagerTest.kt | 136 ++++++ .../storage/restore/FileSplitterTest.kt | 79 ++++ storage/logcat-verbose.sh | 3 + 179 files changed, 9668 insertions(+), 182 deletions(-) create mode 100644 .idea/runConfigurations/All_unit_tests.xml rename .idea/runConfigurations/{Instrumentation_Tests.xml => Instrumentation_tests__app.xml} (93%) rename .idea/runConfigurations/{Unit_Tests.xml => Unit_tests__app.xml} (85%) create mode 100644 .idea/runConfigurations/Unit_tests__contactsbackup.xml create mode 100644 .idea/runConfigurations/Unit_tests__storage_lib.xml create mode 100644 .idea/runConfigurations/seedvault_storage_lib__assembleRelease_.xml create mode 100644 app/src/main/java/com/stevesoltys/seedvault/storage/SeedvaultStoragePlugin.kt create mode 100644 app/src/main/java/com/stevesoltys/seedvault/storage/Services.kt create mode 100644 app/src/main/java/com/stevesoltys/seedvault/storage/StorageModule.kt create mode 100644 app/src/main/java/com/stevesoltys/seedvault/ui/files/FileSelectionFragment.kt create mode 100644 app/src/main/java/com/stevesoltys/seedvault/ui/files/FileSelectionViewModel.kt create mode 100644 app/src/main/res/drawable/ic_library_add.xml create mode 100644 app/src/main/res/drawable/ic_save_alt.xml create mode 100644 storage/.gitignore create mode 100644 storage/demo/.gitignore create mode 100644 storage/demo/build.gradle create mode 100644 storage/demo/proguard-rules.pro create mode 100644 storage/demo/src/main/AndroidManifest.xml create mode 100644 storage/demo/src/main/assets/test.jpg create mode 100644 storage/demo/src/main/ic_launcher-playstore.png create mode 100644 storage/demo/src/main/java/de/grobox/storagebackuptester/App.kt create mode 100644 storage/demo/src/main/java/de/grobox/storagebackuptester/Job.kt create mode 100644 storage/demo/src/main/java/de/grobox/storagebackuptester/LogAdapter.kt create mode 100644 storage/demo/src/main/java/de/grobox/storagebackuptester/LogFragment.kt create mode 100644 storage/demo/src/main/java/de/grobox/storagebackuptester/MainActivity.kt create mode 100644 storage/demo/src/main/java/de/grobox/storagebackuptester/MainViewModel.kt create mode 100644 storage/demo/src/main/java/de/grobox/storagebackuptester/backup/BackupStats.kt create mode 100644 storage/demo/src/main/java/de/grobox/storagebackuptester/crypto/KeyManager.kt create mode 100644 storage/demo/src/main/java/de/grobox/storagebackuptester/plugin/TestSafStoragePlugin.kt create mode 100644 storage/demo/src/main/java/de/grobox/storagebackuptester/restore/DemoSnapshotFragment.kt create mode 100644 storage/demo/src/main/java/de/grobox/storagebackuptester/restore/RestoreFragment.kt create mode 100644 storage/demo/src/main/java/de/grobox/storagebackuptester/restore/RestoreStats.kt create mode 100644 storage/demo/src/main/java/de/grobox/storagebackuptester/scanner/DocumentScanFragment.kt create mode 100644 storage/demo/src/main/java/de/grobox/storagebackuptester/scanner/DocumentScanner.kt create mode 100644 storage/demo/src/main/java/de/grobox/storagebackuptester/scanner/MediaScanFragment.kt create mode 100644 storage/demo/src/main/java/de/grobox/storagebackuptester/scanner/MediaScanner.kt create mode 100644 storage/demo/src/main/java/de/grobox/storagebackuptester/settings/InfoFragment.kt create mode 100644 storage/demo/src/main/java/de/grobox/storagebackuptester/settings/SettingsFragment.kt create mode 100644 storage/demo/src/main/java/de/grobox/storagebackuptester/settings/SettingsManager.kt create mode 100644 storage/demo/src/main/res/drawable/ic_info.xml create mode 100644 storage/demo/src/main/res/drawable/ic_launcher_background.xml create mode 100644 storage/demo/src/main/res/drawable/ic_launcher_foreground.xml create mode 100644 storage/demo/src/main/res/drawable/ic_refresh.xml create mode 100644 storage/demo/src/main/res/drawable/ic_settings.xml create mode 100644 storage/demo/src/main/res/drawable/ic_share.xml create mode 100644 storage/demo/src/main/res/layout/activity_main.xml create mode 100644 storage/demo/src/main/res/layout/footer_snapshot.xml create mode 100644 storage/demo/src/main/res/layout/fragment_content.xml create mode 100644 storage/demo/src/main/res/layout/fragment_log.xml create mode 100644 storage/demo/src/main/res/layout/fragment_scan.xml create mode 100644 storage/demo/src/main/res/layout/item_log.xml create mode 100644 storage/demo/src/main/res/menu/fragment_main.xml create mode 100644 storage/demo/src/main/res/menu/fragment_scan.xml create mode 100644 storage/demo/src/main/res/menu/fragment_settings.xml create mode 100644 storage/demo/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 storage/demo/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100644 storage/demo/src/main/res/values-night/themes.xml create mode 100644 storage/demo/src/main/res/values/colors.xml create mode 100644 storage/demo/src/main/res/values/strings.xml create mode 100644 storage/demo/src/main/res/values/themes.xml create mode 100644 storage/lib/.gitignore create mode 100644 storage/lib/Android.bp create mode 100644 storage/lib/build.gradle create mode 100644 storage/lib/build/outputs/aar/lib-release.aar create mode 100644 storage/lib/consumer-rules.pro create mode 120000 storage/lib/libs/storage.aar create mode 100644 storage/lib/libs/tink-android-1.5.0.jar create mode 100644 storage/lib/proguard-rules.pro create mode 100644 storage/lib/schemas/org.calyxos.backup.storage.db.Db/1.json create mode 100644 storage/lib/src/androidTest/java/org/calyxos/backup/storage/db/ChunksCacheTest.kt create mode 100644 storage/lib/src/androidTest/java/org/calyxos/backup/storage/db/FilesCacheTest.kt create mode 100644 storage/lib/src/androidTest/java/org/calyxos/backup/storage/db/UriStoreTest.kt create mode 100644 storage/lib/src/main/AndroidManifest.xml create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/ByteArrayUtils.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/TimeUtils.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/UriUtils.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/api/BackupContentType.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/api/BackupFile.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/api/BackupObserver.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/api/RestoreObserver.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/api/Snapshot.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/api/StorageBackup.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/api/StoragePlugin.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/backup/Backup.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/backup/BackupJobService.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/backup/BackupService.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/backup/ChunkWriter.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/backup/Chunker.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/backup/ChunksCacheRepopulater.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/backup/FileBackup.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/backup/NotificationBackupObserver.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/backup/SmallFileBackup.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/backup/ZipChunker.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/content/ContentFile.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/crypto/ChunkCrypto.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/crypto/Hkdf.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/crypto/StreamCrypto.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/db/ChunksCache.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/db/Db.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/db/FilesCache.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/db/UriStore.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/plugin/SnapshotRetriever.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/plugin/saf/DocumentFileExt.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/plugin/saf/SafStoragePlugin.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/prune/Pruner.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/prune/RetentionManager.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/restore/AbstractChunkRestore.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/restore/FileRestore.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/restore/FileSplitter.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/restore/MultiChunkRestore.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/restore/NotificationRestoreObserver.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/restore/Restore.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/restore/RestoreService.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/restore/SingleChunkRestore.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/restore/ZipChunkRestore.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/scanner/DocumentScanner.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/scanner/FileScanner.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/scanner/MediaScanner.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/ui/Notifications.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/ui/backup/BackupContentAdapter.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/ui/backup/BackupContentFragment.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/ui/backup/BackupContentItem.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/ui/backup/BackupContentViewModel.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/ui/restore/SnapshotAdapter.kt create mode 100644 storage/lib/src/main/java/org/calyxos/backup/storage/ui/restore/SnapshotFragment.kt create mode 100644 storage/lib/src/main/proto/backup_document_file.proto create mode 100644 storage/lib/src/main/proto/backup_media_file.proto create mode 100644 storage/lib/src/main/proto/backup_snapshot.proto create mode 100644 storage/lib/src/main/res/drawable/ic_add.xml create mode 100644 storage/lib/src/main/res/drawable/ic_auto_delete.xml create mode 100644 storage/lib/src/main/res/drawable/ic_cloud_done.xml create mode 100644 storage/lib/src/main/res/drawable/ic_cloud_restore.xml create mode 100644 storage/lib/src/main/res/drawable/ic_cloud_upload.xml create mode 100644 storage/lib/src/main/res/drawable/ic_download_library.xml create mode 100644 storage/lib/src/main/res/drawable/ic_folder.xml create mode 100644 storage/lib/src/main/res/drawable/ic_more_vert.xml create mode 100644 storage/lib/src/main/res/drawable/ic_music_library.xml create mode 100644 storage/lib/src/main/res/drawable/ic_photo_library.xml create mode 100644 storage/lib/src/main/res/drawable/ic_video_library.xml create mode 100644 storage/lib/src/main/res/layout/fragment_backup_content.xml create mode 100644 storage/lib/src/main/res/layout/fragment_snapshot.xml create mode 100644 storage/lib/src/main/res/layout/item_custom.xml create mode 100644 storage/lib/src/main/res/layout/item_media.xml create mode 100644 storage/lib/src/main/res/layout/item_snapshot.xml create mode 100644 storage/lib/src/main/res/menu/item_custom.xml create mode 100644 storage/lib/src/main/res/values/strings.xml create mode 100644 storage/lib/src/test/java/org/calyxos/backup/storage/BackupRestoreTest.kt create mode 100644 storage/lib/src/test/java/org/calyxos/backup/storage/TestUtils.kt create mode 100644 storage/lib/src/test/java/org/calyxos/backup/storage/backup/ChunkWriterTest.kt create mode 100644 storage/lib/src/test/java/org/calyxos/backup/storage/backup/ChunkerTest.kt create mode 100644 storage/lib/src/test/java/org/calyxos/backup/storage/backup/ChunksCacheRepopulaterTest.kt create mode 100644 storage/lib/src/test/java/org/calyxos/backup/storage/backup/SmallFileBackupTest.kt create mode 100644 storage/lib/src/test/java/org/calyxos/backup/storage/backup/ZipChunkerTest.kt create mode 100644 storage/lib/src/test/java/org/calyxos/backup/storage/crypto/HkdfTest.kt create mode 100644 storage/lib/src/test/java/org/calyxos/backup/storage/prune/PrunerTest.kt create mode 100644 storage/lib/src/test/java/org/calyxos/backup/storage/prune/RetentionManagerTest.kt create mode 100644 storage/lib/src/test/java/org/calyxos/backup/storage/restore/FileSplitterTest.kt create mode 100755 storage/logcat-verbose.sh diff --git a/.gitignore b/.gitignore index ec605697..0146d1a8 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ hs_err_pid* ## Intellij out/ -lib/ +/lib/ .idea/* !.idea/runConfigurations* !.idea/inspectionProfiles* @@ -33,7 +33,8 @@ local.properties ## NetBeans **/nbproject/private/ -build/ +/build/ +/app/build/ nbbuild/ dist/ nbdist/ @@ -50,6 +51,3 @@ gradle-app.setting ## Android gen/ - -## Prebuilt -Backup.apk diff --git a/.idea/runConfigurations/All_unit_tests.xml b/.idea/runConfigurations/All_unit_tests.xml new file mode 100644 index 00000000..8136a9a1 --- /dev/null +++ b/.idea/runConfigurations/All_unit_tests.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/Instrumentation_Tests.xml b/.idea/runConfigurations/Instrumentation_tests__app.xml similarity index 93% rename from .idea/runConfigurations/Instrumentation_Tests.xml rename to .idea/runConfigurations/Instrumentation_tests__app.xml index 60200c14..9bc639a6 100644 --- a/.idea/runConfigurations/Instrumentation_Tests.xml +++ b/.idea/runConfigurations/Instrumentation_tests__app.xml @@ -1,5 +1,5 @@ - +