Skip to content

Run a virtual iPhone on an Apple Silicon Mac.

Swift

Merge upstream/main into appletv-remote

Guilherme Ramboffcb10e03faf
diff --cc Research/0_binary_patch_comparison.md
index 7fbf067a,4b08b276..971d2535
--- a/Research/0_binary_patch_comparison.md
+++ b/Research/0_binary_patch_comparison.md
@@@ -1,56 -1,52 +1,103 @@@
# Patch Comparison: Regular / Development / Jailbreak / Experimental
+> **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
+ > installed tree and the `devicetree-cfw-ipad_*` presentation from
+ > `DeviceTree.d47ap.im4p`, as every other iPhone does, and skips
+ > `preboot-exp-devicetree_identity`. No patch is new. `ipad_identity` is on in
+ > `standard`, so a `standard` iPhone17,3 guest now reports `iPhone17,3` instead
+ > of `iPhone99,11`. The catalog's release list keeps its iPhone17,3 check
+ > explicit (`VPhoneFirmwareCatalog.pairings`), so its pairings do not change. Checked on
+ > a new `iPhone17,3 27.0.1 (24A446)` guest, cloudOS 26.4 (23E5207q), plain
+ > `standard`: the restore tree split off `DeviceTree.vphone600ap.guest.im4p`;
+ > the receipt records the `ipad_*` patches and
+ > `preboot-cfw-devicetree_board_audio`; `device.info` reports `iPhone17,3` at
+ > 430x932 @3x; Settings > About shows Model Name iPhone 16 and an Action
+ > Button row; the Camera app shows the .5/1x/2 lenses and the test pattern;
+ > with Location Services on, `location.set` reads back a fresh simulated fix
+ > and `bluetoothd`/`locationd` keep their boot PIDs (no #438). Crash reports
+ > held only the documented restore-reboot panic and `duetexpertd` datavault
+ > crashes, plus one `NANDTaskScheduler` PAC kill in its Core Data failure
+ > logging (no ANS NAND on a VM), not on a device tree path.
+
+ > **Account prompt hooks are selectable (2026-10-25).**
+ > `system-preferences-cfw-followup_groups` (`libprefsfix.dylib`, Settings'
+ > CoreFollowUp groups) and `system-apps-cfw-signin_sheets`
+ > (`libsigninfix.dylib`, in-app sign-in sheets) were installed with the guest
+ > environment and could not be turned off. Both are now declarations, on in
+ > `standard` and `experimental`, blocked in the TV and HomePod presets, which
+ > already block the environment. `cfw install` and `cfw update-environment`
+ > install or remove each library per the plan, a VM with no plan keeps both,
+ > and the live environment sync no longer reinstalls one that was turned off.
+ > SystemHook skips a missing library, so removal takes effect on the next
+ > launch of Settings or the app. No binary or loader changes. Account daemons
+ > stay running either way; update and account daemons are disabled only by
+ > vphoned's service profile ([service trimming](Guest/service_trimming.md)).
+
+ > **CSSC kernel compatibility experiment (2026-10-25).**
+ > `kernel-boot-cssc_emulation` targets iOS 27 with cloudOS 26.4. It reuses the
+ > kernel's undefined-instruction copyin, PAC-safe interrupt helpers and
+ > signed-state check/sign ABI. Only known EL0 scalar CSSC words are evaluated;
+ > unknown faults retain native triage. The single baseline-A64 payload occupies
+ > persistent kernel text; no userland/cache CSSC trampolines or writable code
+ > pages are introduced. Existing X1 PAuth/CPA lowering remains unchanged.
+ > Selected X1 boot patch failures abort installation, and an unresolved CSSC
+ > kernel handler aborts kernel preparation. TV and HomePod presets exclude
+ > this operation. See `Research/Guest/iphone_duo_bringup.md` for the reveal
+ > procedure and signed-state handling.
+
> **HomePod local app installation (2026-10-23).**
> `system-installd-exp-homepod_adhoc` is selected only by `homepod-mini` on
> HomePod 27. It loads a dedicated TVOS arm64e build of the existing MIS