Repository navigation
feat(android): expose exact DEX descriptors and direct invoke sites - #2439
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
@greptileai review |
|
|
Review findings addressed at their producing boundaries and consumers. Latest changes were reviewed from source; tests and provider runs were skipped at the maintainer's request. Findings requiring separate decisions or verification remain open. Invoke evidence now shares a byte budget derived from the existing 8 MiB local transport frame, reserving the fixed JSON-RPC envelope and accounting for the nested JSON string escaping. Each site is admitted before retaining it, with a conservative expansion bound checked before serialization. All using nodes remain in the response; direct_invokes_exhaustive=false explicitly marks omitted instruction sites, while null means the producer did not establish instruction coverage. This marker is carried through protocol validation, application mapping, domain schema and documentation. No completed-task performance or real JADX verification is claimed for this source-only update. Source inspected at d17dee5; git diff --check passed. Tests, builds, source checks and CI reruns were skipped at the user's explicit request. No passing runtime/provider verification is claimed for this update. The named trace_android_references contract now distinguishes the containing node dex_offset (still unknown) from direct_invokes DEX code-unit instruction offsets. It also documents the independent direct_invokes_exhaustive coverage marker and preserves using-node totals rather than implying runtime call counts. Source inspected at d17dee5; git diff --check passed. Tests, builds, source checks and CI reruns were skipped at the user's explicit request. No passing runtime/provider verification is claimed for this update. Added production-adapter boundary cases for malformed DEX descriptors, negative instruction offsets and a missing invoke-site field. Additional cases preserve omitted direct_invokes as null versus an observed empty array, and check that bounded instruction coverage remains separate from complete using-node coverage. These new tests were not run because the user explicitly stopped testing. Source inspected at d17dee5; git diff --check passed. Tests, builds, source checks and CI reruns were skipped at the user's explicit request. No passing runtime/provider verification is claimed for this update. |
|
Review findings addressed at their producing boundaries and consumers. Latest changes were reviewed from source; tests and provider runs were skipped at the maintainer's request. Findings requiring separate decisions or verification remain open. Source fix: Invoke-budget admission was created unconditionally even though class-reference queries have no selected method and never collect invoke sites. Budget creation and its loop now share the Source inspection followed class/method selection, marker initialization, budget use, and final response serialization. No schema or evidence fields changed, and no additional downstream workaround remains. Tests, typechecks, builds, lint, JADX/provider workloads, and CI reruns were not run, as explicitly requested; performance was not measured. |
Keep direct_invokes_exhaustive normalization in the Android result contract so its parsed output is JSON-safe. Omitted or explicitly undefined provider coverage becomes null, while false and true remain distinct. Preserve the exact DEX descriptor and direct-invoke evidence introduced by PR morluto#2439. Backports the Android-only part of main commit 6e25cc3 for older PR branches. Captured main already contains this behavior. Tests, checks, builds, typechecks, lint and CI reruns were intentionally skipped at user request; inspected the producing protocol, adapter mapping and named result contract. Co-authored-by: LcokHcak <[email protected]> (cherry picked from commit 9a3b410)
Keep direct_invokes_exhaustive normalization in the Android result contract so its parsed output is JSON-safe. Omitted or explicitly undefined provider coverage becomes null, while false and true remain distinct. Preserve the exact DEX descriptor and direct-invoke evidence introduced by PR morluto#2439. Backports the Android-only part of main commit 6e25cc3 for older PR branches. Captured main already contains this behavior. Tests, checks, builds, typechecks, lint and CI reruns were intentionally skipped at user request; inspected the producing protocol, adapter mapping and named result contract. Co-authored-by: LcokHcak <[email protected]>
Keep direct_invokes_exhaustive normalization in the Android result contract so its parsed output is JSON-safe. Omitted or explicitly undefined provider coverage becomes null, while false and true remain distinct. Preserve the exact DEX descriptor and direct-invoke evidence introduced by PR morluto#2439. Backports the Android-only part of main commit 6e25cc3 for older PR branches. Captured main already contains this behavior. Tests, checks, builds, typechecks, lint and CI reruns were intentionally skipped at user request; inspected the producing protocol, adapter mapping and named result contract. Co-authored-by: LcokHcak <[email protected]>
Summary
Expose exact DEX method descriptors and individual direct
invoke-*sites in Android reference results. This lets an analyst distinguish a method that uses a target from each call instruction inside that method.Problem and expected behavior
In the included two-invoke fixture,
fixture.Caller.twice()callsfixture.Target.mark()twice. JADXgetUseIn()reports one using method, so REA previously returnedtotal: 1with no instruction location. The result looked complete at method granularity but could not answer how many direct calls existed or where they occurred.Change and scope
The JADX bridge now provides the DEX descriptor and direct invoke instruction data when the producer can match them. The Android adapter validates and carries the source method identity, DEX entry, code-unit offset, method index and opcode through the domain result and both CLI/MCP paths.
totalandreference_unit: "using_node"keep their existing meaning;direct_invokesis separate instruction evidence. No APK is executed and no new provider is introduced. No issue is linked because this was reproduced with a controlled repository fixture.Contract and boundary impact
dex_descriptoranddirect_invokesfields, with the same result through both adapters; no new tool.Known workflow effects: reads the selected APK and supplied JADX JAR, runs the existing local Java bridge, and uses its private temporary workspace. It does not run APK code or contact a target service.
Evidence and regression coverage
The controlled fixture now returns one using method with two direct invoke offsets,
0and3, forfixture.Caller.twice()V. Tests cover overload identity, malformed producer values, single/multi-DEX source identity, CLI/MCP parity, and unchanged APK bytes. These are static observations; runtime call counts remain unknown. The regression would fail on the base revision becausedirect_invokesand the exact descriptor were absent.Validation performed
37b7550:npm run build:cachedand the full real Android/JADX lane passed with JDK 21, fixed JADX 0.7.1 JAR and public ApiDemos APK. Single/multi-DEX offsets, overload identity, CLI/MCP parity and APK hash checks passed.37b7550:npm run check,npm run docs:check,npm run verify:test-discovery, 16 relevant Vitest tests and the full real Android and Chrome lanes passed.4773c15;npm run checkpassed on the combined branch at that base. The four intervening upstream commits did not change the Android invoke files.Compatibility, safety, and release
Before merge
CONTRIBUTING.md.