From a7526ac28b1562695ef4a61c4df74317686eef83 Mon Sep 17 00:00:00 2001 From: zengshuchuan Date: Fri, 13 May 2022 16:48:49 +0800 Subject: [PATCH] Fix adb proxy get device id on windows Window adb device contains a '\r' character, translate string to integer comparing. Bug: 232488036 Test: 1. Excute python.exe winscope_proxy.py on Window Powershell. 2. Launch winscope index.html and set the Winscope token. 3. Tablet connect adb and winscope select the device. 4. Tap the 'DUMP STATE' button. Change-Id: I8c261da523763982ea4a4bfae6883694b221883c --- tools/winscope/adb_proxy/winscope_proxy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/winscope/adb_proxy/winscope_proxy.py b/tools/winscope/adb_proxy/winscope_proxy.py index 85089c55b..dd7fafb99 100755 --- a/tools/winscope/adb_proxy/winscope_proxy.py +++ b/tools/winscope/adb_proxy/winscope_proxy.py @@ -322,7 +322,7 @@ class FetchFileEndpoint(DeviceRequestEndpoint): def check_root(device_id): log.debug("Checking root access on {}".format(device_id)) - return call_adb('shell su root id -u', device_id) == "0\n" + return int(call_adb('shell su root id -u', device_id)) == 0 TRACE_THREADS = {}