Duck ToolBox is a KernelSU module scaffold for modular Android utilities.
Current tool set:
RKP Workbench: profile persistence, CSR generation, certificate fetch,keybox.xmlexport, and CSR verificationDevice ID Provisioner: Rust-based Qualcomm Keymaster device ID workbench with default auto-fill, advanced overrides, and provisioning reports
Core layout:
duckd/: Rust backendduckd/src/runtime/: shared runtime concerns such as paths, profile storage, JSON envelopes, errorsduckd/src/features/rkp/: RKP-specific feature modulesduckd/src/features/device_ids/: built-in Device ID Provisioner feature, including default detection and Qualcomm Keymaster provisioning logicduckd/src/shared/: reusable parsing helpers such as Android XML decodingui/: WebUI sourcemodule/: KernelSU module payload, including scripts, binaries, and built WebUI assetsmodule/webroot/: built KernelSU WebUI assetsmodule/bin/duckctl.sh: thin wrapper that forwards WebUI requests toduckdmodule/service.sh: boot-time repair for runtime directories and backend permissions
CLI shape:
duckd rkp profile show --jsonduckd rkp profile save --stdin-json --jsonduckd rkp profile clear --jsonduckd rkp info --jsonduckd rkp provision --jsonduckd rkp keybox --jsonduckd rkp verify <csr-file> --jsonduckd device-ids defaults --jsonduckd device-ids provision --stdin-json --jsonduckd artifacts list --json
Runtime paths:
- Android module runtime data:
/data/adb/duck-toolbox/var/ - Saved profile:
/data/adb/duck-toolbox/var/profile.toml - Saved secrets:
/data/adb/duck-toolbox/var/profile.secrets.toml - Outputs:
/data/adb/duck-toolbox/var/outputs/ - Temporary files:
/data/adb/duck-toolbox/var/tmp/ - Logs:
/data/adb/duck-toolbox/var/logs/
Runtime robustness notes:
module/customize.shandmodule/service.shrepair runtime directories and sensitive file permissions at install time and on boot.- Existing
var/data is migrated out of the module directory into/data/adb/duck-toolbox/var/, so module updates no longer wipe saved profiles and generated files. - Relative
var/...paths now resolve inside the shared Duck ToolBox data directory on Android, while other relative paths still stay under the module root. - RKP requests now validate required device fields before any network call, which makes profile mistakes fail early with clearer errors.
- Device ID provisioning now lives fully in
duckd/src/features/device_ids/; the WebUI auto-fills common fields from the current Android runtime and keeps uncommon options under an advanced section.
Windows environment setup:
- PowerShell 7+
- Rust stable via
rustup - Rust target
aarch64-linux-android cargo-ndk- Node.js 22+
pnpm10+- Android NDK r29 at
C:\Development\Android\NDK\android-ndk-r29
Recommended one-time setup:
rustup target add aarch64-linux-android
cargo install cargo-ndk --locked
npm install --global pnpmSet the Android NDK location for the current PowerShell session:
$env:ANDROID_NDK_ROOT = "C:\Development\Android\NDK\android-ndk-r29"
$env:ANDROID_NDK_HOME = $env:ANDROID_NDK_ROOT
$env:ANDROID_NDK = $env:ANDROID_NDK_ROOTRecommended local build flow:
cd duckd
cargo test --target x86_64-pc-windows-msvc
cargo ndk -t arm64-v8a build --release
cd ..\ui
pnpm install --frozen-lockfile
pnpm build
cd ..
# Package a local module zip after the Android backend build
pwsh .\scripts\package-module.ps1Windows one-step build script:
pwsh ./scripts/build.ps1The script:
- uses
C:\Development\Android\NDK\android-ndk-r29by default - builds the Rust Android backend with
cargo ndk -t arm64-v8a build --release - installs WebUI dependencies with
pnpm install --frozen-lockfile - builds the WebUI into
module/webroot/
Optional module packaging in the same run:
pwsh ./scripts/build.ps1 -PackageModuleBuild outputs:
- Rust Android binary:
duckd/target/aarch64-linux-android/release/duckd - WebUI bundle:
module/webroot/ - Optional module archive:
dist/duck-toolbox-<version>.zip
RKP note:
- The WebUI now opens in
HW Key + KDF Labelmode by default. A blank profile still stays logically unset until you provide real key material.
Release note:
update.jsonintentionally ships with empty URLs. Fill in real release endpoints before publishing updates through KernelSU.