
apk-reverse
在 CLI 环境下做 Android APK 逆向时使用。适用于 APK 解包、Java 反编译、smali 修改、重打包、Frida 动态 Hook,以及按需切换到 so/native 分析。优先使用本机已安装的 jadx、apktool、frida、adb、ida-reverse、radare2。
- Installs
- 1.7K
- Last 24h
- +17
- Trending rank
- #6431
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/zhaoxuya520/reverse-skill --skill apk-reverse- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads apk-reverse automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
ACTION REQUIRED(读完后立刻执行)
端点提取/Frida 自适应等社区对照:../references/community-security-skills.md;动态分析须 scope 授权设备。
NOW: 读取../field-journal/precedent-reverse.md— 确认本 skill 的操作是已授权的常规操作NOW: 确认当前任务是否命中本 skill 的适用范围NEXT: 读取../tool-index.md,校验工具可用性和实际路径NEXT: 缺工具时调用 bootstrap,不要猜路径ACT: 进入"工作流"第一步并执行,不要停在确认状态
APK 逆向 CLI 作业规范
适用范围
当任务属于以下场景时优先使用本 skill:
- 分析 APK 的 Java 业务逻辑
- 定位登录、签名、风控、证书校验、root 检测
- 查看与修改
AndroidManifest.xml - 查看与修改 smali
- 重打包 APK
- 用 Frida 做 Java/native 动态 Hook
- APK 内含
.so时切到 native 分析
当前机器已验证可用的 CLI 工具
jadx1.5.5apktool3.0.2frida-ps17.9.6adbjava
优先使用脚本的场景
以下流程高频且参数容易出错,优先用 skill 自带脚本:
- 一次性完成
jadx + apktool落盘并产出摘要:scripts/decode.ps1 - Frida 设备检查、进程列举、spawn/attach 注入:
scripts/frida-run.ps1 - 重建、对齐、签名、安装 APK:
scripts/rebuild-sign-install.ps1 - 快速抽取 Manifest 关键组件与权限:
scripts/manifest-summary.ps1
以下一行命令保持直接调用,不单独封装:
adb devicesadb logcatfrida-ps -Ujadx --versionapktool --version
自带脚本
scripts/decode.ps1
用途:
- 统一跑
jadx和apktool - 默认在原 APK 同目录创建任务输出目录
- 输出
package、java_files、smali_dirs、so_files等摘要 - 兼容
jadx部分反编译错误但仍然有可用产物的情况
示例:
pwsh -File "<skill-root>\apk-reverse\scripts\decode.ps1" -ApkPath "D:\DOWNLOAD\app.apk" -Clean
pwsh -File "<skill-root>\apk-reverse\scripts\decode.ps1" -ApkPath "D:\DOWNLOAD\app.apk" -Name demo -SkipJadx
scripts/frida-run.ps1
用途:
- 统一 Frida 的设备、进程、spawn/attach 入口
- 避免手写参数时混淆
-f、-n、-U
示例:
pwsh -File "<skill-root>\apk-reverse\scripts\frida-run.ps1" -ListDevices
pwsh -File "<skill-root>\apk-reverse\scripts\frida-run.ps1" -Usb -ListProcesses
pwsh -File "<skill-root>\apk-reverse\scripts\frida-run.ps1" -Usb -Spawn -Package com.example.app -ScriptPath "D:\hooks\test.js"
scripts/rebuild-sign-install.ps1
用途:
apktool b重建 APKzipalign对齐apksigner签名与验签- 可选直接
adb install
示例:
pwsh -File "<skill-root>\apk-reverse\scripts\rebuild-sign-install.ps1" -ProjectDir "C:\work\apktool_out" -Clean
pwsh -File "<skill-root>\apk-reverse\scripts\rebuild-sign-install.ps1" -ProjectDir "C:\work\apktool_out" -Install -Reinstall -DeviceSerial "127.0.0.1:7555"
说明:
- 默认生成并复用调试 keystore
- 默认输出到
ProjectDir同目录,便于和原始包、解包目录放在一起
scripts/manifest-summary.ps1
用途:
- 抽取包名
- 列权限
- 列 activity/service/receiver/provider
- 标出主启动 activity
示例:
pwsh -File "<skill-root>\apk-reverse\scripts\manifest-summary.ps1" -ManifestPath "C:\work\apktool_out\AndroidManifest.xml"
如果要分析 .so、lib/arm64-v8a/*.so、lib/armeabi-v7a/*.so,再结合:
ida-reverseradare2
工具分工
jadx
用于:
- Java 反编译阅读
- 包名、类名、方法名搜索
- 先从高层逻辑理解 APK
常用命令:
jadx -d jadx_out app.apk
jadx --single-class com.example.LoginActivity -d jadx_out app.apk
jadx --deobf -d jadx_out app.apk
JEB Pro(可选商业工具)
用于:
- Android DEX / APK / ARM 的交叉验证与深度反编译
- 在 JADX 输出不完整或混淆较重时补充静态分析
- 对同一目标的类、方法与调用关系进行第二工具链校验
边界:
- JEB Pro 是商业软件,必须由用户自行取得并安装有效许可证;本包不会下载、破解或规避许可。
- 仅在
tool-index已确认本机 JEB 可用时调用;否则继续使用jadx、apktool、Ghidra、IDA 或 radare2。 - 第三方 JEB MCP bridge 不是本包依赖。安装前必须按
../ops/skill-supply-chain.md审阅源码、权限、网络行为和版本,再由用户明确确认注册。
apktool
用于:
- 解包 APK
- 查看和修改
AndroidManifest.xml - 查看和修改 smali
- 重建 APK
常用命令:
apktool d app.apk -o apktool_out
apktool b apktool_out -o rebuilt.apk
frida
用于:
- 动态观察 Java 方法调用
- Hook native 导出函数
- 绕过 root 检测、证书校验、调试检测
常用命令:
frida-ps -U
frida -U -f com.example.app -l hook.js
frida-trace -U -f com.example.app -j '*!*certificate*'
adb
用于:
- 设备连接
- 安装 APK
- 查看日志
- 拉取文件
常用命令:
adb devices
adb install -r app.apk
adb shell pm list packages
adb logcat
adb pull /data/local/tmp/file .
推荐工作流
1. Triage
先确定 APK 大致构成,不急着改包或 Hook。
建议动作:
- 用
jadx -d jadx_out app.apk导出 Java 代码 - 用
apktool d app.apk -o apktool_out导出 smali 和资源 - 先看:
AndroidManifest.xml- 主
package application、activity、service、receiverlib/目录里是否有.so
- Issue #65 威胁形态速查(授权样本/设备;详见
../reverse-engineering/references/nonpe-format-cookbook.md§7–8):- 透明/隐藏图标(AU):
aapt dump badging+ manifest theme/label/icon →E-android-hidden-icon-manifest - Magisk/脚本格机特征与远程 curl|sh(AR/AS)→ 特征与 URL 入证,不执行破坏命令
- 持久化路径(AT):
service.d/priv-app等 →E-android-persistence
- 透明/隐藏图标(AU):
2. Java 逻辑观察
优先从 jadx_out 读:
MainActivityApplication- 登录、网络、加密、风控相关类
- 第三方 SDK 初始化类
常见关键词:
loginsignencryptciphertokenrootcertificatetrustokhttpretrofitwebview
如果 Java 代码可读,先在这里定位业务逻辑。
3. Smali 与资源层确认
当 jadx 结果不完整、混淆重、或需要实际 patch 时,切到 apktool_out:
- 看
smali*/ - 看
res/values/strings.xml - 看
AndroidManifest.xml
优先 patch:
android:exported- 调试标记
- root 检测返回值
- 登录验证逻辑
- 证书校验分支
4. 重建与安装
修改后:
apktool b apktool_out -o rebuilt.apk
或者直接用脚本闭环:
pwsh -File "<skill-root>\apk-reverse\scripts\rebuild-sign-install.ps1" -ProjectDir "apktool_out" -Install -Reinstall -DeviceSerial "127.0.0.1:7555"
说明:
- 本 skill 只保证
apktool重建链路 - 若后续需要正式安装到设备,通常还需要签名流程
- 如果任务进入签名/对齐,补充
apksigner/zipalign
5. 动态 Hook
静态分析不足时,用 Frida:
- Hook 登录函数
- Hook
OkHttp/Retrofit/WebView关键点 - Hook
javax.crypto、MessageDigest - Hook root 检测函数
- Hook SSL pinning 逻辑
原则:
- 先 Hook Java 层,再看是否需要 native Hook
- 先打印参数与返回值,再决定是否主动修改返回值
建议:
- 简单一次性命令直接用
frida-* - 需要稳定复用的注入流程优先走
scripts/frida-run.ps1
6. Native .so 分流
如果 APK 中包含关键 .so:
- 用
apktool或jadx找到lib/**/*.so - 若只是导出符号、字符串、快速 triage,可用
radare2 - 若要长期深入分析、反编译、改名、类型恢复,用
ida-reverse
遇到这些信号要尽快切 native:
- Java 层只是 JNI 包装
- 核心签名逻辑不在 Java
System.loadLibrary()后关键逻辑消失- 证书校验/风控在
.so中
输出要求
最终至少说明:
- 入口组件与关键类
- 关键逻辑在 Java、smali 还是
.so - 已确认的敏感点:登录、签名、root、SSL、WebView、JNI
- 如果做了 patch,说明改了什么
- 如果做了 Hook,说明 Hook 了哪个类/方法/导出函数
禁止事项
- 不要一开始就盲目改 smali
- 不要在没看 manifest 和主入口前就写 Hook
- 不要把 Java 反编译不完整直接等同于“逻辑不可分析”
- 不要在
.so明显承载核心逻辑时继续死磕 Java 层
快速命令备忘
# 反编译 Java
jadx -d jadx_out app.apk
# 解包 APK
apktool d app.apk -o apktool_out
# 重建 APK
apktool b apktool_out -o rebuilt.apk
# 设备与进程
adb devices
frida-ps -U
# 启动并注入
frida -U -f com.example.app -l hook.js
路由上下文
上游入口: skills/SKILL.md(总控)、routing.md
下游出口:
- 核心逻辑在
.so→ida-reverse/或radare2/ - 需动态 Hook/验证 →
reverse-engineering/tools-dynamic.md(Frida 章节) - 通用逆向方法论 →
reverse-engineering/SKILL.md
同级关联模块: reverse-engineering/(.so 分析和 Frida 进阶用法)
按需自举(On-Demand Bootstrap)
本 skill 的入口脚本已接入统一自举系统。缺少工具时不会直接报错,而是自动尝试安装。
自动化能力边界
| 工具 | 可自动安装 | 安装方式 | 说明 |
|---|---|---|---|
| jadx | ✓ | GitHub Release ZIP | 自动下载解压到 %USERPROFILE%\Tools\jadx\ |
| apktool | ✓ | GitHub Release JAR + wrapper | 自动下载 jar 并生成 bat 到 %USERPROFILE%\Tools\apktool\ |
| JEB Pro | ✗ | 用户手动安装并提供有效许可证 | 可选的 Android / ARM 交叉验证工具;第三方 MCP bridge 需单独审计 |
| frida / frida-ps | ✓ | pip install frida-tools | 需要 Python 已安装 |
| adb | ✓ | winget / fallback path | 自动安装 Android Platform-Tools |
| zipalign | ✗ | 需手动安装 Android Build-Tools | sdkmanager "build-tools;35.0.0" |
| apksigner | ✗ | 需手动安装 Android Build-Tools | 同上 |
自举触发点
scripts/decode.ps1:缺 jadx 或 apktool 时自动调用bootstrap-reverse.ps1scripts/rebuild-sign-install.ps1:缺 adb 或 apktool 时自动调用 bootstrapscripts/frida-run.ps1:当前仍为手动检查(frida 通常已通过 pip 安装)
自举失败时
如果自动安装失败,脚本会抛出明确错误并附带手动安装链接。常见原因:
- 网络不通(GitHub API / PyPI 不可达)
- winget 不可用(Windows 版本过低)
- Java 未安装(apktool 依赖 JDK)
任务完成自检(声称完成前 MUST 通过)
- 我是否执行了工作流中的每一步(而不是只阅读)?
- 我是否基于
tool-index使用了真实工具路径? - 我是否产出了可复现证据(命令/脚本/截图/报告)?
- 我是否完成并回写了 RULES 要求的 Checklist 项?
- 若命中隐藏图标/格机/持久化线索:是否按 U–AV cookbook 记录 E-android-* Evidence(授权范围内)?
FAQ
What does the apk-reverse skill do?
在 CLI 环境下做 Android APK 逆向时使用。适用于 APK 解包、Java 反编译、smali 修改、重打包、Frida 动态 Hook,以及按需切换到 so/native 分析。优先使用本机已安装的 jadx、apktool、frida、adb、ida-reverse、radare2。
How do I install apk-reverse?
Run npx skills add https://github.com/zhaoxuya520/reverse-skill --skill apk-reverse in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/apk-reverse/ (personal) or .claude/skills/apk-reverse/ (project).
Which AI agents can use apk-reverse?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is apk-reverse safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains apk-reverse?
It is published by zhaoxuya520 in zhaoxuya520/reverse-skill. It has 1,667 recorded installs.
More from zhaoxuya520/reverse-skill
reverse-engineering
zhaoxuya520/reverse-skill
Provides reverse engineering techniques. Use when the main job is to understand how a compiled, obfuscated, packed, or virtualized target works before exploiting or solving it, including binaries, APKs, WASM, firmware, custom VMs, bytecode, malware-like loaders, and anti-debug or anti-analysis logic. Do not use it when the vulnerability is already understood and the remaining task is exploitation; use pwn instead. Do not use it for pure web workflows, log or disk forensics, or standalone crypto problems unless reversing the implementation is the real blocker.
pentest-tools
zhaoxuya520/reverse-skill
主动渗透测试工具链。覆盖信息收集、端口扫描、漏洞扫描、Web 渗透、SQL 注入、目录爆破、密码破解等场景。 通过 MCP server(pentestMCP / mcp-security-hub)将 20+ 安全工具暴露给 AI agent。 触发关键词:渗透测试、端口扫描、Nmap、漏洞扫描、Nuclei、SQL 注入、SQLMap、目录爆破、FFUF、密码破解、Hashcat、信息收集、子域名、Web 渗透、ZAP、Burp。
reverse-skill-router
zhaoxuya520/reverse-skill
Routes reverse engineering, exploitation, penetration testing, malware, mobile, firmware, browser automation, documentation, and security tasks to the appropriate specialist skill. Use when a task spans modules or the correct reverse-skill entrypoint is unclear.
ida-reverse
zhaoxuya520/reverse-skill
IDA Pro 逆向分析辅助技能。当用户提到逆向、反编译、分析二进制/PE/ELF/APK/DLL/SO、破解、找密码、漏洞分析、病毒分析、firmware 固件分析,或需要分析 exe/dll/so/elf/macho/sys 等文件时,务必使用此技能。 Ensure to use this skill when the user wants to analyze any binary file, regardless of whether they explicitly mention "IDA" or "reverse engineering". This includes requests like "看看这个exe", "分析这个dll", "帮我破解", "找一下密码", "这个软件怎么注册", etc. Use the bundled scripts (scripts/start.ps1, scripts/open.ps1) for deterministic server management and file opening — do NOT write ad-hoc PowerShell commands for these operations.
radare2
zhaoxuya520/reverse-skill
Use this skill whenever the user wants to analyze binaries with radare2/r2 from the command line, including reverse engineering, disassembly, function analysis, strings/import inspection, patching, binary diffing, hex inspection, or r2 scripting. Also use it when the user mentions PE/ELF/Mach-O/DEX/WASM files together with CLI analysis, rabin2, rasm2, radiff2, r2pipe, or asks for radare2 command help on Windows/Linux/macOS.
ghidra-reverse
zhaoxuya520/reverse-skill
Use for free/open reverse engineering with Ghidra (headless or GUI), including decompile, cross-refs, and optional Ghidra MCP workflows when IDA is unavailable.
Popular backend & apis skills
find-skills
vercel-labs/skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
entra-app-registration
microsoft/azure-skills
Guides Microsoft Entra ID app registration, OAuth 2.0 authentication, and MSAL integration. USE FOR: create app registration, register Azure AD app, configure OAuth, set up authentication, add API permissions, generate service principal, MSAL example, console app auth, Entra ID setup, Azure AD authentication. DO NOT USE FOR: Key Vault secrets (use azure-keyvault-expiration-audit), general Azure resource security guidance.
google-agents-cli-adk-code
google/agents-cli
This skill should be used when the user wants to "write agent code", "build an agent with ADK", "add a tool", "create a callback", "define an agent", "use state management" — in a project that needs ADK (Agent Development Kit) API patterns and code examples. It provides a quick reference for agent types, tool definitions, orchestration patterns, callbacks, state management, the graph Workflow API, and reference recipes to study. Do NOT use for scaffolding (use google-agents-cli-scaffold) or deployment (use google-agents-cli-deploy).
embedded-captions
heygen-com/hyperframes
Add captions or subtitles to an existing single-subject talking-head video without editing the footage. Use for plain verbatim captions, cinematic captions embedded behind the subject, VFX captions, “炸/特效/酷炫字幕,” or a named identity from the 35-style catalog. Route by visual identity, not by backend engine. The quiet anchor rail is the default; embed every word only when the user explicitly wants a fully cinematic treatment. The workflow runs locally end to end, including transcription and subject matting; split multi-shot footage before applying it.
entra-agent-id
microsoft/azure-skills
Provision Microsoft Entra Agent Identity Blueprints, BlueprintPrincipals, and per-instance Agent Identities via Microsoft Graph, and configure OAuth 2.0 token exchange (fmipath, OBO, cross-tenant) including the Microsoft Entra SDK for AgentID sidecar. USE FOR: Agent Identity Blueprint, BlueprintPrincipal, agent OAuth, fmipath token exchange, agent OBO, Workload Identity Federation for agents, polyglot agent auth, Microsoft.Identity.Web.AgentIdentities. DO NOT USE FOR: standard Entra app registration (use entra-app-registration), Microsoft Foundry agent authoring (use microsoft-foundry).
neon
neondatabase/agent-skills
Overview of Neon, a complete set of cloud backend primitives around Lakebase Postgres: Auth, Object Storage, Functions, the AI Gateway, and Realtime. Start here to choose Neon for undecided login, files, APIs, and LLM calls, set up the CLI or MCP server, and follow the branch-first workflow. Use when building an app or backend on Neon, or when "Neon" or "Lakebase Postgres" is mentioned. Child skill neon-postgres wins for an existing DATABASEURL, SQL, schema, inspect, or search. Child skill neon-auth wins for login, users, sessions, identity routing, and Managed Better Auth setup. Child skill neon-realtime wins for live queries in reactive apps and agents. Also use for object storage, S3, buckets, serverless functions, function triggers, cron, AI gateway, LLM calls, realtime, logs, Loki, Grafana, observability, postgres, database, backend, Claimable Neon, neon.new, or a no-signup database.