Improve install Magisk

This commit is contained in:
topjohnwu 2017-09-06 14:41:59 +08:00
parent 1c06b04c45
commit a1ba4fda6f
4 changed files with 7 additions and 2 deletions

View File

@ -166,7 +166,7 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
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<Void, Void, Boolean> {
// 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;

View File

@ -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,

View File

@ -212,5 +212,6 @@
<string name="restore_stock_boot">還原原廠 boot 映像</string>
<string name="restore_done">還原完成!</string>
<string name="restore_fail">原廠 boot 映像備份不存在!</string>
<string name="boot_file_patch_msg">選擇原廠 boot 映像備份;支援 .img 以及 .img.tar 格式</string>
</resources>

View File

@ -116,6 +116,7 @@
<string name="direct_install">Direct Install (Recommend)</string>
<string name="select_method">Select Method</string>
<string name="no_boot_file_patch_support">Target Magisk version doesn\'t support boot image file patching</string>
<string name="boot_file_patch_msg">Select stock boot image dump in .img or .img.tar format</string>
<string name="complete_uninstall">Complete Uninstall</string>
<string name="restore_stock_boot">Restore Stock Boot</string>
<string name="restore_done">Restoration done!</string>