From 92f980601c1c632a1a477a4f854b57f5b8420b6e Mon Sep 17 00:00:00 2001 From: vvb2060 Date: Tue, 27 Jun 2023 02:27:41 +0800 Subject: [PATCH] Fix close --- .../java/com/topjohnwu/magisk/core/tasks/MagiskInstaller.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/core/tasks/MagiskInstaller.kt b/app/src/main/java/com/topjohnwu/magisk/core/tasks/MagiskInstaller.kt index cfd4911f4..ee3de79c9 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/tasks/MagiskInstaller.kt +++ b/app/src/main/java/com/topjohnwu/magisk/core/tasks/MagiskInstaller.kt @@ -13,6 +13,7 @@ import com.topjohnwu.magisk.R import com.topjohnwu.magisk.StubApk import com.topjohnwu.magisk.core.* import com.topjohnwu.magisk.core.di.ServiceLocator +import com.topjohnwu.magisk.core.ktx.copyAndClose as copyAndCloseBoth import com.topjohnwu.magisk.core.ktx.reboot import com.topjohnwu.magisk.core.ktx.toast import com.topjohnwu.magisk.core.ktx.withStreams @@ -117,6 +118,7 @@ abstract class MagiskInstallImpl protected constructor( zf.getInputStream(it).writeTo(dest) dest.setExecutable(true) } + zf.close() } else { val info = context.applicationInfo var libs = File(info.nativeLibraryDir).listFiles { _, name -> @@ -442,7 +444,7 @@ abstract class MagiskInstallImpl protected constructor( } outStream.putNextEntry(newTarEntry(name, newBoot.length())) } - newBoot.newInputStream().copyAndClose(outStream) + newBoot.newInputStream().copyAndCloseBoth(outStream) newBoot.delete() console.add("")