Migrate PREINITDEVICE in recovery mode

Close #6917
This commit is contained in:
topjohnwu
2023-06-02 16:49:04 -07:00
parent 7eebe62bb6
commit feb44f875e
7 changed files with 23 additions and 44 deletions

View File

@ -104,7 +104,12 @@ case $((STATUS & 3)) in
1 ) # Magisk patched
ui_print "- Magisk patched image detected"
# Find SHA1 of stock boot image
SHA1=$(./magiskboot cpio ramdisk.cpio sha1 2>/dev/null)
./magiskboot cpio ramdisk.cpio "extract .backup/.magisk config.orig"
if [ -f config.orig ]; then
chmod 0644 config.orig
SHA1=$(grep_prop SHA1 config.orig)
rm config.orig
fi
BACKUPDIR=/data/magisk_backup_$SHA1
if [ -d $BACKUPDIR ]; then
ui_print "- Restoring stock boot image"