fix: Fix apps reassess on root

This commit is contained in:
Alberto Ponces
2022-09-18 01:54:25 +01:00
parent 257fd46e27
commit ae801a2918
2 changed files with 25 additions and 30 deletions

View File

@@ -58,16 +58,7 @@ class RootAPI {
cmd: 'ls "$_managerDirPath"',
);
if (res != null) {
List<String> apps = res.split('\n');
List<String> toRemove = [];
for (String packageName in apps) {
bool isInstalled = await isAppInstalled(packageName);
if (!isInstalled) {
toRemove.add(packageName);
}
}
apps.removeWhere((a) => toRemove.contains(a));
return apps;
return res.split('\n').map((pack) => pack.trim()).toList();
}
} on Exception {
return List.empty();