Skip to content

Run a virtual iPhone on an Apple Silicon Mac.

Swift

Merge remote-tracking branch 'origin/main' into tvos-roothide-bootstrap

Lakr233cc4deef4d246
diff --cc Research/0_binary_patch_comparison.md
index 9a37c0f5,971d2535..cd731b05
--- a/Research/0_binary_patch_comparison.md
+++ b/Research/0_binary_patch_comparison.md
@@@ -1,24 -1,56 +1,75 @@@
# Patch Comparison: Regular / Development / Jailbreak / Experimental
+> **Apple TV RootHide bootstrap and environment hooks (2026-10-26).** No new
+> declaration or instruction patch. An arm64e Apple TV now admits
+> `system-launchdaemons-boot-environment` and
+> `system-launchd-boot-jetsam_panic_guard_bypass`
+> (`FirmwareGuestPatchResolution.tvArm64eGuestPatches`); both stay blocked in
+> `tvos` and `tvos-4k` and on the plain-arm64 HD. On TV the environment is
+> `launchdhook-vphone.dylib` and `SystemHook-vphone.dylib` alone, their
+> `LC_BUILD_VERSION` rewritten to tvOS (`MachOBuildPlatform`) and re-signed at
+> install, with `/vh`; turning it off removes them. The launchd patch is
+> unchanged: on `tv4k`'s tvOS 26.6 arm64e launchd it rewrote `tbnz w0, #0,
+> 0xdac4` at `0xDA68` to `b 0xdac4` (anchor `jetsam property category`) and
+> `/vh` went in as `LC_LOAD_WEAK_DYLIB`. With both on, `tv4k` booted to the
+> home screen with SystemHook in every process and the vphoned RootHide root
+> as `VPHONE_JB_ROOT`; with both off again launchd came back from its backup
+> and the libraries and `/vh` were removed. vphoned installs Irisin's
+> `appletvos-arm64e` package as the RootHide bootstrap on any tvOS guest and
+> refuses rootless there; both were validated live on `tv4k`. See
+> [tvOS support](Firmware/tvos_support.md#roothide-bootstrap).
+
+ > **Apple TV remote and native Setup (2026-10-24).** The current
+ > `tvos-4k` preset selects `system-setupbackground-exp-pineboard_lookup` on
+ > 27.2 and blocks `system-tv-exp-legacy_setup`. The environment update
+ > restores the original CompanionServices flags from their backup, returning
+ > to the new Setup app. Live debugger inspection localized Select's failure:
+ > Hello's native focus target exists but is deferred; a directional press
+ > commits it, after which Select executes the ordinary Hello callback and
+ > opens Language. `system-setup-exp-deferred_focus` installs a tvOS dylib into
+ > Setup via `/tf`, preserving its original entitlements and a reversible backup.
+ > Its adapter uses native TV button-focus policy (`0`) only for an active key
+ > Setup window whose WaffleIron system has default deferral (`3`) and no explicit
+ > override. It observes scene/key/focus updates, preserves other overrides, and
+ > uses UIKit's own preferred-focus machinery and eligibility checks. Earlier
+ > focus-initialization prototypes expired after the native 60-second idle timer.
+ > A live policy-0 test retained focus past 80 seconds and Select entered the
+ > native country picker. The adapter changes no
+ > pairing, drawing, ScenePhase, window suppression or setup-completion state.
+ > This patch is selected only by `tvos-4k` on 27.2; legacy setup remains off.
+ > Installed cold-boot testing passes the first Select after more than 65 seconds
+ > idle at Hello, without directional priming or a debugger. Completed
+ > AX/button taps now survive panel focus loss; pending holds are cancelled and
+ > neither may cross a guest reconnection. The actual AX-button/queue harness
+ > covers this live-discovered delivery failure. See the
+ > [input investigation](Firmware/tvos_27_setup_input.md). Remote clicks, holds,
+ > Home/Settings navigation and Control Center have passed live testing.
+ >
+ > Native Setup then reached manual activation and failed with -71136. The
+ > matching tvOS mobileactivationd retains the existing `should_hactivate`
+ > local-state path, but the TV preset had excluded it. The new declaration
+ > `system-mobileactivationd-exp-tv_activation` reuses that unchanged patcher
+ > with an exact 27.2 applicability gate, selected only by `tvos-4k` and admitted
+ > only for arm64e Apple TV. The installer uses one activation declaration per
+ > device, retaining the existing backup/revert path. Installed native Manual
+ > setup now advances past activation to room choice and Terms & Conditions.
+ > Cold boot of `a4b9ffc4` exposed a packaging failure: the final Setup bundle
+ > seal discarded the entitlements preserved by `patchMachO`, causing native
+ > TCC Bluetooth usage-description crashes. Both applying the focus adapter
+ > and restoring its backup now preserve original entitlements through bundle
+ > sealing. Corrected bundle `da14d7a4` retains the full pristine entitlement set
+ > byte-identically and passes the idle/AX input test. After user-confirmed Terms,
+ > native Setup completes to Home with its own SetupDone/TVBuddy completion
+ > flags true and TVSetupVersion=15. The original VM is also updated, with its
+ > prior setup and data preserved. Navigation, Control Center, Siri search,
+ > Power sleep and TV wake pass; audio effects without active media remain
+ > unverified. A final read-only daemon correction uses TV version/completion
+ > policy instead of the iOS setup version; 376 logic checks pass. Its bundle
+ > `9ffd2d6e` is installed on both machines. Final cold boots report TV setup
+ > and current versions 15, pending=false, and no Setup process. The clone
+ > returns directly to Home; the original remains running with its data intact.
+ > Both receipts have zero pending changes and legacy setup off.
+
> **The iPhone17,3 presents its board (2026-10-25).**
> `VPhoneGuestDevice.presentsBoard` no longer excludes the iPhone17,3; only the
> XS Max keeps the shared tree. An iPhone17,3 guest now gets the separate
diff --cc VPhoneDaemon/Tests/LogicTests.swift
index 3ed916e5,522b3ddc..33350776
--- a/VPhoneDaemon/Tests/LogicTests.swift
+++ b/VPhoneDaemon/Tests/LogicTests.swift
@@@ -37,7 -36,7 +37,8 @@@ enum LogicTests
dataMigrationRecord()
deviceNameRule()
pointerScroll()
+ bootstrapPlatform()
+ setupAssistantState()
print("\(checks) checks, \(failures) failures")
exit(failures == 0 ? 0 : 1)
}
diff --cc VPhoneDaemon/Tests/run-logic-tests.sh
index 028d7983,f24fa3ec..e63f1dbf
--- a/VPhoneDaemon/Tests/run-logic-tests.sh
+++ b/VPhoneDaemon/Tests/run-logic-tests.sh
@@@ -16,7 -16,7 +16,8 @@@ trap '/bin/rm -rf "$temporary"' EXI
"$daemon/Daemon/GuestFirstBootSettle.swift" \
"$daemon/Daemon/GuestDeviceNameRule.swift" \
"$daemon/Daemon/GuestPointerScroll.swift" \
+ "$daemon/Daemon/Bootstrap/GuestBootstrapPlatform.swift" \
+ "$daemon/Daemon/GuestSetupAssistantState.swift" \
"$daemon/Tests/LogicTests.swift" \
-o "$temporary/logic-tests"
diff --cc VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestPatchResolution.swift
index 46de17c3,6d1d8ad6..2bc4fd56
--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestPatchResolution.swift
+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestPatchResolution.swift
@@@ -44,9 -41,9 +44,11 @@@ public enum FirmwareGuestPatchResolutio
"system-extensions-boot-gpu_bundle",
FirmwareGuestSystemPatchSet.tvOTAUserland,
FirmwareGuestSystemPatchSet.tvSetupDisplayLookup,
+ FirmwareGuestSystemPatchSet.tvSetupFocus,
+ FirmwareGuestSystemPatchSet.tvLocalActivation,
FirmwareGuestSystemPatchSet.tvLegacySetup,
+ "system-launchdaemons-boot-environment",
+ "system-launchd-boot-jetsam_panic_guard_bypass",
]).union(FirmwarePatchSetCatalog.tvOS27UserlandPatches)
public static func unvalidatedTVGuestPatches(enabled: Set<String>, arm64eUserland: Bool = false) -> [String] {