Update scripts

This commit is contained in:
topjohnwu
2019-02-24 02:11:11 -05:00
parent 0f46493477
commit defbbdfe21
9 changed files with 74 additions and 87 deletions

View File

@@ -215,7 +215,7 @@ public abstract class MagiskInstaller {
// Patch boot image
if (!Shell.sh(Utils.fmt("cd %s; KEEPFORCEENCRYPT=%b KEEPVERITY=%b " +
"sh update-binary indep boot_patch.sh %s",
"sh update-binary sh boot_patch.sh %s",
installDir, Config.keepEnc, Config.keepVerity, srcBoot))
.to(console, logs).exec().isSuccess())
return false;
@@ -245,7 +245,7 @@ public abstract class MagiskInstaller {
.to(console, logs).exec().isSuccess())
return false;
if (!Config.keepVerity)
Shell.su("find_dtbo_image", "patch_dtbo_image").to(console, logs).exec();
Shell.su("patch_dtbo_image").to(console, logs).exec();
return true;
}

View File

@@ -16,7 +16,7 @@ import androidx.annotation.NonNull;
public class RootUtils extends Shell.Initializer {
public static void rmAndLaunch(String rm, String launch) {
Shell.su(Utils.fmt("(rm_launch %d %s %s)&", Const.USER_ID, rm, launch)).exec();
Shell.su(Utils.fmt("(rm_launch %s %s)&", rm, launch)).exec();
}
@Override

View File

@@ -1,18 +1,18 @@
env_check() {
for file in busybox magisk magiskboot magiskinit util_functions.sh boot_patch.sh; do
[ -f /data/adb/magisk/$file ] || return 1
[ -f $MAGISKBIN/$file ] || return 1
done
return 0
}
fix_env() {
cd /data/adb/magisk
cd $MAGISKBIN
local OLDPATH="$PATH"
PATH=/sbin:/system/bin:/vendor/bin
sh update-binary extract
sh update-binary -x
PATH="$OLDPATH"
./busybox rm -f /sbin/.magisk/busybox/*
/sbin/.magisk/mirror/bin/busybox --install -s /sbin/.magisk/busybox
./busybox rm -f $MAGISKTMP/busybox/*
$MAGISKTMP/mirror/bin/busybox --install -s $MAGISKTMP/busybox
rm -f update-binary magisk.apk
cd /
}
@@ -31,11 +31,11 @@ run_migrations() {
}
direct_install() {
rm -rf /data/adb/magisk/* 2>/dev/null
mkdir -p /data/adb/magisk 2>/dev/null
chmod 700 /data/adb
cp -rf $1/* /data/adb/magisk
rm -rf /data/adb/magisk/new-boot.img
rm -rf $MAGISKBIN/* 2>/dev/null
mkdir -p $MAGISKBIN 2>/dev/null
chmod 700 $NVBASE
cp -af $1/. $MAGISKBIN
rm -f $MAGISKBIN/new-boot.img
echo "- Flashing new boot image"
flash_image $1/new-boot.img $2
if [ $? -ne 0 ]; then
@@ -47,12 +47,7 @@ direct_install() {
}
mm_patch_dtbo() {
if $KEEPVERITY; then
return 1
else
find_dtbo_image
patch_dtbo_image
fi
$KEEPVERITY && return 1 || patch_dtbo_image
}
restore_imgs() {
@@ -114,8 +109,7 @@ EOF
}
rm_launch() {
db_clean $1
pm uninstall $2
am start -n ${3}/a.c
pm uninstall $1
am start -n ${2}/a.c
exit
}