Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for android clients that do not expect encrypted connections #93

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Ottoz1
Copy link

@Ottoz1 Ottoz1 commented Feb 12, 2025

This pull request includes a small change to the ADBTcpDevice implementation in the adb_client module. The changes solve a problem for android devices that refuse to talk over STLS and respond with CNXN previously causing the error WrongResponseReceived("CNXN", "STLS")

Mind taking a look at it? :)

@cocool97
Copy link
Owner

Thanks for your PR :)

On what device/version have you tested it ? I didn't know devices could communicate on unencrypted channels like that 😅

@Ottoz1
Copy link
Author

Ottoz1 commented Feb 13, 2025

Im on a pretty custom android screen (not even able to adjust brightness) android 11, and running adb_client 2.1.7. Was only able to test the code for unencrypted connections, but should work identically for normal encrypted devices. I basically just seperated out the (messages.header.command) and matched it against two message types, CNXN and STLS instead of previously only STLS, all logic for the STLS case is copied from the previous iteration. I also added a warn! when connecting unsecurely. Even if its ultimately up to the client, how the client want's to communicate, but feels weird not mentioning it in some log.

Im very surprised as well, no one mentions anything related to using adb unencrypted. And googles adb documentation... Leaves much to be desired 😆. But following the original ADB servers communication with my device on wireshark shows that ADB handles it even though its never mentioned thats its an option directly.

@cocool97
Copy link
Owner

Yes the code looks good to me, I only need to test encrypted communication and I'll merge :)

This is indeed kinda weird, I haven't tested the TCP device on versions older than A13, so this is likely something common for old versions 🤷
Haven't seen anything in the documentation as well...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants