diff --git a/scripts/__version__.py b/scripts/__version__.py index d7f4c06..1ec7fcf 100644 --- a/scripts/__version__.py +++ b/scripts/__version__.py @@ -1,6 +1,6 @@ """frida-gadget version information.""" __title__ = "frida-gadget" -__version__ = "1.3.4" +__version__ = "1.3.5" __description__ = "Automated Frida Gadget injection tool" __url__ = "https://github.com/ksg97031/frida-gadget" __author__ = "ksg97031" diff --git a/scripts/cli.py b/scripts/cli.py index 32f6049..d1dbe3e 100644 --- a/scripts/cli.py +++ b/scripts/cli.py @@ -109,12 +109,16 @@ def insert_loadlibary(decompiled_path, main_activity, load_library_name): logger.debug( 'Locating the entrypoint method and injecting the loadLibrary code') status = False - entrypoints = ["onCreate(", ""] + entrypoints = [" onCreate(", ""] for entrypoint in entrypoints: idx = 0 while idx != len(text): line = text[idx].strip() if line.startswith('.method') and entrypoint in line: + if ".locals" not in text[idx + 1]: + idx += 1 + continue + locals_line_bit = text[idx + 1].split(".locals ") locals_variable_count = min(int(locals_line_bit[1]), 15) locals_line_bit[1] = str(locals_variable_count + 1) @@ -252,7 +256,7 @@ def run(apk_path: str, arch: str, use_aapt2:bool, no_res:bool, # Make temp directory for decompile decompiled_path = TEMP_DIR.joinpath(str(apk_path.resolve())[:-4]) if not skip_decompile: - logger.debug("Decompiling the target APK using apktool\n%s", decompiled_path) + logger.debug('Decompiling the target APK using apktool\n"%s"', decompiled_path) if decompiled_path.exists(): shutil.rmtree(decompiled_path) decompiled_path.mkdir() @@ -269,7 +273,7 @@ def run(apk_path: str, arch: str, use_aapt2:bool, no_res:bool, # Rebuild with apktool, print apk_path if process is success if not skip_recompile: - logger.debug('Recompiling the new APK using apktool\n%s', decompiled_path) + logger.debug('Recompiling the new APK using apktool\n"%s"', decompiled_path) recompile_option = ['b'] if use_aapt2: