Repository navigation
Conversation
[Medium impact] The reviewed changes appear safe to merge; all previous findings are addressed and no new blocking issue was found. SummaryAdds APK caller tracing for external methods named directly by DEX invokes.
Reviews (2) · Last reviewed commit: "fix(android): bound and reuse external p..." · Reviewed by Greptile |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
I tested this PR at
The reference is Exact match with dexdump. The callers and sites (DEX entry, caller, offset, opcode) are equal in all 18 cases:
Other checks:
Three observations, none blocking:
I didn't test reflection, JNI, inherited lookups (calls through an app subclass's method reference) or the oversized-inventory refusal path. |
|
Absorbing this contribution in #8154 because the source branch does not allow maintainer edits and needs a current-main conflict resolution. The integration preserves author credit, excludes unrelated resource-limit/JavaScript-test edits, and adds shared aggregate instruction-position coverage. All 322 Android boundary tests (1 existing Windows skip), the complete real Android CLI/MCP lane, and an independent NewPipe/dexdump check passed locally. The original PR will remain open until the integration merges. |
Resolve exact external method targets from directly encoded DEX invokes. Preserve complete caller identity, bounded position evidence and follow-up selectors. Report aggregate position coverage independently of the caller inventory, and reuse bounded prototype facts within the exact session. Absorbs #8096. Fixes #7811. Co-authored-by: hhang <[email protected]>
|
Integrated in #8154 / 0ffed7a, with original author credit retained. The integration keeps this Android feature and its real conformance, adds aggregate instruction-position coverage, and preserves current-main resource controls. Current code CI, CodeQL and Greptile passed; real CLI/MCP and independent NewPipe/dexdump verification are recorded in #8154. |
Summary
Find APK callers of a framework/library method even when the APK does not define its declaring class. The existing
trace_android_referencesCLI/MCP operation now accepts these method targets from exact, directly encoded DEX invokes, reports observed prototypes, and returns selectors for inspecting the actual APK caller bodies.Fixes #7811. Measured baseline and controls: #7811 (comment) (recorded before implementation).
Problem and expected behavior
On main317bf3fe,
trace-android-references fixture.apk android.app.NotificationManager --method-name notifyrefuses the target becauseNotificationManageris absent from APK definitions, although the APK contains exact invokes. Defined-method references and reading the caller body already work. This extends that defined-only contract; it does not claim unknown runtime dispatch or every conservative refusal is a bug.With multiple observed prototypes, the caller must choose
overload_index. The selected result preserves one using-node row per APK method, repeated instruction sites, the raw DEX carrier/index/code-unit offset/opcode, and asource_selectoraccepted byinspect_android_method.Change and scope
Contract and boundary impact
ReaJadxBridgeobserves direct METHOD_REF invokes;JadxAnalysisvalidates/normalizes a distinct external prototype reply. Shared method selector schema supplies follow-up source identity.method_nameadmits externally referenced exact classes. Overload ambiguity stays explicit. No new tool (233 tools/6 prompts).target_definition,reference_scopeand callersource_selector; old retained Evidence may omit them and omission remains unknown. Existing digest/carrier/source facts remain primary.Expected effects:
Evidence and regression coverage
{ "class_name": "android.app.NotificationManager", "method_name": "notify", "dex_descriptor": "(ILandroid/app/Notification;)V", "target_definition": "external", "reference_scope": "direct_dex_invokes", "reference_unit": "using_node", "total": 3, "first_caller": { "source_selector": { "class_name": "fixture.Caller", "method_name": "notify0", "overload_index": 0 }, "direct_invokes_exhaustive": true, "direct_invokes": [ { "dex_entry": "classes.dex", "source_raw_method_id": "fixture.Caller.notify0(Landroid/app/NotificationManager;Landroid/app/Notification;)V", "dex_code_unit_offset": 1, "dex_method_index": 0, "opcode": "INVOKE_VIRTUAL" }, { "dex_entry": "classes.dex", "source_raw_method_id": "fixture.Caller.notify0(Landroid/app/NotificationManager;Landroid/app/Notification;)V", "dex_code_unit_offset": 4, "dex_method_index": 0, "opcode": "INVOKE_VIRTUAL" } ] } }For evidence-bearing changes:
Review fixes and CI boundary
The normal follow-up commit
fdfaa08171c8d9f75cf63c2f0a2e1935eeb53de9addresses three concrete review findings:method_inventoryprototype now returns the existing typed resource refusal and recovers on a valid subsequent request. Canonical upstreamMethodInfoallocation remains outside this additional guard; this is not a general memory or performance guarantee.The original head
6fcda30fhad one actual JavaScript worker test failure in CI run41010775127 (plus two aggregate failures): the assertion found the abort signal still unset while using a raw stdout-chunk observer. The exact CI chunk/timer order is not established and three local unmodified-worker attempts did not reproduce that CI failure. A separate valid-schema fragmented-frame control demonstrates the observer gap. The test now uses the existing framed observer after stream ownership and awaits the original abort event, retaining all original error/evidence/close assertions. Production worker, cancellation, timeouts, retries and skips are unchanged. The full worker test file passes36 cases. Old failed output and the initial invalid-UUID harness control remain preserved; a later green run will not erase them.Validation performed
npm run checkand test-discovery both PASS;2866 test files discovered once. Docs/package/real-engine gates retain their actual earlier timestamps: only two unshipped test files changed afterward, and all runtime/product inputs and2661 product bytes remain identical.npm run verify:androidwith pinned unmodified JADX0.7.1/JDK21.0.11/macOS arm64: complete existing real lane plus new single/multidex, ambiguity/descriptor, oversized-prototype, refusal/recovery and caller-inventory controls PASS. New compiled controls include7 CLI calls and3 stdio MCP sessions/25 calls, separately counted.npm run verify:packageand explicit pack dry-run PASS: official installed REA MCP233 tools/6 prompts, exact6.8.0 update, verified lineage and awaited cleanup.fdfaa081/9174d507/ parent6fcda30f. No history rewriting or hook bypass.Compatibility, safety, and release
Author readiness
Human owner: @xu91102
Before merge
type(scope): outcome.