Skip to content

Commit

Permalink
Fix #14
Browse files Browse the repository at this point in the history
Signed-off-by: ksg97031 <[email protected]>
  • Loading branch information
ksg97031 committed Dec 23, 2023
1 parent 3e4728e commit a6ef6b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion scripts/__version__.py
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
10 changes: 7 additions & 3 deletions scripts/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(", "<init>"]
entrypoints = [" onCreate(", "<init>"]
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)
Expand Down Expand Up @@ -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()
Expand All @@ -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:
Expand Down

0 comments on commit a6ef6b6

Please sign in to comment.