Update to use new paths

This commit is contained in:
topjohnwu 2017-11-22 14:03:08 +08:00
parent 7273a1c34d
commit f520fe36bd
3 changed files with 14 additions and 7 deletions

View File

@ -130,10 +130,7 @@ public class SettingsActivity extends Activity implements Topic.Subscriber {
.setPositiveButton(R.string.ok, (d, i) -> {
prefs.edit().putString(Const.Key.CUSTOM_CHANNEL, url.getText().toString()).apply();
})
.setNegativeButton(R.string.close, (d, i) -> {
mm.updateChannel = Const.Value.STABLE_CHANNEL;
prefs.edit().putString(Const.Key.UPDATE_CHANNEL, String.valueOf(Const.Value.STABLE_CHANNEL)).apply();
})
.setNegativeButton(R.string.close, null)
.show();
}
return true;

View File

@ -24,11 +24,20 @@ public class Const {
public static final String MAGISK_DISABLE_FILE = "/cache/.disable_magisk";
public static final String TMP_FOLDER_PATH = "/dev/tmp";
public static final String MAGISK_LOG = "/cache/magisk.log";
public static final String BUSYBOX_PATH = "/dev/magisk/bin";
public static final File EXTERNAL_PATH = new File(Environment.getExternalStorageDirectory(), "MagiskManager");
public static String BUSYBOX_PATH() {
if (Utils.itemExist("/sbin/.core/busybox/busybox")) {
return "/sbin/.core/busybox";
} else {
return "/dev/magisk/bin";
}
}
public static String MAGISK_PATH() {
if (Utils.itemExist("/dev/magisk/img")) {
if (Utils.itemExist("/sbin/.core/img")) {
return "/sbin/.core/img";
} else if (Utils.itemExist("/dev/magisk/img")) {
return "/dev/magisk/img";
} else {
return "/magisk";

View File

@ -89,8 +89,9 @@ public class Shell {
}
// Root shell initialization
String bbpath = Const.BUSYBOX_PATH();
mm.shell.run_raw(false, false,
"export PATH=" + Const.BUSYBOX_PATH + ":$PATH",
"export PATH=" + bbpath + ":$PATH",
"mount_partitions",
"find_boot_image",
"migrate_boot_backup");