Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow choosing which apps will get restored #670

Merged
merged 30 commits into from
Jun 19, 2024

Conversation

grote
Copy link
Collaborator

@grote grote commented May 30, 2024

This adds quite a bit of plumping around the restore process. E.g. we now separately store all the icons of apps we back up, as well as their names and system app status. Apps during restore are now also (mostly) sorted by name.

This then leads to a bit of changes in how we display backup status, e.g. check-boxes instead of switches, show system data instead of system apps and include launch-able system apps in list.

Testing

  • check that backup status list looks as expected
  • check that apps can still be excluded from backup
  • test restore process in various scenarios
    • from existing installation
    • from new install SUW
    • with system app restore and without (while restoring some shown system apps and others not)
    • check that unselected apps don't get restored
    • with APK backup enabled and without
    • check that APKs get installed fine
    • check that APKs that could not get installed or were not backed up can manually be installed
    • check that a backup made with an older version restores just as fine as one made with the current version

Closes #309, #624

@grote grote force-pushed the 309-restore-choose-apps branch 3 times, most recently from bcc9922 to ab4b1f1 Compare May 31, 2024 14:01
grote added 24 commits May 31, 2024 11:10
so they can be shown when selecting apps for restore which is before we have downloaded the APK files to extract icons from
this is helpful for restore, so the user can see app names when deciding which apps to restore
system data comes first and then apps
This way we don't need to show the long complicated list, but provide an all or nothing option at least.
While we still don't guarantee that an attacker with access to the storage can't find out which apps we use (APKs are still unencrypted after all), we go into this direction.

Also, this should make it impossible for an attacker that can modify files to replace or otherwise mess with the icons.
Resources$NotFoundException: Resource ID #0x7f060258 type #0x2 is not valid
during restore process. These can usually not be manually installed anyway and just clutter the list making it harder for the user to find their important apps and potential failures there.
grote added 2 commits May 31, 2024 13:35
AppDataRestoreManager

which was in RestoreViewModel before.
Now all three steps of app restore have their own dedicated manager class making the ViewModel more readable.
grote added 2 commits May 31, 2024 17:06
Apps are now restored alphabetically to be consistent with the other lists. Some irrelevant apps are hidden. Under the hood, we now use an AsyncListDiffer like in the other lists.
it doesn't really exist and should probably not even be in the backup metadata. It messes up progress reporting, if we keep it in.
@t-m-w
Copy link
Collaborator

t-m-w commented Jun 4, 2024

with system app restore and without (while restoring some shown system apps and others not)

When restoring, I see a "System apps" toggle under "System data", but I do not see the ability to select or deselect individual system apps. What I'm looking for is e.g. Chromium, but I don't see it. Am I missing something?

Edit: I do see some, such as Phone and Music, mixed in with other user apps (that's the part I wasn't expecting, but it's fine). It turns out that Calculator, Chromium, Clock, and some others are "Waiting to back up..." for some reason. I do have D2D on, currently.

@t-m-w
Copy link
Collaborator

t-m-w commented Jun 4, 2024

UX: As I scroll around the list of apps to restore, when I scroll down, including when I reach the bottom, there is no clear way to proceed with restoration, as the "Restore backup" button hides itself when you scroll down. I need to scroll up a bit to make the floating "Restore backup" button reappear, which is a bit unintuitive.

@grote
Copy link
Collaborator Author

grote commented Jun 4, 2024

When restoring, I see a "System apps" toggle under "System data", but I do not see the ability to select or deselect individual system apps. What I'm looking for is e.g. Chromium, but I don't see it. Am I missing something?

Edit: I do see some, such as Phone and Music, mixed in with other user apps (that's the part I wasn't expecting, but it's fine). It turns out that Calculator, Chromium, Clock, and some others are "Waiting to back up..." for some reason. I do have D2D on, currently.

We do show launchable system apps like regular apps now. Other non-userfacing system apps are behind that "System apps" toggle as an all or nothing.

UX: As I scroll around the list of apps to restore, when I scroll down, including when I reach the bottom, there is no clear way to proceed with restoration, as the "Restore backup" button hides itself when you scroll down. I need to scroll up a bit to make the floating "Restore backup" button reappear, which is a bit unintuitive.

Maybe @theimpulson knows a coordinator layout behavior that works better here. Because of the long app list and the need to go through all of it, I didn't want to steal precious screen space for that button and hence let it float above the list.

@t-m-w
Copy link
Collaborator

t-m-w commented Jun 4, 2024

When trying to restore an older backup (from CalyxOS 5.7.1, Pixel 8a akita), I do not see app names or icons, only package names and generic icons. Waiting a while does not cause them to load.

@grote
Copy link
Collaborator Author

grote commented Jun 4, 2024

When trying to restore an older backup (from CalyxOS 5.7.1, Pixel 8a akita), I do not see app names or icons, only package names and generic icons.

Yes that is expected. Only the new code does store names and icons. As we don't control old installs and old backups, there's no way we can retroactively store those things. So restoring old backups will need to live without icons and app names.

Both do exist in the APKs, if available, but downloading all APKs before the user can select something is a bit much, so we didn't do it.

@t-m-w
Copy link
Collaborator

t-m-w commented Jun 4, 2024

Okay, everything checks out to me except for one thing which isn't really a Seedvault problem / not related to this change. I left a bullet next to it.

  • check that backup status list looks as expected
  • check that apps can still be excluded from backup
  • test restore process in various scenarios
    • from existing installation
    • from new install SUW
    • with system app restore and without (while restoring some shown system apps and others not)
    • check that unselected apps don't get restored
    • with APK backup enabled and without
    • check that APKs get installed fine
    • check that APKs that could not get installed or were not backed up can manually be installed
      • CalyxOS-specific failure: F-Droid Basic and Aurora Store are not available at this time. Seedvault launches Chromium to a Play Store page, where nothing can be done.
      • If you do an existing-install restore with *#*#RESTORE#*#*, it's okay, except that it immediately fails for apps which have no APKs backed up, even if those apps were installed in the interim - so you tap to install, go back without doing anything, and the app moves to the bottom with a green checkmark. Unrelated issue I think, I believe I've seen it before.
    • check that a backup made with an older version restores just as fine as one made with the current version
      • System apps are not listed individually, but this is likely not possible or feasible.

@grote grote marked this pull request as ready for review June 4, 2024 20:43
@grote grote requested a review from stevesoltys June 4, 2024 20:43
@grote
Copy link
Collaborator Author

grote commented Jun 5, 2024

Thanks a lot for testing @t-m-w!

If you do an existing-install restore with ##RESTORE##, it's okay, except that it immediately fails for apps which have no APKs backed up, even if those apps were installed in the interim - so you tap to install, go back without doing anything, and the app moves to the bottom with a green checkmark. Unrelated issue I think, I believe I've seen it before.

Right, that's unrelated and one of the items of #671

@grote grote force-pushed the 309-restore-choose-apps branch 4 times, most recently from b65595e to fec7fbf Compare June 6, 2024 19:36
We still don't know why, but after latest test fixes, the @pm@ package didn't have the the @meta@ key in the backup, but it did in restore.
@grote grote force-pushed the 309-restore-choose-apps branch 3 times, most recently from 3a5eea2 to 2f23882 Compare June 7, 2024 13:29
@grote grote merged commit 22ca255 into seedvault-app:android14 Jun 19, 2024
3 checks passed
@grote grote deleted the 309-restore-choose-apps branch June 19, 2024 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Choose what apps will get restored
3 participants