Failure to retrieve long plist with format information
Reported by Martin S. | June 7th, 2009 @ 11:58 AM | in 1.0 Release
In attempts to find out how to retrieve the equivialent to the "supported formats plist" earlier device generations have been sending after issuing a specific SCSI command the way to do it was actually trivial.
It is retrieved by sending a command plist with the domain "com.apple.mobile.iTunes" with the "GetValue" request to lockdownd. Basically what iphoneinfo is doing right now.
The issue here is though that the whole plist is somehow not retrieved correctly and libplist fails to parse it later.
The following code demonstrates this:
#! /usr/bin/env python
from libiphone.iPhone import *
from libplist.PList import *
phone = iPhone()
phone.set_debug_mask(DBGMASK_ALL)
if not phone.init_device() :
print "Couldn't find device, is it connected ?"
exit(1)
lckd = phone.get_lockdown_client()
if not lckd :
print "Failed to start lockdown service."
exit(1)
xml = """<plist>
<dict>
<key>Domain</key>
<string>com.apple.mobile.iTunes</string>
<key>Request</key>
<string>GetValue</string>
</dict></plist>"""
plist = PListNode( xml ) lckd.send(plist) plist = lckd.receive()
The information contains things like what image formats are supported and information about the iTunes DB which is useful/needed for libgpod and friends.
Have not yet have time to investigate why it fails to retrieve
the whole thing but from what I checked it only retrieves exactly
16300 bytes (perhaps it is related to what Matt discovered some
while ago about some missing stuff in the usbmux protocol
implementation).
All this using the current usbmuxd refactored version.
Comments and changes to this ticket
-
Nikias Bassen June 8th, 2009 @ 12:53 AM
- State changed from new to open
The problem is in iphone_lckd_recv: when an encrypted plist is received that is not sent in one packet by the device then only the first packet is received. I modified the function to do the same as with unencrypted plists, i.e. retrieve any following packet to complete the full packet size that always is sent before the plist itself. So consider it fixed.
-
Martin S. June 8th, 2009 @ 08:51 AM
Ah, superb, it's working now! Perhaps this might also fix some other stuff I encountered...
-
Nikias Bassen June 9th, 2009 @ 10:58 AM
- Assigned user set to Matt Colyer
@Matt please close this ticket if you've merged the patch into git.
-
Matt Colyer July 2nd, 2009 @ 02:45 AM
- State changed from open to resolved
(from [52d1beb6e43cc12ff57e648f1e5bdfadc4d36929]) lockdown: fix receive of large TLS-encapsulated plists
[#48 state:resolved]
Signed-off-by: Matt Colyer matt@colyer.name
http://github.com/MattColyer/libiphone/commit/52d1beb6e43cc12ff57e6...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
A project around supporting the iPhone in Linux.
See http://libimobiledevice.org