How luoyesiqiu/dpt-shell works
dpt-shell is a command-line Android APK/AAB protection tool paired with a runtime shell. The main workflow accepts a package and options, transforms its DEX content, then rebuilds the package; the installed shell loads the protected app and reconstructs method code at runtime. The graph includes documented runtime risk checks and the component-factory path. Some native and packaging stages were not sampled in detail, so uncertain links are omitted or marked unverified.
Main entry points: AndroidPackage.java Package orchestrator · dpt.cpp DEX reconstruction · Dpt.java CLI options · DexUtils.java DEX processing
Components 24
Protection processor
- CLI options
dpt/src/main/java/com/luoye/dpt/Dpt.java - Protection config
dpt/src/main/java/com/luoye/dpt/config/ShellConfig.java - Class exclusions
dpt/src/main/java/com/luoye/dpt/config/ProtectRules.java - Package orchestrator
dpt/src/main/java/com/luoye/dpt/builder/AndroidPackage.java
DEX transformation
- DEX processing
dpt/src/main/java/com/luoye/dpt/util/DexUtils.java - Initializer injection
dpt/src/main/java/com/luoye/dpt/dex/ReflectionClinitInjector.java - String protection
dpt/src/main/java/com/luoye/dpt/dex/DexStringDecryptBuilder.java - Code model
dpt/src/main/java/com/luoye/dpt/model/Instruction.java
Package assembly
- APK builder
dpt/src/main/java/com/luoye/dpt/builder/Apk.java - AAB builder
dpt/src/main/java/com/luoye/dpt/builder/Aab.java - APK manifest editor
dpt/src/main/java/com/luoye/dpt/res/ApkManifestEditor.java - AAB manifest editor
dpt/src/main/java/com/luoye/dpt/res/AabManifestEditor.java - Protected package
Runtime shell
- Proxy application
shell/src/main/java/com/luoyesiqiu/shell/ProxyApplication.java - Component factory
shell/src/main/java/com/luoyesiqiu/shell/ProxyComponentFactory.java - JNI bridge
shell/src/main/java/com/luoyesiqiu/shell/JniBridge.java - Shell file utilities
shell/src/main/java/com/luoyesiqiu/shell/util/FileUtils.java
Native runtime
- DEX reconstruction
shell/src/main/cpp/dpt.cpp - Runtime hooks
shell/src/main/cpp/dpt_hook.cpp - Runtime risk checks
shell/src/main/cpp/dpt_risk.cpp - Native DEX model
shell/src/main/cpp/dex/MultiDexCode.cpp - Native utilities
shell/src/main/cpp/dpt_util.cpp
Other components
- Package operator
- Android runtime
Connections 27
- Package operator → CLI options: provides package and options
README.md - CLI options → Package orchestrator: starts protection
dpt/src/main/java/com/luoye/dpt/Dpt.java - CLI options → Protection config: sets options
- Package orchestrator → Protection config: uses settings
dpt/src/main/java/com/luoye/dpt/builder/AndroidPackage.java - Package orchestrator → Class exclusions: applies exclusions
dpt/src/main/java/com/luoye/dpt/builder/AndroidPackage.java - Package orchestrator → DEX processing: processes DEX
dpt/src/main/java/com/luoye/dpt/builder/AndroidPackage.java - DEX processing → Initializer injection: injects helpers
dpt/src/main/java/com/luoye/dpt/util/DexUtils.java - Initializer injection → String protection: uses string decrypt builder
dpt/src/main/java/com/luoye/dpt/dex/ReflectionClinitInjector.java - DEX processing → Code model: uses instruction model
dpt/src/main/java/com/luoye/dpt/util/DexUtils.java - Package orchestrator → APK builder: selects APK builder
dpt/src/main/java/com/luoye/dpt/Dpt.java - Package orchestrator → AAB builder: selects AAB builder
dpt/src/main/java/com/luoye/dpt/Dpt.java - APK builder → APK manifest editor: edits manifest
dpt/src/main/java/com/luoye/dpt/builder/Apk.java - AAB builder → AAB manifest editor: edits manifest
dpt/src/main/java/com/luoye/dpt/builder/Aab.java - APK builder → Protected package: builds output
- AAB builder → Protected package: builds output
- Protected package → Android runtime: installs and runs
- Android runtime → Proxy application: starts shell
- Android runtime → Component factory: dispatches components
- Proxy application → JNI bridge: calls native bridge
shell/src/main/java/com/luoyesiqiu/shell/ProxyApplication.java - Proxy application → Shell file utilities: extracts shell files
shell/src/main/java/com/luoyesiqiu/shell/ProxyApplication.java - Component factory → JNI bridge: loads shell library
shell/src/main/java/com/luoyesiqiu/shell/ProxyComponentFactory.java - Component factory → Shell file utilities: extracts libraries
shell/src/main/java/com/luoyesiqiu/shell/ProxyComponentFactory.java - JNI bridge → DEX reconstruction: invokes native runtime
- DEX reconstruction → Native DEX model: uses DEX structures
shell/src/main/cpp/dpt.cpp - DEX reconstruction → Native utilities: uses runtime utilities
shell/src/main/cpp/dpt.cpp - DEX reconstruction → Runtime hooks: dispatches hooks
- DEX reconstruction → Runtime risk checks: runs risk checks