APKiD 能告诉你一个 APK 是如何构建的。它可以识别多种编译器、加壳器、混淆器以及其他奇奇怪怪的东西。它是 Android 版的 PEiD。

关于此工具的更多用途,请参考:
pip install apkid
你也可以通过 Docker 运行 APKiD!当然,这需要你已安装 git 和 Docker。
使用 Docker 的方法如下:
git clone https://github.com/rednaga/APKiD
cd APKiD/
docker build . -t rednaga:apkid
docker/apkid.sh ~/reverse/targets/android/example/example.apk
[+] APKiD 2.1.0 :: from RedNaga :: rednaga.io
[*] example.apk!classes.dex
|-> compiler : dx
usage: apkid [-h] [-v] [-t TIMEOUT] [-r] [--scan-depth SCAN_DEPTH]
[--entry-max-scan-size ENTRY_MAX_SCAN_SIZE] [--typing {magic,filename,none}] [-j]
[-o DIR]
[FILE [FILE ...]]
APKiD - Android Application Identifier v2.1.2
positional arguments:
FILE apk, dex, or directory
optional arguments:
-h, --help show this help message and exit
-v, --verbose log debug messages
scanning:
-t TIMEOUT, --timeout TIMEOUT Yara scan timeout (in seconds)
-r, --recursive recurse into subdirectories
--scan-depth SCAN_DEPTH how deep to go when scanning nested zips
--entry-max-scan-size ENTRY_MAX_SCAN_SIZE max zip entry size to scan in bytes, 0 = no limit
--typing {magic,filename,none} method to decide which files to scan
output:
-j, --json output scan results in JSON format
-o DIR, --output-dir DIR write individual results here (implies --json)
如果你遇到一个 APKiD 无法识别的 APK 或 DEX,请提一个 GitHub issue 并告诉我们:
我们欢迎任何你想到的“有趣可检测”的概念,不必局限于加壳器、编译器或混淆器。如果有有趣的反反汇编、反虚拟机、反*技巧,也请提 issue。
欢迎提交 Pull Request。如果你提交新规则,请务必附上 APK / DEX 的文件哈希,以便我们验证规则。
本工具采用双许可证:商业许可证适用于闭源项目,GPL 许可证适用于开源软件。
请根据你的需求选择其中之一并遵守其政策。每种许可证类型的政策和协议详情见 LICENSE.COMMERCIAL 和 LICENSE.GPL 文件。
如果你想安装最新版以进行修改、开发自己的规则等,只需克隆本仓库、编译规则并以可编辑模式安装包:
git clone https://github.com/rednaga/APKiD
cd APKiD
python prep-release.py
pip install -e .[dev,test]
如果上述命令因本机权限问题(取决于 Python 安装位置)而失败,请尝试加上 --user 标志。如果你未使用虚拟环境,通常需要这么做:
pip install -e .[dev,test] --user
如果你更新了任何规则,请务必运行 prep-release.py 重新编译。
如果你使用 Windows,请在编译前安装 Yara 3.11.0 和 yara-python-dex:
pip install yara-python==3.11.0
pip install wheel
pip wheel --wheel-dir=yara-python-dex git+https://github.com/MobSF/yara-python-dex.git
pip install --no-index --find-links=yara-python-dex yara-python-dex
发布新版本时,请确保 apkid/init.py 中的版本号已更新。
关于运行测试,请查看 .travis.yml 了解开发和测试环境的搭建方式及测试运行方式。
更新编译后的规则、自述文件,构建包并上传至 PyPI:
./prep-release.py readme
rm -f dist/*
python setup.py sdist bdist_wheel
twine upload --repository-url https://upload.pypi.org/legacy/ dist/*
更多信息请参考 打包项目。