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