mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-02-25 13:37:35 +00:00
Refine
This commit is contained in:
parent
584bad5314
commit
9656cf2f86
@ -238,14 +238,13 @@ abstract class MagiskInstallImpl protected constructor(
|
|||||||
}
|
}
|
||||||
boot.delete()
|
boot.delete()
|
||||||
} else {
|
} else {
|
||||||
if (!initBoot.exists()) {
|
srcBoot = when {
|
||||||
if (!boot.exists()) {
|
initBoot.exists() -> initBoot
|
||||||
|
boot.exists() -> boot
|
||||||
|
else -> {
|
||||||
console.add("! No boot image found")
|
console.add("! No boot image found")
|
||||||
throw IOException()
|
throw IOException()
|
||||||
}
|
}
|
||||||
srcBoot = boot
|
|
||||||
} else {
|
|
||||||
srcBoot = initBoot
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return tarOut
|
return tarOut
|
||||||
@ -306,14 +305,13 @@ abstract class MagiskInstallImpl protected constructor(
|
|||||||
try {
|
try {
|
||||||
val newBoot = installDir.getChildFile("new-boot.img")
|
val newBoot = installDir.getChildFile("new-boot.img")
|
||||||
if (outStream is TarOutputStream) {
|
if (outStream is TarOutputStream) {
|
||||||
val name =
|
val name = with(srcBoot.path) {
|
||||||
if (srcBoot.path.contains("recovery")) {
|
when {
|
||||||
"recovery.img"
|
contains("recovery") -> "recovery.img"
|
||||||
} else if (srcBoot.path.contains("init_boot")) {
|
contains("init_boot") -> "init_boot.img"
|
||||||
"init_boot.img"
|
else -> "boot.img"
|
||||||
} else {
|
|
||||||
"boot.img"
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
outStream.putNextEntry(newTarEntry(name, newBoot.length()))
|
outStream.putNextEntry(newTarEntry(name, newBoot.length()))
|
||||||
}
|
}
|
||||||
newBoot.newInputStream().cleanPump(outStream)
|
newBoot.newInputStream().cleanPump(outStream)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user