ADB Modules are ZIP packages installed into Nightzuku private app storage and executed through the currently active Nightzuku server. If Nightzuku is running from ADB, module scripts run with ADB shell privileges. If Nightzuku is running from root, scripts run with root privileges.
This is not a root overlay system. It is a Nightzuku-backed module runner for actions, WebUI, service hooks, and controlled ADB/root shell access.
A module is a .zip file with module.prop at the ZIP root.
module.zip
├── module.prop
├── banner.png
├── action.sh
├── service.sh
└── webui/
└── index.html
All paths must be relative. Absolute paths and .. traversal are rejected during install.
Required fields:
id=my-module
name=My Module
version=1.0
versionCode=1
author=Author
description=Short descriptionOptional fields:
banner=banner.png
webui=webui
action=action.shRules:
idmust match[A-Za-z][A-Za-z0-9._-]{1,63}.bannercan point to.png,.jpg,.jpeg, or.webp.- If
banneris omitted, Nightzuku checksbanner.png,banner.jpg,banner.jpeg, thenbanner.webp. - If
webuiis omitted, Nightzuku checkswebroot,webui, thenweb. - WebUI is available only when
<webui>/index.htmlexists. actiondefaults toaction.sh.service.shis detected automatically.
Install flow:
- User selects a module ZIP with Android file picker.
- Nightzuku copies it into cache.
- Nightzuku validates
module.prop. - Nightzuku extracts into a staging directory.
- Nightzuku rejects unsafe paths.
- Nightzuku marks
.shfiles executable. - Nightzuku replaces any existing module with the same
id. - Nightzuku stores the module under app-private storage.
Safety limits:
- Max ZIP entries:
2048. - Max extracted size:
200 MB. - Script output retained in memory/log: last
64 KBper stream. - Script timeout:
120 seconds.
Scripts run through Nightzuku server process creation. The command is:
sh /path/to/module/action.shor:
sh /path/to/module/service.shWorking directory is the module directory.
Environment variables:
MODDIR=/data/user/0/kerneldroid.nightzuku/files/adb_modules/<id>
ASH_STANDALONE=1
SHIZUKU_MODULE_ID=<id>
SHIZUKU_MODULE_MODE=safe|full
SHIZUKU_MODULE_BACKGROUND=0|1Use MODDIR for all module-local files. Do not assume root paths such as /data/adb/modules.
action.sh is a manual user action launched from the module card.
Action result:
- stdout/stderr are shown in a dialog.
- Last output is written to
logs/action-last.loginside the module directory. - Timeout (120s) returns exit code
124.
Minimal action.sh:
#!/system/bin/sh
echo "module=$SHIZUKU_MODULE_ID"
idservice.sh is the background hook.
Execution policy:
- Safe mode: Blocked.
- Full access mode: Allowed if "Allow background actions" is enabled.
- Service scripts run once per Nightzuku binder session.
- Last output is written to
logs/service-last.log. - Timeout (120s) returns exit code
124.
WebUI is loaded from webui/index.html.
Current WebView policy:
- JavaScript, DOM storage, and local file access enabled.
- Network access blocked unless Custom/Full mode enables it.
window.Shizukuis exposed for enabled module-local WebUI if policy allows.
The window.Shizuku object allows WebUI to interact with the shell.
const info = JSON.parse(window.Shizuku.getModuleInfo());
console.log(info.id); // e.g. "my-module"
console.log(info.enabled); // trueconst result = JSON.parse(window.Shizuku.exec("id"));
if (result.ok) {
console.log(result.stdout);
}Advanced execution:
const result = JSON.parse(window.Shizuku.execWithOptions("pwd", JSON.stringify({
timeoutSeconds: 30,
cwd: "webui"
})));Rules:
stdinis limited to 64 KB.- stdout/stderr return the last 64 KB per stream.
cwdmust be within the module directory.
Full Trust is a per-module override. Long-press a module card to toggle.
Trusted modules:
- Bypass global Action/Service/Background/WebUI gates.
- Skip ReCommand prompts.
- Can use
download()and WebView internet together.
window.Shizuku.download(url, relativeWebPath) downloads HTTPS assets to the module WebUI root.
- Max file size: 20 MB.
- Cannot overwrite
index.html.
Disabling creates a disable file in the module directory, blocking actions and services. Deleting removes the entire module directory.
The repository includes a test module:
test-modules/adb-test-module.zip
It contains:
module.propbanner.pngaction.shservice.shwebui/index.html
Expected action output includes the current UID, SDK version, module id, and module mode.
Implemented:
- ZIP install.
- Module metadata parsing.
- Path traversal protection.
- Size and entry limits.
- Enable/disable/delete.
- Banner rendering.
- WebUI rendering.
- HTTPS WebUI asset loading.
- WebUI HTTPS file download into the module WebUI root.
- Manual
action.sh. - Policy-gated
service.sh. - One service run per Nightzuku binder session.
- Last action/service logs.
- Direct JavaScript-to-shell bridge with optional timeout/stdin/cwd/env.
Not implemented:
- Systemless filesystem overlays.
- Magisk/KSU mount semantics.
- Long-running service supervision.
Those are separate features and should not be implied by the current ADB module API.