mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-01-11 22:03:37 +00:00
parent
b1dbbdef12
commit
07bd36c94b
@ -188,10 +188,15 @@ abstract class MagiskInstallImpl protected constructor(
|
|||||||
val name = entry.name.replace(".lz4", "")
|
val name = entry.name.replace(".lz4", "")
|
||||||
console.add("-- Extracting: $name")
|
console.add("-- Extracting: $name")
|
||||||
|
|
||||||
val extract = File(installDir, name)
|
val extract = installDirFile(name)
|
||||||
extract.outputStream().use { decompressedStream().copyTo(it) }
|
SuFileOutputStream(extract).use { decompressedStream().copyTo(it) }
|
||||||
} else if (entry.name.contains("vbmeta.img")) {
|
} else if (entry.name.contains("vbmeta.img")) {
|
||||||
val rawData = decompressedStream().readBytes()
|
// DO NOT USE readBytes() DUE TO BUG IN LZ4FrameInputStream
|
||||||
|
val rawData = decompressedStream().run {
|
||||||
|
val buffer = ByteArrayOutputStream()
|
||||||
|
copyTo(buffer)
|
||||||
|
buffer.toByteArray()
|
||||||
|
}
|
||||||
// Valid vbmeta.img should be at least 256 bytes
|
// Valid vbmeta.img should be at least 256 bytes
|
||||||
if (rawData.size < 256)
|
if (rawData.size < 256)
|
||||||
continue
|
continue
|
||||||
@ -264,9 +269,10 @@ abstract class MagiskInstallImpl protected constructor(
|
|||||||
handleTar(src, outFile!!.uri.outputStream())
|
handleTar(src, outFile!!.uri.outputStream())
|
||||||
} else {
|
} else {
|
||||||
// Raw image
|
// Raw image
|
||||||
srcBoot = File(installDir, "boot.img").path
|
val image = installDirFile("boot.img")
|
||||||
|
srcBoot = image.path
|
||||||
console.add("- Copying image to cache")
|
console.add("- Copying image to cache")
|
||||||
FileOutputStream(srcBoot).use { src.copyTo(it) }
|
SuFileOutputStream(image).use { src.copyTo(it) }
|
||||||
outFile = MediaStoreUtils.getFile("$filename.img", true)
|
outFile = MediaStoreUtils.getFile("$filename.img", true)
|
||||||
outFile!!.uri.outputStream()
|
outFile!!.uri.outputStream()
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,6 @@ kapt.incremental.apt=true
|
|||||||
|
|
||||||
# Magisk
|
# Magisk
|
||||||
magisk.stubVersion=16
|
magisk.stubVersion=16
|
||||||
magisk.versionCode=21403
|
magisk.versionCode=21404
|
||||||
magisk.ndkVersion=21d
|
magisk.ndkVersion=21d
|
||||||
magisk.fullNdkVersion=21.3.6528147
|
magisk.fullNdkVersion=21.3.6528147
|
||||||
|
Loading…
x
Reference in New Issue
Block a user