mirror of
https://github.com/morluto/rea.git
synced 2026-11-18 20:53:00 +00:00
fix(android): reject invoke coverage without site evidence (#10679)
The JADX bridge emits or removes direct_invokes and direct_invokes_exhaustive together. A protocol item carrying only the coverage flag reached trace_android_references as a reference that claimed true or false coverage over a null site list, while the coverage summary counted it as unknown. The protocol schema now rejects that combination. Rebased onto current main from morluto/rea#2850. The companion change that removed the null default from the result schema already landed on main. Co-authored-by: LcokHcak <268763621+LcokHcak@users.noreply.github.com>
This commit is contained in:
1 parent
c1c9783a9e
commit
fbd6fd1c4f
2 files changed
+43
-21
No files matched your search
+32
-21
@@ -162,27 +162,38 @@ export const jadxXrefsSchema = z.object({
|
||||
count,
|
||||
resolve_line: z.literal(false),
|
||||
items: z.array(
|
||||
z.object({
|
||||
kind: z.string(),
|
||||
name: z.string(),
|
||||
full_name: z.string(),
|
||||
containing_class: z.string(),
|
||||
top_class: z.string(),
|
||||
def_pos: z.int(),
|
||||
source_selector: androidMethodSelectorSchema.optional(),
|
||||
direct_invokes_exhaustive: z.boolean().optional(),
|
||||
direct_invokes: z
|
||||
.array(
|
||||
z.object({
|
||||
dex_entry: z.string().min(1),
|
||||
source_raw_method_id: z.string().min(1),
|
||||
dex_code_unit_offset: count,
|
||||
dex_method_index: count,
|
||||
opcode: z.string().regex(/^INVOKE_/u),
|
||||
}),
|
||||
)
|
||||
.optional(),
|
||||
}),
|
||||
z
|
||||
.object({
|
||||
kind: z.string(),
|
||||
name: z.string(),
|
||||
full_name: z.string(),
|
||||
containing_class: z.string(),
|
||||
top_class: z.string(),
|
||||
def_pos: z.int(),
|
||||
source_selector: androidMethodSelectorSchema.optional(),
|
||||
direct_invokes_exhaustive: z.boolean().optional(),
|
||||
direct_invokes: z
|
||||
.array(
|
||||
z.object({
|
||||
dex_entry: z.string().min(1),
|
||||
source_raw_method_id: z.string().min(1),
|
||||
dex_code_unit_offset: count,
|
||||
dex_method_index: count,
|
||||
opcode: z.string().regex(/^INVOKE_/u),
|
||||
}),
|
||||
)
|
||||
.optional(),
|
||||
})
|
||||
// The bridge emits or removes the site list and its coverage together.
|
||||
.refine(
|
||||
(item) =>
|
||||
item.direct_invokes_exhaustive === undefined ||
|
||||
item.direct_invokes !== undefined,
|
||||
{
|
||||
message: "Invoke coverage requires a direct invoke site list",
|
||||
path: ["direct_invokes_exhaustive"],
|
||||
},
|
||||
),
|
||||
),
|
||||
});
|
||||
const toolResponse = z
|
||||
|
||||
Reference in new issue
Block a user