objection icon indicating copy to clipboard operation
objection copied to clipboard

[bug] Objection unable to attach to Android audioserver

Open matbrik opened this issue 4 years ago • 3 comments

Describe the bug If I try to attach to audioserver using objection an exception is triggered: AttributeError: 'DeviceState' object has no attribute 'device_type'

To Reproduce

 objection.exe --gadget "audioserver"  explore
Using USB device `AOSP on angler`
Agent injected and responds ok!
Traceback (most recent call last):
  File "path_to_python\Scripts\objection-script.py", line 33, in <module>
    sys.exit(load_entry_point('objection==1.9.6', 'console_scripts', 'objection')())
  File "path_to_python\site-packages\click\core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "path_to_python\site-packages\click\core.py", line 782, in main
    rv = self.invoke(ctx)
  File "path_to_python\site-packages\click\core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "path_to_python\site-packages\click\core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "path_to_python\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "path_to_python\site-packages\objection\console\cli.py", line 182, in explore
    warn_about_older_operating_systems()
  File "path_to_python\site-packages\objection\utils\helpers.py", line 177, in warn_about_older_operating_systems
    if device_state.device_type == Android and (
AttributeError: 'DeviceState' object has no attribute 'device_type'
Asking jobs to stop...
Unloading objection agent...

Environment (please complete the following information):

  • Device: Nexus 6P
  • OS: Android 8
  • Frida Version 12.11.17
  • Objection Version 1.9.6

matbrik avatar Sep 29 '20 13:09 matbrik

How do i fixed this? has anyone been able to get around this?

1trackprojects1 avatar May 16 '21 02:05 1trackprojects1

This error is definitely a little misleading, and hard to figure out whats happening. In short, the device_type property is set in the get_device_info() call, which in turn calls runtime in the agent. It seems like for audio server is fails (or is set to unknown), making the property access to device_type fail when dropping into the warn_about_older_operating_systems() call.

Objections spawning logic is due a major refactor, which would hopefully also fix this by better handling unknown cases.

leonjza avatar May 17 '21 04:05 leonjza

我也有同樣的問題,最後是發現關閉iPhone的Cydia 的 Shadow Dynamic Libraries hook 就可以使用囉

imbauni avatar Oct 13 '23 10:10 imbauni