mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-11-06 17:52:36 +00:00
Update scripts
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user