From 279b76ad53a910e4285b01544a45ddb320ec063c Mon Sep 17 00:00:00 2001 From: Aunali321 Date: Tue, 11 Oct 2022 02:17:13 +0530 Subject: [PATCH] fix: don't show previously patched apps after clearing data. --- lib/services/manager_api.dart | 29 --------------------------- lib/ui/views/home/home_viewmodel.dart | 1 - 2 files changed, 30 deletions(-) diff --git a/lib/services/manager_api.dart b/lib/services/manager_api.dart index 4bfae93a..236e1b80 100644 --- a/lib/services/manager_api.dart +++ b/lib/services/manager_api.dart @@ -256,35 +256,6 @@ class ManagerAPI { return unsavedApps; } - Future reAssessSavedApps() async { - List patchedApps = getPatchedApps(); - List unsavedApps = await getUnsavedApps(patchedApps); - patchedApps.addAll(unsavedApps); - List toRemove = await getAppsToRemove(patchedApps); - patchedApps.removeWhere((a) => toRemove.contains(a)); - for (PatchedApplication app in patchedApps) { - app.hasUpdates = - await hasAppUpdates(app.originalPackageName, app.patchDate); - app.changelog = - await getAppChangelog(app.originalPackageName, app.patchDate); - if (!app.hasUpdates) { - String? currentInstalledVersion = - (await DeviceApps.getApp(app.packageName))?.versionName; - if (currentInstalledVersion != null) { - String currentSavedVersion = app.version; - int currentInstalledVersionInt = int.parse( - currentInstalledVersion.replaceAll(RegExp('[^0-9]'), '')); - int currentSavedVersionInt = - int.parse(currentSavedVersion.replaceAll(RegExp('[^0-9]'), '')); - if (currentInstalledVersionInt > currentSavedVersionInt) { - app.hasUpdates = true; - } - } - } - } - await setPatchedApps(patchedApps); - } - Future isAppUninstalled(PatchedApplication app) async { bool existsRoot = false; bool existsNonRoot = await DeviceApps.isAppInstalled(app.packageName); diff --git a/lib/ui/views/home/home_viewmodel.dart b/lib/ui/views/home/home_viewmodel.dart index e28c864f..426a93dc 100644 --- a/lib/ui/views/home/home_viewmodel.dart +++ b/lib/ui/views/home/home_viewmodel.dart @@ -49,7 +49,6 @@ class HomeViewModel extends BaseViewModel { _toast.show('homeView.noConnection'); } _getPatchedApps(); - _managerAPI.reAssessSavedApps().then((_) => _getPatchedApps()); } void navigateToAppInfo(PatchedApplication app) {