Skip to content

feat(android): pin jadx-headless-mcp 0.8.0 - #7772

Merged
N0zoM1z0 merged 5 commits into
morluto:mainfrom
cainiao1992:feat/jadx-headless-mcp-0.8.0
Nov 22, 2026
Merged

N0zoM1z0 merged 5 commits into
morluto:mainfrom
cainiao1992:feat/jadx-headless-mcp-0.8.0

Conversation

@cainiao1992

@cainiao1992 cainiao1992 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Move the audited Android engine from jadx-headless-mcp v0.7.1 to v0.8.0, and let the metadata bridge advertise the input schemas it actually accepts. No linked issue: this is a routine engine pin plus a defect found while verifying it.

Problem and expected behavior

  • src/android/JadxRelease.ts pinned v0.7.1, so REA rejected the current upstream release (Expected engine 0.7.1; JAR reported 0.8.0).
  • Listing bridge tools tore the session down. The bridge reused each property from the pinned engine's schema, and that schema has no overload_index for get_xrefs_to_method, so the advertised map contained a null that kotlinx serialization cannot write. Only tools/list was affected, which is why the existing lanes never saw it: REA calls tools by name. The same failure reproduces against the 0.7.1 engine, so this is a pre-existing defect, not an upstream regression.

Expected: the pinned 0.8.0 release loads and inspects APKs exactly as before, and a client can list the bridge catalog.

Change and scope

  • Bump the release identity and the submodule gitlink to v0.8.0 (2b2a560e, sha256 4b9a01c2…). Upstream only changed source-window paging and metadata-only field reads; the six tools REA consumes are unchanged.
  • Remove hand-copied version numbers: the fixture download name, the real-android-metadata workflow JAR path, and the fake MCP server's reported engine version now derive from JADX_RELEASE. The composition fallback availability text no longer names a release, because the Android boundary owns the versioned remediation.
  • The bridge now declares the properties and required fields for the five tools it reimplements, so an engine bump can neither advertise a null nor drop the overload selector REA relies on. Bridge identity moves 11 → 12 with that contract (main's JNI change already owns 11).
  • Advertised external-reference inputs: get_class_summary now lists method_name and reference_target, and get_xrefs_to_method lists reference_target; the bridge already reads both on its external-prototype path, and REA stopped sending limit, resolve_line and smali_fallback, which the bridge never read.
  • Add scripts/verify/android/bridge-catalog.mjs to the real lane: it connects to the live bridge, lists the catalog, and asserts the exact advertised schemas.
  • Update supply docs, third-party records, the packaged skill reference, and the showcase download link. docs/public/product-catalog.json and skills/ are regenerated, not hand-edited.

Scope note: an earlier draft of this PR reported scripts/verify/android/failure-recovery.mjs as expecting a spawn ENOENT for the missing java scenario while JadxConfiguration reports a PATH lookup failure. That observation no longer holds on this branch's base — the file is identical to main, and its expectation there matches the JadxConfiguration report (Cannot find an executable java …, phase: "path-lookup"). A later full rerun of the lane passed that scenario (see validation); the earlier stop did not reproduce.

Contract and boundary impact

  • Semantic owner and earliest changed stage: the engine release identity stays owned by src/android/JadxRelease.ts; bridge input schemas move from engine-derived to REA-owned in bridge/android/ReaJadxBridge.java.
  • Contribution scope fit and linked maintainer decision: routine fix within an existing provider boundary; no maintainer scope decision required.
  • CLI and MCP/tool-catalog contract: no tool name or argument changes. The catalog now advertises the external-reference inputs the bridge already reads (method_name and reference_target on get_class_summary, reference_target on get_xrefs_to_method) alongside overload_index on get_xrefs_to_method, which REA already sends.
  • Provider, bridge, target-format, or platform compatibility: REA still rejects any JAR that does not report the pinned version; a bridge identity mismatch is already refused by JadxSession.
  • Evidence, artifact, provenance, or reconstruction contract: engine name, version, artifact digest and source revision are preserved as before.
  • Target selection, authority, upstream behavior, and cleanup details: unchanged; the engine remains caller-supplied and read-only.
  • Generated metadata: docs/public/product-catalog.json regenerated and validated by docs:check; authored skill text edited in .agents/skills/ and regenerated.

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: scripts/verify/android/bridge-catalog.mjs (new, real bridge, exact catalog, schemas and property types, plus the source-read bridge identity); the fake MCP fixture and tests/boundary/process/androidAnalysisMcp.test.ts now derive engine and bridge versions from the release constants, and the domain view tests use a neutral synthetic version instead of the current pin.
  • Base reproduction: tools/list against either the 0.7.1 or the 0.8.0 JAR logs Error writing to output sink … JsonElementSerializer … parameter value and closes the connection; with this change the same call returns ten tools with the expected properties.
  • User-visible CLI/MCP output: unchanged for inspect_android_package, search_android_classes, inspect_android_class, inspect_android_method and trace_android_references (CLI/MCP parity re-run below).
  • Remaining proof gaps: no Windows host was exercised; CI's metadata workflow compiles the bridge and runs metadata regressions but does not list tools.

Validation performed

  • npm run build:cached — success.
  • npm run check:fast — success (typecheck, lint).
  • npm run docs:check — success.
  • npm run test:focused -- <16 Android boundary files> — 296 passed.
  • npm run test:focused -- tests/boundary/process/jadxIntegration.test.ts — 52 passed (re-run in isolation; one poll timed out once under parallel load and did not reproduce).
  • npm run verify:android with the pinned 0.8.0 JAR and ApiDemos 6.0.18 on macOS/OpenJDK 21 — bridge build, metadata regressions, five-operation CLI/MCP parity, ownership cleanup and the new catalog step passed; the lane stops at the pre-existing missing java expectation.
  • Real CLI inspection of an APK with the pinned JAR on macOS/OpenJDK 21 — success (author's local run).
  • Post-rebase rerun of the full npm run verify:android with the sha256-matched 0.8.0 JAR (4b9a01c2…) and ApiDemos 6.0.18 — every step passed, including the bridge-catalog schemas step and the missing java recovery scenario that stopped earlier runs; that stop did not reproduce (reviewer's local run on the rewritten branch).
  • Post-squash re-verification: after the review fixes were folded into their introducing commits, the rewritten branch's tree was verified identical to the pre-rebase tree, and npm run check:fast plus the touched domain view tests (16 tests) were re-run.

Compatibility, safety, and release

  • Breaking changes or migration steps: callers must supply a JAR reporting 0.8.0. A 0.7.1 JAR is rejected with Expected engine 0.8.0; JAR reported 0.7.1; replace the file and update REA_JADX_MCP_JAR. The supply docs carry the new URL and digest.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable; Linux and Windows Android lanes were not run for this change.
  • Package or release metadata impact: engine version and digest appear in generated catalogs and docs, all regenerated.
  • Security, privacy, process, or containment review: no new authority, no downloads at analysis time, no changes to process ownership.

Author readiness

Human owner: @cainiao1992

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-28T10:46:34.913023Z
We couldn’t complete this review. Comment @codex review to try again.
21cbb65 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The PR appears safe to merge, with no new actionable findings.

Summary

Pins jadx-headless-mcp to 0.8.0 and makes the bridge own the input schemas for its reimplemented tools.

  • REA’s Android provider now accepts the pinned jadx-headless-mcp 0.8.0 release.
  • The Android bridge advertises the inputs its tools actually accept.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Release["JADX_RELEASE: 0.8.0"] --> Fixtures["Fixture filename and checksum"]
  Release --> Guard["Engine version check"]
  Bridge["ReaJadxBridge: version 12"] --> Schemas["REA-owned input schemas"]
  Schemas --> Catalog["tools/list"]
  Catalog --> Check["bridge-catalog.mjs checks names, types and required fields"]
Loading

Reviews (7) · Last reviewed commit: "test(android): stop hand-copying the eng..." · Reviewed by Greptile

@CassieFox23

Copy link
Copy Markdown
Contributor

Hi! This PR's checks pass, but GitHub shows a merge conflict with main. A rebase on main should clear it, and then it's ready for a maintainer to review. No rush.

🤖 Written with Claude Code (Opus 5.5), posted with my OK 🦊

@N0zoM1z0

Copy link
Copy Markdown
Collaborator

Thanks for the 0.8.0 pin. Changing the pinned engine or the bridge behaviour while keeping bridge identity version 10 would collide with the identity cached and verified for 0.7.1. This likely needs JADX_BRIDGE_IDENTITY.version bumped to 11 along with the pin.

@cainiao1992

Copy link
Copy Markdown
Contributor Author

Done — thanks for catching this, @N0zoM1z0.

Git archaeology confirmed your concern: identity 10 was already published with 0.7.1 and never changed on main, so the earlier "identity moves to 10" wording in the schema commit was wrong — that commit never actually touched the identity value. The changed advertised contract was reusing an already-cached identity.

Fixed in edc70fe: JADX_BRIDGE_IDENTITY.version moves to 11, along with the bridge-side BRIDGE_VERSION mirror. Every consumer (handshake check, verify scripts, fixtures, test expectations) references the constant, so those were the only two call sites. The misleading sentence in the schema commit's message is corrected as well. The branch is also rebased onto the latest main per the earlier comment.

cainiao1992 added a commit to cainiao1992/rea that referenced this pull request Nov 14, 2026
The 0.7.1 era already published, cached and verified identity 10, and
the schema-advertising bridge kept that version. Shipping the changed
advertised contract under the unchanged identity would make the cached
value ambiguous, so the identity moves to 11 with the new contract.

Suggested-by: N0zoM1z0 (morluto#7772 (comment))
Validation: check:fast and the Android MCP boundary tests (8 tests).
@cainiao1992
cainiao1992 force-pushed the feat/jadx-headless-mcp-0.8.0 branch 2 times, most recently from 701d8c1 to 3a6ee6f Compare November 17, 2026 09:02
cainiao1992 added a commit to cainiao1992/rea that referenced this pull request Nov 17, 2026
Identity 11 now belongs to main's JNI split-qualification change
(455ed1b), so this branch's schema-advertised contract and the
0.8.0 engine pin cannot reuse it. The identity moves to 12, one past
main's, so a cached 11 from the JNI change cannot collide with the
behaviour introduced here.

The original review suggested 11 when main still advertised 10; after
the rebase exposed the collision, 12 continues the same rule.

Suggested-by: N0zoM1z0 (morluto#7772 (comment))
Validation: check:fast and the Android MCP boundary tests.
@cainiao1992
cainiao1992 force-pushed the feat/jadx-headless-mcp-0.8.0 branch from 3a6ee6f to 8ca4ae4 Compare November 17, 2026 12:00
cainiao1992 added a commit to cainiao1992/rea that referenced this pull request Nov 17, 2026
Identity 11 now belongs to main's JNI split-qualification change
(455ed1b), so this branch's schema-advertised contract and the
0.8.0 engine pin cannot reuse it. The identity moves to 12, one past
main's, so a cached 11 from the JNI change cannot collide with the
behaviour introduced here.

The original review suggested 11 when main still advertised 10; after
the rebase exposed the collision, 12 continues the same rule.

Suggested-by: N0zoM1z0 (morluto#7772 (comment))
Validation: check:fast and the Android MCP boundary tests.
@cainiao1992
cainiao1992 force-pushed the feat/jadx-headless-mcp-0.8.0 branch from ac5efa1 to 7c4029b Compare November 17, 2026 18:39
Move the audited engine release and its submodule gitlink from v0.7.1 to
v0.8.0 (commit 2b2a560e, sha256 4b9a01c2...). Upstream only changed
source-window paging and metadata-only field reads, so the six tools REA
consumes and the bridge identity stay unchanged.

Hand-copied version numbers now derive from JADX_RELEASE: the fixture
download name, the metadata-bridge workflow path and the fake MCP
server's reported engine version. The composition fallback availability
text no longer names a release, because the Android boundary owns the
versioned remediation.

Validation: build:cached, check:fast, docs:check, test:focused over the
16 Android test files (296 tests), and verify:android against the real
0.8.0 JAR and ApiDemos 6.0.18.
Listing the bridge tools closed the connection. The bridge copied each
property from the pinned engine's schema, and that schema has no
`overload_index` for `get_xrefs_to_method`, so the advertised map carried
a null that kotlinx serialization cannot write. Only `tools/list` was
affected: REA calls tools by name, which is why the real lanes never saw
it, and the same defect reproduces against the 0.7.1 engine.

The bridge now declares the properties and required fields it accepts, so
an engine bump can neither advertise a null nor drop the overload
selector REA relies on. The real Android lane lists the live catalog to
keep the shape under test. One tool list serves both the consumed set and
the reimplementation loop, unknown names fail fast instead of inheriting
a method-shaped schema, and the identity moves to 12 because main's JNI
split-qualification change already owns 11.

Validation: build:cached, check:fast, docs:check, test:focused over the
Android boundary files, and verify:android against the real 0.8.0 JAR and
ApiDemos 6.0.18. The new catalog step passes; the lane still stops at the
pre-existing `missing java` recovery expectation, which this change does
not touch.
The catalog check compared property names and required fields only, so
advertising `overload_index` as a string would still have passed even
though the bridge rejects it. Each expected property now carries its type.

The transport piped the bridge's stderr and never read it, so a failing
startup or catalog reply surfaced as "Connection closed" with the Java
error hidden. Retain a bounded tail and append it to the failure.

Validation: bridge-catalog against the real 0.8.0 JAR passes; a wrong
expected type fails with "get_method_body.overload_index must stay
string", and a missing engine JAR now reports the javac diagnostics
instead of only the closed connection.
The bridge-owned catalog omitted method_name and reference_target from
get_class_summary and reference_target from get_xrefs_to_method, even
though the bridge reads both on its external-prototype path and REA
sends both for reference queries. Neither side validates against the
schema today, but the verified catalog contradicted the traffic it
describes, and any schema-validating client would reject REA's own
reference queries.

The REA call sites also stopped sending limit, resolve_line and
smali_fallback, which the bridge never reads.

Validation: check:fast, and the Android MCP boundary plus JadxAnalysis
tests (92 tests). The bridge source itself was not compiled here; the
local engine JAR is absent, so verify:android against the real 0.8.0
JAR remains the authoritative catalog check.
Boundary tests derive the jadx engine version from JADX_RELEASE,
matching the fixture convention this branch already established.
Domain view tests cannot import the provider layer without inverting
dependency flow, so their synthetic engine metadata uses a neutral
version instead of the stale pin.

Validation: check:fast, and the five touched test files (114 tests).
@cainiao1992
cainiao1992 force-pushed the feat/jadx-headless-mcp-0.8.0 branch from 7c4029b to 9db3c6c Compare November 20, 2026 08:12
@CassieFox23

Copy link
Copy Markdown
Contributor

TL;DR: I ran the PR's 6 changed test files on Node 22.23.4, 24.22.1 and 26.12.1. Each run passed all 124 tests. I did not run npm run verify:android, and the head is 173 commits behind main.

I ran head 9db3c6c in a VM. The PR changes 26 files against the merge base: 6 test files and 20 others.

Check Node 22.23.4 Node 24.22.1 Node 26.12.1
Test Files 6 passed (6) 6 passed (6) 6 passed (6)
Tests 124 passed (124) 124 passed (124) 124 passed (124)

On 14 Nov, N0zoM1z0 asked for a bridge identity bump along with the pin. At this head, bridge/android/ReaJadxBridge.java:52 sets BRIDGE_VERSION to "12", up from "11" at the merge base 8bb01b5.

The head is 173 commits behind main 3d95d34. These results cover the head alone.

CI on the head, read live with gh:

  • The CI workflow run is completed/success.
  • PR title has 4 runs, all completed/success.
  • CodeQL production is completed/skipped.
  • 32 check runs are success. They include Source tests, Portable tests, Static checks, Build package and CI required.
  • android_metadata / android-metadata is success.
  • 23 check runs are skipped, such as Deep static checks and Python producer tests.
  • GitHub shows mergeable true and state clean.

Not run

  • npm run verify:android. It needs the 0.8.0 JAR and a test APK (REA_JADX_MCP_JAR, REA_ANDROID_TEST_APK), which I did not set up for this run.
  • A merge with current main, 3d95d34
Test setup
  • Box: Fedora 44 VM (4 vCPUs, 8 GB, Linux 7.2.11) on my Nobara 44 PC
  • Node: 22.23.4, 24.22.1, 26.12.1
  • Head / base: 9db3c6c / 8bb01b5 (merge base with main)
  • Install: npm ci --offline and npm run test:prepare on Node 24.22.1
Commands
npm ci --offline
npm run test:prepare
xvfb-run -a npm run test:focused -- src/domain/analysisView/androidPackageView.test.ts src/domain/analysisView/androidSymbolView.test.ts tests/boundary/android/JadxAnalysis.test.ts tests/boundary/android/JadxExternalReferences.test.ts tests/boundary/mcp/androidPackageSummaryMcp.test.ts tests/boundary/process/androidAnalysisMcp.test.ts

🤖 Written and tested with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊

@N0zoM1z0 N0zoM1z0 closed this Nov 22, 2026
@N0zoM1z0 N0zoM1z0 reopened this Nov 22, 2026

@gensokyo-dev gensokyo-dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the supply chain and the engine. Tag v0.8.0 resolves to 2b2a560e8, the release is by the repository owner, and the asset's SHA-256 (my download and GitHub's digest) matches the pin. Upstream rewrote its history, but the rewritten v0.7.1 commit has the same tree as the old pin, and the v0.7.1 to v0.8.0 source diff adds no process, network or class-loading calls. Locally, the real Android lane (analysis.mjs with the bridge catalog check) passes against the 0.8.0 JAR on JDK 17, along with 560 touched tests. Fresh CI is green. Thanks.

@N0zoM1z0
N0zoM1z0 merged commit 3d1f11a into morluto:main Nov 22, 2026
118 checks passed
@cainiao1992
cainiao1992 deleted the feat/jadx-headless-mcp-0.8.0 branch November 22, 2026 11:25
@cainiao1992
cainiao1992 restored the feat/jadx-headless-mcp-0.8.0 branch November 22, 2026 11:26
@cainiao1992
cainiao1992 deleted the feat/jadx-headless-mcp-0.8.0 branch November 22, 2026 11:26
@morluto morluto added area: mcp MCP server, transport, and tool registration enhancement New feature or request provider: jadx Analysis provider / engine: jadx labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: mcp MCP server, transport, and tool registration enhancement New feature or request provider: jadx Analysis provider / engine: jadx

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants