fix: close before returning

This commit is contained in:
oSumAtrIX 2023-08-28 00:41:16 +02:00
parent 45fae3f0fd
commit 64a96fc3ce
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4

View File

@ -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",