Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add niki914/zafiro --skill extract-apkgit clone --depth 1 https://github.com/niki914/zafiroWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/niki914/zafiro/extract-apk)<a href="https://agentmods.dev/skills/niki914/zafiro/extract-apk"><img src="https://agentmods.dev/badge/skills/niki914/zafiro/extract-apk/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/niki914/zafiro/extract-apk"><img src="https://agentmods.dev/badge/skills/niki914/zafiro/extract-apk.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00105 | $0.01707 |
| Opus 5.5 | $0.00042 | $0.00683 |
| Sonnet 5.5 | $0.00021 | $0.00341 |
| Haiku 4.5 | $0.00011 | $0.00171 |
Grade A, and why
extract-apk scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 101 lines — stays where its author put it; the contents beside it link to each section on GitHub.
extract-apk
把「人类口中一个 App」变成「本地一份可检索的反编译源码树」。三个脚本,一条直线,不做别的事。
边界
做:搜索包名 → 提取 APK → 反编译 → 打印规范产物路径。
不做:不读反编译产物里的源码、不看 AndroidManifest.xml 内容、不生成 hook 配置、不做静态分析。读到路径就结束,源码阅读交给下游流程。
如果越界去读源码,会把本应属于静态分析阶段的上下文窗口消耗掉。
环境前置
脚本目录:<本 skill 目录>/scripts/,下文命令都用 python3 <脚本绝对路径> 调用,不要 cd 进去。
依赖三项:adb(设备侧)、java(jadx 运行时)、jadx(反编译器)。
- 缺
jadx:脚本会自己用brew list --formula jadx判断是不是装了没进 PATH,并给出确切安装命令。不要自动安装,把命令给用户确认。 - 缺
java:脚本会提示brew install openjdk。 - 设备未就绪:脚本会打印
adb devices的实际输出;多设备时用--serial,或设ANDROID_SERIAL。
三步流水线
1. 搜索包名
python3 <scripts>/search_app.py <keyword> [--limit N] [--serial SERIAL]
关键字做包名子串匹配,大小写不敏感。搜不到就换更短的关键字(品牌名 / 域名片段)重试,不要猜包名。
关于应用显示名:adb 拿不到 label(pm list packages 和 dumpsys package 都没有这个字段,设备上也没有 aapt)。所以英文系统下搜 wechat、line、telegram 这类"界面上的名字"会命中 0 条。此时脚本会自动列出设备上全部第三方包(pm list packages -3)供按语义挑选,例如 com.tencent.mm、tv.danmaku.bili。不要自己编造包名,从这份列表里选。
2. 提取 APK
python3 <scripts>/extract_apk.py <package_name> [--serial SERIAL] [--force]
- 单个 APK → 存成
<root>/extracted_apps/<包名下划线化>.apk。 - 检测到 split → 全部拉到
<root>/extracted_apps/<包名下划线化>_splits/,base.apk在内。不要只拿 base.apk:缺 split 会导致 jadx 资源解析缺失,静态事实失真。 - 目标已存在时直接返回既有路径(
status: cached),不重复下载;要重拉加--force。
3. 反编译
python3 <scripts>/decompile_apk.py <apk_文件或_splits_目录> [--force] [--no-res]
- 传目录时会把目录内所有
*.apk(base.apk优先)一次性喂给 jadx,这是 split 场景的正确用法。 - 产物已存在且
sources/完整 →status: cached直接返回,不重跑。 --no-res只产出 sources,跳过资源解析,用于超大 App 抢时间。
jadx 是分钟级任务,必须用后台方式执行(例如 bg_run),不要在前台阻塞等。脚本自身按百分比打印进度到 stderr。
产物路径约定
根目录默认是运行脚本时的工作目录下的 .apk_decs/(Path.cwd() / ".apk_decs"),可用环境变量 APK_DECS_ROOT 覆盖成别的绝对路径。
因为默认跟 cwd 走,运行前先确认自己在对的工作目录:脚本用绝对路径调用,产物就会落在你当时所在目录。要固定到某处,直接设 APK_DECS_ROOT。
<cwd>/.apk_decs/extracted_apps/<包名下划线化>.apk # 单 APK
<cwd>/.apk_decs/extracted_apps/<包名下划线化>_splits/ # split 场景
<cwd>/.apk_decs/<apk_stem>_apk/sources/ # Java 源码根
<cwd>/.apk_decs/<apk_stem>_apk/resources/AndroidManifest.xml
<cwd>/.apk_decs/<apk_stem>_apk/.rgignore # 已忽略框架/资源噪声,可直接给 rg 用
<cwd>/.apk_decs/<apk_stem>_apk/jadx.log # jadx 完整输出
What ships with it
4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 101 lines · 105 tokens per session scan A 3ca78bb9f6a3
extract-apk is a skill published in the GitHub repository niki914/zafiro (259 stars, last pushed yesterday), licensed MIT. It adds 105 tokens to every session and 1,707 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-11.
Other skills, from other repositories
compose-performance
Use when investigating Jetpack Compose recomposition cost, compiler stability reports, skippability, unstable parameters, frame-rate State reads, cross-phase snapshot back-writing, or @ReadOnlyComposable contracts.
flutter-error-handling
Implement functional repository error recovery with Either/Failure patterns in Flutter. Use when handling exceptions or dartz Either types in data flows; defer UI-only retry buttons.
kotlin-expert
Expert-level Kotlin development, Android, coroutines, and multiplatform. Use when the user mentions Android, coroutines, multiplatform, or JVM, or when the task involves Kotlin Fundamentals, Android Development, Kotlin Multiplatform, or Kotlin Style.
phone-harness
Use when an agent needs to control a real phone — iPhone via Mac iPhone Mirroring or Android via adb (open apps, tap, type, swipe, OCR the screen). Android path runs on this Linux workstation (adb), targets phonefarm devices. iOS path needs macOS + iPhone Mirroring. Use for phonefarm device debugging, OTP/2FA flows…
context-collector
Deep architecture recovery, context gathering, and root cause analysis for unfamiliar or undocumented codebases. Use when asked to analyze a codebase, understand its architecture, map dependencies, gather context before a task, do architecture recovery, explore an unknown repo, or investigate a production…
dagger-hilt-expert
Expert guidance for Dagger and Hilt dependency injection in Android. Use when implementing DI, creating modules, configuring scopes, optimizing performance, testing with Hilt, setting up multi-module architecture, using assisted injection, or debugging DI issues. Triggers on "dagger", "hilt", "dependency injection"…