fix(android): validate engine archive prerequisites (#1145)
* fix(android): validate engine archive prerequisites * fix(android): bound engine metadata reads before allocation
This commit is contained in:
Vendored
+2
-1
@@ -12,6 +12,7 @@ import {
|
||||
import { cleanupOwnedProcessGroup } from "../../../src/process/ProcessOwnership.js";
|
||||
import { writeOrderedZip } from "../artifactEntryOrder.js";
|
||||
import { createTestTempDirectory } from "../temporaryDirectory.js";
|
||||
import { writeJadxJarInventory } from "./jadxJar.js";
|
||||
|
||||
const fixture = fileURLToPath(new URL("./jadx-mcp.mjs", import.meta.url));
|
||||
|
||||
@@ -30,7 +31,7 @@ export const createJadxProtocolFixture = async (mode = "normal") => {
|
||||
);
|
||||
await chmod(java, 0o755);
|
||||
await writeOrderedZip(apk, ["AndroidManifest.xml", "classes.dex"]);
|
||||
await writeFile(jar, "synthetic engine bytes; not a Java archive");
|
||||
await writeJadxJarInventory(jar);
|
||||
const launches: {
|
||||
runId: string;
|
||||
cwd: string | undefined;
|
||||
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
import { writeOrderedZip } from "../artifactEntryOrder.js";
|
||||
|
||||
/** ZIP classpath inventory for synthetic protocol tests; not executable bytecode. */
|
||||
export const writeJadxJarInventory = (
|
||||
path: string,
|
||||
extraEntries: readonly string[] = [],
|
||||
): Promise<void> =>
|
||||
writeOrderedZip(path, [
|
||||
"com/atxx/jhmcp/JadxSession.class",
|
||||
"com/atxx/jhmcp/SessionHolder.class",
|
||||
"jadx/api/JadxDecompiler.class",
|
||||
"com/google/gson/Gson.class",
|
||||
"io/modelcontextprotocol/kotlin/sdk/server/Server.class",
|
||||
...extraEntries,
|
||||
]);
|
||||
Reference in New Issue
Block a user