From abc866504c05ae787626b6eebc9f474bbc6c537a Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Sat, 12 Nov 2022 12:12:44 +0100 Subject: [PATCH] Use aapt2 by default From https://developer.android.com/studio/command-line/aapt2 > Prior to AAPT2, AAPT was the default version of Android Asset Packaging Tool and it has now been deprecated. Although AAPT2 should immediately work with older projects, this section describes some behavior changes that you should be aware of. --- objection/commands/mobile_packages.py | 2 +- objection/console/cli.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/objection/commands/mobile_packages.py b/objection/commands/mobile_packages.py index 68516e8c..0fb6e126 100644 --- a/objection/commands/mobile_packages.py +++ b/objection/commands/mobile_packages.py @@ -99,7 +99,7 @@ def patch_ios_ipa(source: str, codesign_signature: str, provision_file: str, bin def patch_android_apk(source: str, architecture: str, pause: bool, skip_cleanup: bool = True, enable_debug: bool = True, gadget_version: str = None, skip_resources: bool = False, network_security_config: bool = False, target_class: str = None, - use_aapt2: bool = False, gadget_name: str = 'libfrida-gadget.so', + use_aapt2: bool = True, gadget_name: str = 'libfrida-gadget.so', gadget_config: str = None, script_source: str = None, ignore_nativelibs: bool = False, manifest: str = None) -> None: """ diff --git a/objection/console/cli.py b/objection/console/cli.py index 4a97f10d..d43cd3b5 100644 --- a/objection/console/cli.py +++ b/objection/console/cli.py @@ -266,8 +266,8 @@ def patchipa(source: str, gadget_version: str, codesign_signature: str, provisio @click.option('--skip-resources', '-D', is_flag=True, default=False, help='Skip resource decoding as part of the apktool processing.', show_default=True) @click.option('--target-class', '-t', help='The target class to patch.', default=None) -@click.option('--use-aapt2', '-2', is_flag=True, default=False, - help='Use the aapt2 binary instead of aapt as part of the apktool processing.', show_default=True) +@click.option('--use-aapt2', '-2', is_flag=True, default=True, + help='Use the aapt2 binary instead of aapt au part of the apktool processing.', show_default=True) @click.option('--gadget-name', '-g', default='libfrida-gadget.so', help=( 'Name of the gadget library. Can be named whatever you want to dodge anti-frida '