From 7cb82a47bda665e11da4944410fe4d2d9889ef66 Mon Sep 17 00:00:00 2001 From: Domenico Iezzi Date: Fri, 8 Sep 2017 16:26:37 +0200 Subject: [PATCH] Initial password encryption implementation Signed-off-by: Domenico Iezzi --- config.py | 3 ++- googleplay.py | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/config.py b/config.py index e8f4185..a334d91 100644 --- a/config.py +++ b/config.py @@ -2,7 +2,8 @@ SEPARATOR = ";" LANG = "en_US" -ANDROID_ID = "8AAF7D11483A175" +ANDROID_ID = "320d104c4dc6eaa4" +GOOGLE_PUBKEY = "AAAAgMom/1a/v0lblO2Ubrt60J2gcuXSljGFQXgcyZWveWLEwo6prwgi3iJIZdodyhKZQrNWp5nKJ3srRXcUW+F1BD3baEVGcmEgqaLZUNBjm057pKRI16kB0YppeGx5qIQ5QjKzsR8ETQbKLNWgRY0QRNVz34kMJR3P/LgHax/6rmf5AAAAAwEAAQ==" GOOGLE_LOGIN = "" GOOGLE_PASSWORD = "" AUTH_TOKEN = "" diff --git a/googleplay.py b/googleplay.py index de03443..13d62e2 100644 --- a/googleplay.py +++ b/googleplay.py @@ -60,6 +60,15 @@ class GooglePlayAPI(object): self.lang = lang self.debug = debug + def encrypt_password(self, login, passwd): + + def readInt(byteArray, start): + return struct.unpack(">I", byteArray[0:4])[0] + + binaryKey = base64.b64encode(bytes(config.GOOGLE_PUBKEY, 'utf-8')) + i = readInt(binaryKey, 0) + + def toDict(self, protoObj): """Converts the (protobuf) result from an API call into a dict, for easier introspection."""