From 3be5a17b0ffd359f04d60eaee82f053d3a043dad Mon Sep 17 00:00:00 2001 From: JJTech0130 Date: Mon, 23 Oct 2023 10:54:34 -0400 Subject: [PATCH] use older iosbuddy endpoint for compat. --- demo.py | 2 +- examples/cloudkit.py | 3 ++- examples/openhaystack.py | 3 ++- icloud/__init__.py | 9 +++------ 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/demo.py b/demo.py index 577bb80..66dbf20 100644 --- a/demo.py +++ b/demo.py @@ -25,7 +25,7 @@ logging.getLogger("apns").setLevel(logging.INFO) logging.getLogger("albert").setLevel(logging.INFO) logging.getLogger("ids").setLevel(logging.DEBUG) logging.getLogger("bags").setLevel(logging.INFO) -logging.getLogger("imessage").setLevel(logging.INFO) +logging.getLogger("imessage").setLevel(logging.DEBUG) logging.captureWarnings(True) diff --git a/examples/cloudkit.py b/examples/cloudkit.py index 39c4036..863908d 100644 --- a/examples/cloudkit.py +++ b/examples/cloudkit.py @@ -39,7 +39,8 @@ def main(): cloudkit_token = r['delegates']['com.apple.mobileme']['service-data']['tokens']['cloudKitToken'] mme_token = r['delegates']['com.apple.mobileme']['service-data']['tokens']['mmeAuthToken'] - ds_prs_id = r['delegates']['com.apple.mobileme']['service-data']['appleAccountInfo']['dsPrsID'] # This can also be obtained from the grandslam response + #ds_prs_id = r['delegates']['com.apple.mobileme']['service-data']['appleAccountInfo']['dsPrsID'] # This can also be obtained from the grandslam response + ds_prs_id = r['dsid'] logging.info("Logged in!") diff --git a/examples/openhaystack.py b/examples/openhaystack.py index 196bf31..1d4346f 100644 --- a/examples/openhaystack.py +++ b/examples/openhaystack.py @@ -35,7 +35,8 @@ else: r = icloud.login(USERNAME, PASSWORD, delegates=["com.apple.mobileme"]) search_party_token = r['delegates']['com.apple.mobileme']['service-data']['tokens']['searchPartyToken'] - ds_prs_id = r['delegates']['com.apple.mobileme']['service-data']['appleAccountInfo']['dsPrsID'] # This can also be obtained from the grandslam response + #ds_prs_id = r['delegates']['com.apple.mobileme']['service-data']['appleAccountInfo']['dsPrsID'] # This can also be obtained from the grandslam response + ds_prs_id = r['dsid'] print("Logged in!") diff --git a/icloud/__init__.py b/icloud/__init__.py index 437d616..4749596 100644 --- a/icloud/__init__.py +++ b/icloud/__init__.py @@ -51,13 +51,9 @@ def login( } data = plistlib.dumps(data) - logger.debug("Generating validation data") - v = nac.generate_validation_data() - logger.debug("Generated validation data") - headers = { "X-Apple-ADSID": adsid, - "X-Mme-Nas-Qualify": base64.b64encode(v).decode(), + #"X-Mme-Nas-Qualify": base64.b64encode(nac.generate_validation_data()).decode(), # Only necessary with new prefpane URL "User-Agent": USER_AGENT, "X-Mme-Client-Info": gsa.build_client( emulated_app="accountsd" @@ -67,7 +63,8 @@ def login( logger.debug("Making login request") r = requests.post( - "https://setup.icloud.com/setup/prefpane/login", + #"https://setup.icloud.com/setup/prefpane/login", + "https://setup.icloud.com/setup/iosbuddy/loginDelegates", auth=(username, password), data=data, headers=headers,