diff --git a/app/src/main/java/com/topjohnwu/magisk/MagiskManager.java b/app/src/main/java/com/topjohnwu/magisk/MagiskManager.java
index 0b41814b2..df9be7371 100644
--- a/app/src/main/java/com/topjohnwu/magisk/MagiskManager.java
+++ b/app/src/main/java/com/topjohnwu/magisk/MagiskManager.java
@@ -77,6 +77,7 @@ public class MagiskManager extends Application {
public int multiuserMode;
public int suResponseType;
public int suNotificationType;
+ public int suNamespaceMode;
// Global resources
public SharedPreferences prefs;
@@ -137,6 +138,7 @@ public class MagiskManager extends Application {
.putString("su_notification", String.valueOf(suNotificationType))
.putString("su_access", String.valueOf(suAccessState))
.putString("multiuser_mode", String.valueOf(multiuserMode))
+ .putString("mnt_ns", String.valueOf(suNamespaceMode))
.putString("busybox_version", BUSYBOX_VERSION)
.apply();
// Add busybox to PATH
@@ -164,6 +166,7 @@ public class MagiskManager extends Application {
if (isSuClient) {
suAccessState = suDB.getSettings(SuDatabaseHelper.ROOT_ACCESS, 3);
multiuserMode = suDB.getSettings(SuDatabaseHelper.MULTIUSER_MODE, 0);
+ suNamespaceMode = suDB.getSettings(SuDatabaseHelper.MNT_NS, 1);
}
}
diff --git a/app/src/main/java/com/topjohnwu/magisk/SettingsActivity.java b/app/src/main/java/com/topjohnwu/magisk/SettingsActivity.java
index a8f535d47..b14ff70c6 100644
--- a/app/src/main/java/com/topjohnwu/magisk/SettingsActivity.java
+++ b/app/src/main/java/com/topjohnwu/magisk/SettingsActivity.java
@@ -60,7 +60,7 @@ public class SettingsActivity extends Activity {
private SharedPreferences prefs;
private PreferenceScreen prefScreen;
- private ListPreference suAccess, autoRes, suNotification, requestTimeout, multiuserMode;
+ private ListPreference suAccess, autoRes, suNotification, requestTimeout, multiuserMode, namespaceMode;
private MagiskManager magiskManager;
@Override
@@ -80,6 +80,7 @@ public class SettingsActivity extends Activity {
requestTimeout = (ListPreference) findPreference("su_request_timeout");
suNotification = (ListPreference) findPreference("su_notification");
multiuserMode = (ListPreference) findPreference("multiuser_mode");
+ namespaceMode = (ListPreference) findPreference("mnt_ns");
setSummary();
@@ -182,6 +183,11 @@ public class SettingsActivity extends Activity {
case "multiuser_mode":
magiskManager.multiuserMode = Utils.getPrefsInt(prefs, "multiuser_mode", 0);
magiskManager.suDB.setSettings(SuDatabaseHelper.MULTIUSER_MODE, magiskManager.multiuserMode);
+ break;
+ case "mnt_ns":
+ magiskManager.suNamespaceMode = Utils.getPrefsInt(prefs, "mnt_ns", 1);
+ magiskManager.suDB.setSettings(SuDatabaseHelper.MNT_NS, magiskManager.suNamespaceMode);
+ break;
case "su_request_timeout":
magiskManager.suRequestTimeout = Utils.getPrefsInt(prefs, "su_request_timeout", 10);
break;
@@ -212,6 +218,8 @@ public class SettingsActivity extends Activity {
getString(R.string.request_timeout_summary, prefs.getString("su_request_timeout", "10")));
multiuserMode.setSummary(getResources()
.getStringArray(R.array.multiuser_summary)[magiskManager.multiuserMode]);
+ namespaceMode.setSummary(getResources()
+ .getStringArray(R.array.namespace_summary)[magiskManager.suNamespaceMode]);
}
}
diff --git a/app/src/main/java/com/topjohnwu/magisk/database/SuDatabaseHelper.java b/app/src/main/java/com/topjohnwu/magisk/database/SuDatabaseHelper.java
index b8f49916d..4c7945923 100644
--- a/app/src/main/java/com/topjohnwu/magisk/database/SuDatabaseHelper.java
+++ b/app/src/main/java/com/topjohnwu/magisk/database/SuDatabaseHelper.java
@@ -21,6 +21,7 @@ public class SuDatabaseHelper extends SQLiteOpenHelper {
public static final String ROOT_ACCESS = "root_access";
public static final String MULTIUSER_MODE = "multiuser_mode";
+ public static final String MNT_NS = "mnt_ns";
private static final int DATABASE_VER = 2;
private static final String POLICY_TABLE = "policies";
diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml
index 51092a10a..8eddee08b 100644
--- a/app/src/main/res/values/arrays.xml
+++ b/app/src/main/res/values/arrays.xml
@@ -61,4 +61,16 @@
- @string/user_indepenent_summary
+
+ - @string/settings_ns_global
+ - @string/settings_ns_requester
+ - @string/settings_ns_isolate
+
+
+
+ - @string/global_summary
+ - @string/requester_summary
+ - @string/isolate_summary
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index e2a8ae82b..b9e5439cd 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -175,6 +175,14 @@
Each user has its own separate root rules
A request has been sent to the device owner. Please switch to the owner and grant the permission
+ Mount Namespace Mode
+ Global Namespace
+ Requester Namespace
+ Isolated Namespace
+ All root sessions use the global mount namespace
+ Root sessions will use its requester\'s namespace
+ Each root session will have its own isolated namespace
+
App Development
Enable advanced debug logging
Check this to enable verbose logging
diff --git a/app/src/main/res/xml/app_settings.xml b/app/src/main/res/xml/app_settings.xml
index 182f2def9..af09ae9bb 100644
--- a/app/src/main/res/xml/app_settings.xml
+++ b/app/src/main/res/xml/app_settings.xml
@@ -58,6 +58,12 @@
android:entries="@array/multiuser_mode"
android:entryValues="@array/value_array" />
+
+