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

Commit

Permalink
Add better comment
Browse files Browse the repository at this point in the history
  • Loading branch information
rustyhowell committed Feb 27, 2018
1 parent dd9bffc commit 25015a8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions adb/adb_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,13 @@ def Connect(cls, usb, banner=b'notadb', rsa_keys=None, auth_timeout_ms=100):
InvalidResponseError: When the device does authentication in an
unexpected way.
"""
# In py3, convert unicode/str to bytes. It's joined into a byte string.
# In py3/py2, convert unicode/str to bytes. It's joined into a byte string.
# In py2, this ends up kind of being a no-op.
if isinstance(banner, str):
banner = bytearray(banner, 'utf-8')
msg = cls(
command=b'CNXN', arg0=VERSION, arg1=MAX_ADB_DATA,
data=b'host::%s\0' % banner, 'utf-8')
data=b'host::%s\0' % banner)
msg.Send(usb)
cmd, arg0, arg1, banner = cls.Read(usb, [b'CNXN', b'AUTH'])
if cmd == b'AUTH':
Expand Down

0 comments on commit 25015a8

Please sign in to comment.