From c967e618a1b8301c4192196c63ecbdb0bb3bd322 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Mon, 13 Aug 2018 02:57:03 +0800 Subject: [PATCH] Adjustment to direct install --- .../java/com/topjohnwu/magisk/asyncs/InstallMagisk.java | 2 +- app/src/full/res/raw/utils.sh | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/full/java/com/topjohnwu/magisk/asyncs/InstallMagisk.java b/app/src/full/java/com/topjohnwu/magisk/asyncs/InstallMagisk.java index afbfb8eb4..a8ae8be61 100644 --- a/app/src/full/java/com/topjohnwu/magisk/asyncs/InstallMagisk.java +++ b/app/src/full/java/com/topjohnwu/magisk/asyncs/InstallMagisk.java @@ -278,7 +278,7 @@ public class InstallMagisk extends ParallelTask { break; case SECOND_SLOT_MODE: case DIRECT_MODE: - if (!Shell.su(Utils.fmt("direct_install %s %s %s", patched, mBoot, installDir)) + if (!Shell.su(Utils.fmt("direct_install %s %s", installDir, mBoot)) .to(console, logs).exec().isSuccess()) return false; if (!Data.keepVerity) diff --git a/app/src/full/res/raw/utils.sh b/app/src/full/res/raw/utils.sh index 89a89c272..f9fef56fa 100644 --- a/app/src/full/res/raw/utils.sh +++ b/app/src/full/res/raw/utils.sh @@ -57,15 +57,15 @@ direct_install() { rm -rf /data/adb/magisk/* 2>/dev/null mkdir -p /data/adb/magisk 2>/dev/null chmod 700 /data/adb - cp -rf $3/* /data/adb/magisk + cp -rf $1/* /data/adb/magisk + rm -rf /data/adb/magisk/new-boot.img echo "- Flashing new boot image" - flash_image $1 $2 + flash_image $1/new-boot.img $2 if [ $? -ne 0 ]; then echo "! Insufficient partition size" return 1 fi - rm -f $1 - rm -rf $3 + rm -rf $1 return 0 }