ksg97031 / frida-gadget

Automated tool for patching APKs to enable the use of Frida gadget by downloading the library and injecting code into the main activity.
MIT License
150 stars 21 forks source link

AttributeError: 'NoneType' object has no attribute 'replace' #22

Closed hitfzyangdianshi closed 2 months ago

hitfzyangdianshi commented 2 months ago

apk: https://drive.google.com/file/d/1zmJMWgPpSZF0UXjY0BTFlg-wWnyaB-35/view?usp=sharing game: com.EngineOrganic.HAX_Demo https://sidequestvr.com/app/3366/hax-demo

[DEBUG] Auto-detected your frida version: 16.2.1
[DEBUG] Downloading the frida gadget library(16.2.1) for arm64
[DEBUG] Checking internet permission and extractNativeLibs settings
[DEBUG] Adding 'android.permission.INTERNET' permission to AndroidManifest.xml
[DEBUG] Searching for the main activity in the smali files
Traceback (most recent call last):
  File "E:\ProgramData\Anaconda3\envs\frida\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "E:\ProgramData\Anaconda3\envs\frida\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "E:\ProgramData\Anaconda3\envs\frida\Scripts\frida-gadget.exe\__main__.py", line 7, in <module>
    sys.exit(run())
  File "E:\ProgramData\Anaconda3\envs\frida\lib\site-packages\click\core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "E:\ProgramData\Anaconda3\envs\frida\lib\site-packages\click\core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "E:\ProgramData\Anaconda3\envs\frida\lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "E:\ProgramData\Anaconda3\envs\frida\lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "E:\ProgramData\Anaconda3\envs\frida\lib\site-packages\scripts\cli.py", line 270, in run
    inject_gadget_into_apk(apk_path, arch, decompiled_path)
  File "E:\ProgramData\Anaconda3\envs\frida\lib\site-packages\scripts\cli.py", line 200, in inject_gadget_into_apk
    insert_loadlibary(decompiled_path, main_activity, load_library_name)
  File "E:\ProgramData\Anaconda3\envs\frida\lib\site-packages\scripts\cli.py", line 93, in insert_loadlibary
    target_relative_path = main_activity.replace(".", os.sep)
AttributeError: 'NoneType' object has no attribute 'replace'
ksg97031 commented 2 months ago

@hitfzyangdianshi I have patched the issue where the main activity was not found. Please upgrade to the newer version 1.3.9 (pip install frida-gadget --upgrade) and try again.