Skip to content

Commit 805a900

Browse files
committed
Run libsu commands inside the global mount namespace
This ensures we're able to access other app's internal storage directories using libsu when running on Android 11 or newer.
1 parent 1f2e45f commit 805a900

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/src/main/java/com/beemdevelopment/aegis/AegisApplication.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import com.beemdevelopment.aegis.vault.VaultManagerException;
3030
import com.mikepenz.iconics.Iconics;
3131
import com.mikepenz.material_design_iconic_typeface_library.MaterialDesignIconic;
32+
import com.topjohnwu.superuser.Shell;
3233

3334
import java.util.ArrayList;
3435
import java.util.Collections;
@@ -43,6 +44,11 @@ public class AegisApplication extends Application {
4344
private static final String CODE_LOCK_STATUS_ID = "lock_status_channel";
4445
private static final String CODE_LOCK_VAULT_ACTION = "lock_vault";
4546

47+
static {
48+
// to access other app's internal storage directory, run libsu commands inside the global mount namespace
49+
Shell.Config.setFlags(Shell.FLAG_MOUNT_MASTER);
50+
}
51+
4652
@Override
4753
public void onCreate() {
4854
super.onCreate();

0 commit comments

Comments
 (0)