mirror of
https://github.com/morluto/rea.git
synced 2026-11-19 21:23:45 +00:00
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:
1 parent
486470ec9b
commit
dc6799d488
10 files changed
+251
-65
No files matched your search
@@ -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(
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Reference in new issue
Block a user