Use direct path
This commit is contained in:
parent
e171362e3e
commit
36025d6d9f
@ -218,12 +218,12 @@ public class SettingsActivity extends Activity implements Topic.Subscriber {
|
||||
enabled = prefs.getBoolean(Const.Key.HOSTS, false);
|
||||
if (enabled) {
|
||||
Shell.su_raw(
|
||||
"cp -af /system/etc/hosts " + Const.MAGISK_HOST_FILE,
|
||||
"mount -o bind " + Const.MAGISK_HOST_FILE + " /system/etc/hosts");
|
||||
"cp -af /system/etc/hosts " + Const.MAGISK_HOST_FILE(),
|
||||
"mount -o bind " + Const.MAGISK_HOST_FILE() + " /system/etc/hosts");
|
||||
} else {
|
||||
Shell.su_raw(
|
||||
"umount -l /system/etc/hosts",
|
||||
"rm -f " + Const.MAGISK_HOST_FILE);
|
||||
"rm -f " + Const.MAGISK_HOST_FILE());
|
||||
}
|
||||
break;
|
||||
case Const.Key.ROOT_ACCESS:
|
||||
|
@ -112,7 +112,7 @@ public class SplashActivity extends Activity {
|
||||
.putBoolean(Const.Key.DARK_THEME, mm.isDarkTheme)
|
||||
.putBoolean(Const.Key.MAGISKHIDE, mm.magiskHide)
|
||||
.putBoolean(Const.Key.UPDATE_NOTIFICATION, mm.updateNotification)
|
||||
.putBoolean(Const.Key.HOSTS, Utils.itemExist(Const.MAGISK_HOST_FILE))
|
||||
.putBoolean(Const.Key.HOSTS, Utils.itemExist(Const.MAGISK_HOST_FILE()))
|
||||
.putBoolean(Const.Key.DISABLE, Utils.itemExist(Const.MAGISK_DISABLE_FILE))
|
||||
.putBoolean(Const.Key.SU_REAUTH, mm.suReauth)
|
||||
.putString(Const.Key.SU_REQUEST_TIMEOUT, String.valueOf(mm.suRequestTimeout))
|
||||
|
@ -11,7 +11,7 @@ import java.util.List;
|
||||
public class LoadModules extends ParallelTask<Void, Void, Void> {
|
||||
|
||||
private List<String> getModList() {
|
||||
String command = "ls -d " + Const.MAGISK_PATH + "/* | grep -v lost+found";
|
||||
String command = "ls -d " + Const.MAGISK_PATH() + "/* | grep -v lost+found";
|
||||
return Shell.su(command);
|
||||
}
|
||||
|
||||
|
@ -20,12 +20,22 @@ public class Const {
|
||||
|
||||
// Paths
|
||||
public static final String MAGISK_DISABLE_FILE = "/cache/.disable_magisk";
|
||||
public static final String MAGISK_HOST_FILE = "/magisk/.core/hosts";
|
||||
public static final String TMP_FOLDER_PATH = "/dev/tmp";
|
||||
public static final String MAGISK_PATH = "/magisk";
|
||||
public static final String MAGISK_LOG = "/cache/magisk.log";
|
||||
public static final String BUSYBOXPATH = "/dev/magisk/bin";
|
||||
|
||||
public static String MAGISK_PATH() {
|
||||
if (Utils.itemExist("/dev/magisk/img")) {
|
||||
return "/dev/magisk/img";
|
||||
} else {
|
||||
return "/magisk";
|
||||
}
|
||||
}
|
||||
|
||||
public static String MAGISK_HOST_FILE() {
|
||||
return MAGISK_PATH() + "/.core/hosts";
|
||||
}
|
||||
|
||||
/* A list of apps that should not be shown as hide-able */
|
||||
public static final List<String> SN_BLACKLIST = Arrays.asList(
|
||||
"android",
|
||||
|
Loading…
Reference in New Issue
Block a user