fix move-object arg swap
This commit is contained in:
parent
84eacfb7d4
commit
e4532f9e3c
2 changed files with 61 additions and 5 deletions
64
test.py
64
test.py
|
|
@ -82,8 +82,6 @@ new_apk = Apk()
|
|||
for dex in dex_raw:
|
||||
new_apk.add_dex_file(dex)
|
||||
|
||||
print(f"{new_apk == apk=}")
|
||||
|
||||
|
||||
# print("[+] Repackage")
|
||||
#
|
||||
|
|
@ -97,7 +95,65 @@ print(f"{new_apk == apk=}")
|
|||
# )
|
||||
|
||||
|
||||
def cmp(a, b):
|
||||
def cmp(a, b, req=0):
|
||||
if req > 6:
|
||||
return
|
||||
if type(a) == dict:
|
||||
cmp_dict(a, b, req)
|
||||
elif type(a) == list:
|
||||
cmp_list(a, b, req)
|
||||
else:
|
||||
cmp_other(a, b, req)
|
||||
|
||||
|
||||
def cmp_other(a, b, req=0):
|
||||
ident = " " * req
|
||||
for f in dir(a):
|
||||
if getattr(getattr(a, f), "__call__", None) is None:
|
||||
print(f"{f}: {getattr(a, f) == getattr(b, f)}")
|
||||
eq = getattr(a, f) == getattr(b, f)
|
||||
print(f"{f'{ident}{f}: ':<150}{eq}")
|
||||
if not eq:
|
||||
cmp(getattr(a, f), getattr(b, f), req + 1)
|
||||
|
||||
|
||||
def cmp_dict(a, b, req=0):
|
||||
ident = " " * req
|
||||
keys_a = set(a.keys())
|
||||
keys_b = set(b.keys())
|
||||
if keys_a != keys_b:
|
||||
print(f"{ident}a.keys() != b.keys()")
|
||||
for key in keys_a & keys_b:
|
||||
eq = a[key] == b[key]
|
||||
print(f"{f'{ident}{str(key)}: ':<150}{eq}")
|
||||
if not eq:
|
||||
cmp(a[key], b[key], req + 1)
|
||||
|
||||
|
||||
def cmp_list(a, b, req=0):
|
||||
ident = " " * req
|
||||
la = len(a)
|
||||
lb = len(b)
|
||||
if la != lb:
|
||||
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}{eq}")
|
||||
if not eq:
|
||||
cmp(a[i], b[i], req + 1)
|
||||
|
||||
|
||||
apk_eq = new_apk == apk
|
||||
print(f"apk are equals: {apk_eq}")
|
||||
if not apk_eq:
|
||||
cmp(new_apk, apk)
|
||||
|
||||
mid = IdMethod(
|
||||
"setAction",
|
||||
IdMethodType(
|
||||
IdType("Landroidx/navigation/NavDeepLink$Builder;"),
|
||||
[IdType("Ljava/lang/String;")],
|
||||
),
|
||||
IdType("Landroidx/navigation/NavDeepLink$Builder;"),
|
||||
)
|
||||
m = apk.classes[mid.class_].virtual_methods[mid]
|
||||
nm = new_apk.classes[mid.class_].virtual_methods[mid]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue