Small improvements and bug fixes

This commit is contained in:
topjohnwu 2017-03-12 19:22:15 +08:00
parent 8833d21ac3
commit c421e45fa0
3 changed files with 12 additions and 16 deletions

View File

@ -196,7 +196,7 @@ static void cpio_test(vector *v) {
vec_for_each(v, f) { vec_for_each(v, f) {
if (strcmp(f->filename, "sbin/launch_daemonsu.sh") == 0) { if (strcmp(f->filename, "sbin/launch_daemonsu.sh") == 0) {
if (!ret) ret = 2; if (!ret) ret = 2;
} else if (strcmp(f->filename, "magisk") == 0) { } else if (strcmp(f->filename, "init.magisk.rc") == 0) {
ret = 1; ret = 1;
break; break;
} }

View File

@ -198,12 +198,8 @@ getvar KEEPVERITY
getvar KEEPFORCEENCRYPT getvar KEEPFORCEENCRYPT
getvar BOOTIMAGE getvar BOOTIMAGE
if [ -z "$KEEPVERITY" ]; then [ -z $KEEPVERITY ] && KEEPVERITY=false
KEEPVERITY=false [ -z $KEEPFORCEENCRYPT ] && KEEPFORCEENCRYPT=false
fi
if [ -z "$KEEPFORCEENCRYPT" ]; then
KEEPFORCEENCRYPT=false
fi
# Check if system root is installed and remove # Check if system root is installed and remove
remove_system_su remove_system_su
@ -229,13 +225,13 @@ fi
ui_print "- Device platform: $ARCH" ui_print "- Device platform: $ARCH"
BINDIR=$INSTALLER/$ARCH BINDIR=$INSTALLER/$ARCH
chmod -R 755 $CHROMEDIR/futility $BINDIR chmod -R 755 $CHROMEDIR $BINDIR
SYSTEMLIB=/system/lib SYSTEMLIB=/system/lib
$IS64BIT && SYSTEMLIB=/system/lib64 $IS64BIT && SYSTEMLIB=/system/lib64
find_boot_image find_boot_image
if [ -z "$BOOTIMAGE" ]; then if [ -z $BOOTIMAGE ]; then
ui_print "! Unable to detect boot image" ui_print "! Unable to detect boot image"
exit 1 exit 1
fi fi
@ -258,6 +254,7 @@ chmod -R 755 $MAGISKBIN
chcon -h u:object_r:system_file:s0 $MAGISKBIN $MAGISKBIN/* chcon -h u:object_r:system_file:s0 $MAGISKBIN $MAGISKBIN/*
# Temporary busybox for installation # Temporary busybox for installation
rm -rf $TMPDIR/busybox 2>/dev/null
mkdir -p $TMPDIR/busybox mkdir -p $TMPDIR/busybox
$BINDIR/busybox --install -s $TMPDIR/busybox $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
@ -457,8 +454,8 @@ esac
# Sign chromeos boot # Sign chromeos boot
if [ -f chromeos ]; then if [ -f chromeos ]; then
cp -af $CHROMEDIR/. $MAGISKBIN/chromeos cp -af $CHROMEDIR/. $MAGISKBIN/chromeos
echo " " > config echo > config
echo " " > bootloader echo > bootloader
LD_LIBRARY_PATH=$SYSTEMLIB $CHROMEDIR/futility vbutil_kernel --pack new-boot.img.signed --keyblock $CHROMEDIR/kernel.keyblock --signprivate $CHROMEDIR/kernel_data_key.vbprivk --version 1 --vmlinuz new-boot.img --config config --arch arm --bootloader bootloader --flags 0x1 LD_LIBRARY_PATH=$SYSTEMLIB $CHROMEDIR/futility vbutil_kernel --pack new-boot.img.signed --keyblock $CHROMEDIR/kernel.keyblock --signprivate $CHROMEDIR/kernel_data_key.vbprivk --version 1 --vmlinuz new-boot.img --config config --arch arm --bootloader bootloader --flags 0x1
rm -f new-boot.img rm -f new-boot.img
mv new-boot.img.signed new-boot.img mv new-boot.img.signed new-boot.img

View File

@ -114,12 +114,11 @@ esac
# Sign chromeos boot # Sign chromeos boot
if [ -f chromeos ]; then if [ -f chromeos ]; then
cp -af $CHROMEDIR/. $MAGISKBIN/chromeos
echo > config echo > config
echo > bootloader echo > bootloader
LD_LIBRARY_PATH=$SYSTEMLIB $CHROMEDIR/futility vbutil_kernel --pack new-boot.img.signed --keyblock $CHROMEDIR/kernel.keyblock --signprivate $CHROMEDIR/kernel_data_key.vbprivk --version 1 --vmlinuz new-boot.img --config config --arch arm --bootloader bootloader --flags 0x1 LD_LIBRARY_PATH=$SYSTEMLIB $CHROMEDIR/futility vbutil_kernel --pack stock_boot.img.signed --keyblock $CHROMEDIR/kernel.keyblock --signprivate $CHROMEDIR/kernel_data_key.vbprivk --version 1 --vmlinuz stock_boot.img --config config --arch arm --bootloader bootloader --flags 0x1
rm -f new-boot.img rm -f stock_boot.img
mv new-boot.img.signed new-boot.img mv stock_boot.img.signed stock_boot.img
fi fi
ui_print_wrapper "- Flashing stock/reverted image" ui_print_wrapper "- Flashing stock/reverted image"