Use direct path

This commit is contained in:
topjohnwu
2017-11-09 00:03:37 +08:00
parent e171362e3e
commit 36025d6d9f
4 changed files with 17 additions and 7 deletions

View File

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