An Agent Skill for Android APK reverse engineering, debloating, ad removal, surgical
dex patching, repacking, and runtime/server analysis.
It is a skill, not a tutorial: it is written to be loaded by an agent (Claude Code,
Codex, or any harness that supports the Agent Skills format) while it works, so it is
organized for progressive disclosure — a short decision-oriented SKILL.md, detailed
references loaded only when a step needs them, and parameterized scripts you can run
directly.
How an agent is expected to consume this
SKILL.md is deliberately written as a procedure with gates rather than as advice, because the
observed failure mode is not ignorance — it is a model reading the whole thing, agreeing with it, and
then reasoning from first principles anyway.
So there are four things in the body that are meant to be acted on, not read:
Four override rules (R1–R4). Where they conflict with the current plan, they win until evidence
overrides them.
A symptom index. Each row is a failure that has already been paid for. A matching row is a
stop signal: load that file before running another command, rather than after a few more attempts.
Reasoning past a known symptom is how the same hours get spent twice.
Four gates (G1–G4), each an action with a pass criterion. "I understand the idea" does not clear
a gate. They exist so that classification, environment truth and a control build happen before
the first patch, not after the third failure.
A two-strike rule and stop conditions. Two failures of the same shape mean the model is wrong,
not the parameters. The third variant of a hypothesis that already failed twice is where rounds go
to die.
And one thing at the end that is meant to be withheld: "done" has a definition (six items). A
clean log is not one of them. Anything short of all six is a checkpoint, and should be reported as a
checkpoint with what remains.
What the split costs is not measured, and the claim should not be overstated.SKILL.md loads in
full; a reference loads when the symptom index or the routing table
(skills/apk-reverse/references/routing.md) sends you to one. That is
usually described as "cheaper context", and only half of it has been measured here: the always-loaded
body has a measured size and a gate that fails when it grows (check_budget.py). The other half has
not — how many references a real question pulls in, and whether fetching them one at a time ends up
costing more than the alternative would have. A question that needs four references is not obviously
cheaper than one longer file would have been, and every reference also carries its own entry in the
index that has to be read to find it. Treat the split's economy as unknown -- nothing here has
measured it -- and treat the body budget as observed. The second is the one that compounds on every
task, which is why it is the one gated.
If you are an agent reading this: the cheapest possible first command is
python skills/apk-reverse/scripts/doctor.py. It tells you which of these tools exist here, which
scripts can actually run, and whether something in the environment is already poisoning your
measurements.