MagiskSU (su) Developer Reference
Developer reference for MagiskSU (the su binary), Magisk's isolated, multi-user privilege elevation daemon. Covers command-line arguments, Mount Master mode (--mount-master), socket IPC, and programmatic root execution.
MagiskSU Security Architecture
MagiskSU communicates with the central magiskd daemon via a secure UNIX domain socket (/data/adb/magisk/magisk64). The client process passes the calling application's UID and PID to the daemon, which verifies authorization against SQLite settings (/data/adb/magisk.db), transitions SELinux domain to u:r:magisk:s0, and forks the elevated shell.
CLI Command Syntax & Flags
Understanding Mount Master Mode (--mount-master / -M)
On Android, every application and process runs within an isolated Linux Mount Namespace. Standard mounts executed in normal su are invisible to other apps. Using su --mount-master (or su -M) forces the root shell into the root init namespace, granting full access to all dynamic storage mounts, loop devices, and external SD cards.
Programmatic Root Integration for Android Apps
To execute root commands reliably within Android applications via Java/Kotlin:
Related Guides & Next Steps
Explore interconnected tutorials, module guides, and developer references related to this topic:
Zygisk C++ Module Dev
ZygiskExecute privileged companion tasks over UNIX domain sockets.
BusyBox for Android NDK
ModuleInstall POSIX command-line toolchain for root shell scripting.
Technical Documentation
DocsComprehensive MagiskSU daemon architecture and socket IPC.
Verified against official upstream repository topjohnwu/Magisk on Magisk v30.7 (February 23, 2026).