androguard / androguard

Reverse engineering and pentesting for Android applications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AttributeError: type object 'DEX' has no attribute 'get_bytecodes_method'

Drjacky opened this issue · comments

Describe what you wanted to do

Decompile an APK

Androguard Version: 4.0.0
Python Version: 3.12.1
Operating System: macOS

Further Log Files and Output

2023-12-16 15:15:19.761 | INFO     | androguard.core.analysis.analysis:create_xref:1479 - End of creating cross references (XREF) run time: 0min 26s
2023-12-16 15:15:19.761 | INFO     | androguard.session:addAPK:156 - added APK example..apk:c1211fd......9d8a313e525c68d9186fbea
Dump information example.apk in /outttt/
Clean directory /outttt/
Decompilation ... End
Dump Lcom/example/labor/view/R$anim; <init> ()V ... source codes ... bytecodes ... Traceback (most recent call last):
  File "/opt/homebrew/bin/androguard", line 8, in <module>
    sys.exit(entry_point())
             ^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.12/site-packages/androguard/cli/cli.py", line 303, in decompile
    export_apps_to_format(fname, s, output, limit,
  File "/opt/homebrew/lib/python3.12/site-packages/androguard/cli/main.py", line 173, in export_apps_to_format
    bytecode_buff = DEX.get_bytecodes_method(vm, vmx, method)
                    ^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'DEX' has no attribute 'get_bytecodes_method'

#922 (comment)

@Drjacky commit 63791b9 should be solving your issue.

Note

This fix will not be available through PyPI yet, so to install it (install the latest available version from github) you can run pip install git+https://github.com/androguard/androguard