fix(android): report method disassembly failure as unavailable body (#12090)

* fix(android): report method disassembly failure as unavailable body

Catch JADX bridge get_method_body failures in inspectMethod and project as an unavailable body with disassembly_failed marker, avoiding generic execution_failure with irrelevant rea doctor remediation.

Fixes #10482

* fix(android): preserve method identity when disassembly is unavailable

* fix(android): retain method identity when smali generation fails

---------

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
This commit is contained in:
Ahmedandmorluto authored and GitHub committed 2026-11-18 15:23:34 -05:00
1 parent 486470ec9b
commit dc6799d488
10 files changed
+251 -65

No files matched your search

+16 -5
View File
@@ -437,11 +437,22 @@ const inspectMethod = async (
class_name: summary.full_name,
method: selected,
overload_count: candidates.length,
representation: body.mode,
body_status: body.body.length === 0 ? "not_available" : "available",
fell_back: body.fell_back,
markers: body.markers,
source: normalizeJadxText(body.body),
...(body.mode === "unavailable"
? {
representation: null,
body_status: "not_available",
body_unavailable_reason: body.body_unavailable_reason,
fell_back: false,
markers: ["disassembly_failed"],
source: null,
}
: {
representation: body.mode,
body_status: body.body.length === 0 ? "not_available" : "available",
fell_back: body.fell_back,
markers: body.markers,
source: normalizeJadxText(body.body),
}),
...mappingOf(mapping, () => [
classQuery(summary),
...methodQueries(summary).filter(
+16 -6
View File
@@ -139,18 +139,28 @@ export const jadxExternalReferenceSummarySchema = z.object({
observed_method_count: count,
prototypes: z.array(jadxMethodMetadataSchema).min(1),
});
export const jadxMethodSchema = z.object({
const jadxMethodIdentity = {
class_name: z.string(),
method_name: z.string(),
full_name: z.string(),
overload_index: count,
overload_count: count,
dex_descriptor: dexDescriptorSchema,
mode: z.enum(["java", "smali"]),
fell_back: z.boolean(),
markers: z.array(z.string()),
body: z.string(),
});
};
export const jadxMethodSchema = z.discriminatedUnion("mode", [
z.object({
...jadxMethodIdentity,
mode: z.enum(["java", "smali"]),
fell_back: z.boolean(),
markers: z.array(z.string()),
body: z.string(),
}),
z.strictObject({
...jadxMethodIdentity,
mode: z.literal("unavailable"),
body_unavailable_reason: z.string().min(1),
}),
]);
export const jadxXrefsSchema = z.object({
target: z.string(),
reference_target: z.literal("external").optional(),