catch when nb method ids > 2^16

This commit is contained in:
Jean-Marie 'Histausse' Mineau 2024-02-29 14:43:56 +01:00
parent 0b430fe187
commit ed8c584647
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2
3 changed files with 89 additions and 32 deletions

View file

@ -2,7 +2,8 @@ import logging
FORMAT = "[%(levelname)s] %(name)s %(filename)s:%(lineno)d: %(message)s"
logging.basicConfig(format=FORMAT)
logging.getLogger().setLevel(logging.DEBUG)
# logging.getLogger().setLevel(logging.DEBUG)
logging.getLogger().setLevel(logging.WARNING)
import json
import zipfile as z
@ -207,8 +208,8 @@ def cmp_other(a, b, req=0):
len(f) < 2 or f[:2] != "__"
):
eq = getattr(a, f) == getattr(b, f)
print(f"{f'{ident}{f}: ':<150}{nice_bool(eq)}")
if not eq:
print(f"{f'{ident}{f}: ':<150}{nice_bool(eq)}")
if "descriptor" in dir(a):
global last_id
last_id = a.descriptor
@ -227,8 +228,8 @@ def cmp_dict(a, b, req=0):
eq = a[key] == b[key]
tot += 1
if not eq:
nb_failed += 1
print(f"{f'{ident}{str(key)}: ':<150}{nice_bool(eq)}")
nb_failed += 1
global last_id
last_id = key
cmp(a[key], b[key], req + 1)
@ -243,8 +244,8 @@ def cmp_list(a, b, req=0):
print(f"{ident}len(a) != len(b)")
for i in range(min(la, lb)):
eq = a[i] == b[i]
print(f"{f'{ident}{str(i)}: ':<150}{nice_bool(eq)}")
if not eq:
print(f"{f'{ident}{str(i)}: ':<150}{nice_bool(eq)}")
print(f"{ident}: {str(a[i])} != {str(b[i])}")
cmp(a[i], b[i], req + 1)
@ -252,7 +253,9 @@ def cmp_list(a, b, req=0):
instrumented_apk = Apk()
instrumented_apk.add_dex_file(dex_raw[0])
cmp(instrumented_apk, dyn_load_apk)
print("wtf?")
# cmp(instrumented_apk, dyn_load_apk)
MAX_REQ = 5
@ -330,3 +333,6 @@ for ty in tys:
instrumented_apk.classes[ty],
dyn_load_apk.classes[ty],
)
# direct: Landroidx/compose/foundation/layout/IntrinsicSize;->values()[Landroidx/compose/foundation/layout/IntrinsicSize;
# insns[3]: Landroidx/compose/foundation/layout/IntrinsicSize;->values()[Landroidx/compose/foundation/layout/IntrinsicSize;: