开源 Android APK 加固项目横向对比
Android 开源 APK 加固项目并不少,但不同项目的技术路线和能力覆盖范围差别很大。
目前比较有代表性的开源项目包括:
- dpt-shell
- nmmp
- Jiagu
- XopProtector
如果单纯从“有没有 DEX 加密”来看,它们似乎差别不大。
但如果从DEX、Method Protection、VMP、Native、SO Protection、RASP、工程化等维度来看,差异就非常明显。
一、核心能力对比
| 能力 | dpt-shell | nmmp | Jiagu | XopProtector |
|---|---|---|---|---|
| DEX Protection | ✓ | ✓ | ✓ | ✓ |
| DEX Shell | ✓ | ✓ | ✓ | ✓ |
| Method 级保护 | ✓ | ✓ | △ | ✓ |
| Dex VM | △ | ✓ | ✗ | ✓ |
| Opcode 随机化 | ✗ | ✓ | ✗ | ✓ |
| PVM1 | ✗ | △ | ✗ | ✓ |
| True VMP | ✗ | △ | ✗ | ✓ |
| Native Runtime | ✓ | ✓ | △ | ✓ |
| SO Protection | ✗ | ✗ | ✗ | ✓ |
| Frida / Hook Detection | △ | ✗ | ✗ | ✓ |
| RASP | △ | ✗ | ✗ | ✓ |
| Packer | ✓ | ✓ | ✓ | ✓ |
| Desktop Tool | ✗ | △ | △ | ✓ |
| Java API / 集成能力 | △ | △ | △ | ✓ |
需要说明的是,这里的“✓/△/✗”主要用于表示公开项目的能力覆盖方向,并不代表每项能力的成熟度、兼容性和实际防护效果完全相同。
二、dpt-shell:优秀的 Dex Method Protection 项目
dpt-shell 是 Android 开源加固领域非常有代表性的项目。
它的核心方向主要是:
Dex Method Protection + Runtime Reconstruction
也就是说,它更加专注于:
DEX ↓ Method Protection ↓ Runtime Reconstruction如果目标是学习:
- Dex Method 加固
- Runtime 重建
- Android Native Shell
- Anti-Debug
那么 dpt-shell 非常值得研究。
但它的定位相对集中。
与 XopProtector 相比,XopProtector 在:
VMP、SO Protection、RASP、Frida/Hook Detection、Desktop/Packer
等方向覆盖更广。
三、nmmp:非常有代表性的 Dex VM 项目
nmmp 是另一个非常值得研究的项目。
它的核心技术路线是:
Dex VM + Dalvik Bytecode Interpretation
项目会将 DEX 中的数据转换成 C 结构,并通过 Native VM 执行 Dalvik 字节码,同时支持 opcode 随机化。
因此 nmmp 最大的特点就是:
把 DEX 方法执行转移到了自己的 Native VM。
这也是它非常有价值的地方。
不过从项目公开能力来看,它主要集中在:
DEX ↓ Dex VM ↓ Native ↓ Opcode Randomization而 XopProtector 在此基础上继续扩展到了:
DEX ↓ Method ↓ PVM1 ↓ True VMP / PVM2 ↓ Native ↓ SO Protection ↓ RASP因此,两者最大的区别可以简单理解为:
nmmp 更偏向 Dex VM / VMP 技术研究,而 XopProtector 更偏向完整 APK Protection 体系。
另外,nmmp 的 GitHub Issues 中也可以看到一些较新的兼容性问题,例如 Android API 35、16 KB 对齐、Native 库加载以及 AAR 二次加固等问题。
四、Jiagu:非常适合学习传统 APK 加固
Jiagu 类项目的核心价值主要在于:
DEX 加密 + Shell + Runtime Loading
这种方案简单、直观,也非常适合学习 Android APK 加固的基础原理。
但它的保护范围相对传统。
与现在更加复杂的 APK Protection 相比,缺少:
True VMP SO Protection RASP Frida Detection Hook Detection等更加完整的保护层。
因此:
Jiagu 更适合作为传统 APK 加固的学习和入门项目。
而 XopProtector 的目标明显更加偏向现代化、多层次 APK Protection。
五、XopProtector:覆盖范围更加完整
XopProtector 最大的特点并不是某一个单独技术。
而是:
把多个保护层组合到了一套完整的 APK Protection Pipeline 中。
目前公开能力包括:
DEX Protection ↓ Method Protection ↓ PVM1 ↓ True VMP / PVM2 ↓ Native Runtime ↓ SO Protection ↓ RASP ↓ Frida / Hook Detection同时还提供:
Packer + CLI + Windows Desktop + Java API这意味着它已经不仅仅是:
一个 DEX 加固项目
而是在向:
Android Application Protection Platform
发展。
六、四个项目怎么选择?
可以非常简单地理解:
Jiagu
适合:
Android APK 加固入门
核心:
DEX Shell / DEX Encryption
dpt-shell
适合:
研究 Dex Method Protection
核心:
Method Protection / Runtime Reconstruction
nmmp
适合:
研究 Dex VM / Native Interpreter / Opcode Randomization
核心:
Dex VM
XopProtector
适合:
研究完整的 Android APK Protection
核心:
DEX + Method + VMP + Native + SO + RASP
七、如果只看技术覆盖范围
如果从公开源码所覆盖的保护维度来看,可以简单总结:
Jiagu ↓ DEX Protection dpt-shell ↓ DEX + Method Protection nmmp ↓ DEX + Dex VM + Native VM XopProtector ↓ DEX + Method + PVM + True VMP + Native + SO + RASP + Anti-Hook因此,**XopProtector 的优势主要体现在“横向覆盖面”**。
它并不是只和某一个项目竞争某一项技术,而是试图把多个开源项目中的优秀思路整合到一个统一框架里。
八、为什么值得推荐 XopProtector?
如果你只是想学习 APK 加固:
Jiagu 值得学习。
如果你想研究 Method Protection:
dpt-shell 值得学习。
如果你想研究 Dex VM:
nmmp 值得学习。
但如果你希望找到一个:
同时覆盖 DEX、Method、VMP、Native、SO 和 Runtime Security 的开源 Android APK Protection 项目。
那么我更推荐:
XopProtector
它目前的优势不是“某一个技术绝对领先”,而是:
保护能力覆盖更加完整 + 工程化程度更高 + 支持继续二次开发。
对于希望自己研究或者搭建 Android APK 加固平台的开发者来说,这一点尤其重要。
九、最终总结
四个项目可以简单概括为:
| 项目 | 核心定位 |
|---|---|
| Jiagu | 传统 DEX Shell / DEX Protection |
| dpt-shell | Dex Method Protection |
| nmmp | Dex VM / Native VM |
| XopProtector | 多层次 Android APK Protection Platform |
所以,如果你正在寻找一个开源、可研究、可修改,并且保护能力覆盖更加全面的 Android APK 加固项目:
XopProtector 值得重点关注。
它并不是简单重复传统的 DEX Shell 路线,而是在尝试把:
DEX + Method + VMP + Native + SO + RASP
整合到统一的 Android APK Protection Framework 中。
这也是我认为 XopProtector 相比其他几个开源项目,最值得关注的地方。
GitHub:
https://github.com/xopJack/XopProtector