feat: add App Info View

This commit is contained in:
Alberto Ponces
2022-09-05 13:43:13 +01:00
parent 5e8e090e34
commit 2944a2b788
13 changed files with 433 additions and 25 deletions

View File

@@ -102,12 +102,18 @@ class ManagerAPI {
await setPatchedApps(patchedApps);
}
Future<void> deletePatchedApp(PatchedApplication app) async {
List<PatchedApplication> patchedApps = getPatchedApps();
patchedApps.removeWhere((a) => a.packageName == app.packageName);
await setPatchedApps(patchedApps);
}
Future<void> reAssessSavedApps() async {
bool isRoot = isRooted() ?? false;
bool isRooted = this.isRooted() ?? false;
List<PatchedApplication> patchedApps = getPatchedApps();
List<PatchedApplication> toRemove = [];
for (PatchedApplication app in patchedApps) {
bool isRemove = await isAppUninstalled(app, isRoot);
bool isRemove = await isAppUninstalled(app, isRooted);
if (isRemove) {
toRemove.add(app);
} else {
@@ -133,9 +139,9 @@ class ManagerAPI {
await setPatchedApps(patchedApps);
}
Future<bool> isAppUninstalled(PatchedApplication app, bool isRoot) async {
Future<bool> isAppUninstalled(PatchedApplication app, bool isRooted) async {
bool existsRoot = false;
if (isRoot) {
if (isRooted) {
existsRoot = await _rootAPI.isAppInstalled(app.packageName);
}
bool existsNonRoot = await DeviceApps.isAppInstalled(app.packageName);

View File

@@ -146,7 +146,7 @@ class PatcherAPI {
Future<bool> installPatchedFile(PatchedApplication patchedApp) async {
if (_outFile != null) {
try {
if (patchedApp.isRooted && !patchedApp.isFromStorage) {
if (patchedApp.isRooted) {
return _rootAPI.installApp(
patchedApp.packageName,
patchedApp.apkFilePath,