From 6f72c2ebec7b7844332ca7e634bde4f59268b198 Mon Sep 17 00:00:00 2001 From: Alberto Ponces Date: Tue, 20 Sep 2022 01:07:36 +0100 Subject: [PATCH] fix: Fix unfixed fixes which needed to be fixed (better now??) --- lib/services/manager_api.dart | 20 +++++++++++-------- lib/services/patcher_api.dart | 7 ++++--- .../app_selector/app_selector_viewmodel.dart | 7 ++++--- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/lib/services/manager_api.dart b/lib/services/manager_api.dart index 679454d0..d0482527 100644 --- a/lib/services/manager_api.dart +++ b/lib/services/manager_api.dart @@ -97,8 +97,10 @@ class ManagerAPI { Future savePatchedApp(PatchedApplication app) async { List patchedApps = getPatchedApps(); patchedApps.removeWhere((a) => a.packageName == app.packageName); - ApplicationWithIcon? installed = - await DeviceApps.getApp(app.packageName, true) as ApplicationWithIcon?; + ApplicationWithIcon? installed = await DeviceApps.getApp( + app.packageName, + true, + ) as ApplicationWithIcon?; if (installed != null) { app.name = installed.appName; app.version = installed.versionName!; @@ -202,9 +204,10 @@ class ManagerAPI { List installedApps = await _rootAPI.getInstalledApps(); for (String packageName in installedApps) { if (!patchedApps.any((app) => app.packageName == packageName)) { - ApplicationWithIcon? application = - await DeviceApps.getApp(packageName, true) - as ApplicationWithIcon?; + ApplicationWithIcon? application = await DeviceApps.getApp( + packageName, + true, + ) as ApplicationWithIcon?; if (application != null) { unsavedApps.add( PatchedApplication( @@ -229,9 +232,10 @@ class ManagerAPI { if (app.packageName.startsWith('app.revanced') && !app.packageName.startsWith('app.revanced.manager.') && !patchedApps.any((uapp) => uapp.packageName == app.packageName)) { - ApplicationWithIcon? application = - await DeviceApps.getApp(app.packageName, true) - as ApplicationWithIcon?; + ApplicationWithIcon? application = await DeviceApps.getApp( + app.packageName, + true, + ) as ApplicationWithIcon?; if (application != null) { unsavedApps.add( PatchedApplication( diff --git a/lib/services/patcher_api.dart b/lib/services/patcher_api.dart index 8479f343..4067caa2 100644 --- a/lib/services/patcher_api.dart +++ b/lib/services/patcher_api.dart @@ -53,9 +53,10 @@ class PatcherAPI { for (Package package in patch.compatiblePackages) { try { if (!filteredApps.any((app) => app.packageName == package.name)) { - ApplicationWithIcon? app = - await DeviceApps.getApp(package.name, true) - as ApplicationWithIcon?; + ApplicationWithIcon? app = await DeviceApps.getApp( + package.name, + true, + ) as ApplicationWithIcon?; if (app != null) { filteredApps.add(app); } diff --git a/lib/ui/views/app_selector/app_selector_viewmodel.dart b/lib/ui/views/app_selector/app_selector_viewmodel.dart index 95ee3ec0..23e3c8a6 100644 --- a/lib/ui/views/app_selector/app_selector_viewmodel.dart +++ b/lib/ui/views/app_selector/app_selector_viewmodel.dart @@ -43,9 +43,10 @@ class AppSelectorViewModel extends BaseViewModel { ); if (result != null && result.files.single.path != null) { File apkFile = File(result.files.single.path!); - ApplicationWithIcon? application = - await DeviceApps.getAppFromStorage(apkFile.path, true) - as ApplicationWithIcon?; + ApplicationWithIcon? application = await DeviceApps.getAppFromStorage( + apkFile.path, + true, + ) as ApplicationWithIcon?; if (application != null) { locator().selectedApp = PatchedApplication( name: application.appName,