From 64a96fc3cea3a59d89d757c06a4a13d6d88cf995 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Mon, 28 Aug 2023 00:41:16 +0200 Subject: [PATCH] fix: close before returning --- .../main/kotlin/app/revanced/manager/flutter/MainActivity.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/android/app/src/main/kotlin/app/revanced/manager/flutter/MainActivity.kt b/android/app/src/main/kotlin/app/revanced/manager/flutter/MainActivity.kt index b94a582c0c..e00044da7a 100644 --- a/android/app/src/main/kotlin/app/revanced/manager/flutter/MainActivity.kt +++ b/android/app/src/main/kotlin/app/revanced/manager/flutter/MainActivity.kt @@ -266,6 +266,7 @@ class MainActivity : FlutterActivity() { if (cancel) { handler.post { stopResult!!.success(null) } + patcher.close() return@Thread } @@ -279,8 +280,10 @@ class MainActivity : FlutterActivity() { ) ) } + val res = patcher.get() patcher.close() + ZipFile(patchedFile).use { file -> res.dexFiles.forEach { if (cancel) { @@ -303,10 +306,12 @@ class MainActivity : FlutterActivity() { ZipAligner::getEntryAlignment ) } + if (cancel) { handler.post { stopResult!!.success(null) } return@Thread } + handler.post { installerChannel.invokeMethod( "update",