fix switch and array alignement
This commit is contained in:
parent
cd6c638080
commit
a0ecb1a18d
5 changed files with 165 additions and 51 deletions
56
test.py
56
test.py
|
|
@ -59,24 +59,24 @@ print(f"[+] New code of {method_id} ")
|
|||
for i in code.insns:
|
||||
print(f" {i}")
|
||||
|
||||
# Strip class for debugging
|
||||
classes = list(
|
||||
filter(
|
||||
lambda x: x
|
||||
not in [
|
||||
# IdType("Lcom/example/testapplication/ui/home/HomeViewModel;"),
|
||||
# IdType("Landroidx/navigation/NavDeepLink$Builder;"),
|
||||
# IdType("Landroidx/constraintlayout/core/widgets/ConstraintWidget$1;"),
|
||||
# IdType("Landroidx/appcompat/app/ActionBar;"),
|
||||
# IdType("Landroidx/constraintlayout/core/state/WidgetFrame;"),
|
||||
IdType("Landroidx/appcompat/app/AppCompatViewInflater;"),
|
||||
],
|
||||
apk.classes.keys(),
|
||||
)
|
||||
)
|
||||
for cls in classes:
|
||||
apk.remove_class(cls)
|
||||
|
||||
# # Strip class for debugging
|
||||
# classes = list(
|
||||
# filter(
|
||||
# lambda x: x
|
||||
# not in [
|
||||
# IdType("Lcom/example/testapplication/ui/home/HomeViewModel;"),
|
||||
# IdType("Landroidx/navigation/NavDeepLink$Builder;"),
|
||||
# IdType("Landroidx/constraintlayout/core/widgets/ConstraintWidget$1;"),
|
||||
# IdType("Landroidx/appcompat/app/ActionBar;"),
|
||||
# IdType("Landroidx/constraintlayout/core/state/WidgetFrame;"),
|
||||
# IdType("Landroidx/appcompat/app/AppCompatViewInflater;"),
|
||||
# ],
|
||||
# apk.classes.keys(),
|
||||
# )
|
||||
# )
|
||||
# for cls in classes:
|
||||
# apk.remove_class(cls)
|
||||
#
|
||||
print("[+] Recompile")
|
||||
|
||||
dex_raw = apk.gen_raw_dex()
|
||||
|
|
@ -86,16 +86,16 @@ for dex in dex_raw:
|
|||
new_apk.add_dex_file(dex)
|
||||
|
||||
|
||||
# print("[+] Repackage")
|
||||
#
|
||||
# utils.replace_dex(
|
||||
# APK_NAME,
|
||||
# APK_NAME.parent / (APK_NAME.name.removesuffix(".apk") + "-instrumented.apk"),
|
||||
# dex_raw,
|
||||
# Path().parent / "my-release-key.jks",
|
||||
# zipalign=Path.home() / "Android" / "Sdk" / "build-tools" / "34.0.0" / "zipalign",
|
||||
# apksigner=Path.home() / "Android" / "Sdk" / "build-tools" / "34.0.0" / "apksigner",
|
||||
# )
|
||||
print("[+] Repackage")
|
||||
|
||||
utils.replace_dex(
|
||||
APK_NAME,
|
||||
APK_NAME.parent / (APK_NAME.name.removesuffix(".apk") + "-instrumented.apk"),
|
||||
dex_raw,
|
||||
Path().parent / "my-release-key.jks",
|
||||
zipalign=Path.home() / "Android" / "Sdk" / "build-tools" / "34.0.0" / "zipalign",
|
||||
apksigner=Path.home() / "Android" / "Sdk" / "build-tools" / "34.0.0" / "apksigner",
|
||||
)
|
||||
|
||||
last_id = None
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue