Verification-oriented Magisk module that faithfully reproduces
Shizuku4CustomROMbehavior and makes SELinux interactions explicitly observable.
Caution
This module is for debugging, auditing, and behavioral verification only. It is NOT intended for production use. It does not harden, optimize, or stealth-persist any functionality.
Sui-Lite exists to:
- Reproduce
Shizuku4CustomROMbehavior via Magisk overlay - Build the APK from upstream sources (deterministic, auditable)
- Register a custom Binder service via
app_processfor verification - Observe SELinux domain transitions, file contexts, and AVC denials
- Verify that runtime state matches upstream policy expectations
- Release automatically via GitHub Actions with full audit artifacts
This module does NOT:
- Inject custom SELinux allow rules
- Set SELinux to permissive
- Modify upstream code
- Suppress or hide AVC denials
| Upstream repository | github.com/zerofrip/Shizuku4CustomROM |
| Original author | zerofrip / The Shizuku4CustomROM Project |
| License | Apache License 2.0 |
| Upstream code location | upstream/Shizuku4CustomROM/ (git submodule, unmodified) |
The upstream source is tracked as a git submodule at upstream/Shizuku4CustomROM/.
No upstream file is renamed, merged, split, or modified.
Sui-Lite/
├── module.prop # Magisk module metadata
├── service.sh # Magisk service phase (Binder launch & observation)
├── post-fs-data.sh # Magisk post-fs-data phase (overlay verification)
├── README.md # This file
├── .gitmodules # Submodule definition
│
├── upstream/ # Upstream source (git submodule)
│ └── Shizuku4CustomROM/ # https://github.com/zerofrip/Shizuku4CustomROM
│ ├── Android.bp
│ ├── init.system_shizuku.rc
│ ├── aidl/
│ ├── sepolicy/
│ ├── service/
│ ├── permissions/
│ ├── settings-integration/
│ └── external/Shizuku-API/ # Nested submodule
│
├── overlay/ # Magisk overlay mount paths
│ └── system/
│ ├── priv-app/SystemShizuku/ # APK deployment target
│ ├── etc/permissions/ # Permission XMLs (from upstream)
│ └── etc/init/ # init.rc (from upstream)
│
├── binder-service/ # Custom Binder service registration
│ ├── src/ # Java sources (no dependencies)
│ ├── build.sh # DEX JAR compiler script
│ └── README.md # Binder-specific documentation
│
├── build/ # APK build pipeline
│ ├── build_apks.sh # Deterministic APK build script
│ ├── env_check.sh # Build environment validator
│ ├── README.build.md # Build documentation
│ └── libs/ # Jetpack dependencies (downloaded)
│
├── audit/ # SELinux observation & verification
│ ├── scripts/ # Capture & verification scripts
│ │ ├── capture_contexts.sh
│ │ ├── capture_denials.sh
│ │ ├── verify_domains.sh
│ │ └── capture_binder_contexts.sh
│ ├── selinux/ # Example audit output
│ │ ├── contexts.before.txt
│ │ ├── contexts.after.txt
│ │ ├── denials.log
│ │ ├── domain.map
│ │ └── binder_contexts.txt
│ └── upstream/ # Upstream diff reports (CI-generated)
│
└── .github/workflows/ # CI/CD automation
├── upstream-sync.yml # Upstream submodule tracking
└── build-and-release.yml # APK build + module ZIP + GitHub Release
| Trigger | Manual dispatch or weekly (Monday 06:00 UTC) |
| Action | Updates upstream/Shizuku4CustomROM/ submodule, syncs overlay files, generates diff |
| Output | Commit with updated submodule ref + audit/upstream/upstream_diff.txt |
| Trigger | Push to main (upstream/overlay/build changes) or manual dispatch |
| Action | Detect changes → Build APK → Assemble Magisk ZIP → Create GitHub Release |
| Tag format | sui-lite-<upstream_commit_hash> |
| Release body | Verbatim upstream commit message + module metadata |
Each release includes:
| Artifact | Description |
|---|---|
Sui-Lite-*.zip |
Flashable Magisk module |
apk_hashes.txt |
SHA256 hashes of all APKs |
rebuilt_apks.json |
Build metadata (JSON) |
deployment_tree.txt |
Full module file tree |
upstream_diff.txt |
Changes from upstream (if synced) |
build_manifest.txt |
Build environment details |
Two build modes are supported:
| Mode | Command | Signing | Binder Registration |
|---|---|---|---|
| AOSP tree | ./build/build_apks.sh --aosp --deploy |
Platform key | ✅ Works |
| Standalone | ./build/build_apks.sh --standalone --deploy |
Debug key | ❌ Structural only |
# Check build environment
./build/env_check.sh
# Build and deploy to overlay
./build/build_apks.sh --standalone --deployWarning
Debug-signed APKs cannot register Binder services because they lack
android.uid.system. The standalone build is for structural verification only.
For full functional testing, use the AOSP tree build with platform signing.
For standalone builds, you need a framework stub for hidden API access:
adb pull /system/framework/framework.jar build/framework-stub.jarSee build/README.build.md for full documentation.
- Download the latest
Sui-Lite-*.zipfrom Releases - Flash via Magisk Manager → Modules → Install from storage
- Reboot
git clone --recurse-submodules https://github.com/zerofrip/Sui-Lite.git
cd Sui-Lite
# Option A: Use a pre-built platform-signed APK
cp /path/to/SystemShizuku.apk overlay/system/priv-app/SystemShizuku/
# Option B: Build from source (debug-signed)
./build/build_apks.sh --standalone --deploy
# Create flashable ZIP
zip -r ../Sui-Lite.zip . -x '.git/*' 'upstream/Shizuku4CustomROM/.git/*' 'build/out/*'| Component | Minimum Version |
|---|---|
| Rooted Android device | Android 11+ |
| Magisk | v26+ |
| SELinux | Enforcing (recommended) |
Important
The module is designed to operate under SELinux Enforcing mode. AVC denials are expected and intentionally captured for analysis.
All audit output is written to /data/local/tmp/sui-lite/ on the device.
/data/local/tmp/sui-lite/
├── post-fs-data.log # post-fs-data phase log
├── service.log # service phase log
├── contexts.before.txt # SELinux contexts before activation
├── contexts.after.txt # SELinux contexts after activation
├── denials.log # AVC denial capture
├── domain.map # Domain verification results (PASS/FAIL/SKIP)
└── binder_contexts.txt # Binder registration & context audit
# Capture SELinux file contexts
adb shell sh /data/adb/modules/sui-lite/audit/scripts/capture_contexts.sh "manual" /data/local/tmp/sui-lite
# Capture AVC denials
adb shell sh /data/adb/modules/sui-lite/audit/scripts/capture_denials.sh /data/local/tmp/sui-lite
# Verify domains
adb shell sh /data/adb/modules/sui-lite/audit/scripts/verify_domains.sh /data/local/tmp/sui-lite
# Audit Binder contexts
adb shell sh /data/adb/modules/sui-lite/audit/scripts/capture_binder_contexts.sh /data/local/tmp/sui-lite
# Pull results
adb pull /data/local/tmp/sui-lite/ ./audit-results/SELinux file contexts for all system_shizuku-relevant paths. Diff to see what changed after module activation:
diff contexts.before.txt contexts.after.txtAVC denials filtered for system_shizuku / shizuku. These document
exactly what policy rules are required. Use them to generate targeted
sepolicy.rule entries — do NOT suppress them.
PASS/FAIL/SKIP results for each verification check:
- PASS — runtime state matches upstream expectation
- FAIL — mismatch detected (investigate)
- SKIP — component not available (service not started, APK missing)
Contains details about the custom Binder service (sui_lite_binder):
- Registration status: Whether ServiceManager accepted the registration.
- Process identity: PID, UID, GID, and SELinux domain of the process.
- Relevant denials: AVC denials specifically filtered for Binder registration.
Expected behavior: Registration is expected to FAIL under Enforcing mode without custom policy, but the process should remain alive for inspection.
Debug-signed APKs are useful for structural and flow verification but have a significant limitation: they cannot register fully functional Binder services. This is because they lack the android.uid.system shared UID, which is required by ServiceManager for privileged service registration.
Important
Full Binder functionality and registration of shizuku / system_shizuku services require a platform-signed APK built from an AOSP tree.
This flow confirms that the Magisk module's lifecycle, overlay mounting, and process launching are working as intended.
-
Build in Debug Mode Compile the Sui-Lite module components with standalone/debug configurations:
./build/build_apks.sh --standalone --deploy ./binder-service/build.sh
-
Install & Reboot Flash the generated ZIP via Magisk Manager and reboot the device.
-
Monitor service.sh Execution
service.shruns automatically on boot. Check its execution flow:adb shell tail -f /data/local/tmp/sui-lite/service.log
Look for:
init service 'shizuku': RUNNINGVISIBLE: /system/priv-app/SystemShizuku context=...Launching Binder service...
-
Verify Process & Contexts Check if the
binder-service.jarprocess is running and inspect its SELinux domain:adb shell pidof com.suilite.binder.BinderEntryPoint adb shell cat /data/local/tmp/sui-lite/binder_contexts.txt
-
Audit SELinux Denials Even if registration fails, the audit logs will confirm the domain transition and the exact reason for the failure:
adb shell grep -i "sui_lite" /data/local/tmp/sui-lite/denials.log
This flow ensures that the module infrastructure is verified and functional, serving as a baseline before deploying platform-signed components.
- Enforcing mode is the default. The module observes real constraints.
- No policy injection. No
sepolicy.rulefile is included. - AVC denials are informational. They tell you what rules upstream requires.
- Domain transitions require device-level policy. The upstream
init.rcspecifiesseclabel u:r:system_shizuku:s0— the device's SELinux policy must define this type.
Key files in upstream/Shizuku4CustomROM/ for SELinux analysis:
| File | Purpose |
|---|---|
sepolicy/system_shizuku.te |
Type declarations, allow rules, neverallow rules |
sepolicy/file_contexts |
File path → label mapping |
sepolicy/service_contexts |
Binder service → label mapping |
init.system_shizuku.rc |
Service definition with seclabel |
service/AndroidManifest.xml |
Permissions and component declarations |
This module packages upstream code under the Apache License 2.0. See the upstream repository for full license text.
All files in upstream/Shizuku4CustomROM/ are copyright their original authors.
The Magisk integration layer (module.prop, service.sh, post-fs-data.sh,
build/, audit/scripts/, .github/workflows/) is released under the same license.