Fix direct install on NAND devices

Co-authored-by: John Wu <topjohnwu@gmail.com>
This commit is contained in:
Chris Renshaw
2020-06-01 02:08:13 -07:00
committed by topjohnwu
parent 02b2290b16
commit ad94f10205
2 changed files with 12 additions and 2 deletions

View File

@@ -239,6 +239,12 @@ abstract class MagiskInstallImpl : FlashResultListener {
}
private fun patchBoot(): Boolean {
var srcNand = ""
if ("[ -c $srcBoot ] && nanddump -f boot.img $srcBoot".sh().isSuccess) {
srcNand = srcBoot
srcBoot = File(installDir, "boot.img").path
}
var isSigned = false
try {
SuFileInputStream(srcBoot).use {
@@ -258,6 +264,10 @@ abstract class MagiskInstallImpl : FlashResultListener {
return false
}
if (srcNand.isNotEmpty()) {
srcBoot = srcNand
}
val job = Shell.sh(
"./magiskboot cleanup",
"mv bin/busybox busybox",