From a1ba4fda6ff7a8814f8e9ccba4522af4130708f4 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Wed, 6 Sep 2017 14:41:59 +0800 Subject: [PATCH] Improve install Magisk --- .../java/com/topjohnwu/magisk/asyncs/InstallMagisk.java | 6 ++++-- app/src/main/java/com/topjohnwu/magisk/utils/Utils.java | 1 + app/src/main/res/values-zh-rTW/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/asyncs/InstallMagisk.java b/app/src/main/java/com/topjohnwu/magisk/asyncs/InstallMagisk.java index e105c776a..018ec1715 100644 --- a/app/src/main/java/com/topjohnwu/magisk/asyncs/InstallMagisk.java +++ b/app/src/main/java/com/topjohnwu/magisk/asyncs/InstallMagisk.java @@ -166,7 +166,7 @@ public class InstallMagisk extends ParallelTask { shell.sh(mList, "cd " + install, "KEEPFORCEENCRYPT=" + mKeepEnc + " KEEPVERITY=" + mKeepVerity + " sh " + - "update-binary indep boot_patch.sh " + boot + " 2>&1" + + "update-binary indep boot_patch.sh " + boot + " && echo 'Success!' || echo 'Failed!'" ); @@ -213,8 +213,10 @@ public class InstallMagisk extends ParallelTask { // Finals getShell().sh_raw( + "cd " + install, "mv bin/busybox busybox", - "rm -rf bin *.img update-binary"); + "rm -rf bin *.img update-binary", + "cd /"); } catch (Exception e) { e.printStackTrace(); return false; diff --git a/app/src/main/java/com/topjohnwu/magisk/utils/Utils.java b/app/src/main/java/com/topjohnwu/magisk/utils/Utils.java index 69e2c9441..16ece3f54 100644 --- a/app/src/main/java/com/topjohnwu/magisk/utils/Utils.java +++ b/app/src/main/java/com/topjohnwu/magisk/utils/Utils.java @@ -354,6 +354,7 @@ public class Utils { mm.toast(R.string.no_boot_file_patch_support, Toast.LENGTH_LONG); return; } + mm.toast(R.string.boot_file_patch_msg, Toast.LENGTH_LONG); Intent intent = new Intent(Intent.ACTION_GET_CONTENT); intent.setType("*/*"); fragment.startActivityForResult(intent, SELECT_BOOT_IMG, diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 14d995105..5de99f01a 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -212,5 +212,6 @@ 還原原廠 boot 映像 還原完成! 原廠 boot 映像備份不存在! + 選擇原廠 boot 映像備份;支援 .img 以及 .img.tar 格式 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index bc5079604..b6dfcae2f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -116,6 +116,7 @@ Direct Install (Recommend) Select Method Target Magisk version doesn\'t support boot image file patching + Select stock boot image dump in .img or .img.tar format Complete Uninstall Restore Stock Boot Restoration done!