diff --git a/peas/pyActiveSync/dev_playground.py b/peas/pyActiveSync/dev_playground.py index 71df813..e644546 100644 --- a/peas/pyActiveSync/dev_playground.py +++ b/peas/pyActiveSync/dev_playground.py @@ -48,9 +48,16 @@ storage.create_db_if_none() conn, curs = storage.get_conn_curs() -device_info = {"Model": "%d.%d.%d" % (pyver[0], pyver[1], pyver[2]), "IMEI": "123457", - "FriendlyName": "My pyAS Client 2", "OS": "Python", "OSLanguage": "en-us", "PhoneNumber": "NA", - "MobileOperator": "NA", "UserAgent": "pyAS"} +device_info = { + "Model": "Outlook for iOS and Android", + "IMEI": "2095f3b9f442a32220d4d54e641bd4aa", + "FriendlyName": "Outlook for iOS and Android", + "OS": "OutlookBasicAuth", + "OSLanguage": "en-us", + "PhoneNumber": "NA", + "MobileOperator": "NA", + "UserAgent": "Outlook-iOS-Android/1.0" +} #create wbxml_parser test cp, cp_sh = as_code_pages.build_as_code_pages() diff --git a/peas/pyActiveSync/misc_tests.py b/peas/pyActiveSync/misc_tests.py index 59da36d..848ac5c 100644 --- a/peas/pyActiveSync/misc_tests.py +++ b/peas/pyActiveSync/misc_tests.py @@ -19,7 +19,7 @@ # Tests -import sys, time +import time import ssl from utils.as_code_pages import as_code_pages @@ -53,12 +53,18 @@ # Disable SSL certificate verification. ssl._create_default_https_context = ssl._create_unverified_context - -pyver = sys.version_info - storage.create_db_if_none() conn, curs = storage.get_conn_curs() -device_info = {"Model":"%d.%d.%d" % (pyver[0], pyver[1], pyver[2]), "IMEI":"123456", "FriendlyName":"My pyAS Client", "OS":"Python", "OSLanguage":"en-us", "PhoneNumber": "NA", "MobileOperator":"NA", "UserAgent": "pyAS"} +device_info = { + "Model": "Outlook for iOS and Android", + "IMEI": "2095f3b9f442a32220d4d54e641bd4aa", + "FriendlyName": "Outlook for iOS and Android", + "OS": "OutlookBasicAuth", + "OSLanguage": "en-us", + "PhoneNumber": "NA", + "MobileOperator": "NA", + "UserAgent": "Outlook-iOS-Android/1.0" +} #create wbxml_parser test cp, cp_sh = as_code_pages.build_as_code_pages() diff --git a/peas/pyActiveSync/objects/MSASHTTP.py b/peas/pyActiveSync/objects/MSASHTTP.py index dbd5444..a6f2faf 100644 --- a/peas/pyActiveSync/objects/MSASHTTP.py +++ b/peas/pyActiveSync/objects/MSASHTTP.py @@ -21,9 +21,9 @@ class ASHTTPConnector(object): """ActiveSync HTTP object""" - USER_AGENT = "Python" - POST_URL_TEMPLATE = "/Microsoft-Server-ActiveSync?Cmd=%s&User=%s&DeviceId=123456&DeviceType=Python" - POST_GETATTACHMENT_URL_TEMPLATE = "/Microsoft-Server-ActiveSync?Cmd=%s&AttachmentName=%s&User=%s&DeviceId=123456&DeviceType=Python" + USER_AGENT = "Outlook-iOS-Android/1.0" + POST_URL_TEMPLATE = "/Microsoft-Server-ActiveSync?Cmd=%s&User=%s&DeviceId=2095f3b9f442a32220d4d54e641bd4aa&DeviceType=Outlook" + POST_GETATTACHMENT_URL_TEMPLATE = "/Microsoft-Server-ActiveSync?Cmd=%s&AttachmentName=%s&User=%s&DeviceId=2095f3b9f442a32220d4d54e641bd4aa&DeviceType=Outlook" def __init__(self, server, port=443, ssl=True): diff --git a/peas/py_activesync_helper.py b/peas/py_activesync_helper.py index 6c13167..891f0a3 100644 --- a/peas/py_activesync_helper.py +++ b/peas/py_activesync_helper.py @@ -191,9 +191,16 @@ def extract_emails(creds): storage.create_db_if_none() conn, curs = storage.get_conn_curs() - device_info = {"Model": "1234", "IMEI": "123457", - "FriendlyName": "My pyAS Client 2", "OS": "Python", "OSLanguage": "en-us", "PhoneNumber": "NA", - "MobileOperator": "NA", "UserAgent": "pyAS"} + device_info = { + "Model": "Outlook for iOS and Android", + "IMEI": "2095f3b9f442a32220d4d54e641bd4aa", + "FriendlyName": "Outlook for iOS and Android", + "OS": "OutlookBasicAuth", + "OSLanguage": "en-us", + "PhoneNumber": "NA", + "MobileOperator": "NA", + "UserAgent": "Outlook-iOS-Android/1.0" + } #create ActiveSync connector as_conn = ASHTTPConnector(creds['server']) #e.g. "as.myserver.com"