Repository navigation
fix(usb): accept the padding iOS 27 adds after USBMUX replies - #43
Open
code-new-bie wants to merge 1 commit into
Open
code-new-bie wants to merge 1 commit into
code-new-bie wants to merge 1 commit into
Conversation
An iPhone on iOS 27 can send four extra bytes after some USBMUX replies: the version reply declares 20 bytes and arrives as 24, and TCP replies, with or without data, can carry the same trailer. Iap2UsbMuxHost read those bytes as the start of the next header, got a length of 6 and ended the wired session with "Invalid USBMUX frame length 6". Framing now goes through UsbMuxFrameBuffer. Exactly four bytes are skipped, only after the version reply, a valid TCP reply from the iPhone or a diagnostic reply, and only when a valid header follows; incomplete data waits for more instead of being dropped, and any other bad length still fails. Skips and rejections are reported through a new onDiagnostic hook, which CarPlayController writes to its debug log. The fix and its tests come from DiPlay (shihabal3amri/DiPlay, commits 3d0411d5 and f7af3286, for its issue #100), which shares this code with xcertplay; both are GPL-3.0. UsbMuxIssue100RegressionTest replays the USB transfers captured in that issue through the real Iap2UsbSession read and the Iap2UsbMuxHost handshake, so shared gains a Robolectric test dependency.
code-new-bie
added a commit
to code-new-bie/xcertplay
that referenced
this pull request
Oct 12, 2026
Eight pull requests (shilapi#43 to shilapi#50) and one issue (shilapi#51) went to shilapi/xcertplay, each built on upstream 1.4.0 with one change. docs/UPSTREAM.md lists them with the commits of this branch they come from, and what was left out and why.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An iPhone on iOS 27 can send four extra bytes after some USBMUX replies: the
version reply declares 20 bytes and arrives as 24, and TCP replies, with or
without data, can carry the same trailer. Iap2UsbMuxHost read those bytes as
the start of the next header, got a length of 6 and ended the wired session
with "Invalid USBMUX frame length 6".
Framing now goes through UsbMuxFrameBuffer. Exactly four bytes are skipped,
only after the version reply, a valid TCP reply from the iPhone or a
diagnostic reply, and only when a valid header follows; incomplete data waits
for more instead of being dropped, and any other bad length still fails.
Skips and rejections are reported through a new onDiagnostic hook, which
CarPlayController writes to its debug log.
The fix and its tests come from DiPlay (shihabal3amri/DiPlay, commits
3d0411d5 and f7af3286, for its issue #100), which shares this code with
xcertplay; both are GPL-3.0. UsbMuxIssue100RegressionTest replays the USB
transfers captured in that issue through the real Iap2UsbSession read and the
Iap2UsbMuxHost handshake, so shared gains a Robolectric test dependency.