feat(android): expose exact DEX descriptors and direct invoke sites (#2439)

* feat(android): expose precise method references and DEX invoke sites

* fix(android): bound invoke evidence without losing reference inventory

* perf(android): skip invoke admission for class references

---------

Co-authored-by: LcokHcak <268763621+LcokHcak@users.noreply.github.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
This commit is contained in:
LcokHcak
2026-10-13 22:02:47 +08:00
committed by GitHub
co-authored by LcokHcak morluto
parent ce748be2f3
commit c45d912c91
17 changed files with 870 additions and 38 deletions
+9
View File
@@ -0,0 +1,9 @@
.class public Lfixture/Caller;
.super Ljava/lang/Object;
.method public static twice()V
.registers 0
invoke-static {}, Lfixture/Target;->mark()V
invoke-static {}, Lfixture/Target;->mark()V
return-void
.end method
+7
View File
@@ -0,0 +1,7 @@
.class public Lfixture/Target;
.super Ljava/lang/Object;
.method public static mark()V
.registers 0
return-void
.end method
+12 -1
View File
@@ -32,18 +32,21 @@ const methods = [
{
name: "onCreate",
signature: "onCreate(Bundle): void",
dex_descriptor: "(Landroid/os/Bundle;)V",
is_constructor: false,
def_pos: 0,
},
{
name: "choose",
signature: "choose(String): void",
dex_descriptor: "(Ljava/lang/String;)V",
is_constructor: false,
def_pos: 0,
},
{
name: "choose",
signature: "choose(int): void",
dex_descriptor: "(I)V",
is_constructor: false,
def_pos: 0,
},
@@ -139,10 +142,18 @@ register("get_method_body", ({ method_name, overload_index }) =>
}),
);
for (const name of ["get_xrefs_to_class", "get_xrefs_to_method"])
register(name, ({ class_name, method_name }) =>
register(name, ({ class_name, method_name, overload_index }) =>
json({
target:
method_name === undefined ? class_name : `${class_name}.${method_name}`,
...(method_name === undefined
? {}
: {
overload_index,
reported_signature: methods.filter(
(method) => method.name === method_name,
)[overload_index]?.signature,
}),
total: mode === "partial-xrefs" ? 2 : 1,
count: 1,
resolve_line: false,