mirror of
https://github.com/topjohnwu/Magisk
synced 2024-11-13 20:54:12 +01:00
Fix direct install on NAND devices
Co-authored-by: John Wu <topjohnwu@gmail.com>
This commit is contained in:
parent
02b2290b16
commit
ad94f10205
@ -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",
|
||||
|
@ -411,8 +411,8 @@ flash_image() {
|
||||
[ $img_sz -gt $blk_sz ] && return 1
|
||||
eval $CMD1 | eval $CMD2 | cat - /dev/zero > "$2" 2>/dev/null
|
||||
elif [ -c "$2" ]; then
|
||||
flash_eraseall "$2"
|
||||
eval $CMD1 | eval $CMD2 | nandwrite -p "$2" -
|
||||
flash_eraseall "$2" >&2
|
||||
eval $CMD1 | eval $CMD2 | nandwrite -p "$2" - >&2
|
||||
else
|
||||
ui_print "- Not block or char device, storing image"
|
||||
eval $CMD1 | eval $CMD2 > "$2" 2>/dev/null
|
||||
|
Loading…
Reference in New Issue
Block a user