fix: Improve root installations management to fix patching of already patched apps

This commit is contained in:
Alberto Ponces
2022-09-13 16:54:43 +01:00
parent 779b659108
commit d613cece15
7 changed files with 100 additions and 85 deletions

View File

@@ -198,7 +198,10 @@ class ManagerAPI {
Future<bool> isAppUninstalled(PatchedApplication app) async {
bool existsRoot = false;
if (app.isRooted) {
existsRoot = await _rootAPI.isAppInstalled(app.packageName);
bool hasRootPermissions = await _rootAPI.hasRootPermissions();
if (hasRootPermissions) {
existsRoot = await _rootAPI.isAppInstalled(app.packageName);
}
}
bool existsNonRoot = await DeviceApps.isAppInstalled(app.packageName);
return !existsRoot && !existsNonRoot;