From 4007e6ab1eab39f189d5991a63eff3eef06bb4f9 Mon Sep 17 00:00:00 2001 From: Bjoern Kerler Date: Mon, 1 Jul 2024 08:33:11 +0200 Subject: [PATCH] Improve port detection --- mtkclient/Library/Port.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mtkclient/Library/Port.py b/mtkclient/Library/Port.py index 53fbce7d..ad8c051e 100755 --- a/mtkclient/Library/Port.py +++ b/mtkclient/Library/Port.py @@ -136,8 +136,7 @@ def run_handshake(self): try: while i < length: if ep_out(int.to_bytes(startcmd[i], 1, 'little')): - v = ep_in(maxinsize) - if len(v) == 1 and v[0] == ~(startcmd[i]) & 0xFF: + if ep_in(maxinsize)[-1] == ~(startcmd[i]) & 0xFF: i += 1 else: i = 0