Skip to content

fix(android): support owned JADX stdio on Windows - #1276

Merged
N0zoM1z0 merged 1 commit into
mainfrom
fix/android-windows-stdio
Oct 9, 2026
Merged

N0zoM1z0 merged 1 commit into
mainfrom
fix/android-windows-stdio

Conversation

@N0zoM1z0

@N0zoM1z0 N0zoM1z0 commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Windows rejected every Android/JADX request because the owned launcher had no writable protocol stdin. Support Windows x64 through the existing atomic Job Object boundary, resolve the selected java.exe to an absolute executable, and retain stream error handling until pending writes settle during cancellation.

Native input writes copy the admitted Buffer and run off the Node event loop. Opaque process handles, explicit handle inheritance, backpressure, EOF and kill-on-owner-close remain enforced. The default NUL input and four-argument native launch remain valid for existing providers. Readiness distinguishes missing Windows package controls from JDK/JAR failures. Documentation and the existing Android/native verification lanes cover the Windows path.

Closes #1262.

Validation:

  • Native Windows x64, supported Node 22.19.0, existing full JDK 21 and pinned JADX 0.7.1; source-built package snapshot with reused locked dependencies, not a newly published npm installation.
  • Real ApiDemos: all five CLI/MCP results match; metadata/generic/overload regression; missing compiler/Java, invalid JAR and selector recovery. A separate final run exercises all five MCP operations and CLI package parity on an APK path containing Chinese characters and spaces, retains that path and digest, and validates the full 139-tool catalog.
  • Real Windows MCP cancellation/disconnect: Java exit and workspace removal; ping and next successful call after cancellation. Abrupt CLI owner exit kills Java through the job; temporary workspace removal is explicitly not claimed for forced exit. Observed Java affinity: two CPUs, BelowNormal priority, -Xmx512m, -XX:ActiveProcessorCount=2.
  • verify:windows-native: protected DACL/snapshots, descendant and owner-crash cleanup, default launch/output, 2,520,000-byte UTF-8/binary input, responsive event loop, backpressure/EOF, forged/malformed input rejection, native pending-write closure and provider transport cancellation. The last case reproduced an unhandled pipe error before the stream-close fix and passes after it. Optional extra boundary executable was not supplied locally; CI covers that fixture.
  • Linux x64/JDK 21: real SDK MCP execution of all five Android operations and successful close/ping with the same pinned engine. No new macOS real-provider run was performed.
  • 65 focused tests across nine files; 16 Windows native-loader cases including independent stdin capability; npm run check:fast; npm run docs:check.

Representative Windows MCP request:

{"name":"inspect_android_package","arguments":{"path":"D:/targets/ApiDemos-debug.apk"}}

The APK is never executed. Windows arm64 remains outside the native boundary. Real Hopper/Ghidra verification was not performed for this change. Windows support is new on main; this PR does not claim an existing released npm package includes it.

@N0zoM1z0 N0zoM1z0 added area: cli CLI adapter and one-shot commands area: mcp MCP server, transport, and tool registration area: tests Test suite and verification area: build Build, CI, packaging, and publishing labels Oct 9, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 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-09T12:27:48.360595Z d0e2ea2 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: d0e2ea2e8d

ℹ️ 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 +150 to +152
input?.destroy();
await inputClosed;
input?.off("error", this.#error);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Await pending stdin writes before destroying the stream

When a Windows process_stdin_write is blocked during cancellation, WindowsOwnedProcess.#release() destroys this writable as soon as job settlement is observed. Node's finished() settles on that close event even if the custom _write callback and native promise are still pending, so destroying the input here and then awaiting inputClosed does not actually join the write. Consequently, close() can return and remove the error listener before the pending write rejects, leaving the native work active past the claimed cleanup boundary; explicitly track and await in-flight sends/writes before destroying and detaching the stream.

AGENTS.md reference: AGENTS.md:L101-L101

Useful? React with 👍 / 👎.

@N0zoM1z0
N0zoM1z0 merged commit 636b245 into main Oct 9, 2026
29 checks passed
@N0zoM1z0
N0zoM1z0 deleted the fix/android-windows-stdio branch October 9, 2026 12:34
morluto pushed a commit that referenced this pull request Oct 10, 2026
- EVM bytecode and recorded crashes: state the Linux x64 host requirement.
  `EvmoleInterfaceProvider` and `PwntoolsDecoder` refuse every other host
  with `capability_unavailable`, but only the neighbouring offline ELF layout
  row said so.
- Translations: Android analysis has supported Windows x64 since 6.2.0
  (#1276), which updated only the English table; 16 translations still said
  Linux/macOS.

Translated cells reuse each README's own wording: the recorded-crash cell
copies that file's ELF-row pwntools phrase, and the EVM and Android cells
follow the construction the same table already uses for host platforms.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
darsrc pushed a commit to darsrc/rea that referenced this pull request Oct 10, 2026
Support owned JADX stdio on Windows x64, preserve protocol input errors through cancellation, and verify native stdin and Android CLI/MCP lifecycle on the real Windows host.

Closes morluto#1262
darsrc pushed a commit to darsrc/rea that referenced this pull request Oct 10, 2026
…o#1422)

- EVM bytecode and recorded crashes: state the Linux x64 host requirement.
  `EvmoleInterfaceProvider` and `PwntoolsDecoder` refuse every other host
  with `capability_unavailable`, but only the neighbouring offline ELF layout
  row said so.
- Translations: Android analysis has supported Windows x64 since 6.2.0
  (morluto#1276), which updated only the English table; 16 translations still said
  Linux/macOS.

Translated cells reuse each README's own wording: the recorded-crash cell
copies that file's ELF-row pwntools phrase, and the EVM and Android cells
follow the construction the same table already uses for host platforms.
@morluto morluto added bug Something isn't working 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: build Build, CI, packaging, and publishing area: cli CLI adapter and one-shot commands area: mcp MCP server, transport, and tool registration area: tests Test suite and verification bug Something isn't working provider: jadx Analysis provider / engine: jadx

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] codex 提示 REA 的 Android/JADX 流程在当前 Windows 宿主上不可用,需要受支持的 Linux/macOS 环境。

2 participants