seedvault
seedvault copied to clipboard
Frozen apps in Work profile are not backed up
- Set up a Work profile using Shelter
- Install an app there
- Freeze the app
- Use SeedVault to start a backup
- The app is not listed on SeedVault
Meanwhile, a disabled app on the main profile (GrapheneOS has a toggle on user apps to disable them) is included in the backup list of SeedVault.
Is there a way to include frozen apps in the backup of a Work profile?
What does "freeze" an app even mean?
This might be related: https://github.com/seedvault-app/seedvault/wiki/FAQ#why-do-some-apps-not-allow-to-get-backed-up
AFAIK, freezing is defined here
https://github.com/PeterCxy/Shelter/blob/5c7e4b3b267f7be594f083c271d1b6cf36903418/app/src/main/java/net/typeblog/shelter/services/ShelterService.java using the library on line 8
import android.app.admin.DevicePolicyManager;
the variable on line 33
private DevicePolicyManager mPolicyManager = null;
the un/freeze code is
@Override
public void freezeApp(ApplicationInfoWrapper app) {
if (!mIsProfileOwner)
throw new IllegalArgumentException("Cannot freeze app without being profile owner");
mPolicyManager.setApplicationHidden(
mAdminComponent,
app.getPackageName(), true);
}
@Override
public void unfreezeApp(ApplicationInfoWrapper app) {
if (!mIsProfileOwner)
throw new IllegalArgumentException("Cannot unfreeze app without being profile owner");
mPolicyManager.setApplicationHidden(
mAdminComponent,
app.getPackageName(), false);
}
A frozen app is similar to a disabled app. A frozen app is not technically disabled, but the effect is very similar: the app cannot start by itself, is hidden from the launcher, and can not do anything in the background.
The link you mentioned explains that apps can opt out of system backups, which is related but not useful for this issue.
@grote on CalyxOS this is called "hide app", available from app info.
The app is pretty much hidden from everything which is why it isn't getting backed up here. But there are ways.
From https://review.calyxos.org/c/CalyxOS/platform_frameworks_base/+/11873
PackageManager.MATCH_UNINSTALLED_PACKAGES
- as that's what setApplicationHidden
does.
It uninstalls the app - but keeps the APK and data around, ready for re-install when you unfreeze/unhide.
@grote For more information, setApplicationHidden
is explained at https://developer.android.com/reference/android/app/admin/DevicePolicyManager#setApplicationHidden(android.content.ComponentName,%20java.lang.String,%20boolean)
In practice, i install privacy-invading apps and all Google dependent apps in the Work profile using Shelter, and Shelter automatically freezes most apps in the Work profile a few seconds after locking the screen. Freezing apps also helps a lot to lower battery usage.
Is it possible to back up such hidden apps?
We'd need to check if adding the flag PackageManager.MATCH_UNINSTALLED_PACKAGES
does the trick, but if the system is not even backing up stopped apps, I am not holding my breath for uninstalled apps.
FYI, the other popular Work profile app "Insular" seems to do it the same way: https://gitlab.com/search?search=setApplicationHidden&nav_source=navbar&project_id=18237274&group_id=7721834&search_code=true&repository_ref=dev-ci