Skip to content

Commit

Permalink
Formatting fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
leonjza committed Apr 3, 2020
1 parent 255acd1 commit a111716
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion objection/commands/mobile_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ 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_config: str = None, script_source: str = None, ignore_nativelibs: bool = True) -> None:
use_aapt2: bool = False, gadget_config: str = None, script_source: str = None,
ignore_nativelibs: bool = True) -> None:
"""
Patches an Android APK by extracting, patching SMALI, repackaging
and signing a new APK.
Expand Down
2 changes: 1 addition & 1 deletion objection/console/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ def patchipa(source: str, gadget_version: str, codesign_signature: str, provisio
@click.option('--script-source', '-l', default=None,
help=('A script file to use with the the "path" config type. '
'Specify "libfrida-gadget.script.so" as the "path" in your config.'), show_default=False)
@click.option('--ignore-nativelibs', '-n', is_flag=True, default=False,
@click.option('--ignore-nativelibs', '-n', is_flag=True, default=False,
help=('Do not change the extractNativeLibs flag in the AndroidManifest.xml.'), show_default=False)
def patchapk(source: str, architecture: str, gadget_version: str, pause: bool, skip_cleanup: bool,
enable_debug: bool, skip_resources: bool, network_security_config: bool, target_class: str,
Expand Down
6 changes: 3 additions & 3 deletions objection/utils/patchers/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,14 +469,14 @@ def extract_native_libs_patch(self):

application_tag = application_tag[0]

#Check if the flag is present and set to false
# Check if the flag is present and set to false
if '{http://schemas.android.com/apk/res/android}extractNativeLibs' in application_tag.attrib \
and application_tag.attrib['{http://schemas.android.com/apk/res/android}extractNativeLibs'] == 'false':
#Set the flag to true
# Set the flag to true
application_tag.attrib['{http://schemas.android.com/apk/res/android}extractNativeLibs'] = 'true'
click.secho('Setting extractNativeLibs to true...', dim=True)
xml.write(os.path.join(self.apk_temp_directory, 'AndroidManifest.xml'),
encoding='utf-8', xml_declaration=True)
encoding='utf-8', xml_declaration=True)
return

def flip_debug_flag_to_true(self):
Expand Down

0 comments on commit a111716

Please sign in to comment.