fix(android)!: preserve JVM settings and reuse metadata sessions (#908)

* perf(graph): avoid repeated traversal edge scans and copies

* fix(android)!: preserve JVM settings and reuse metadata sessions

Read class metadata without generating application source, retain immutable serialized APK sessions, and join owned cleanup on cancellation and shutdown.

BREAKING CHANGE: Android analysis now requires a full JDK 17 or newer with its compiler module for the packaged Java source bridge.
This commit is contained in:
morluto
2026-10-07 16:50:41 +08:00
committed by GitHub
parent f430c416c7
commit eab34a9d8c
36 changed files with 1165 additions and 138 deletions
+3 -1
View File
@@ -93,5 +93,7 @@ const addAdjacency = (
nodeId: string,
entry: AdjacencyEntry,
): void => {
adjacency.set(nodeId, [...(adjacency.get(nodeId) ?? []), entry]);
const entries = adjacency.get(nodeId);
if (entries === undefined) adjacency.set(nodeId, [entry]);
else entries.push(entry);
};
+9 -5
View File
@@ -204,16 +204,20 @@ export const traceNativeInvestigationGraph = (
let reachedDepth = 0;
let truncated = false;
let reason: string | null = null;
const adjacency = new Map<string, NativeInvestigationEdge[]>();
for (const edge of graph.edges) {
const nodeId = direction === "forward" ? edge.from : edge.to;
if (nodeId === null) continue;
const entries = adjacency.get(nodeId);
if (entries === undefined) adjacency.set(nodeId, [edge]);
else entries.push(edge);
}
while (queue.length > 0) {
const current = queue.shift();
if (current === undefined) break;
reachedDepth = Math.max(reachedDepth, current.depth);
const adjacent = graph.edges.filter((edge) =>
direction === "forward"
? edge.from === current.id
: edge.to === current.id,
);
const adjacent = adjacency.get(current.id) ?? [];
for (const edge of adjacent) {
if (selectedEdges.size + unresolved.size >= limits.max_edges) {