mirror of
https://github.com/morluto/rea
synced 2026-10-27 22:45:19 -04:00
03f17cf41d
Apply caller-selected R8/ProGuard mappings to shared Android inspections, preserving raw identities, exact verification, ambiguity and provenance. Add retained summaries and bounded/cached parsing, with measured real R8/Conscrypt workflows and review fixes. Fixes #6329. Co-authored-by: 555aaditya <107977627+555aaditya@users.noreply.github.com>
76 lines
2.0 KiB
TypeScript
76 lines
2.0 KiB
TypeScript
import { expect } from "vitest";
|
|
import { cliTest } from "../../support/cli/cliFixture.js";
|
|
|
|
cliTest.for([
|
|
["inspect-android-class", "selected.Class"],
|
|
["inspect-android-method", "selected.Class", "chosen"],
|
|
] as const)(
|
|
"requires portable source output for Android symbol summary (%s)",
|
|
async (command, { cli }) => {
|
|
const result = await cli.run({
|
|
arguments: [
|
|
command[0],
|
|
"/nonexistent/selected.apk",
|
|
...command.slice(1),
|
|
"--detail",
|
|
"summary",
|
|
"--mapping-path",
|
|
"/nonexistent/mapping.txt",
|
|
"--json",
|
|
],
|
|
environment: {
|
|
REA_JADX_MCP_JAR: "/nonexistent/engine.jar",
|
|
REA_LOG_LEVEL: "silent",
|
|
},
|
|
});
|
|
expect(result.exitCode).toBe(1);
|
|
expect(result.json).toMatchObject({
|
|
code: "invalid_request",
|
|
details: {
|
|
issues: expect.arrayContaining([
|
|
expect.objectContaining({ path: ["evidence_output"] }),
|
|
]),
|
|
},
|
|
});
|
|
},
|
|
);
|
|
|
|
cliTest.for([
|
|
["complete", '{"kind":"android","facet":"components"}', "view"],
|
|
["summary", '{"kind":"android","facet":"components"}', "evidence_output"],
|
|
[
|
|
"summary",
|
|
'{"kind":"android","facet":"components","fields":["invented"]}',
|
|
"view",
|
|
],
|
|
["summary", "{broken", "view"],
|
|
] as const)(
|
|
"rejects invalid Android delivery before missing APK/JAR work (%s, %s)",
|
|
async ([detail, view, field], { cli }) => {
|
|
const result = await cli.run({
|
|
arguments: [
|
|
"inspect-android-package",
|
|
"/nonexistent/selected.apk",
|
|
"--detail",
|
|
detail,
|
|
"--view",
|
|
view,
|
|
"--json",
|
|
],
|
|
environment: {
|
|
REA_JADX_MCP_JAR: "/nonexistent/selected-engine.jar",
|
|
REA_LOG_LEVEL: "silent",
|
|
},
|
|
});
|
|
expect(result.exitCode).toBe(1);
|
|
expect(result.json).toMatchObject({
|
|
code: "invalid_request",
|
|
details: {
|
|
issues: expect.arrayContaining([
|
|
expect.objectContaining({ path: expect.arrayContaining([field]) }),
|
|
]),
|
|
},
|
|
});
|
|
},
|
|
);
|