fix(lockdown): stabilize heartbeat, DDI, and profile services - #14
Open
truebit wants to merge 2 commits into
Open
fix(lockdown): stabilize heartbeat, DDI, and profile services#14truebit wants to merge 2 commits into
truebit wants to merge 2 commits into
Conversation
- Keep a persistent Lockdown heartbeat with bounded receive deadlines while leaving Remote Pairing on its existing RSD path. - Serialize endpoint and foreground transitions so retiring sessions reject stale readiness and drain active DDI/profile leases before device state changes. - Queue DDI mounts and profile operations behind heartbeat readiness, and coordinate replacement mounts so Health Check observes the latest device state. - Reset the Lockdown runtime before pairing changes so repeated starts cannot leak heartbeat work into an RSP session.
- Recognize the pre-iOS 17 /Developer and DiskImageType=Developer response while retaining personalized DDI schema support. - Respect explicit unmounted responses so Health Check does not accept stale image metadata. - Add focused schema coverage and document the new domain and runtime layout.
truebit
force-pushed
the
fix-upstream-lockdown-heartbeat-ddi
branch
from
August 3, 2026 04:00
63f3d07 to
b6cc70e
Compare
Author
|
This PR is the upstream fix of LiveContainer#1 |
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.
Summary
This change primarily fixes connectivity failures on iOS 16 and earlier devices, where SideStore uses the Lockdown service path instead of Remote Pairing/RSD.
It addresses the minimuxer-side causes observed in:
SideStore/SideStore#1377
The reported symptoms included transient DDI Health Check failures and provisioning-profile operations failing with “Unable to Manage Profiles”.
Technical Details
Keep the Lockdown heartbeat service alive for the lifetime of the active minimuxer session.
Mark a Lockdown session ready only after completing a successful Marco/Polo heartbeat exchange.
Gate Lockdown DDI and provisioning-profile operations on heartbeat readiness. Remote Pairing/RSD operations continue to use their existing direct service path without starting a Lockdown heartbeat.
Introduce session-scoped child-service leases. Endpoint changes and foreground revalidation retire the current session, wait for in-flight operations to drain, and then start a new heartbeat session.
Preserve pending readiness waiters across endpoint-generation changes so a deferred DDI mount can continue after the replacement Lockdown session becomes ready.
Serialize DDI mount requests and track their generation. Health Check waits for the latest mount generation instead of observing a stale or transient mount result.
Derive the heartbeat receive timeout from the interval requested by the device, adding a five-second margin and capping the timeout at sixty seconds. This prevents a normal heartbeat cadence from being treated as a disconnect.
Revalidate the Lockdown session when SideStore returns to the foreground so tunnel or session loss can recover without restarting the app.
Recognize both Developer Disk Image response formats:
/DeveloperwithDiskImageType=Developer/System/Developerwith the personalized image schemaExplicitly reject entries reported with
IsMounted=false.Rationale
On Lockdown devices, DDI mounting and
misagentprofile operations could begin before the heartbeat service was ready. The heartbeat connection could also time out before the device’s next expected Marco message.This created a race where Health Check temporarily reported a DDI error and profile installation failed even though the tunnel and application otherwise remained usable.
Remote Pairing uses RSD service connections and does not require this Lockdown heartbeat coordination, so that path remains intentionally separate.
Testing
Automated:
swift test: 7 tests passedswift build --target Minimuxer: passedManual testing:
iPhone 13 running iOS 16.0.2:
iPhone 13 running iOS 17.5.1:
Both device configurations passed manual testing.