Torsten Grote
14775b5c3e
Check that exceptions from file loading get caught
...
a sha256sum mismatch for example can happen, so the exception should get caught e.g. in RestoreCoordinatorState and should not necessarily be fatal
2024-10-10 13:42:23 -03:00
Torsten Grote
9422d0d309
Encode icons in PNG, because JPEG doesn't support transparency
...
This caused black squares around icons.
2024-10-10 13:42:23 -03:00
Torsten Grote
682afa1c69
Try to recover data for force stopped apps from latest snapshot
...
The system doesn't allow us to backup forced stopped apps, but if we had data for them once, we can at least carry it along.
2024-10-10 13:42:23 -03:00
Torsten Grote
c09ea7c075
Use BackupManagerMonitor to handle K/V with no data changed
...
The fake package manager package is essential for the backup, but when its data doesn't change and we request a normal incremental backup, it doesn't get included, because our transport doesn't even get called for it. Only the BackupMonitor gets a hint that it had no (new?) data via LOG_EVENT_ID_NO_DATA_TO_SEND.
This behavior started with Android 15 that fixed a bug that caused @pm@ to always backup. However, other K/V apps were probably affected before.
2024-10-10 13:42:23 -03:00
Torsten Grote
f8451586df
Minor improvements for app restore
...
* activity now can be launched from notification
* better logging
* app data restore continues even after activity died
2024-10-10 13:42:23 -03:00
Torsten Grote
11270ff694
Reset latest snapshot to avoid it getting stale
...
When switching to new storage that doesn't yet have any snapshots, we would otherwise keep the old latest snapshot around.
2024-10-10 13:42:22 -03:00
Torsten Grote
7696b88a5a
Improve RestoreSet display
...
when user is asked to choose a backup to restore
2024-10-10 13:42:22 -03:00
Torsten Grote
84dc13d267
Split up success and error notification
...
Now, we don't do partial backups anymore. A snapshot is only done at the end and no information can make it to the backup before. Hence the old error notification with number of apps backed up didn't make sense anymore.
2024-10-10 13:42:22 -03:00
Torsten Grote
b7b07d0ba1
Fix recovery code keyboard input for Android 15
...
We need to account for IME insets when applying padding to the window.
2024-10-10 13:42:22 -03:00
Torsten Grote
f7354a3d79
Show when launchable system apps do not allow backup
...
Even though we use d2d, backup is only forced for user apps.
2024-10-10 13:42:22 -03:00
Torsten Grote
751504c214
improve local metadata handling
2024-10-10 13:42:21 -03:00
Torsten Grote
eea65d4082
do scheduling migration before strict mode
...
otherwise all LoggingFactory ClassLoader lookups that cause disk reads are logged when koin initializes classes
2024-10-10 13:42:21 -03:00
Torsten Grote
b4c84272ff
Update UI state for some system apps if they have NO_DATA
...
Instead of showing 'Waiting to be backed up...'
2024-10-10 13:42:21 -03:00
Torsten Grote
8d949e2d64
Support adb shell bmgr backupnow
...
We don't get notified about the start nor the end of such a backup run, so we need hacks to do initialization and finalization.
2024-10-10 13:42:21 -03:00
Torsten Grote
e602bbe2ab
Adapt reuse backup screen after designer input
2024-10-10 13:42:21 -03:00
Torsten Grote
7b0e02c451
Clean up code after refactorings
2024-10-10 13:42:20 -03:00
Torsten Grote
5c75574f65
Use cached snapshots for auto-restore to save time
...
All snapshots we wrote out should be cached locally. Auto-restore is holding up app installs, so we should be as fast as possible.
2024-10-10 13:42:20 -03:00
Torsten Grote
1e5a4deedf
Clean up libraries, move to where they are included
2024-10-10 13:42:20 -03:00
Torsten Grote
1aa5c68d0a
Add RestoreV1IntegrationTest to ensure we can still restore v1 backup
2024-10-10 13:42:20 -03:00
Torsten Grote
83fd0ba5d1
Upgrade all the binary dependencies we include
...
Since this is for Android 15 and the new v2 format, this is a good time for upgrading, because we need to test the app extensively anyway.
2024-10-10 13:42:19 -03:00
Torsten Grote
03d2946c93
Remove setting for unlimited quota
...
we set a hard limit for 1 GiB per app for now, but leave code in to make it configurable in the future
2024-10-10 13:42:19 -03:00
Torsten Grote
176a703720
Offer option to recycle backup after restoring
...
The most common restore scenario is assumed to be moving from one device to another, like when the old one was lost or stolen. Most users probably don't continue to use the old device themselves still.
Since they just restored this backup on their phone, most data is already in this backup. Deduplication allows re-using that, so it doesn't need to be saved again.
2024-10-10 13:42:19 -03:00
Torsten Grote
20ea0b332d
Delete repo and exit process when key changes
...
There is no easy way to re-initialize all data based on the old key, so to prevent usage of the old key we need to exit our process. When the app is started again, only the new key will be used.
2024-10-10 13:42:19 -03:00
Torsten Grote
62991ed38b
Move app backup to expert settings
2024-10-10 13:42:19 -03:00
Torsten Grote
9de1d2472b
Remove D2D setting, it is now always on
2024-10-10 13:42:18 -03:00
Torsten Grote
fe8d458890
Always use SnapshotManager to load snapshots to benefit from cache
2024-10-10 13:42:18 -03:00
Torsten Grote
a1baa6f9d2
Implement pruning of old snapshots and unused blobs
...
This happens regularly after each successful backup.
2024-10-10 13:42:18 -03:00
Torsten Grote
307ccf57de
Move new classes to repo package
...
as they all relate to interacting with the backup repository
2024-10-08 19:38:15 -03:00
Torsten Grote
32e116ffe1
Polish AppBackupManager and write tests
2024-10-08 19:38:14 -03:00
Torsten Grote
7702fb7bd8
Polish SnapshotCreator and write tests
2024-10-08 19:38:14 -03:00
Torsten Grote
463fc33230
Log memory and when system calls App#onTrimMemory()
2024-10-08 19:38:14 -03:00
Torsten Grote
f188230269
Add padding to all blobs using the Padmé algorithm
2024-10-08 19:38:14 -03:00
Torsten Grote
52f528dbf0
Fully implement BackupReceiver and write tests
2024-10-08 19:38:14 -03:00
Torsten Grote
dd5180f3b7
Polish BlobCreator and extend its test
2024-10-08 19:38:13 -03:00
Torsten Grote
237fd683bd
Clean up metadata as it lost most of its importance
...
Historically, metadata was uploaded to the backend after each app update and contained all essential data that is now in snapshots. We still support reading metadata for legacy backups and use the metadata classes as a common wrapper for snapshots. However, there is no need anymore to write out complete historic metadata and maintain duplicated unused information there. This got removed. THe information we do still save and write out is only for UI representation of backup state.
The time of last backup is now managed by SettingsManager.
2024-10-08 19:38:13 -03:00
Torsten Grote
a268116e06
Remove warnings when choosing backup location in UI
2024-10-08 19:36:05 -03:00
Torsten Grote
bfa17fa5ec
Fully implement SnapshotManager
...
which manages interactions with snapshots, such as loading, saving and removing them.
It also keeps a reference to the latestSnapshot that holds important re-usable data.
2024-10-08 19:36:05 -03:00
Torsten Grote
952cdec55d
Fully implement BlobCache
...
This class is responsible for caching blobs during a backup run,
so we can know that a blob for the given chunk ID already exists
and does not need to be uploaded again.
It builds up its cache from snapshots available on the backend
and from the persistent cache that includes blobs that could not be added to a snapshot,
because the backup was aborted.
2024-10-08 19:36:05 -03:00
Torsten Grote
5b567c79a2
Also snapshot unchanged APKs
2024-10-08 19:36:05 -03:00
Torsten Grote
cacea886b0
Simplify transport init and token handling
...
The token used to be very important, because it was our restore set folder name. Now it is just a number in a snapshot, so things get a bit simpler.
2024-10-08 19:36:05 -03:00
Torsten Grote
3c4b4f705c
Remove hack of @pm@ backup when initializing transport
...
as it isn't needed anymore with v2 since we don't do duplicate restore sets anymore
2024-10-08 19:36:04 -03:00
Torsten Grote
7f9e84fdb6
Stop writing out old metadata to backend
...
We'll probably keep metadata around for internal information about backup state
2024-10-08 19:36:04 -03:00
Torsten Grote
c2ad309f93
K/V backup and restore using v2
...
while maintaining support for v0 and v1
2024-10-08 19:36:04 -03:00
Torsten Grote
7c7ea5fcd7
Full backup and restore using v2
...
while maintaining support for v0 and v1
2024-10-08 19:36:04 -03:00
Torsten Grote
83708d9403
Prepare restore backup loading for v2
2024-10-08 19:36:03 -03:00
Torsten Grote
8ce79f4195
Add protobuf-kotlin-lite and use new builders
2024-10-08 19:36:03 -03:00
Torsten Grote
897ae48b44
Back up app APKs in new v2 format
...
We still support restoring in v1 format for some time.
2024-10-08 19:36:03 -03:00
Torsten Grote
e17c98857f
Back up app icons in new v2 format
...
We still support downloading in v1 format for some time.
2024-10-08 19:36:03 -03:00
Torsten Grote
1efa8e8f59
Add prototype plumbing for new v2 app backup
2024-10-08 19:36:03 -03:00
Torsten Grote
e6905c0365
Move tink library into core module and expose via CoreCrypto
...
This also moves key derivation via HKDF into the core.
2024-10-08 19:36:03 -03:00
Torsten Grote
c19787a7fa
Prepare backends for new app backup repository
2024-10-08 19:36:02 -03:00
Torsten Grote
d2df088f2c
Add zstd-jni library
2024-10-08 19:36:02 -03:00
Torsten Grote
cb68f75eb6
remove kotlin protobuf as its not in aosp
2024-10-08 19:36:02 -03:00
Torsten Grote
b2307d94dd
Add protobuf definitions for snapshot
2024-10-08 19:36:02 -03:00
Torsten Grote
a9df9a2d2f
Merge pull request #771 from grote/770-backup-start
...
Unify code to start new backup
2024-10-08 18:21:15 -03:00
Torsten Grote
d6572979cc
Unify code to start new backup
...
to ensure that files backup and app backup will always run if they should
2024-10-08 16:13:12 -03:00
Torsten Grote
5498e838db
Merge pull request #764 from grote/697-receivery-code-crash
...
Trim white-spaces from recovery code words
2024-10-07 11:09:26 -03:00
Torsten Grote
3601494b06
Also show TikTok in Backup status
...
The apps ships an instrumentation configuration which we've so far only soon for instrumentation test dev apps. Now, we do more checks to identify those.
2024-10-07 10:47:27 -03:00
t-m-w
a27ef47294
Fix title of restore notification channel
...
The restore foreground service notification uses the restore channel, which was inadvertently using the title from the error channel, showing "Auto restore flash drive error" when tapping and holding on the notification, and showing that channel name twice in the notification settings.
2024-10-03 16:09:25 -04:00
Torsten Grote
542a79e2e1
Trim white-spaces from recovery code words
2024-10-03 14:09:39 -03:00
Torsten Grote
f2aec3f932
Merge pull request #747 from theimpulson/a15
...
Support edge to edge
2024-09-20 14:03:29 -03:00
Aayush Gupta
b9b7c96063
Support edge to edge
...
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-09-18 20:21:09 +05:30
Torsten Grote
78ef0caea7
clean up libs and fix AOSP build
2024-09-12 09:34:00 -03:00
Torsten Grote
206affee00
Move AOSP libs to root libs dir
2024-09-12 09:33:59 -03:00
Torsten Grote
c83e8f392e
Fix issue with DocumentFileCache
2024-09-12 09:33:59 -03:00
Torsten Grote
96a3564610
Switch everything to new backends
2024-09-12 09:33:58 -03:00
Torsten Grote
58d58415c5
Use new Backend directly in storage lib
2024-09-12 09:18:22 -03:00
Torsten Grote
0c1dfb316d
Use new Backend directly in the app
2024-09-12 09:18:22 -03:00
Torsten Grote
5bb599e528
Use new SafBackend in DocumentsProviderStoragePlugin
2024-09-12 09:18:21 -03:00
Torsten Grote
8c05ccc39d
Use new WebDavBackend in WebDavStoragePlugin
2024-09-12 09:18:21 -03:00
Torsten Grote
099e0ba6d5
Remove hasData() method from StoragePlugin
...
because it is one extra request for packages that do have data and from the looks of it not really needed.
2024-09-12 09:18:21 -03:00
Torsten Grote
27eb95f768
Split key concern out of storage plugin
...
This creates a KeyManager interface in the new core module which the storage module can use to get the key from.
2024-09-12 09:18:21 -03:00
Torsten Grote
9e56384cb2
Add core gradle module with unified storage backends
2024-09-12 09:18:21 -03:00
Aayush Gupta
bc2cb257b1
app: test: Force robolectric to SDK 34 for now
...
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-09-12 17:31:01 +05:30
Aayush Gupta
4a235c6739
app: test: Assert applicationInfo is non-null
...
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-09-10 12:13:21 +05:30
Aayush Gupta
a334eb0e91
Update AGP, Gradle and dependencies to AOSP versions
...
* Also regenerate JARs against Android 15 user build
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-09-09 11:39:58 +05:30
Chirayu Desai
bf609f9723
Bump version to 15-4.1, mention 15 in README
...
* VanillaIceCream
Change-Id: Idd149e2be3329452ab61941cde2ff4f2ae3575ca
2024-09-06 20:52:49 +05:30
Aayush Gupta
085d152e55
drawable: Use text color for system icons
...
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-09-06 12:50:42 +05:30
Torsten Grote
ff59decaab
Merge pull request #731 from lucasmz-dev/android14-bump-version
...
Bump version
2024-09-05 16:24:37 -03:00
Torsten Grote
dc9391deef
Merge pull request #723 from grote/allow-restore
...
Allow restore whenever the user feels like it
2024-09-05 16:24:13 -03:00
Torsten Grote
b8602fdcc2
Merge pull request #736 from grote/fix-retry
...
Fix retries: don't upload metadata three times
2024-09-05 16:14:20 -03:00
Torsten Grote
710354d6d0
Merge pull request #722 from grote/restore-foreground-service
...
Start a foreground service during restore
2024-09-05 16:14:02 -03:00
Torsten Grote
17d0885e77
Fix retries: don't upload metadata three times
2024-09-05 09:11:52 -03:00
Torsten Grote
40d0f55012
Show app is in progress before we download APKs
2024-08-28 15:07:36 -03:00
Torsten Grote
7214d9c666
Don't allow app selection toggles before icons have loaded
2024-08-28 15:07:31 -03:00
LucasMZ
006dfadca0
Bump to 14-4.1 - many cool things :D
2024-08-23 22:40:40 -03:00
Torsten Grote
d266c36c91
Don't use Context#startForegroundService() because we may get killed
...
If the foreground service doesn't have anything to do and terminates quickly, the system will kill us, even though the service had called startForeground(). To prevent this, we don't promise that our service will be a foreground service. We can still be a foreground service, but escape the punishment if we are too quick.
2024-08-22 17:45:39 -03:00
Torsten Grote
639947b87e
Start a foreground service during restore
...
so the system won't kill us, even if the user navigates away.
2024-08-21 17:28:37 -03:00
Torsten Grote
bebb9005da
Merge pull request #719 from grote/only-install-if-not-installed
...
Don't re-install apps that are already installed and disable auto-restore
2024-08-21 17:22:41 -03:00
Torsten Grote
61e748ac42
Don't back up to USB, if backup disabled
2024-08-21 14:47:54 -03:00
Torsten Grote
ebb662add7
Merge pull request #720 from grote/fix-app-selection
...
Fix app selection when restoring after SUW
2024-08-21 14:36:26 -03:00
Torsten Grote
1b9dc25896
Allow restore whenever the user feels like it
2024-08-20 17:53:24 -03:00
Torsten Grote
570850aa51
Disable auto-restore during install, if it was on
2024-08-16 10:53:00 -03:00
Torsten Grote
09074c5dff
Move Settings.Secure backup flags into BackupStateManager
2024-08-16 10:53:00 -03:00
Torsten Grote
3397fdbd87
Fix app selection when restoring after SUW
2024-08-16 09:45:46 -03:00
Torsten Grote
109e0ae281
Don't re-install apps that are already installed
2024-08-16 09:29:43 -03:00
Torsten Grote
7f934c8209
Fix back navigation when FirstRunFragment is shown
2024-08-15 18:29:38 -03:00
Torsten Grote
22b3ace3aa
Ask on first run if user wants restore
2024-08-15 18:29:37 -03:00
Torsten Grote
cff5d20342
Merge pull request #712 from grote/debug-launcher
...
Add launcher icon for debug builds
2024-08-15 18:28:25 -03:00
Torsten Grote
e4de9e1c41
Uncheck system apps by default if restore outside of SUW
2024-08-15 15:46:40 -03:00