From 0d0f25194f99b27f965294b362f2c40717cb79eb Mon Sep 17 00:00:00 2001 From: linsoft Date: Thu, 1 Mar 2018 22:40:23 +0800 Subject: [PATCH] Fix TypeError while using Python3.6 with python-rsa --- adb/adb_protocol.py | 2 +- adb/sign_pythonrsa.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/adb/adb_protocol.py b/adb/adb_protocol.py index 8047f48..b337205 100644 --- a/adb/adb_protocol.py +++ b/adb/adb_protocol.py @@ -298,7 +298,7 @@ def Connect(cls, usb, banner=b'notadb', rsa_keys=None, auth_timeout_ms=100): raise InvalidResponseError( 'Unknown AUTH response: %s %s %s' % (arg0, arg1, banner)) - signed_token = rsa_key.Sign(str(banner)) + signed_token = rsa_key.Sign(banner) msg = cls( command=b'AUTH', arg0=AUTH_SIGNATURE, arg1=0, data=signed_token) msg.Send(usb) diff --git a/adb/sign_pythonrsa.py b/adb/sign_pythonrsa.py index 5c00bb2..fcf0725 100644 --- a/adb/sign_pythonrsa.py +++ b/adb/sign_pythonrsa.py @@ -24,7 +24,7 @@ # hashing algo for this. class _Accum(object): def __init__(self): - self._buf = '' + self._buf = b'' def update(self, msg): self._buf += msg def digest(self):