Commit graph

740 commits

Author SHA1 Message Date
Chirayu Desai
422e3f547d restore: Skip installing APKs if not allowed by policy
* We should not bypass the OS-wide APK install restriction.
* Simply treat that as just not having the APK in the first place,
  since we do support that as an option.
* This still lets users install apps via the store it was downloaded
  from, if said store is installed and allowed to install apps.
* Introduce InstallRestriction to make testing easier.

Co-Authored-By: Torsten Grote <t@grobox.de>
Change-Id: Ic0a56961c9078d4dd542db5d9fc75034abb27bea
2024-05-14 20:34:33 +05:30
Torsten Grote
bb562a4cb2 Catch out 507 HTTP error when using WebDAV
Nextcloud has a bug that lets us write chunked transfers over quota:
https://github.com/nextcloud/server/issues/7993

However, when we upload small files, we can get the proper 507 response and thus detect out of space situations and warn the user about them.
2024-05-14 20:31:15 +05:30
Torsten Grote
066b147315 Catch out of space exception during FullBackup 2024-05-14 20:31:15 +05:30
Torsten Grote
860733d238 Don't retry backup on removable storage 2024-05-14 20:31:15 +05:30
Torsten Grote
49262682d1 Don't do backup, if space is already low, warn instead 2024-05-14 20:31:15 +05:30
Torsten Grote
36910fc777 Catch out of space errors and show error notification 2024-05-14 20:31:15 +05:30
Torsten Grote
5cae1b202d Show app restore sets sorted by latest first 2024-05-14 20:31:15 +05:30
Torsten Grote
7ec80d4ebb Store total backup size and show it when restoring
This is done by storing also the APK sizes in addition to the app data size we already store.
2024-05-14 20:31:15 +05:30
Torsten Grote
1d8c438723 Implement a storage plugin method to get free space 2024-05-14 20:31:15 +05:30
Torsten Grote
81cbb6e4dc Get free space for storage authority if not available by other means 2024-05-14 20:31:15 +05:30
Torsten Grote
c04ddfa9a0 Add helper text for WebDAV URL field 2024-05-08 19:10:46 +05:30
Torsten Grote
d0cf168198
Merge pull request #647 from grote/webdav
Implement a native WebDAV plugin
2024-05-06 13:41:45 -03:00
Torsten Grote
1931024a10
Introduce constant for files snapshot file extension 2024-05-03 16:09:41 -03:00
Torsten Grote
2f6edf6b4b
Rename StoragePluginEnum to StoragePluginType 2024-05-03 15:59:28 -03:00
Torsten Grote
4651ad5eb3
Replace field naming _foo with mFoo 2024-05-03 15:57:01 -03:00
Torsten Grote
01dbcf5f2f
Move StorageProperties class into its own file 2024-05-03 15:54:04 -03:00
Torsten Grote
b041c208ac
Always update next scheduling time in UI
Also avoid hard-coded strings and log when no backups are scheduled.
2024-04-29 12:00:39 -03:00
Torsten Grote
0b4bd09e7d
Don't assume SAF-based storage is available
it may be WebDAV now
2024-04-25 14:13:32 -03:00
Torsten Grote
0e51c00bca
Properly migrate existing users to new plugin setup 2024-04-25 09:51:46 -03:00
Torsten Grote
a95ba41196
Reset WebDAV config state when the UI is left 2024-04-25 09:51:46 -03:00
Torsten Grote
f4366d930f
Adapt integration test to new plugin structure 2024-04-25 09:51:46 -03:00
Torsten Grote
a4cccabc5e
Don't allow changing backup location while backup is running 2024-04-25 09:51:45 -03:00
Torsten Grote
0e4c37e796
Properly track if a backup is running
this is important, so we don't allow more than one backup running at the same time and not swapping out the storage while one is running.

Previously, we had some bare bones tracking, but nothing precise.
2024-04-25 09:51:45 -03:00
Torsten Grote
b1c87a8a9e
Add the UI for the WebDAV plugin
including ViewModel and StoragePluginManager logic
2024-04-25 09:51:45 -03:00
Torsten Grote
7e612cb8e0
Introduce StoragePluginManager to handle storage plugins
and allow changing them dynamically. So far plugins were injected into the dependency graph and couldn't be changed at runtime, only their config could. Now we have the infrastructure in place to really allow for more than one plugin.
2024-04-25 09:51:45 -03:00
Torsten Grote
2489190824
Rename Storage to SafStorage
in preparation for generalization
2024-04-25 09:51:45 -03:00
Torsten Grote
6788d0d25a
Prepare backup destination UI refactoring
Mostly renaming for clarity.
2024-04-25 09:51:44 -03:00
Torsten Grote
ec8190755e
Add a method for testing if storage works
This is especially useful for WebDAV storage where the user can supply whatever URL and before proceeding, we need to know whether that URL and the provided credentials are actually working.
2024-04-25 09:51:44 -03:00
Torsten Grote
4f2ead66a5
Ensure root folder exists when using storage
We use the same root folder for app and files backup. App backup usually creates the root folder, but if only storage backup is used, it will be missing and needs to be created.
2024-04-25 09:51:44 -03:00
Torsten Grote
e6e65d0dd1
WebDAV files backup plugin 2024-04-25 09:51:44 -03:00
Torsten Grote
870d1617d2
Initial implementation of WebDavStoragePlugin 2024-04-25 09:51:43 -03:00
Hosted Weblate
a25ecd1886
Import translations from Weblate
Co-authored-by: Anonymous <noreply@weblate.org>
Co-authored-by: Fjuro <fjuro@alius.cz>
Co-authored-by: Fjuro <ifjuro@proton.me>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Igor Sorocean <sorocean.igor@gmail.com>
Co-authored-by: Kristian Nordin <kristian.po@proton.me>
Co-authored-by: Michael Bestas <mkbestas@gmail.com>
Co-authored-by: Oğuz Ersen <oguz@ersen.moe>
Co-authored-by: Suguru Hirahara <shirahara@users.noreply.hosted.weblate.org>
Co-authored-by: Yaron Shahrabani <sh.yaron@gmail.com>
Co-authored-by: Yuya <yuyaj@tutanota.com>
Co-authored-by: ZehRique <zehrique.dev@gmail.com>
Co-authored-by: gallegonovato <fran-carro@hotmail.es>
Co-authored-by: lucasmz <git@lucasmz.dev>
Co-authored-by: lucasmz <github@lucasmz.dev>
Co-authored-by: lucasmz <lucasmz@users.noreply.hosted.weblate.org>
Co-authored-by: nautilusx <translate@disroot.org>
Co-authored-by: rehork <cooky@e.email>
Co-authored-by: 大王叫我来巡山 <hamburger2048@users.noreply.hosted.weblate.org>
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault/cs/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault/de/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault/el/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault/es/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault/fi/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault/he/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault/it/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault/ja/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault/pl/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault/pt/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault/pt_BR/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault/ro/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault/sv/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault/tr/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault/zh_Hans/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault_contactsbackup/pt/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault_contactsbackup/ro/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault_storage/pt_BR/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault_storage/ro/
Translate-URL: https://hosted.weblate.org/projects/calyxos/seedvault_storage/sv/
Translation: CalyxOS/Seedvault
Translation: CalyxOS/Seedvault contacts backup
Translation: CalyxOS/Seedvault storage backup
2024-04-24 07:31:58 +02:00
Torsten Grote
11fbd450da
Fix nullability for UserManager in AOSP build (#646) 2024-04-17 00:12:29 +05:30
Torsten Grote
c8d21fcf34 Auto-disable apps that cancel the entire backup
This can happen when the app process gets killed while its BackupAgent is running. There are several qcom apps in the wild that have this issue. These are DoSing our backups and are non-free, so we are defending ourselves against them.
2024-04-16 18:30:20 +05:30
Torsten Grote
499126c459 Log pre-flight errors in BackupMonitor 2024-04-16 18:30:20 +05:30
Torsten Grote
87db20e45f Include user profile name in backup name
so it is easier to identify the right backup if more users backup to the same storage medium.

Change-Id: I56fa93899da3764e20b6aee40adfd52722a05a9f
2024-04-16 18:21:27 +05:30
Torsten Grote
6caa01f8c5
Merge pull request #628 from grote/583-scheduling
Move to our own scheduling
2024-03-26 12:23:49 -03:00
Torsten Grote
baef15b2bc
Do live-counting of backed up apps for success notification
Previously, we asked the MetadataManager which also includes historic data and may provide misleading totals.
2024-03-19 14:31:36 -03:00
Torsten Grote
db1fc90589
Merge pull request #609 from seedvault-app/feature/rclone
Add support for RoundSync as a storage provider
2024-03-18 10:53:25 -03:00
Torsten Grote
f7730d3034
Report total number of user apps when showing final notification
Before, we showed the number of apps we requested the backup for which in case of non-d2d may be much lower than the number of installed apps.

In the future we may decide to also include certain system apps in that count.
2024-03-13 09:55:46 -03:00
Aayush Gupta
6e4bf90e7c BackupScreen: Don't hardcode model name for internal storage
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-03-12 19:09:21 +05:30
Torsten Grote
0b021e3b48
Try to close system dialogs of emulator 2024-03-08 09:52:23 -03:00
Torsten Grote
8489753d58
Address review feedback 2024-03-08 09:52:23 -03:00
Torsten Grote
ee581ee652
Initialize backup, when enabling it
For ApkBackup, we need to be initialized. If the system starts with app backup off, we would not initialize which would lead to issues when backing up the APKs.
2024-03-08 09:52:23 -03:00
Torsten Grote
2da989971b
Request @pm@ backup after initialization
to avoid a 2nd restore set being used.

This also changes the initialization behavior to only create the restore set folder and upload the metadata only when we actually need to. This way, double inits are not creating new restore sets on the backup destination.
2024-03-08 09:52:23 -03:00
Torsten Grote
19bfc41d95
Allow backups in metered network, if user wants that 2024-03-08 09:52:07 -03:00
Torsten Grote
4eaa806636
Expose scheduling options in the UI 2024-03-08 09:52:07 -03:00
Torsten Grote
f593b66e00
try more than once to upload metadata after APK backups
Failure to upload metadata after backup up APKs can be critical and flaky I/O can make it fail, so we try again.
2024-03-08 09:52:06 -03:00
Torsten Grote
e7e489e091
Only reschedule next app backup when not on USB storage
Currently, after a manual run, we need to schedule the background backups again, because the scheduling gets lost. However, we need to be careful not to do that when the backup destination is on removable storage. Then we don't want to run.
2024-03-08 09:52:06 -03:00
Torsten Grote
8a870d8942
Use WorkInfo for determining if a backup is already running
Backup and restore is not possible when a backup is running. We used to check notifications for this, but now can use WorkManager's WorkInfo which should be more reliable.

Also, we used to prevent the "Backup now" action when app backup was disabled. But the user may want to do a storage backup. This is now possible.
2024-03-08 09:52:06 -03:00