fix: Fix installation being cancelled at installation by not prematurely deleting patched APK (#2490)

This commit is contained in:
kitadai31 2025-05-05 22:56:28 +09:00 committed by GitHub
parent 3074766ff2
commit dedcb3c51a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -366,7 +366,6 @@ class ManagerAPI {
PatchedApplication app,
File outFile,
) async {
deleteLastPatchedApp();
final Directory appCache = await getApplicationSupportDirectory();
app.patchedFilePath =
outFile.copySync('${appCache.path}/lastPatchedApp.apk').path;
@ -691,16 +690,6 @@ class ManagerAPI {
patchedApps.addAll(mountedApps);
await setPatchedApps(patchedApps);
// Delete the saved app if the file is not found.
final PatchedApplication? lastPatchedApp = getLastPatchedApp();
if (lastPatchedApp != null) {
final File file = File(lastPatchedApp.patchedFilePath);
if (!file.existsSync()) {
deleteLastPatchedApp();
_prefs.remove('lastPatchedApp');
}
}
}
Future<bool> isAppUninstalled(PatchedApplication app) async {