Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError #73

Open
lennartbunk opened this issue Jan 20, 2016 · 8 comments
Open

AttributeError #73

lennartbunk opened this issue Jan 20, 2016 · 8 comments

Comments

@lennartbunk
Copy link

Hi, its my first attempt to use python. Maybe the solution is obvious for someone else.
I'm running Win 10 with Python 2.7.7.

C:\Python27\iloot-master>iloot.py EMAIL PASSWORD
Working with EMAIL PASSWORD
Output directory : output
Traceback (most recent call last):
File "C:\Python27\iloot-master\iloot.py", line 679, in
download_backup(args.apple_id, args.password, args.output, args.item_types, args.snapshot, args.combined, args.itunes_style, args.domain, args.threads, args.keep_existing)
File "C:\Python27\iloot-master\iloot.py", line 605, in download_backup
account_settings = plist_request("setup.icloud.com", "POST", "/setup/get_account_settings", "", headers)
File "C:\Python27\iloot-master\iloot.py", line 89, in plist_request
print "{}: {}".format(plist_data.title, plist_data.message)
File "C:\Python27\lib\plistlib.py", line 301, in getattr
raise AttributeError, attr
AttributeError: title

@ifnull
Copy link

ifnull commented Jan 24, 2016

Add a print data to https://github.com/hackappcom/iloot/blob/master/iloot.py#L79. Sounds like get_account_settings didn't return the settings. May be 2 factor auth issue. You should see an error in the print statement.

@lennartbunk
Copy link
Author

I added "print data" to line 79, line 80, line 379 and 380.
It results in syntax error or makes no difference at all.
Sorry, i'm a total newbie in python.

@ifnull
Copy link

ifnull commented Jan 24, 2016

it should look like this ...

def plist_request(host, method, url, body, headers):
    conn = HTTPSConnection(host)
    sock = socket.create_connection((conn.host, conn.port), conn.timeout, conn.source_address)
    conn.sock = ssl.wrap_socket(sock, conn.key_file, conn.cert_file, ssl_version=ssl.PROTOCOL_TLSv1)
    request = conn.request(method, url, body, headers)
    response = conn.getresponse()

    data = response.read()
    print data
    try:
        plist_data = plistlib.readPlistFromString(data)
    except:
        plist_data = None

@lennartbunk
Copy link
Author

Okay, now that's the result:

protocolVersion 1.0
            <key>appleAccountInfo</key>
            <dict>
                    <key>dsid</key>
                    <string>123123123</string>

                    <key>dsPrsID</key>
                    <integer>123123123</integer>

            </dict>

            <key>tokens</key>
            <dict>
                    <key>mmeAuthToken</key>
                    <string>123123123</string>

            </dict>

    </dict>
protocolVersion 2
            <key>localizedError</key>
            <string>MOBILEME_TERMS_OF_SERVICE_UPDATE</string>

    </dict>
Traceback (most recent call last): File "iloot.py", line 679, in download_backup(args.apple_id, args.password, args.output, args.item_types, args.snapshot, args.combined, args.itunes_style, args.domain, args.threads, args.keep_existing) File "iloot.py", line 605, in download_backup account_settings = plist_request("setup.icloud.com", "POST", "/setup/get_account_settings", "", headers) File "iloot.py", line 89, in plist_request print "{}: {}".format(plist_data.title, plist_data.message) File "C:\Python27\lib\plistlib.py", line 301, in **getattr** raise AttributeError, attr AttributeError: title

@mca-gif
Copy link
Contributor

mca-gif commented Jan 26, 2016

The issue is that you have not approved the terms and conditions released when iOS 9 was released. Back in October iloot was changed to pretend to be iOS 9 in a vain attempt to get it to fetch iOS 9 backups. Aside from perhaps a recent version of iTunes, I'm not sure anything but signing in on an iOS 9 device can trigger the approval process. You could also roll back the changes made in commit bcc5052 and it would begin working again.

@lennartbunk
Copy link
Author

The MOBILEME_TERMS_OF_SERVICE_UPDATE line made me think of that problem too but i didn't found a solution. I installed the newest iTunes and iCloud but there wasn't an option to accept the new TOS.

I now rolled back the changes made in commit bcc5052 and - it's working!
The reason might be that it's an old iPhone 4s Backup from iOS 8.1.1.

Now it stopps after about 5mb with that:

Traceback (most recent call last):
File "iloot.py", line 679, in
download_backup(args.apple_id, args.password, args.output, args.item_types, args.snapshot, args.combined, args.itunes_style, args.domain, args.threads, args.keep_existing)
File "iloot.py", line 635, in download_backup
client.download(UDID, types)
File "iloot.py", line 510, in download
self.authorize_get(authTokens, snapshot)
File "iloot.py", line 281, in authorize_get
self.write_file(file, decrypted_chunks, snapshot)
File "iloot.py", line 345, in write_file
with open(path, "wb") as ff:
IOError: [Errno 2] No such file or directory: u'output[...]/store/CloudUserDictionary.sqlite'

The backup has a size of 1.81gb. I successfully downloaded it with wondershare dr.fone.

@AnonyMoouse
Copy link

Hi, I am a total and complete noob when it comes to programming of any kind. I was wondering if you could post the version without the ios9 changes on MEGA or email them to me at [email protected]. It would be greatly appreciated.

@sbasmanov
Copy link

I needed sms.db to restore dialog deleted by accident. On my 5s script worked fine. On wife's 5s it gave MOBILEME_TERMS_OF_SERVICE_UPDATE error. Googling shows that no easy solution. But above link to commit bcc5052 that did the trick. In current script I changed only 3 lines:
CLIENT_INFO = "<iPhone2,1> <iPhone OS;5.1.1;9B206> <com.apple.AppleAccount/1.0 ((null)/(null))>" #CLIENT_INFO = "<iPhone6,2> <iPhone OS;9.0.2;13A452> <com.apple.AppleAccount/1.0 ((null)/(null))>" USER_AGENT_MOBILE_BACKUP = "MobileBackup/5.1.1 (9B206; iPhone3,1)" #USER_AGENT_MOBILE_BACKUP = "MobileBackup/9.0.2 (13A452; iPhone6,2)" CLIENT_INFO_BACKUP = "<N88AP> <iPhone OS;5.1.1;9B206> <com.apple.icloud.content/211.1 (com.apple.MobileBackup/9B206)>" #CLIENT_INFO_BACKUP = "<N88AP> <iPhone OS;9.0.2;13A452> <com.apple.icloud.content/211.1 (com.apple.MobileBackup/13A452)>"
And that worked. I think apple returns response depending on device version. So, reverting to old version strings makes it work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants