add compatibility with mypeugeot 1.26.2

This commit is contained in:
Florian Bezannier
2020-11-26 10:22:41 +01:00
parent 9339a0516d
commit 53a5cecb84
2 changed files with 14 additions and 2 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ We need to get credentials from the MyPeugeot app. You have two solutions :
To do that you can follow this guide: https://forum.xda-developers.com/android/software-hacking/guide-how-to-enable-adb-backup-app-t3495117
The original app can be downloaded [here](https://apkpure.com/fr/mypeugeot-app/com.psa.mym.mypeugeot) for example.
You should download Mypeugeot 1.25.2, higher versions doesn't seems to work
I tested Mypeugeot version 1.25.2 and 1.26.2.
1.2 Uninstall the original app
+13 -1
View File
@@ -8,6 +8,7 @@ from MyPSACC import MyPSACC
from sys import argv
import tarfile
import sys
import traceback
def getxmlvalue(root, name):
@@ -56,7 +57,18 @@ else:
#get remote token
root = ET.parse("HUTokenManager.xml").getroot()
remote_enc = root[0].text
remote_refresh_token = json.loads(base64.b64decode(remote_enc))["refresh_token"]
remote_dec = json.loads(base64.b64decode(remote_enc))
try:
if "refresh_token" in remote_dec:
remote_refresh_token = remote_dec["refresh_token"]
else:
remote_refresh_token = next(iter(remote_dec.values()))["refresh_token"]
# Mypeugeot >= 1.26
except:
traceback.print_exc()
print(remote_dec)
client_email = input("mypeugeot email: ")
client_paswword = input("mypeugeot password: ")