From c87fdbea0fc1ff1f370e2a33fe3e172ae407922c Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Fri, 22 Jan 2021 03:07:39 -0800 Subject: [PATCH] Fix erroneous stream close --- .../java/com/topjohnwu/magisk/core/tasks/MagiskInstaller.kt | 2 +- 1 file changed, 1 insertion(+), 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 e8f8a7cd3..7cf897ad7 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 @@ -189,7 +189,7 @@ abstract class MagiskInstallImpl protected constructor( console.add("-- Extracting: $name") val extract = File(installDir, name) - decompressedStream().writeTo(extract) + extract.outputStream().use { decompressedStream().copyTo(it) } } else if (entry.name.contains("vbmeta.img")) { val rawData = decompressedStream().readBytes() // Valid vbmeta.img should be at least 256 bytes