Slight XAPK support improvement + BG install bugfix

This commit is contained in:
Imran Remtulla
2024-08-19 21:29:19 -04:00
parent 37e90dabe7
commit 514ca3e28b

View File

@@ -485,8 +485,17 @@ class AppsProvider with ChangeNotifier {
.listSync() .listSync()
.where((e) => e.path.toLowerCase().endsWith('.apk')) .where((e) => e.path.toLowerCase().endsWith('.apk'))
.toList(); .toList();
newInfo = for (var i = 0; i < apks.length; i++) {
await pm.getPackageArchiveInfo(archiveFilePath: apks.first.path); try {
newInfo = await pm.getPackageArchiveInfo(
archiveFilePath: apks.first.path);
break;
} catch (e) {
if (i == apks.length - 1) {
rethrow;
}
}
}
} }
if (newInfo == null) { if (newInfo == null) {
downloadedFile.delete(); downloadedFile.delete();
@@ -844,7 +853,11 @@ class AppsProvider with ChangeNotifier {
if (needBGWorkaround) { if (needBGWorkaround) {
// ignore: use_build_context_synchronously // ignore: use_build_context_synchronously
installApk(downloadedFile, contextIfNewInstall, installApk(downloadedFile, contextIfNewInstall,
needsBGWorkaround: true); needsBGWorkaround: true,
shizukuPretendToBeGooglePlay: apps[id]!
.app
.additionalSettings['shizukuPretendToBeGooglePlay'] ==
true);
} else { } else {
// ignore: use_build_context_synchronously // ignore: use_build_context_synchronously
sayInstalled = await installApk(downloadedFile, contextIfNewInstall, sayInstalled = await installApk(downloadedFile, contextIfNewInstall,