Commit 98622654 authored by topjohnwu's avatar topjohnwu

Add Samsung RKP hexpatch back

parent 624b7616
...@@ -263,6 +263,40 @@ $BINDIR/busybox --install -s $TMPDIR/busybox ...@@ -263,6 +263,40 @@ $BINDIR/busybox --install -s $TMPDIR/busybox
rm -f $TMPDIR/busybox/su $TMPDIR/busybox/sh $TMPDIR/busybox/reboot rm -f $TMPDIR/busybox/su $TMPDIR/busybox/sh $TMPDIR/busybox/reboot
PATH=$TMPDIR/busybox:$PATH PATH=$TMPDIR/busybox:$PATH
##########################################################################################
# Magisk Image
##########################################################################################
# Fix SuperSU.....
$BOOTMODE && $BINDIR/magiskpolicy --live "allow fsck * * *"
if (is_mounted /data); then
IMG=/data/magisk.img
else
IMG=/cache/magisk.img
ui_print "- Data unavailable, use cache workaround"
fi
if [ -f $IMG ]; then
ui_print "- $IMG detected!"
else
ui_print "- Creating $IMG"
make_ext4fs -l 64M -a /magisk -S $COMMONDIR/file_contexts_image $IMG
fi
mount_image $IMG /magisk
if (! is_mounted /magisk); then
ui_print "! Magisk image mount failed..."
exit 1
fi
MAGISKLOOP=$LOOPDEVICE
# Core folders and scripts
mkdir -p $COREDIR/magiskhide $COREDIR/post-fs-data.d $COREDIR/service.d 2>/dev/null
cp -af $COMMONDIR/magiskhide/. $COREDIR/magiskhide
chmod -R 755 $COREDIR/magiskhide $COREDIR/post-fs-data.d $COREDIR/service.d
chown -R 0.0 $COREDIR/magiskhide $COREDIR/post-fs-data.d $COREDIR/service.d
########################################################################################## ##########################################################################################
# Unpack boot # Unpack boot
########################################################################################## ##########################################################################################
...@@ -371,7 +405,7 @@ case $? in ...@@ -371,7 +405,7 @@ case $? in
esac esac
########################################################################################## ##########################################################################################
# Ramdisk patch # Boot image patches
########################################################################################## ##########################################################################################
# All ramdisk patch commands are stored in a separate script # All ramdisk patch commands are stored in a separate script
...@@ -389,43 +423,17 @@ fi ...@@ -389,43 +423,17 @@ fi
rm -f ramdisk.cpio.orig rm -f ramdisk.cpio.orig
########################################################################################## ##########################################################################################
# Magisk Image # Repack and flash
########################################################################################## ##########################################################################################
# Fix SuperSU..... # Hexpatches
$BOOTMODE && $BINDIR/magiskpolicy --live "allow fsck * * *"
if (is_mounted /data); then
IMG=/data/magisk.img
else
IMG=/cache/magisk.img
ui_print "- Data unavailable, use cache workaround"
fi
if [ -f $IMG ]; then
ui_print "- $IMG detected!"
else
ui_print "- Creating $IMG"
make_ext4fs -l 64M -a /magisk -S $COMMONDIR/file_contexts_image $IMG
fi
mount_image $IMG /magisk
if (! is_mounted /magisk); then
ui_print "! Magisk image mount failed..."
exit 1
fi
MAGISKLOOP=$LOOPDEVICE
# Core folders and scripts # Remove Samsung RKP in stock kernel
mkdir -p $COREDIR/magiskhide $COREDIR/post-fs-data.d $COREDIR/service.d 2>/dev/null LD_LIBRARY_PATH=$SYSTEMLIB $BINDIR/bootimgtools --hexpatch kernel \
cp -af $COMMONDIR/magiskhide/. $COREDIR/magiskhide 49010054011440B93FA00F71E9000054010840B93FA00F7189000054001840B91FA00F7188010054 \
chmod -R 755 $COREDIR/magiskhide $COREDIR/post-fs-data.d $COREDIR/service.d A1020054011440B93FA00F7140020054010840B93FA00F71E0010054001840B91FA00F7181010054
chown -R 0.0 $COREDIR/magiskhide $COREDIR/post-fs-data.d $COREDIR/service.d
##########################################################################################
# Repack and flash
##########################################################################################
ui_print "- Repacking boot image"
LD_LIBRARY_PATH=$SYSTEMLIB $BINDIR/magiskboot --repack $BOOTIMAGE LD_LIBRARY_PATH=$SYSTEMLIB $BINDIR/magiskboot --repack $BOOTIMAGE
case $? in case $? in
......
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