Repository navigation
fix(android): preserve executable static initializer evidence - #1876
Conversation
Return the exact static initializer disassembly before Java projection can lose field assignments. Retain byte limits and representation markers, and verify fully folded and mixed initialization through the real CLI/MCP lane. Closes #1846 Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> Co-authored-by: Kaoru0822 <[email protected]>
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5b065df1bc
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!smali.getFound() || smali.getBlocks().size() != 1) | ||
| throw new IllegalArgumentException("Static initializer disassembly requires one exact method: " + selected.shortId()); |
There was a problem hiding this comment.
Preserve the smali generation failure reason
When JADX times out or fails while materializing the class smali, getMethodSmali returns found=false together with a diagnostic note, but this branch discards that note and reports only that one exact method was required. This misclassifies an engine failure as a selector/cardinality problem and removes the timeout or generation reason from the caller's Evidence; propagate smali.getNote() or otherwise distinguish generation failure from zero/multiple blocks.
AGENTS.md reference: AGENTS.md:L21-L21
Useful? React with 👍 / 👎.
Summary
REA could report an executable Android static initializer as unavailable, or return only a surviving Java static block while omitting field assignments. Return the exact
<clinit>()Vsmali body, markedstatic_initializer_disassembly, so both folded assignments and remaining calls are available together.Closes #1846.
Problem and change
Java generation can relocate initializer instructions into field declarations. A nonempty Java method body therefore does not establish initializer coverage. The REA bridge selects the original method identity and requires one disassembly block; it preserves the engine's existing source byte limit and truncation marker. Ordinary method decompilation and overloaded-smali rejection remain in place.
The real Android verifier now assembles two source-owned DEX fixtures with the audited engine's existing assembler. It checks completely folded initialization and mixed field/static-block initialization through the bridge and public CLI/MCP. Its stale runtime-helper imports are updated to the current configuration boundary and a streaming verifier digest.
Contract and boundary impact
Evidence and validation
npm run verify:android— passed, including cold metadata, stable overloads, both initializer cases through actual CLI/MCP, ordinary Java methods, no fabricated executable native/abstract bodies, byte-limited disassembly, cancellation/cleanup and failure recovery.npm run build:cached,npm run check,npm run docs:checkandgit diff --check— passed.Compatibility and proof gaps
Verified with the audited Android engine 0.7.1 on Linux x86_64, Node.js 24.18.0 and JDK 21, under one CPU / 3 GiB with a configured 768-MiB Java heap. Native Windows/macOS execution was not performed locally; the Windows verifier's configuration calls now match the runtime API. No new non-Android provider claim or runtime-execution capability is made.