Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

TCP Connection Error on API29 #164

Open
bannsec opened this issue Jun 24, 2019 · 0 comments
Open

TCP Connection Error on API29 #164

bannsec opened this issue Jun 24, 2019 · 0 comments

Comments

@bannsec
Copy link

bannsec commented Jun 24, 2019

Trying to use python adb to connect to an emulated API29 device over TCP. Failing spectacularly.

In [6]: d = device.ConnectDevice(serial="127.0.0.1:5554")
---------------------------------------------------------------------------
InvalidCommandError                       Traceback (most recent call last)
<ipython-input-6-7567c46f5431> in <module>
----> 1 d = device.ConnectDevice(serial="127.0.0.1:5554")

~/.virtualenvs/frida/lib/python3.6/site-packages/adb/adb_commands.py in ConnectDevice(self, port_path, serial, default_timeout_ms, **kwargs)
    140                     timeout_ms=default_timeout_ms)
    141
--> 142         self._Connect(**kwargs)
    143
    144         return self

~/.virtualenvs/frida/lib/python3.6/site-packages/adb/adb_commands.py in _Connect(self, banner, **kwargs)
    171             banner = socket.gethostname().encode()
    172
--> 173         conn_str = self.protocol_handler.Connect(self._handle, banner=banner, **kwargs)
    174
    175         # Remove banner and colons after device state (state::banner)

~/.virtualenvs/frida/lib/python3.6/site-packages/adb/adb_protocol.py in Connect(cls, usb, banner, rsa_keys, auth_timeout_ms)
    312             data=b'host::%s\0' % banner)
    313         msg.Send(usb)
--> 314         cmd, arg0, arg1, banner = cls.Read(usb, [b'CNXN', b'AUTH'])
    315         if cmd == b'AUTH':
    316             if not rsa_keys:

~/.virtualenvs/frida/lib/python3.6/site-packages/adb/adb_protocol.py in Read(cls, usb, expected_cmds, timeout_ms, total_timeout_ms)
    245             if not command:
    246                 raise InvalidCommandError(
--> 247                     'Unknown command: %x' % cmd, cmd, (arg0, arg1))
    248             if command in expected_cmds:
    249                 break

InvalidCommandError: ('Unknown command: 72646e41', 1919184449, (543451503, 1936617283))
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant