github doronz88/pymobiledevice3 v11.32.0

5 hours ago

Highlights

⚡ construct replaced with stdlib parsing

Every binary protocol pymobiledevice3 speaks (DTX, RemoteXPC, usbmux, AFC, tunnel pairing, pcapd, kcdata stackshots, network monitor, syslog, baseband mbn/ftab) is now parsed with a small struct-based module (pymobiledevice3.binary) instead of construct. construct and construct-typing are no longer direct dependencies. Parsing and building are 4-22x faster (XPC parse+decode 826 → 63 µs, a 1.1 MB stackshot to JSON 183 → 27 ms). The CLI feels about the same, since startup and device round-trips dominate, except core-profile-session stackshot --json, which is ~0.16 s faster. Parsed values are typed dataclasses, and malformed data raises BinaryParseError with the record, field and offset.

🐛 Fixes that came with the port

  • ftab: adding an entry (the Rose restore path that appends rrko) overwrote the first payload of the image.
  • kcdata stackshots: io_statistics counters were read from the wrong layout; ts_pid, cputype/cpusubtype, donating pids and thread priorities were read unsigned; a name cut mid-UTF-8-character or a truncated stackshot no longer fails the whole parse.
  • pcap: pcapng blocks carry the device's capture time instead of the host's clock; a process name cut mid-UTF-8-character no longer ends watch().
  • syslog: an unknown log level no longer ends the stream.
  • usbmux: a malformed device record no longer kills the tunneld monitor task.
  • AFC/XPC: a string with an embedded NUL is rejected instead of silently becoming a different request.
  • XPC: dates before 1970 decode correctly (also on Windows).
  • netstat: an address without a decodable payload no longer crashes the CLI.

⚠️ Low-level API changes

The documented service APIs are unchanged. Internal protocol objects changed. The module-level construct structs (XpcWrapper, dtx_fragment_header, afc_*_t, usbmuxd_*, device_packet_struct, the kcdata structs, pymobiledevice3.construct_compat, ...) are replaced by dataclasses with parse()/build(). The full list is in #2031. If you use PcapdService.watch(), packets are now DevicePacket dataclasses: attribute access (packet.pid, packet.data, ...) works as before, but dict-style access (packet["pid"]) is gone.

What's Changed

Full Changelog: v11.31.0...v11.32.0

Don't miss a new pymobiledevice3 release

NewReleases is sending notifications on new releases.