fix(adb): preserve directory identities and share byte capture

Use Android 8-compatible batched find/stat with NUL-framed names and raw symlink targets. Preserve malformed or invalid UTF-8 records as partial evidence with exact source bytes. List hidden direct children without synthetic navigation entries.

Share process byte capture with UTF-8 callers and screenshots, removing duplicate timeout and cancellation supervision. Verified 35 focused process, ADB, CLI and MCP tests; compatibility checked against AOSP Oreo sources. Live Android device/emulator verification was not run.
This commit is contained in:
morluto
2026-10-12 13:06:51 +08:00
parent 3bcc68c037
commit 3bdc8730bd
10 changed files with 552 additions and 180 deletions
+11 -1
View File
@@ -5,9 +5,19 @@ import { describe, expect, it } from "vitest";
import { createTestTempDirectory } from "../../tests/fixtures/temporaryDirectory.js";
import { execFileOutput } from "./ExecFileOutput.js";
import { execFileBytes, execFileOutput } from "./ExecFileOutput.js";
describe("execFileOutput", () => {
it("preserves captured bytes for callers that own the output format", async () => {
const result = await execFileBytes(process.execPath, [
"-e",
"process.stdout.write(Buffer.from([0x00, 0xff, 0x41])); process.stderr.write(Buffer.from([0xfe]));",
]);
expect(result.stdout).toEqual(Buffer.from([0x00, 0xff, 0x41]));
expect(result.stderr).toEqual(Buffer.from([0xfe]));
});
it("captures output larger than Node's default execFile limit", async () => {
const marker = "tail-marker";
const result = await execFileOutput(process.execPath, [