Skip to content

fix(android): preserve executable static initializer evidence - #1876

Merged
N0zoM1z0 merged 1 commit into
mainfrom
fix/1846-android-initializer-evidence
Oct 11, 2026
Merged

N0zoM1z0 merged 1 commit into
mainfrom
fix/1846-android-initializer-evidence

Conversation

@N0zoM1z0

Copy link
Copy Markdown
Collaborator

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>()V smali body, marked static_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

  • Owner: Android provider bridge, before source projection. Public inputs and result schemas are unchanged; static initializer output uses the already-supported smali representation and an explicit reason marker.
  • Evidence: retains method/overload identity, original observations, artifact/engine digests, and incomplete-text reporting. Disassembly is static evidence and does not establish runtime behavior.
  • Process, authorization and containment: existing owned-worker lifecycle; target APKs are never launched. Fixture DEX/APK bytes are generated in an owned temporary directory and removed.
  • Package/generated metadata: no package, installation or catalog contract changes; no generated binaries are committed.

Evidence and validation

  • The added real-engine regression failed on the base bridge. Source investigation also confirmed the mixed case can have a nonempty Java method body while its field assignment is absent.
  • 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.
  • Final initializer regression — passed after adding an explicit byte-prefix check.
  • Original reported APK — CLI/MCP return matching initializer instructions, the field assignment and all eleven whitelist strings; following MCP ping succeeds and APK digest is unchanged.
  • Seven focused Android suites — 35 tests passed, including transport, partial observations, selector errors and cleanup.
  • npm run build:cached, npm run check, npm run docs:check and git 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.

  • Observations, derivations and unknowns remain distinguishable.
  • Artifact identity, provenance and partial evidence remain preserved.
  • One concrete issue, Conventional Commit title, meaningful regression and owning documentation.
  • Final diff contains no credentials, private artifacts or generated binaries.

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]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 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 ✅ Completed 2026-10-11T15:25:52.613831Z 5b065df 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +136 to +137
if (!smali.getFound() || smali.getBlocks().size() != 1)
throw new IllegalArgumentException("Static initializer disassembly requires one exact method: " + selected.shortId());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

@N0zoM1z0
N0zoM1z0 merged commit efbc25f into main Oct 11, 2026
31 checks passed
@N0zoM1z0
N0zoM1z0 deleted the fix/1846-android-initializer-evidence branch October 11, 2026 15:40
@github-actions github-actions Bot mentioned this pull request Oct 11, 2026
3 tasks done
@morluto morluto added bug Something isn't working area: evidence Evidence, artifacts, and reconstruction labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: evidence Evidence, artifacts, and reconstruction bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Android method inspection loses executable static initializer evidence

2 participants