Commit 942c8709 authored by topjohnwu's avatar topjohnwu

Properly handle KEEPVERITY and HIGHCOMP

parent baff9256
Subproject commit 96eaa833f561e645ba99f87ec9d376fc338b0861
Subproject commit c461fc6daa7096398f9227a10bcb4cec271cb5e7
......@@ -88,7 +88,6 @@ case $? in
;;
2 )
ui_print "! Insufficient boot partition size detected"
ui_print "- Enable high compression mode"
HIGHCOMP=true
;;
3 )
......@@ -104,6 +103,13 @@ case $? in
abort "! Stock kernel cannot be patched, please use a custom kernel"
esac
if [ -f /sdcard/ramdisk-recovery.img ]; then
HIGHCOMP=true
ui_print "- Detected ramdisk-recovery.img"
fi
$HIGHCOMP && ui_print "- Enable high compression mode"
##########################################################################################
# Ramdisk restores
##########################################################################################
......@@ -139,8 +145,6 @@ esac
ui_print "- Patching ramdisk"
[ -f /sdcard/ramdisk-recovery.img ] && HIGHCOMP=true
./magiskboot --cpio-add ramdisk.cpio 750 init magiskinit
./magiskboot --cpio-backup ramdisk.cpio ramdisk.cpio.orig $HIGHCOMP $KEEPVERITY $KEEPFORCEENCRYPT $SHA1
......
......@@ -123,7 +123,7 @@ if [ -f stock_boot* ]; then
is_mounted /data && mv stock_boot* /data
fi
patch_dtbo_image
$KEEPVERITY || patch_dtbo_image
if [ -f stock_dtbo* ]; then
rm -f /data/stock_dtbo* 2>/dev/null
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment