From 0a32c5d88e1bd685126821de09239e6bececb69b Mon Sep 17 00:00:00 2001 From: Rossen Georgiev Date: Tue, 31 Jan 2017 17:44:16 +0200 Subject: [PATCH] bugfix extract_secrets_from_android_rooted; #69 * fixed file split * fixed bytes to str comparison in py3 --- steam/guard.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/steam/guard.py b/steam/guard.py index 65de977..1315e24 100644 --- a/steam/guard.py +++ b/steam/guard.py @@ -467,7 +467,7 @@ def extract_secrets_from_android_rooted(adb_path='adb'): - device in debug mode, connected and paired .. note:: - If you know how to make this work, without requiring a the device to be rooted, + If you know how to make this work, without requiring the device to be rooted, please open a issue on github. Thanks :param adb_path: path to adb binary @@ -481,8 +481,10 @@ def extract_secrets_from_android_rooted(adb_path='adb'): "'cat /data/data/com.valvesoftware.android.steam.community/files/Steamguard*'" ]) + data = data.decode('utf-8') + if data[0] != "{": raise RuntimeError("Got invalid data: %s" % repr(data)) return {int(x['steamid']): x - for x in map(json.loads, data.replace("}{", '}||||{').split('|||||'))} + for x in map(json.loads, data.replace("}{", '}|||||{').split('|||||'))}