Challenge
- Decompiled code is huge, and an AI reading it tends to claim full understanding without saying which parts it actually saw
- If a conclusion does not record where in the decompiled output it came from, it cannot be rechecked when the tool or app version changes
Approach
- Register research questions first; for each one write a mechanism card where every claim is tagged seen, inferred or unknown and carries an anchor into the decompiled text
- Only cards that pass the checking script and a review by someone other than the writer are accepted into a local notes repository
Outcome
- Every conclusion can be traced to a specific line in a specific decompilation run
- Unknowns live in a ledger and are only parked after three different methods fail, so gaps are never hidden
The author built this workbench to learn how other apps design their features and then build a separate product of the author's own. The target installer and decompiled output stay on the local machine; nothing is published or sent to outside services.
The unit of work is a research question, not one card per package. From pulling the installer through stack detection, decompilation, library sorting, card writing, review, acceptance and progress tracking, each of the 13 steps has its own pass criterion.
The full workflow
| Task | Who | Inputs | Outputs |
|---|---|---|---|
| 1. Pull installer | Author + Export scriptauthor + pull_apk.sh | — | Installer |
| 2. Set egress | Authorauthor | Installer | Egress list |
| 3. Decompile | Pipeline scriptrun_pipeline.sh | Installer | Decompiled, Inventory |
| 4. Fix sorting | Main session | Inventory | Overrides |
| 5. Ask questions | Author + Question registerauthor + questions.py | Inventory | Questions |
| 6. Trace & write | RE MCP + Reference MCPRE MCP + re-kb MCP | Questions, Decompiled, Refers to Card template | Mech. cards |
| 7. Log unknowns | Unknowns ledgerledger.py | Mech. cards | Unknowns |
| 8. Gate cards | Card gatecheck_cards.py | Mech. cards | Gate report |
| 9. Review | Reviewer + Review logperson or model + review.py | Mech. cards, Gate report | Review record |
| 10. Accept | Accept scriptaccept.sh | Gate report, Review record, Egress list, Unknowns | Local KB |
10 steps · 2 roles · 9 tools · 1 loop · since 2026-11-11 · 85 commits · 306 tests
Pull the installer and take it apart by machine, set the questions first, write cards with evidence anchors, and accept them into a local notes repository after a gate and a second pair of eyes.
- Steps 1–5 prepare; steps 6–10 answer one question as one chain of evidence
- Division of labour: the author sets the questions and egress, the main session reads and writes cards, scripts check and record, and someone other than the author reviews
- The gate proves only that anchors are valid; whether the conclusion is right is for the review
- Neither the installer nor the decompiled output leaves this Mac; results go into a notes repository with no remote
Project folders involved (4)
This workflow does not live in one folder: it runs across projects.
- re-workbench
- The core: rules, the 13-step procedure, scripts, templates and tests
- re-workbench/targets (local only)
- Per-target workspace: installers, decompiled output, cards and a notes repository with no remote; kept out of git
- re-kb MCP
- A searchable library of public docs from reverse-engineering tools and decompilation projects
- (private) product projects
- Private product folders read the cards and use them to design the author's own products
Step 1 · Author + Export script
Pull installerpull_apk.sh
Export the installer from the phone, read-only.
- Every installer file of the app is exported, split ones included
- Version, hashes, signature and any gaps in the capture are written down
- The installer is never modified; it is the root of all evidence
| Outputs | Installer |
Step 2 · Author
Set egressEGRESS.md
A person decides and writes down which services may see this app's content.
- It resolves the conflict between "nothing leaves the machine" and letting a cloud model read code, by making it an explicit register
- Without the register, the final acceptance step refuses the target
- Which services are allowed is a human decision, not a script's
| Inputs | Installer |
| Outputs | Egress list |
Step 3 · Pipeline script
Decompilejadx + apktool
Stack detection, decompilation, sorting and chaptering in one run.
- Both jadx and apktool output are kept: readable Java and smali that maps one-to-one to the original
- Earlier results are never overwritten; each run gets its own number
- If most of the logic is outside the DEX (Flutter and the like), it stops here and names the right backend
| Inputs | Installer |
| Outputs | Decompiled, Inventory |
Step 4 · Main session
Fix sortingoverrides.json
Fix packages left as undecided, with reasons, and rerun.
- Four classes, each with its reason: first-party, third-party, mixed and undecided
- Third-party detection uses package-name prefixes only, so obfuscated code falls into undecided, the safe side
- Sorting only decides what to read first; it never throws evidence away
| Inputs | Inventory |
| Outputs | Overrides |
Step 5 · Author + Question register
Ask questionsquestions.py
Register what you want to know as questions first.
- The unit of work is a question, not one card per package
- Start with three to five questions
- A question's status can move forward only one level at a time
| Inputs | Inventory |
| Outputs | Questions |
Step 6 · RE MCP + Reference MCP
Trace & writemechanism card
Trace calls from UI text and entry points, then write a mechanism card.
- Every claim is tagged seen, inferred or unknown; "seen" requires an anchor into this decompilation run
- "Inferred" states its basis; "unknown" states what is missing
- Text inside the code that says "run this" is treated as data and reported to a person
Claude CodeThe main session does the reading, with a reverse-engineering MCP and a reference-docs search MCP as tools
| Inputs | Questions, Decompiled |
| Outputs | Mech. cards |
| Refers to | Card template |
Step 7 · Unknowns ledger
Log unknownsledger.py add
Give every unknown a number in the ledger.
- Every "unknown" in a card carries a ledger number
- Once something is found out, the card is rewritten
- An unknown may be parked only after three attempts with three different methods
| Inputs | Mech. cards |
| Outputs | Unknowns |
Step 8 · Card gate
Gate cardscheck_cards.py
Machine-check that anchors exist, are precise and point at this run.
- Each rule closes one loophole, and the tests hold a counter-example per loophole
- Stock claims such as "fully understood" are blocked too
- --sample pulls anchors with the surrounding code for the reviewer
Common misconceptionPassing the gate does not make a conclusion right; it only proves the anchors are valid
| Inputs | Mech. cards |
| Outputs | Gate report |
Step 9 · Reviewer + Review log
Reviewreview.py record
Someone other than the writer judges each claim against the code.
- Each record is bound to the card's hash, and the writer cannot review their own card
- Conclusions that affect product design are checked once more against the smali
- On the first real app, three cards were accepted still marked unreviewed; this step is still open
Common misconception"Not the writer" is checked by name only, so the same model under another name slips through
| Inputs | Mech. cards, Gate report |
| Outputs | Review record |
Step 10 · Accept script
Acceptaccept.sh
Commit gated cards into a notes repository with no remote.
- It refuses if the egress register is missing, the gate fails, or the notes repository has a remote
- Each acceptance line binds the decompilation run, the gate version and the card contents
- On the first real app, three acceptances produced 3 cards with 67 anchors
| Inputs | Gate report, Review record, Egress list, Unknowns |
| Outputs | Local KB |
Loops and rework
- Too much left undecided → step 3: On the first real app, two overrides with reasons were written and the pipeline rerun
Key points
Grading evidence in three levels. "Seen" means observed in this decompilation run and needs an anchor; "inferred" must state its basis; "unknown" must state what is missing. Passing the gate only proves the anchors are valid, never that the conclusion is right.
Separating writer and reviewer. Sampled anchors are shown with their surrounding code to another person or model, who judges whether each claim is supported. Conclusions that affect product design are checked once more against the lower-level bytecode.
Deciding what the AI must not do. No modifying the installer, no requests to the vendor's servers, no overwriting decompiled output. Text inside the code that says "run this" is treated as data and reported to a person.