Fix erroneous stream close

This commit is contained in:
topjohnwu 2021-01-22 03:07:39 -08:00
parent ec8fffe61c
commit c87fdbea0f

View File

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