libimobiledevice-win32 / imobiledevice-net

.NET (C#, VB.NET,...) bindings for libimobiledevice
GNU Lesser General Public License v2.1
297 stars 77 forks source link

idevice pair not creating proper pair record plist in lockdown folder #186

Closed Dantee296 closed 3 years ago

Dantee296 commented 3 years ago

iTunes mobiledevice creating 10kb plist for pair record libimobildevice creating 7kb plist for pair record and it does that exacly when i call "idevicepair pair"

so even if device paired via idevicepair mobiledevice library wont accept plist created by idevicepair and have user trust device again.

using openssl 1.1.1.9 latest libimobiledevice

@qmfrederik please let me know what could be the issue , Files Attached

67d345af353eb431e4e9fe846b2233b2972e189b - mobiledevice.txt

67d345af353eb431e4e9fe846b2233b2972e189b - idevicepair.txt

qmfrederik commented 3 years ago

The difference between both pair records is that one is in the binary property list format, and the other in the XML property list format. You should be able to use plutil to convert between both formats.

Dantee296 commented 3 years ago

@qmfrederik what could be the reason that my idevicepair not generating correct pair record ?

qmfrederik commented 3 years ago

idevicepair will call lockdownd_pair, which will save the pair record in userpref_save_pair_record. It looks like that method is calling plist_to_bin instead of plist_to_xml.

So you can try changing that.

Dantee296 commented 3 years ago

@qmfrederik thanks now both files are 10kb but mobiledevicedll based code still not accepting it

and by comparing it figured keys missing

"EscrowBag", "HostID" , "HostPrivatekey"

why these keys missing when pairing via idevicepair ?

Dantee296 commented 3 years ago

openssl version issue had to update to latest version