Wrap your Android app
in a shell.
Your original DEX is encrypted and hidden in assets, then restored at runtime by a StubApp and a native engine. Reverse engineers get a shell, not your code. One command runs decompile, encrypt, inject, align, and re-sign.
What it does
Six protections working together: your code is encrypted, the entry point is replaced, the runtime is guarded.
DEX encryption
The original classes.dex is packed, encrypted, and hidden in assets — no plaintext code remains in the APK. Custom stream cipher, a fresh random key per build.
Native engine
libjiaguo.so is the runtime engine across four ABIs. Decryption, integrity checks, and swapping back the real Application all happen in native code.
Shell loader
StubApp loads the .so in attachBaseContext, reads cls_key to derive the dexKey, restores the original DEX, and swaps the real entry back via RefInvoke.
Anti-debugging
Detects ptrace via TracerPid in /proc/self/status, and a watchdog thread catches timing drift — it exits on anomaly.
Environment detection
Flags root, Xposed / Substrate, HTTP proxy, VPN, app-cloning, USB debugging, and developer options.
Multi-scheme signing
Re-signs with apksig: JAR (v1) plus APK Signature Scheme v2 / v3, covering old and new Android.
Eight steps per run
From a raw APK to a hardened build — every step verified on a real APK.
Decompile
apktool unpacks the APK; extract DEX, resources, manifest.
Encrypt DEX
Original DEX encrypted with a random key, written to assets.
Build cls_key
dexKey / signa / init_pass metadata, encrypted as a whole.
Inject shell
StubApp shell DEX and libjiaguo.so placed into the package.
Rewrite Manifest
application entry replaced with the shell's StubApp.
Repack
apktool rebuilds to an unsigned APK.
Align
zipalign does 4-byte alignment.
Re-sign
apksig signs v1 / v2 / v3.
Technical spec
No black box. Encryption, keys, signing, and platforms are all here.
Encryption & keys
Packaging & platform
It actually works
We unshell a hardened APK with the tool's own algorithm — deriving the dexKey from cls_key, restoring the embedded encrypted DEX, and comparing it byte-for-byte with the original.
This is exactly what the shell (StubApp + libjiaguo.so) does at runtime on a real device — proving the chain is complete, the key system correct, and the original app recoverable.
Quick start
A Gradle project on JDK 21. Launch the GUI to pick an APK and keystore and hit start, or drive it from the command line.
↓ Prefer a prebuilt binary? Grab zhidun.exe or the cross-platform jar from the latest release — needs Java 21.
※ The tool looks for config.dll and tools/ in the working directory or next to the chosen APK. On Windows use apktool.bat + zipalign.exe; on Linux the extension-less versions.