Fix close

This commit is contained in:
vvb2060 2023-06-27 02:27:41 +08:00 committed by John Wu
parent d0b8c16651
commit 92f980601c

View File

@ -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("")