mirror of
https://github.com/Sneed-Group/pypush-plus-plus
synced 2024-12-24 20:02:31 -06:00
use older iosbuddy endpoint for compat.
This commit is contained in:
parent
6a3bee35d3
commit
3be5a17b0f
4 changed files with 8 additions and 9 deletions
2
demo.py
2
demo.py
|
@ -25,7 +25,7 @@ logging.getLogger("apns").setLevel(logging.INFO)
|
||||||
logging.getLogger("albert").setLevel(logging.INFO)
|
logging.getLogger("albert").setLevel(logging.INFO)
|
||||||
logging.getLogger("ids").setLevel(logging.DEBUG)
|
logging.getLogger("ids").setLevel(logging.DEBUG)
|
||||||
logging.getLogger("bags").setLevel(logging.INFO)
|
logging.getLogger("bags").setLevel(logging.INFO)
|
||||||
logging.getLogger("imessage").setLevel(logging.INFO)
|
logging.getLogger("imessage").setLevel(logging.DEBUG)
|
||||||
|
|
||||||
logging.captureWarnings(True)
|
logging.captureWarnings(True)
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,8 @@ def main():
|
||||||
|
|
||||||
cloudkit_token = r['delegates']['com.apple.mobileme']['service-data']['tokens']['cloudKitToken']
|
cloudkit_token = r['delegates']['com.apple.mobileme']['service-data']['tokens']['cloudKitToken']
|
||||||
mme_token = r['delegates']['com.apple.mobileme']['service-data']['tokens']['mmeAuthToken']
|
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!")
|
logging.info("Logged in!")
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,8 @@ else:
|
||||||
r = icloud.login(USERNAME, PASSWORD, delegates=["com.apple.mobileme"])
|
r = icloud.login(USERNAME, PASSWORD, delegates=["com.apple.mobileme"])
|
||||||
|
|
||||||
search_party_token = r['delegates']['com.apple.mobileme']['service-data']['tokens']['searchPartyToken']
|
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!")
|
print("Logged in!")
|
||||||
|
|
||||||
|
|
|
@ -51,13 +51,9 @@ def login(
|
||||||
}
|
}
|
||||||
data = plistlib.dumps(data)
|
data = plistlib.dumps(data)
|
||||||
|
|
||||||
logger.debug("Generating validation data")
|
|
||||||
v = nac.generate_validation_data()
|
|
||||||
logger.debug("Generated validation data")
|
|
||||||
|
|
||||||
headers = {
|
headers = {
|
||||||
"X-Apple-ADSID": adsid,
|
"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,
|
"User-Agent": USER_AGENT,
|
||||||
"X-Mme-Client-Info": gsa.build_client(
|
"X-Mme-Client-Info": gsa.build_client(
|
||||||
emulated_app="accountsd"
|
emulated_app="accountsd"
|
||||||
|
@ -67,7 +63,8 @@ def login(
|
||||||
|
|
||||||
logger.debug("Making login request")
|
logger.debug("Making login request")
|
||||||
r = requests.post(
|
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),
|
auth=(username, password),
|
||||||
data=data,
|
data=data,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
|
|
Loading…
Reference in a new issue