Use stub APK hiding method for Android 5.0+

At the same time, disable app hiding on devices lower than 5.0
to simplify the logic in the app. By doing so, a hidden app always
implies running as stub.
This commit is contained in:
topjohnwu
2021-01-26 04:17:37 -08:00
parent fba83e2330
commit 6ae2c9387d
4 changed files with 35 additions and 58 deletions
@@ -59,8 +59,12 @@ class SettingsViewModel(
))
if (Info.env.isActive) {
list.add(ClearRepoCache)
if (Const.USER_ID == 0 && Info.isConnected.get())
list.add(if (hidden) Restore else Hide)
if (Build.VERSION.SDK_INT >= 21 && Const.USER_ID == 0) {
if (hidden)
list.add(Restore)
else if (Info.isConnected.get())
list.add(Hide)
}
}
// Magisk