[PR #1276] [MERGED] fix(android): support owned JADX stdio on Windows #2759

Closed
opened 2026-10-17 21:09:54 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1276
Author: @N0zoM1z0
Created: 10/9/2026
Status: ✅ Merged
Merged: 10/9/2026
Merged by: @N0zoM1z0

Base: main ← Head: fix/android-windows-stdio


📝 Commits (1)

  • d0e2ea2 fix(android): support owned JADX stdio on Windows

📊 Changes

21 files changed (+954 additions, -49 deletions)

View changed files

📝 README.md (+1 -1)
📝 docs/android-analysis.md (+32 -1)
📝 docs/testing.md (+7 -0)
📝 native/windows/src/authority.hpp (+4 -2)
📝 native/windows/src/process.cc (+100 -9)
➕ scripts/lib/windows-protocol-input.mjs (+237 -0)
📝 scripts/verify-windows-native.mjs (+5 -0)
📝 scripts/verify/android/analysis.mjs (+20 -7)
📝 scripts/verify/android/failure-recovery.mjs (+24 -6)
📝 scripts/verify/android/metadata.mjs (+8 -1)
➕ scripts/verify/android/windows-lifecycle.mjs (+301 -0)
📝 skill-src/reverse-engineer-anything/references/android-applications.md (+6 -3)
📝 src/android/JadxConfiguration.ts (+65 -7)
📝 src/android/JadxMcpTransport.ts (+14 -2)
📝 src/application/CapabilityInventory.ts (+1 -1)
📝 src/process/ProviderProcess.ts (+1 -4)
📝 src/server/registerSessionTools.ts (+1 -1)
📝 src/windows/WindowsNativeLoader.test.ts (+18 -1)
📝 src/windows/WindowsNativeLoader.ts (+1 -0)
📝 src/windows/WindowsOwnedProcess.ts (+62 -1)

...and 1 more files

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/1276 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/9/2026 **Status:** ✅ Merged **Merged:** 10/9/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/android-windows-stdio` --- ### 📝 Commits (1) - [`d0e2ea2`](https://github.com/morluto/rea/commit/d0e2ea2e8dc7990301eaccd842798090a9463c39) fix(android): support owned JADX stdio on Windows ### 📊 Changes **21 files changed** (+954 additions, -49 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+1 -1) 📝 `docs/android-analysis.md` (+32 -1) 📝 `docs/testing.md` (+7 -0) 📝 `native/windows/src/authority.hpp` (+4 -2) 📝 `native/windows/src/process.cc` (+100 -9) ➕ `scripts/lib/windows-protocol-input.mjs` (+237 -0) 📝 `scripts/verify-windows-native.mjs` (+5 -0) 📝 `scripts/verify/android/analysis.mjs` (+20 -7) 📝 `scripts/verify/android/failure-recovery.mjs` (+24 -6) 📝 `scripts/verify/android/metadata.mjs` (+8 -1) ➕ `scripts/verify/android/windows-lifecycle.mjs` (+301 -0) 📝 `skill-src/reverse-engineer-anything/references/android-applications.md` (+6 -3) 📝 `src/android/JadxConfiguration.ts` (+65 -7) 📝 `src/android/JadxMcpTransport.ts` (+14 -2) 📝 `src/application/CapabilityInventory.ts` (+1 -1) 📝 `src/process/ProviderProcess.ts` (+1 -4) 📝 `src/server/registerSessionTools.ts` (+1 -1) 📝 `src/windows/WindowsNativeLoader.test.ts` (+18 -1) 📝 `src/windows/WindowsNativeLoader.ts` (+1 -0) 📝 `src/windows/WindowsOwnedProcess.ts` (+62 -1) _...and 1 more files_ </details> ### 📄 Description 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: ```json {"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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:09:54 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#2759
No description provided.