JeffLIrion / adb_shell

A Python implementation of ADB with shell and FileSync functionality.
Apache License 2.0
550 stars 61 forks source link

Support wireless debugging (STLS) #175

Open JeffLIrion opened 3 years ago

JeffLIrion commented 3 years ago

https://cs.android.com/android/platform/superproject/+/master:packages/modules/adb/protocol.txt;l=82-88

--- STLS(type, version, "") --------------------------------------------

Command constant: A_STLS

The TLS message informs the recipient that the connection will be encrypted
and will need to perform a TLS handshake. version is the current version of
the protocol.

If you see an error message of the form

adb_shell.exceptions.InvalidCommandError: Unknown command: 1397511251 = 'b'STLS'' (arg0 = 16777216, arg1 = 0, msg = 'b'STLS\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xac\xab\xb3\xac'')

It's because this is not supported by this package.

h4knet commented 3 years ago

Hi, I confirm I have the same issue and error message.

dandiodati commented 3 years ago

Is this code being maintained any more when I try to connect to a firetv device it just fails "ConnectionResetError: [Errno 104] Connection reset by peer"

I can use the adb command line client manually which can connect correctly.

JeffLIrion commented 3 years ago

Is this code being maintained any more when I try to connect to a firetv device it just fails "ConnectionResetError: [Errno 104] Connection reset by peer"

I can use the adb command line client manually which can connect correctly.

Yes, this package is maintained. The last commit was less than a month ago.

Only one ADB connection is allowed at a time, so if you are connected using the adb binary then this package won't be able to connect. That should be documented more clearly here. But the Home Assistant "Android TV" documentation contains good troubleshooting info: https://www.home-assistant.io/integrations/androidtv/#adb-troubleshooting

Also, in the future please open a new issue rather than using an unrelated existing one.