Android应用打包器、保护器、混淆器及异常识别工具——Android版PEiD
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 3.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}] [-st] [-j]
[-o DIR] [-m] [--print-filter RULES] [--include-types]
[FILE ...]
APKiD - Android Application Identifier v3.2.0
positional arguments:
FILE apk, dex, or directory (default: None)
options:
-h, --help show this help message and exit
-v, --verbose log debug messages (default: False)
scanning:
-t TIMEOUT, --timeout TIMEOUT Yara scan timeout (in seconds) (default: 30)
-r, --recursive recurse into subdirectories (default: False)
--scan-depth SCAN_DEPTH how deep to go when scanning nested zips (default: 2)
--entry-max-scan-size ENTRY_MAX_SCAN_SIZE max zip entry size to scan in bytes, 0 = no limit
(default: 104857600)
--typing {magic,filename,none} method to decide which files to scan (default: magic)
-st, --scan-trackers scans for embedded trackers (default: False)
output:
-j, --json output scan results in JSON format (default: False)
-o DIR, --output-dir DIR write individual results here (implies --json)
(default: None)
-m, --print-matches print matched rules and strings to stdout (default:
False)
--print-filter RULES filter printed matches: comma-separated rule names to
include ('+' or no prefix) or exclude ('-' prefix).
Implies --print-matches. Use '=' when the value starts
with '-', e.g. --print-filter=-is_apk,-is_signed_apk
(default: )
--include-types include file type info for matched files (default:
False)
如果你遇到 APKiD 无法识别的 APK 或 DEX,请提交一个 GitHub issue 并告诉我们:
我们欢迎任何关于“值得检测的有趣内容”的想法,因此请不要仅限于加壳器、编译器或混淆器。如果有有趣的 anti-disassembler、anti-vm、anti-* 技巧,请提交 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 prep-release.py 要求已安装 yara-python 和 yara-python-dex 这两个包。
如果上述操作因本地机器及 Python 安装位置相关的权限错误而无法执行,请尝试指定 --user 标志。如果你未使用虚拟环境,则很可能需要这样做:
pip install -e .[dev,test] --user
如果你更新了任何规则,请务必运行 prep-release.py 重新编译它们。
如果你使用的是 Windows,请在编译前卸载任何先前版本的 Yara,并安装 Yara 3.11.0 和 yara-python-dex
pip uninstall -y yara-python yara-python-dex
pip install yara-python==3.11.0 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 以了解开发环境和测试环境的搭建方式以及测试的运行方式。
更新编译后的规则和 readme,构建软件包并上传至 PyPI:
./prep-release.py readme
rm -f dist/*
python setup.py sdist bdist_wheel
twine upload --repository-url https://upload.pypi.org/legacy/ dist/*
更多信息请参阅 Packaging Projects。