Apk Reverse logo

Apk Reverse

Community
haikow
apk-reverse

在 CLI 环境下做 Android APK 逆向时使用。适用于 APK 解包、Java 反编译、smali 修改、重打包、Frida 动态 Hook,以及按需切换到 so/native 分析。优先使用本机已安装的 jadx、apktool、frida、adb、ida-reverse、radare2。

Overview

Publisherhaikow
Repositoryclaude-reverse-skills
Skill nameapk-reverse
Stars
130
Forks
32
Bundled files
9
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 9 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by haikow on GitHub. Read the source before you install it.

Installation

Install the Apk Reverse AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/haikow/claude-reverse-skills/tree/main/skills/apk-reverse
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/haikow/claude-reverse-skills.git /tmp/claude-reverse-skills
mkdir -p .claude/skills
cp -r /tmp/claude-reverse-skills/skills/apk-reverse .claude/skills/apk-reverse
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Apk Reverse in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Apk Reverse on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Apk Reverse is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

APK 逆向 CLI 作业规范

适用范围

当任务属于以下场景时优先使用本 skill:

  • 分析 APK 的 Java 业务逻辑
  • 定位登录、签名、风控、证书校验、root 检测
  • 查看与修改 AndroidManifest.xml
  • 查看与修改 smali
  • 重打包 APK
  • 用 Frida 做 Java/native 动态 Hook
  • APK 内含 .so 时切到 native 分析

当前机器已验证可用的 CLI 工具

  • jadx 1.5.5
  • apktool 3.0.2
  • frida-ps 17.9.6
  • adb
  • java

优先使用脚本的场景

以下流程高频且参数容易出错,优先用 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 devices
  • adb logcat
  • frida-ps -U
  • jadx --version
  • apktool --version

自带脚本

scripts/decode.ps1

用途:

  • 统一跑 jadx 和 apktool
  • 默认在原 APK 同目录创建任务输出目录
  • 输出 package、java_files、smali_dirs、so_files 等摘要
  • 兼容 jadx 部分反编译错误但仍然有可用产物的情况

示例:

powershell
pwsh -File "C:\Users\YOURNAME\.config\opencode\skills\apk-reverse\scripts\decode.ps1" -ApkPath "D:\DOWNLOAD\app.apk" -Clean
pwsh -File "C:\Users\YOURNAME\.config\opencode\skills\apk-reverse\scripts\decode.ps1" -ApkPath "D:\DOWNLOAD\app.apk" -Name demo -SkipJadx

scripts/frida-run.ps1

用途:

  • 统一 Frida 的设备、进程、spawn/attach 入口
  • 避免手写参数时混淆 -f、-n、-U

示例:

powershell
pwsh -File "C:\Users\YOURNAME\.config\opencode\skills\apk-reverse\scripts\frida-run.ps1" -ListDevices
pwsh -File "C:\Users\YOURNAME\.config\opencode\skills\apk-reverse\scripts\frida-run.ps1" -Usb -ListProcesses
pwsh -File "C:\Users\YOURNAME\.config\opencode\skills\apk-reverse\scripts\frida-run.ps1" -Usb -Spawn -Package com.example.app -ScriptPath "D:\hooks\test.js"

scripts/rebuild-sign-install.ps1

用途:

  • apktool b 重建 APK
  • zipalign 对齐
  • apksigner 签名与验签
  • 可选直接 adb install

示例:

powershell
pwsh -File "C:\Users\YOURNAME\.config\opencode\skills\apk-reverse\scripts\rebuild-sign-install.ps1" -ProjectDir "C:\work\apktool_out" -Clean
pwsh -File "C:\Users\YOURNAME\.config\opencode\skills\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

示例:

powershell
pwsh -File "C:\Users\YOURNAME\.config\opencode\skills\apk-reverse\scripts\manifest-summary.ps1" -ManifestPath "C:\work\apktool_out\AndroidManifest.xml"

如果要分析 .so、lib/arm64-v8a/*.so、lib/armeabi-v7a/*.so,再结合:

  • ida-reverse
  • radare2

工具分工

jadx

用于:

  • Java 反编译阅读
  • 包名、类名、方法名搜索
  • 先从高层逻辑理解 APK

常用命令:

bash
jadx -d jadx_out app.apk
jadx --single-class com.example.LoginActivity -d jadx_out app.apk
jadx --deobf -d jadx_out app.apk

apktool

用于:

  • 解包 APK
  • 查看和修改 AndroidManifest.xml
  • 查看和修改 smali
  • 重建 APK

常用命令:

bash
apktool d app.apk -o apktool_out
apktool b apktool_out -o rebuilt.apk

frida

用于:

  • 动态观察 Java 方法调用
  • Hook native 导出函数
  • 绕过 root 检测、证书校验、调试检测

常用命令:

bash
frida-ps -U
frida -U -f com.example.app -l hook.js
frida-trace -U -f com.example.app -j '*!*certificate*'

adb

用于:

  • 设备连接
  • 安装 APK
  • 查看日志
  • 拉取文件

常用命令:

bash
adb devices
adb install -r app.apk
adb shell pm list packages
adb logcat
adb pull /data/local/tmp/file .

推荐工作流

1. Triage

先确定 APK 大致构成,不急着改包或 Hook。

建议动作:

  1. 用 jadx -d jadx_out app.apk 导出 Java 代码
  2. 用 apktool d app.apk -o apktool_out 导出 smali 和资源
  3. 先看:
    • AndroidManifest.xml
    • 主 package
    • application、activity、service、receiver
    • lib/ 目录里是否有 .so

2. Java 逻辑观察

优先从 jadx_out 读:

  • MainActivity
  • Application
  • 登录、网络、加密、风控相关类
  • 第三方 SDK 初始化类

常见关键词:

  • login
  • sign
  • encrypt
  • cipher
  • token
  • root
  • certificate
  • trust
  • okhttp
  • retrofit
  • webview

如果 Java 代码可读,先在这里定位业务逻辑。

3. Smali 与资源层确认

当 jadx 结果不完整、混淆重、或需要实际 patch 时,切到 apktool_out:

  • 看 smali*/
  • 看 res/values/strings.xml
  • 看 AndroidManifest.xml

优先 patch:

  • android:exported
  • 调试标记
  • root 检测返回值
  • 登录验证逻辑
  • 证书校验分支

4. 重建与安装

修改后:

bash
apktool b apktool_out -o rebuilt.apk

或者直接用脚本闭环:

powershell
pwsh -File "C:\Users\YOURNAME\.config\opencode\skills\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 层

快速命令备忘

bash
# 反编译 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

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Apk Reverse AI skill do?

在 CLI 环境下做 Android APK 逆向时使用。适用于 APK 解包、Java 反编译、smali 修改、重打包、Frida 动态 Hook,以及按需切换到 so/native 分析。优先使用本机已安装的 jadx、apktool、frida、adb、ida-reverse、radare2。

Why use Apk Reverse on TypingMind?

Because you install it once and use it with any model. Apk Reverse is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Apk Reverse in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/haikow/claude-reverse-skills/tree/main/skills/apk-reverse. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Apk Reverse?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Apk Reverse?

As many as you like. As long as a model supports skills, you can use Apk Reverse with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Apk Reverse AI skill free?

It is published on GitHub by haikow. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇