This guide is for module authors and testers. For the exact API contract, see ADB Modules API reference.
ADB Modules are ZIP packages installed into Nightzuku private storage and executed through the active Nightzuku server.
- ADB-started Nightzuku: scripts run with ADB shell privileges.
- Root-started Nightzuku: scripts run with root privileges.
- Safe mode: manual actions only.
- Full access: allows stronger module behavior.
- Background actions: required before
service.shcan run.
This is a real module runner, not a visual stub. It installs ZIPs, parses metadata, stores module files, runs shell scripts through Nightzuku, opens local WebUI, tracks enabled state, deletes modules, and writes last-run logs.
It is not a Magisk/KSU systemless overlay implementation. There are no mount hooks,
no /data/adb/modules compatibility promise, and no long-running daemon supervisor yet.
Create this structure:
my-module/
├── module.prop
├── action.sh
└── webui/
└── index.html
module.prop:
id=my-module
name=My Module
version=1.0
versionCode=1
author=Author
description=Short module descriptionaction.sh:
#!/system/bin/sh
echo "module=$SHIZUKU_MODULE_ID"
echo "mode=$SHIZUKU_MODULE_MODE"
idPackage it:
cd my-module
zip -r ../my-module.zip .Install my-module.zip from the ADB Modules screen.
Banner:
banner.png
WebUI:
webui/index.html
Background/service hook:
service.sh
Custom paths can be declared in module.prop:
banner=assets/banner.webp
webui=webui
usesShellBridge=true
action=scripts/action.shusesShellBridge=true is mandatory for WebUI pages that need window.Shizuku.
Scripts run from the module directory. Use these variables:
MODDIR=/data/user/0/kerneldroid.nightzuku/files/adb_modules/<id>
ASH_STANDALONE=1
SHIZUKU_MODULE_ID=<id>
SHIZUKU_MODULE_MODE=safe|custom|full
SHIZUKU_MODULE_TRUSTED=0|1
SHIZUKU_MODULE_BACKGROUND=0|1Do not hardcode Magisk/KSU paths. Use $MODDIR.
Use action.sh for user-triggered commands.
Use service.sh for background setup. It runs when:
- The module is enabled.
- Access mode is Full, or Custom with Service enabled.
- Background actions are enabled in Settings.
- Nightzuku binder is available.
The manager auto-runs enabled services once per binder session.
Full Trust is a per-module override. Long-press a module card to toggle. Trusted modules bypass global policy gates while respecting core safety limits (timeouts, output caps).
- ZIP path traversal is rejected.
- Max entries:
2048. - Max extracted size:
200 MB. - Script timeout:
120 seconds. - Output retained: last
64 KBper stdout/stderr stream.
Timeout exit code is 124.
Logs are written inside the installed module directory:
logs/action-last.log
logs/service-last.log
Each log includes module id, script name, exit code, access mode, stdout, and stderr.
The repository includes:
test-modules/adb-test-module.zip
Use it to verify install, enable/disable, Action, Service, WebUI, and banner rendering.