1
mirror of https://github.com/topjohnwu/Magisk synced 2024-10-21 06:31:56 +02:00

Properly handle KEEPVERITY and HIGHCOMP

This commit is contained in:
topjohnwu 2017-12-07 04:20:27 +08:00
parent baff9256c5
commit 942c870981
3 changed files with 9 additions and 5 deletions

2
app

@ -1 +1 @@
Subproject commit 96eaa833f561e645ba99f87ec9d376fc338b0861 Subproject commit c461fc6daa7096398f9227a10bcb4cec271cb5e7

View File

@ -88,7 +88,6 @@ case $? in
;; ;;
2 ) 2 )
ui_print "! Insufficient boot partition size detected" ui_print "! Insufficient boot partition size detected"
ui_print "- Enable high compression mode"
HIGHCOMP=true HIGHCOMP=true
;; ;;
3 ) 3 )
@ -104,6 +103,13 @@ case $? in
abort "! Stock kernel cannot be patched, please use a custom kernel" abort "! Stock kernel cannot be patched, please use a custom kernel"
esac 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 # Ramdisk restores
########################################################################################## ##########################################################################################
@ -139,8 +145,6 @@ esac
ui_print "- Patching ramdisk" ui_print "- Patching ramdisk"
[ -f /sdcard/ramdisk-recovery.img ] && HIGHCOMP=true
./magiskboot --cpio-add ramdisk.cpio 750 init magiskinit ./magiskboot --cpio-add ramdisk.cpio 750 init magiskinit
./magiskboot --cpio-backup ramdisk.cpio ramdisk.cpio.orig $HIGHCOMP $KEEPVERITY $KEEPFORCEENCRYPT $SHA1 ./magiskboot --cpio-backup ramdisk.cpio ramdisk.cpio.orig $HIGHCOMP $KEEPVERITY $KEEPFORCEENCRYPT $SHA1

View File

@ -123,7 +123,7 @@ if [ -f stock_boot* ]; then
is_mounted /data && mv stock_boot* /data is_mounted /data && mv stock_boot* /data
fi fi
patch_dtbo_image $KEEPVERITY || patch_dtbo_image
if [ -f stock_dtbo* ]; then if [ -f stock_dtbo* ]; then
rm -f /data/stock_dtbo* 2>/dev/null rm -f /data/stock_dtbo* 2>/dev/null