doronz88 / pymobiledevice3

Pure python3 implementation for working with iDevices (iPhone, etc...).
https://discord.gg/52mZGC3JXJ
GNU General Public License v3.0
1.5k stars 209 forks source link

service_connection: fix `parse_plist()` for supprting even older legacy devices #1280

Closed prosch88 closed 1 week ago

prosch88 commented 1 week ago

I had an issue with connecting an iPad 1 (iPad 1,1) with pmd3. This commit filter some uninterpreted byte strings from the payload allowing a connection.

Before:

  File "/usr/lib/python3.12/plistlib.py", line 186, in parse
    self.parser.ParseFile(fileobj)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 86, column 18

after:

[
    {
        "BuildVersion": "9B206",
        "ConnectionType": "USB",
        "DeviceClass": "iPad",
        "DeviceName": "Wingscommander's iPad",
        "Identifier": "8579c2f382f49aa1558c2c5a610205ffd7ee7835",
        "ProductType": "iPad1,1",
        "ProductVersion": "5.1.1",
        "UniqueDeviceID": "8579c2f382f49aa1558c2c5a610205ffd7ee7835"
    }
]