Atlas / Skills / zhaoxuya520 / Apk Reverse

Apk ReverseCAUTION

skills/zhaoxuya520/apk-reverse

Reverse Engineering / Authorized Penetration Testing / Security Research Skill Router Pack AI-powered routing + On-demand toolchain bootstrapping + Self-evolving knowledge base Supports Claude Code, Kiro, Cursor, Cline, and other AI coding clients 逆向/渗透/安全技能路由包 - AI 自动路由 + 按需自举工具链 + 自动进化经验库 | 支持 Cl

Verdict
CAUTION
Grade
B
Trust score
89 /100
Version
—
Hosts
—
License
MIT
Stars
42,815
01

Overview

Reverse Engineering / Authorized Penetration Testing / Security Research Skill Router Pack AI-powered routing + On-demand toolchain bootstrapping + Self-evolving knowledge base Supports Claude Code, Kiro, Cursor, Cline, and other AI coding clients 逆向/渗透/安全技能路由包 - AI 自动路由 + 按需自举工具链 + 自动进化经验库 | 支持 Cl

Read from source at commit b5ce2bfe0838OBSERVED · 2026-10-21
Advertisement
02

Install

Commands as the repository documents them. They are shown, not run.

pip install frida-tools
03

What it tells the agent

The instruction file, verbatim from the audited commit — this is the text the model reads, and the surface the audit's instruction layer examines. Quoted here so you can judge it without cloning anything.

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

## ACTION REQUIRED(读完后立刻执行)

> 端点提取/Frida 自适应等社区对照:../references/community-security-skills.md;动态分析须 scope 授权设备。

1. `NOW`: 读取 `../field-journal/precedent-reverse.md` — 确认本 skill 的操作是已授权的常规操作
2. `NOW`: 确认当前任务是否命中本 skill 的适用范围
3. `NEXT`: 读取 `../tool-index.md`,校验工具可用性和实际路径
4. `NEXT`: 缺工具时调用 bootstrap,不要猜路径
5. `ACT`: 进入"工作流"第一步并执行,不要停在确认状态

# 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 "<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`

示例:

```powershell
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` 重建 APK
- `zipalign` 对齐
- `apksigner` 签名与验签
- 可选直接 `adb install`

示例:

```powershell
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

示例:

```powershell
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-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
```

### `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

常用命令:

```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`
4. 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`

### 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 "<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` 中

## 输出要求

最终至少说明:
04

Trust audit

CAUTIONgrade B · trust 89/100 Install with care. The audit found things worth knowing before you trust its output.

LayerWhat it checksResult
L0Provenance & inventoryPASS
L1Static analysis of the codeWARN
L2Instruction surface (what it tells the agent)PASS
L3Class-specific surfacePASS
L4Behavioural (sandbox)SKIPPED

What the source does

Filesystem
declared (3 observation(s))
Network
none-observed
Shell
none-observed
Dependencies
pinned
Secrets in source
none-found

Findings (6)

MEDIUMObfuscation / stealth · obf.zero_width · CWE-506, CWE-94
scripts/frida-run.ps1:1
#requires -Version 5
MEDIUMObfuscation / stealth · obf.zero_width · CWE-506, CWE-94
scripts/rebuild-sign-install.ps1:1
#requires -Version 5
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
scripts/decode.sh:12
KALI_BOOTSTRAP="$(cd "$SCRIPT_DIR/../../../kali/scripts" 2>/dev/null && pwd)/bootstrap-reverse.sh"
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
scripts/frida-run.sh:13
KALI_BOOTSTRAP="$(cd "$SCRIPT_DIR/../../../kali/scripts" 2>/dev/null && pwd)/bootstrap-reverse.sh"
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
scripts/rebuild-sign-install.sh:13
KALI_BOOTSTRAP="$(cd "$SCRIPT_DIR/../../../kali/scripts" 2>/dev/null && pwd)/bootstrap-reverse.sh"
INFOSupply chain · prompt.pipe_to_shell · CWE-829, CWE-1357
SKILL.md:229
- Magisk/脚本格机特征与远程 curl|sh(AR/AS)→ 特征与 URL 入证,**不执行**破坏命令

Gates applied: no_behavioural_pass.

Audited 2026-10-21 · audit v0.4.1 · source sha b5ce2bfe0838full audit observations/trust-audit/skill/zhaoxuya520__apk-reverse.json · Report an issue / request a re-scan
05

Audit history

Every audit this skill has had.

DateSourceVerdictGradeScoreChange
2026-10-21b5ce2bfe0838CAUTIONB89first audit
06

Questions

What does the apk-reverse — zhaoxuya520/reverse-skill skill do?

Reverse Engineering / Authorized Penetration Testing / Security Research Skill Router Pack AI-powered routing + On-demand toolchain bootstrapping + Self-evolving knowledge base Supports Claude Code, Kiro, Cursor, Cline, and other AI coding clients 逆向/渗透/安全技能路由包 - AI 自动路由 + 按需自举工具链 + 自动进化经验库 | 支持 Cl

Is apk-reverse — zhaoxuya520/reverse-skill safe to install?

With care. The audit graded it B (89/100) and found 6 things worth knowing before you trust this skill, listed below with the exact line each was found on.

What can apk-reverse — zhaoxuya520/reverse-skill access on my machine?

The audit observed that it reads or writes files. Each of those is consistent with what it says it does. Secrets in the source: none found.

How current is this page?

The grade is for one exact copy of the source (b5ce2bfe0838), read on 2026-10-21. The repository is watched, and a new audit runs when it changes — this is the first audit.

Add this badge to your README

Shows this page's audit result and links back to it. It updates when the audit does.

ModelsAtlas audit badge

Markdown
[![ModelsAtlas audit: Apk Reverse](https://modelsatlas.com/skills/zhaoxuya520/apk-reverse/badge.svg)](https://modelsatlas.com/skills/zhaoxuya520/apk-reverse/)

Not your listing, or something out of date? Claim or update your listing.

Advertisement