Note
Verification Magisk Module Available
For verification and testing of system_shizuku features on existing devices, the Sui-Lite Magisk module is available. It is intended for verification and testing purposes only, not for production use.
A built-in, root-free, Shizuku-compatible system service for custom ROMs. Provides elevated IPC to authorised apps via a user-consent dialog — no ADB, Magisk, or Zygisk required.
system_shizuku/
│
├── Android.bp # Soong build rules
├── init.system_shizuku.rc # init.rc service definition
│
├── aidl/moe/shizuku/server/
│ ├── IShizukuService.aidl # Compatibility interface (v13)
│ └── IRemoteProcess.aidl # Process streams/lifecycle interface
│
├── external/Shizuku-API/ # Git submodule for client-side library
│
├── sepolicy/
│ ├── system_shizuku.te # Hardened SELinux domain
│ ├── service_contexts # Service labels ("shizuku")
│ └── file_contexts # File labels
│
├── service/
│ ├── src/com/android/systemshizuku/
│ │ ├── SystemShizukuServer.java # Entrypoint
│ │ ├── ShizukuCompatServiceImpl.java # compatibility layer
│ │ ├── RemoteProcessImpl.java # Process binder implementation
│ │ └── SystemShizukuServiceImpl.java # Internal logic
│
└── settings-integration/ # Settings app Special Access components
- Interface: Implements
moe.shizuku.server.IShizukuServiceexactly as the official Shizuku app. - Binder Name: Registered as
"shizuku"inServiceManager. - Version: Returns protocol version
13(Modern Shizuku support).
- Executes shell commands as the
systemuser (UID 1000). - Binary Compatibility: Apps like SAI, LSPosed, and Swift Backup can use
newProcess()to execute commands. - IRemoteProcess: Transparent stream access via
ParcelFileDescriptorforstdin,stdout, andstderr.
- Client-Death Cleanup: Uses
DeathRecipientto automatically kill child processes if the client app dies. - Resource Limits: Enforces global (64) and per-UID (8) concurrent process limits.
- Hardened I/O: Multi-stage
FileDescriptorextraction (Direct -> Reflected -> Field). - Security Auditing: Structured
Sloglogging of all executed commands (cmd, UID, pkg).
- Runs in a dedicated
system_shizukudomain. - Enforcing Ready: Includes
neverallowrules to prevent privilege escalation or unauthorized file access. - Modern Logging: Uses
logdmacros instead of direct device access.
Place this repository at packages/apps/SystemShizuku/.
Add the following to your device.mk:
PRODUCT_PACKAGES += \
SystemShizuku \
com.android.systemshizuku.xml \
privapp-permissions-systemshizuku.xml \
init.system_shizuku.rcEnsure the Shizuku-API submodule is initialized:
git submodule update --init --recursiveThe included external/Shizuku-API is patched for direct connection. Client apps can connect via ServiceManager without requiring ADB or a Background Provider:
// Example for client apps built with this library
if (Shizuku.pingService()) {
// Service found directly via ServiceManager
}- User Consent: permissions are only granted via the system-rendered
PermissionConsentActivity. - Signature Protection:
MANAGE_SYSTEM_SHIZUKUis restricted to platform-signed apps (Settings). - UID Validation: Every call is verified using
Binder.getCallingUid().