Run a virtual iPhone on an Apple Silicon Mac.
Swift
Merge upstream/main into homeview
Jackycdb97393207a
diff --cc Research/0_binary_patch_comparison.mdindex c3e7b106,699d41b3..0dd39ec9--- a/Research/0_binary_patch_comparison.md+++ b/Research/0_binary_patch_comparison.md@@@ -1,71 -1,12 +1,78 @@@# Patch Comparison: Regular / Development / Jailbreak / Experimental+> **HomeView distance simulation (2026-10-30, runtime validation pending).**+> `dyld-exp-homeview_environment_service` opens only BreadBoardServices'+> environment-service internal-install branch on the reviewed 27.2 userland.+> The preceding client entitlement check remains intact; no global internal+> build identity is changed. The reveal follows the native Platform getter's+> call and validates the service's separate rejection paths with Capstone.+> Writes use cache-page re-attestation and the existing undo log. The patch is+> off in every shipped preset and is admitted only for HomeView installs.+> The guest RPC uses the native environment request, near/increased detail and+> far/decreased detail. Native reset clears all environment overrides and+> requires explicit acknowledgement. Retail runtime probes confirmed the+> internal-build gate; no live distance override or patch deployment has been+> performed. See [distance investigation](Firmware/homeview_distance.md).+> Offline validation passes against an APFS cache clone: unique reviewed gate,+> one instruction and one page hash changed, repeat is a no-op, and undo restores+> every cache file byte-identically. Finished bundle build/admission and 94+> focused Xcode tests pass; the live Near/Far UI effect is still unverified.+> After user authorization, HomeView received this patch and guest environment+> `2.15.0-local.b1ed0817`. Native ABI validation was corrected to accept the+> protocol's `Vv` (oneway void) qualifier, with a focused regression test. The+> installed daemon now activates the service and fetches native detail as root.+> No distance override was written by the agent; the user will test Near/Far/reset.++> **HomeView guest-profile backend lookup (2026-10-30).** The BreadBoard+> display exception clears its first assertion, but its native guest-profile+> fetch still fails with an NSError chain ending in sandbox restriction 159+> for `com.apple.mobile.keybagd.UserManager.xpc`. A mobile native probe with+> BreadBoard's relevant client entitlements reproduces it. Userprofilesd's+> donor sandbox lacks that lookup. New `system-userprofilesd-exp-keybag_lookup`+> adds exactly that one exception to userprofilesd, preserving the native+> profile/persona APIs and authorizations; it never fabricates a profile.+> Selected only in `homeview`, gated to 27.2, reversible from executable backup.+> Native setup bypass verification passed independently (`NeedsSetup=false`,+> `CompletedInitialRun=true`, with `SetupDone` untouched). Validated on the+> clean HomeView VM: native guest-profile retrieval succeeds, BreadBoard+> stays up, and Setup.app renders. Touch navigation works from the bypassed+> dashboard into World Clock and its city chooser.++> **HomeView native shell display startup (2026-10-30).** The clean guest+> reaches vphoned and backboardd, but BreadBoard traps in+> `BKSDisplayServicesStart+436`, at the nonzero display-service query status+> assertion, before drawing its UI. Its donor entitlements use+> `temporary-sandbox` and lack `com.apple.backboard.display.services` and the+> backboard HID/render lookups already repaired for Campo on the 26.4 kernel.+> New `system-breadboard-exp-mach_lookup` reuses that scoped exception merger,+> preserves the rest of BreadBoard's entitlements, and keeps an executable+> backup for deselection. On only in `homeview`, gated to 27.2; native setup+> still stays on. Validated: the display-service assertion is gone. Native+> startup also needs the userprofilesd lookup repair above. No new kernel or+> instruction patch.++> **HomeView bringup (2026-10-30).** Adds the opt-in+> `system-homeview-exp-setup_bypass`, off in every shipped preset, including+> the new `homeview` preset. The existing mobile setup helper runs in an+> isolated HomeView mode, journals only `com.apple.purplebuddy/ForceNoBuddy`,+> verifies the native SetupAssistant gates, and restores the exact original+> key on deselection. No completion, activation or HomeKit state is fabricated.+> `devicetree-cfw-homeview_touch` enables DriverKit for the VM's USB HID touch+> screen on J490/J491 installed trees only. The existing+> `devicetree-cfw-tv_app_architecture` also copies the `home` donor's app+> architecture. `system-tv-exp-ota_userland` is reused for HomeView's own+> arm64e full OTA over the HD restore base; Apple TV remote/setup adapters+> remain off. No new instruction replacement or kernel patch. Restore,+> native setup, bypass enable/disable, framebuffer and touch are now tested; see+> [HomeView bringup](Firmware/homeview_bringup.md).++ > **Camera session teardown (2026-10-29).** Source-only change in libcamfix.+ > Session tracking uses `objc_storeWeakOrNil` and a strong weak-load before+ > weak-table insertion. It skips sessions already in deallocation.+ > No firmware patch or preset changes. A small camera app reproduces the+ > original abort on iOS 27.0.1 (24A446). See+ > [reproduction and crash stack](Guest/virtual_camera_transport.md#session-registration-during-teardown-2026-10-29).+> **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@@@ -5574,46 -5686,6 +5752,50 @@@ The host VM view now derives its input> **Duo display: flicker, capture and rotation (2026-10-29):** in `system-springboard-cfw-fold_display`, the compositor is now a layer at the top of Main's `UIRootSceneWindow` (points) instead of a display-level `CAContext` (pixels), its hosts sync from a main run loop observer before Core Animation's commit and change only when a value changes, and its per-frame damage alternates two clear colors. New SpringBoard hook: `+[CMMagicPoseManager orientationForMagicPose:deviceSurface:]` answers with `+[CMDeviceStateEvent propertyAForConfigType:propertyA:propertyB:propertyC:]` directly, because the guest has no `CMMagicPoseManager` shared manager and every panel read ambiguous, so neither panel rotated. vphoned's `display.rotation` on a foldable sets the pose orientation for the lit panel. Details in `Research/Guest/iphone_duo_bringup.md`.+ > **Duo: folds through SpringBoard, and DeviceHub follows them (2026-10-29 night, PR Lakr233/vphone-cli#774):** no binary change. vphoned's `display.posture` `position` asks SpringBoard to fold itself through `SBSDisplayToolService` (entitlement `com.apple.springboard.sbdisplay.service`) and then sets only the virtual hinge (`Research/vphoned_http_api.md`, "Device pose"). In `system-springboard-cfw-fold_display`, `libvphonefolddisplay.dylib` (1) re-reads the shared panel's owner on `-[SpringBoard displayContentModeCoordinator:handleSwapTransitionFromPrimaryWindowScene:toPrimaryWindowScene:withContinuationLockProvider:]` as well, because a continuous close swaps the primary content as it finishes and the panel kept showing the (black) inner display for 3 s; and (2) in backboardd keeps every clone on the panel: `-[CAWindowServerDisplay addClone:options:]` on the inner render display attaches the clone to display 1 instead, and `removeClone:` removes a clone from its real `cloneMaster` (CoreAnimation aborts otherwise). backboardd moves a mirror (DeviceHub's capture display, AirPlay, recording) to the display with the primary content, so open it carried the inner display upright, while DeviceHub draws an open Duo's stream as the inner panel's native portrait framebuffer and turned it a quarter more; the panel is that framebuffer. Row 26's `libdevicehubfix` gains a `CMDeviceStateManager` stand-in in dtdeviceinfod (`VPCMAngleManager.m`: `isAvailable`, `startUpdatesToQueue:withHandler:`, `stopUpdates`, real `CMDeviceStateEvent`s with A device orientation 1, B the hinge state from `VPhoneHingeLatest`, C 0, delivered at start and on change): Xcode 27.1's DeviceHub (CoreDevicePop plugins) draws a foldable from CoreDevice's device motion state (`streamdevicemotionstate`), which a guest's CoreMotion could not answer ("Pose monitoring failed … 1001"), so the device was always drawn closed. **Validated on iPhone19,4 27.1 (24A94425):** closed shows the folded device with the cover screen, open the opened device with the inner screen upright and filling the panel, following live folds; the VM window is unchanged. **Open:** at book DeviceHub draws the cover (it names the inner panel only from DisplayInfo's `active` integrated display, and reporting the inner display as integrated makes DeviceHub want a per-display stream the guest cannot supply); DeviceHub's own pose controls (vendor-defined HID) are not wired to the guest.++ > **Duo: a hardware-shaped inner display, and DeviceHub's controls (2026-10-29 late, PR Lakr233/vphone-cli#774):** supersedes the clone redirect above and closes both of its open items. In `system-springboard-cfw-fold_display`, backboardd's inner `CAWindowServerVirtualDisplay` is now a portrait 2007×2853 framebuffer at 3× (the simulator's inner `CADisplay`), its `extendedProperties` adding `DisplayRotation` 270, `DisplayScale` 3, `ChromeIdentifier` `com.apple.dt.devicekit.chrome.phone14` and `DeviceCornerRadius` 55 beside `DeviceSurfaceType` 2; its one 120 Hz timing is 2007×2853; the digitizer's 270° position turn and both clone hooks (`addClone:options:`, `removeClone:`) are removed; SpringBoard's compositor draws the inner display's frames onto the panel without a turn. SpringBoard lays the inner UI out at interface orientation 90 into that framebuffer. Row 26's `libdevicehubfix`: `dtremotedisplayd` answers `0x184` (adds `0x100`, drops system audio `0x8`, video output by display ID: DeviceHub draws each integrated panel from its own stream and shows its pose controls only then); in `dtdeviceinfod`, `CADisplay` `displayType` answers 0 (integrated) and `pointScale` 3 for the display named `VPhone Duo Inner`; the `CMAngleManager` stand-in skips `-[CMAngleManagerInternal stopAngleUpdatesPrivate]` (reached from `-[CMAngleManager dealloc]`, it asserts the real hinge notifier is available and aborted `dtdeviceinfod` whenever DeviceHub reconnected), its `minAngleDegrees`/`maxAngleDegrees` return floats, and its `angleDegrees`, `mechanicalAngleDegrees` and `velocityDegreesPerSeconds` return floats, as `dtdeviceinfod`'s `CMAngle_Bridge` declares them (`Tf`, read from `s0`): doubles read as 0° for every whole angle, which in book (where DeviceHub takes the angle from this stream) drew the device nearly shut and focused the cover; `CMDeviceStateManager`'s A is the device orientation vphoned publishes (`VPhoneDeviceOrientation`). vphoned (no binary change) decodes DeviceHub's vendor-defined HID controls (usage page `0xFF61`, usage `0x5B`, an IOKit binary-serialized dictionary from the DDI's `dtuhidd`) and folds or turns through `display.posture`'s paths. **Validated on iPhone19,4 27.1 (24A94425), sbdisplay-duo:** open and closed from DeviceHub's buttons follow and settle; book at 130° (DeviceHub's preset) draws the inner face upright with a vertical crease, as DeviceHub draws a simulator Duo; open and book fill the panel without black bars; 48 scripted folds over every path came back in the expected orientation; `display.rotation` 0/90/180/270 on the open inner panel turns it and DeviceHub's model with it. **Open:** DeviceHub's orientation picker and its book button were not pressed since the float fix (both run the paths measured above). **With the foldable product-id** (on in standard since Lakr233/vphone-cli#778) both `dtdeviceinfod` stand-ins (`CMAngleManager`, `CMDeviceStateManager`) step aside for CoreMotion's own managers, and locationd's relay takes DeviceHub's controls itself (dtuhidd's avpCustom service has the host controls' usage) while vphoned keeps the virtual hinge on each slider value and lights a sleeping cover before an opening run; measured on sbdisplay-duo, one guest fold per DeviceHub click. **2026-10-30:** in `system-springboard-cfw-fold_display` FoldDisplay turns SpringBoard's fold fade to black off for folds made awake (`SBDeviceContinuousFoldInteractionSettings.fadeToBlackEnabled`, via `+[SBDeviceContinuousFoldInteractionDomain rootSettings]`; kept for a fold that starts with the panel off or just lit, where it hides the inner content the effect carries over) and hands the shared panel to the inner display inside the primary-swap callback, so opening out of closed shows a few dark frames instead of 0.12 to 0.2 s of black (`Research/Guest/iphone_duo_bringup.md`, "the fold's fade to black on one panel").+++## HomeView shell Metal compiler lookup (2026-10-30)++The existing `system-breadboard-exp-mach_lookup` patch now also appends exactly+`com.apple.MTLCompilerService` to BreadBoard's global Mach lookup exception list.+Campo's shared backboard/frontboard list is unchanged. This retains the native+`temporary-sandbox` profile, every donor entitlement, and the existing executable+backup/deselection path; no kernel or shader binary is changed.++Live HomeView 27.2 / 24V514 on cloudOS 26.4 repeatedly stalled BreadBoard during+app/Home gestures in RenderBox → Metal function specialization → compiler queue+wait. A unique-source public Metal probe, signed with the installed BreadBoard's+exact entitlements and run as mobile501, failed with MTLLibraryErrorDomain3,+lookup error159, `Sandbox restriction`. Earlier identical-source probes hit+cached libraries and concealed this denial. Adding only the compiler lookup to+that probe's entitlements made a fresh unique library compile in 0.05217s and+specialize in 0.001099s. Cache-path sandbox-extension warnings remained nonfatal;+no file permission exceptions were added. Raw evidence and variant entitlements+are in `.build/homeview-distance-runtime/public-metal-*`; native consumer tracing+is in `Research/Firmware/homeview_distance_consumers.md`. Full shell retest after+deployment remains pending at this entry's creation.++Deployment retest: Xcode built `VPhone` successfully (60.743s,+`BuildProject-Log-20261030-211312.txt`); Launchpad installed+`2.15.0-local.0cfd6bd1` with policy/preflight passing and updated HomeView's host+and guest environment bindings. The installed BreadBoard entitlements differ+from b53c29c8 only by the compiler lookup. The formerly hanging bottom Home+gesture now renders the glass app drawer, native environment fetch stays fast,+and Timers visibly launches to its native preset grid. Screenshot evidence is+`0cfd-after-home.jpg` and `0cfd-timers-settled.jpg` under the runtime directory.+The entitlement merge suite passed all7 tests, including the new HomeView+sandbox-preservation/Campo-isolation regression. Native distance ABI checks+also passed. No extra patch selection or boot-chain update was needed.++Final rollout: **2.15.0-local.e2850909** adds the native app-latching explanation+to Controls, preserving the same validated compiler lookup repair. Host and+guest environment bindings updated successfully, vphoned answered in6seconds,+and an acknowledged environment reset plus independent fetch returned+Automatic/detail2/override=false/style0/backlight2. The native clock is visibly+awake. Far/Near/Far actual FrontBoard settings and UIKit scene/view traits were+verified0→2→0 in the temporary observer; the Far reduction flushes when the app+backgrounds, matching Charcuterie's explicit latching policy. No ActivityKit+permission expansion is part of this patch or the installed bundle. All guest+test timers, activities, apps, helpers and overrides were cleaned up.diff --cc VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swiftindex 86d43291,6349641e..73773ef7--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swift@@@ -68,10 -68,8 +68,9 @@@ public enum FirmwarePatchSetCatalogSet(FirmwareKernelFridaPatchSet.manifest.patches.map(\.identifier)).union(hypervisorConcealmentPatches).union(experimentalIdentityPatches)- .union([FirmwareGuestSystemPatchSet.otaUserland, FirmwareGuestSystemPatchSet.homePodTopCap, FirmwareGuestSystemPatchSet.homePodSetupBypass, FirmwareGuestSystemPatchSet.homePodAirPlayVM, FirmwareGuestSystemPatchSet.homePodAudioProduct, FirmwareGuestSystemPatchSet.homePodWelcome, FirmwareGuestSystemPatchSet.homePodSiriSpeech, FirmwareGuestSystemPatchSet.homePodOTAUserland, FirmwareGuestSystemPatchSet.homePodSoundGlow, FirmwareGuestSystemPatchSet.homePodCryptexStaging, FirmwareGuestSystemPatchSet.homePodCryptexClass, FirmwareGuestSystemPatchSet.homePodAdHocInstall])+ .union([FirmwareGuestSystemPatchSet.homeViewEnvironmentService])- .union([FirmwareGuestSystemPatchSet.homeViewProfileLookup, FirmwareGuestSystemPatchSet.homeViewDisplayLookups, FirmwareGuestSystemPatchSet.homeViewSetupBypass, FirmwareGuestSystemPatchSet.otaUserland, FirmwareGuestSystemPatchSet.homePodTopCap, FirmwareGuestSystemPatchSet.homePodSetupBypass, FirmwareGuestSystemPatchSet.homePodAudioProduct, FirmwareGuestSystemPatchSet.homePodWelcome, FirmwareGuestSystemPatchSet.homePodSiriSpeech, FirmwareGuestSystemPatchSet.homePodOTAUserland, FirmwareGuestSystemPatchSet.homePodSoundGlow, FirmwareGuestSystemPatchSet.homePodCryptexStaging, FirmwareGuestSystemPatchSet.homePodCryptexClass, FirmwareGuestSystemPatchSet.homePodAdHocInstall])++ .union([FirmwareGuestSystemPatchSet.homeViewProfileLookup, FirmwareGuestSystemPatchSet.homeViewDisplayLookups, FirmwareGuestSystemPatchSet.homeViewSetupBypass, FirmwareGuestSystemPatchSet.otaUserland, FirmwareGuestSystemPatchSet.homePodTopCap, FirmwareGuestSystemPatchSet.homePodSetupBypass, FirmwareGuestSystemPatchSet.homePodAirPlayVM, FirmwareGuestSystemPatchSet.homePodAudioProduct, FirmwareGuestSystemPatchSet.homePodWelcome, FirmwareGuestSystemPatchSet.homePodSiriSpeech, FirmwareGuestSystemPatchSet.homePodOTAUserland, FirmwareGuestSystemPatchSet.homePodSoundGlow, FirmwareGuestSystemPatchSet.homePodCryptexStaging, FirmwareGuestSystemPatchSet.homePodCryptexClass, FirmwareGuestSystemPatchSet.homePodAdHocInstall]).union([FirmwareKernelCustomFirmwarePatchSet.tvTPROPagers, misTrustAuthPatch, FirmwareGuestSystemPatchSet.settingsRootRows, FirmwareGuestSystemPatchSet.settingsSoftwareUpdate, FirmwareGuestSystemPatchSet.tvTPRO, FirmwareGuestSystemPatchSet.tvOTAUserland, FirmwareGuestSystemPatchSet.tvSetupDisplayLookup, FirmwareGuestSystemPatchSet.tvSetupFocus, FirmwareGuestSystemPatchSet.tvLocalActivation, FirmwareGuestSystemPatchSet.tvLegacySetup])- .union([FirmwareGuestSystemPatchSet.prebootFoldableProductId])/// ProMotion: the 120 Hz timing for the paravirtual display.///@@@ -228,7 -227,7 +228,7 @@@freshly restored 26.4 guest does not survive. The HomePod-only top cap is off.""",patchSets: bundledReferences,- selection: .block([FirmwareGuestSystemPatchSet.homeViewEnvironmentService, FirmwareGuestSystemPatchSet.homeViewProfileLookup, FirmwareGuestSystemPatchSet.homeViewDisplayLookups, FirmwareGuestSystemPatchSet.homeViewSetupBypass, FirmwareGuestSystemPatchSet.tvLegacySetup, FirmwareGuestSystemPatchSet.tvSetupDisplayLookup, FirmwareGuestSystemPatchSet.tvSetupFocus, FirmwareGuestSystemPatchSet.tvLocalActivation, FirmwareGuestSystemPatchSet.homePodTopCap, FirmwareGuestSystemPatchSet.homePodSetupBypass, FirmwareGuestSystemPatchSet.homePodAudioProduct, FirmwareGuestSystemPatchSet.homePodWelcome, FirmwareGuestSystemPatchSet.homePodSiriSpeech, FirmwareGuestSystemPatchSet.homePodOTAUserland, FirmwareGuestSystemPatchSet.homePodSoundGlow, FirmwareGuestSystemPatchSet.homePodCryptexStaging, FirmwareGuestSystemPatchSet.homePodCryptexClass, FirmwareGuestSystemPatchSet.homePodAdHocInstall]),- selection: .block([FirmwareGuestSystemPatchSet.tvLegacySetup, FirmwareGuestSystemPatchSet.tvSetupDisplayLookup, FirmwareGuestSystemPatchSet.tvSetupFocus, FirmwareGuestSystemPatchSet.tvLocalActivation, FirmwareGuestSystemPatchSet.homePodTopCap, FirmwareGuestSystemPatchSet.homePodSetupBypass, FirmwareGuestSystemPatchSet.homePodAirPlayVM, FirmwareGuestSystemPatchSet.homePodAudioProduct, FirmwareGuestSystemPatchSet.homePodWelcome, FirmwareGuestSystemPatchSet.homePodSiriSpeech, FirmwareGuestSystemPatchSet.homePodOTAUserland, FirmwareGuestSystemPatchSet.homePodSoundGlow, FirmwareGuestSystemPatchSet.homePodCryptexStaging, FirmwareGuestSystemPatchSet.homePodCryptexClass, FirmwareGuestSystemPatchSet.homePodAdHocInstall]),++ selection: .block([FirmwareGuestSystemPatchSet.homeViewEnvironmentService, FirmwareGuestSystemPatchSet.homeViewProfileLookup, FirmwareGuestSystemPatchSet.homeViewDisplayLookups, FirmwareGuestSystemPatchSet.homeViewSetupBypass, FirmwareGuestSystemPatchSet.tvLegacySetup, FirmwareGuestSystemPatchSet.tvSetupDisplayLookup, FirmwareGuestSystemPatchSet.tvSetupFocus, FirmwareGuestSystemPatchSet.tvLocalActivation, FirmwareGuestSystemPatchSet.homePodTopCap, FirmwareGuestSystemPatchSet.homePodSetupBypass, FirmwareGuestSystemPatchSet.homePodAirPlayVM, FirmwareGuestSystemPatchSet.homePodAudioProduct, FirmwareGuestSystemPatchSet.homePodWelcome, FirmwareGuestSystemPatchSet.homePodSiriSpeech, FirmwareGuestSystemPatchSet.homePodOTAUserland, FirmwareGuestSystemPatchSet.homePodSoundGlow, FirmwareGuestSystemPatchSet.homePodCryptexStaging, FirmwareGuestSystemPatchSet.homePodCryptexClass, FirmwareGuestSystemPatchSet.homePodAdHocInstall]),)/// The iOS payloads, hooks and shared-cache patches an Apple TV guest has nodiff --cc VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swiftindex 4cbc1230,13197b30..d0bc9ec9--- a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swift+++ b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swift@@@ -1601,23 -1591,21 +1605,38 @@@ struct VPhoneCustomFirmwareInstaller} else {try system.removeItem(setupPath)}+ let homeViewSetup = FirmwareGuestSystemPatchSet.homeViewSetupBypass+ let homeViewSetupPath = String(FirmwareGuestSystemPatchSet.homeViewSetupPath.dropFirst())+ if guestDevice.family == .homeView {+ // Keep the runtime when off so the next boot can restore the saved key.+ try installHomePodSetupRuntime(system: system, work: work, homeView: true)+ }+ if plan?.isEnabled(homeViewSetup) == true {+ guard guestDevice.family == .homeView else {+ throw ValidationError("HomeView setup bypass requires a HomeView guest.")+ }+ _ = try system.directory("usr/share/vphone", create: true, mode: 0o755)+ let policy = try PropertyListSerialization.data(fromPropertyList: ["Enabled": true], format: .binary, options: 0)+ try system.writeFile(homeViewSetupPath, contents: policy, mode: 0o644, owner: Self.guestOwner)+ live.insert(homeViewSetup)+ } else {+ try system.removeItem(homeViewSetupPath)+ }+ // The same helper sets AirPlay's VM override as mobile and restarts the+ // AirPlay daemons when the value changed; removing the marker restores it.+ let airPlay = FirmwareGuestSystemPatchSet.homePodAirPlayVM+ let airPlayPath = String(FirmwareGuestSystemPatchSet.homePodAirPlayVMPath.dropFirst())+ if plan?.isEnabled(airPlay) == true {+ guard guestDevice.family == .homePod else {+ throw ValidationError("HomePod AirPlay on a VM requires a HomePod guest.")+ }+ _ = try system.directory("usr/share/vphone", create: true, mode: 0o755)+ let policy = try PropertyListSerialization.data(fromPropertyList: ["Enabled": true], format: .binary, options: 0)+ try system.writeFile(airPlayPath, contents: policy, mode: 0o644, owner: Self.guestOwner)+ live.insert(airPlay)+ } else {+ try system.removeItem(airPlayPath)+ }let speech = FirmwareGuestSystemPatchSet.homePodSiriSpeechlet speechPath = String(FirmwareGuestSystemPatchSet.homePodSiriSpeechPath.dropFirst())if plan?.isEnabled(speech) == true {diff --cc VPhoneExecutable/VPhoneVirtualization/Resources/Info.plistindex 47b9d9ff,ee0345c9..322d030d--- a/VPhoneExecutable/VPhoneVirtualization/Resources/Info.plist+++ b/VPhoneExecutable/VPhoneVirtualization/Resources/Info.plist@@@ -9,9 -9,9 +9,9 @@@<key>CFBundlePackageType</key><string>BNDL</string><key>CFBundleVersion</key>- <string>57</string>+ <string>59</string><key>CFBundleShortVersionString</key>- <string>2.14.2</string>+ <string>2.15.0</string><key>NSMicrophoneUsageDescription</key><string>Shares this Mac's microphone with the virtual iPhone so apps running inside it can record.</string></dict>diff --cc VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/homeview.plistindex 96fdb6ee,00000000..70332110mode 100644,000000..100644--- a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/homeview.plist+++ b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/homeview.plist@@@ -1,169 -1,0 +1,171 @@@+<?xml version="1.0" encoding="UTF-8"?>+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">+<plist version="1.0">+<dict>+ <key>Identifier</key>+ <string>homeview</string>+ <key>PatchSets</key>+ <array>+ <dict>+ <key>Identifier</key>+ <string>com.vphone.patchset.bootchain</string>+ <key>Kind</key>+ <string>Bundled</string>+ </dict>+ <dict>+ <key>Identifier</key>+ <string>com.vphone.patchset.kernel.base</string>+ <key>Kind</key>+ <string>Bundled</string>+ </dict>+ <dict>+ <key>Identifier</key>+ <string>com.vphone.patchset.kernel.cfw</string>+ <key>Kind</key>+ <string>Bundled</string>+ </dict>+ <dict>+ <key>Identifier</key>+ <string>com.vphone.patchset.kernel.hypervisor</string>+ <key>Kind</key>+ <string>Bundled</string>+ </dict>+ <dict>+ <key>Identifier</key>+ <string>com.vphone.patchset.kernel.frida</string>+ <key>Kind</key>+ <string>Bundled</string>+ </dict>+ <dict>+ <key>Identifier</key>+ <string>com.vphone.patchset.research.board</string>+ <key>Kind</key>+ <string>Bundled</string>+ </dict>+ <dict>+ <key>Identifier</key>+ <string>com.vphone.patchset.devicetree</string>+ <key>Kind</key>+ <string>Bundled</string>+ </dict>+ <dict>+ <key>Identifier</key>+ <string>com.vphone.patchset.guest.system</string>+ <key>Kind</key>+ <string>Bundled</string>+ </dict>+ <dict>+ <key>Identifier</key>+ <string>com.vphone.patchset.guest.display</string>+ <key>Kind</key>+ <string>Bundled</string>+ </dict>+ <dict>+ <key>Identifier</key>+ <string>com.vphone.patchset.guest.identity</string>+ <key>Kind</key>+ <string>Bundled</string>+ </dict>+ </array>+ <key>Selection</key>+ <dict>+ <key>Kind</key>+ <string>Block</string>+ <key>Patches</key>+ <array>+ <string>devicetree-exp-arm_io_device_type</string>+ <string>devicetree-exp-arm_io_soc_generation</string>+ <string>devicetree-exp-compatible_secondary</string>+ <string>devicetree-exp-product_fdr_product_type</string>+ <string>devicetree-exp-product_gestalt_variants_rename</string>+ <string>devicetree-exp-product_sub_product_type</string>+ <string>devicetree-exp-product_unique_model</string>+ <string>devicetree-exp-target_sub_type</string>+ <string>dyld-boot-arm64e_x1_bootstrap</string>+ <string>dyld-boot-iomfb_swapend</string>+ <string>dyld-cfw-arm64e_x1_cache</string>+ <string>dyld-cfw-camera</string>+ <string>dyld-exp-hv_vmm</string>+ <string>dyld-exp-mis_trust_auth</string>+ <string>dyld-exp-settings_software_update_row</string>+ <string>kernel-boot-arm64e_x1</string>+ <string>kernel-boot-cssc_emulation</string>+ <string>kernel-cfw-paravirt_gpu_task3</string>+ <string>kernel-exp-frida_syscall_filter_off</string>+ <string>kernel-exp-frida_thread_set_state_entitlement_flag</string>+ <string>kernel-exp-frida_tpro_off</string>+ <string>kernel-exp-frida_vm_map_delete_immutable_code</string>+ <string>kernel-exp-hv_vmm</string>+ <string>kernel-exp-tv_tpro_pagers</string>+ <string>preboot-cfw-devicetree_board_audio</string>++ <string>preboot-cfw-devicetree_foldable_displays</string>++ <string>preboot-cfw-devicetree_foldable_product_id</string>+ <string>preboot-cfw-devicetree_foldable_vm_subtype</string>+ <string>preboot-cfw-devicetree_haptics</string>+ <string>preboot-cfw-devicetree_iphone_product</string>+ <string>preboot-cfw-devicetree_microphone_array</string>- <string>preboot-exp-devicetree_foldable_product_id</string>+ <string>preboot-exp-devicetree_identity</string>+ <string>preboot-homepod-exp-audio_product</string>+ <string>preboot-homepod-exp-cryptex_class</string>+ <string>restoreramdisk-boot-apfs_sha3_hash</string>+ <string>system-apps-cfw-attitude</string>+ <string>system-apps-cfw-signin_sheets</string>+ <string>system-backboardd-cfw-accelerometer</string>+ <string>system-backboardd-cfw-gyroscope</string>+ <string>system-backboardd-cfw-hinge</string>+ <string>system-campo-cfw-entitlements</string>+ <string>system-cibarcode-cfw-arm64e_x1</string>+ <string>system-cryptexd-exp-homepod_staging</string>+ <string>system-debugserver-cfw-install</string>+ <string>system-diskimagesiod-cfw-is_mount_complete</string>+ <string>system-dyld-boot-arm64e_x1_bootstrap</string>+ <string>system-dyld-exp-tv_tpro</string>+ <string>system-exp-ota_userland</string>+ <string>system-fsck-boot-arm64e_x1_bootstrap</string>++ <string>system-homepod-exp-airplay_vm</string>+ <string>system-homepod-exp-ota_userland</string>+ <string>system-homepod-exp-setup_bypass</string>+ <string>system-homepod-exp-siri_speech</string>+ <string>system-homepod-exp-sound_glow</string>+ <string>system-homepod-exp-top_cap</string>+ <string>system-homepod-exp-welcome</string>+ <string>system-homeview-exp-setup_bypass</string>+ <string>dyld-exp-homeview_environment_service</string>+ <string>system-installcoordination_proxy-cfw-persona_lookup</string>+ <string>system-installd-exp-homepod_adhoc</string>+ <string>system-jetsamproperties-cfw-disable_allowed</string>+ <string>system-launchd-boot-arm64e_x1_bootstrap</string>+ <string>system-launchd-boot-jetsam_panic_guard_bypass</string>+ <string>system-launchdaemons-boot-environment</string>+ <string>system-locationd-cfw-disable_auto_cohort</string>+ <string>system-mobileactivationd-boot-should_hactivate</string>+ <string>system-mobileactivationd-exp-tv_activation</string>+ <string>system-mount-boot-arm64e_x1_bootstrap</string>+ <string>system-paravirt_gpu-cfw-heap_index_offset</string>+ <string>system-preferences-cfw-followup_groups</string>+ <string>system-preferences-exp-root_rows</string>+ <string>system-setup-exp-deferred_focus</string>+ <string>system-setupbackground-exp-pineboard_lookup</string>+ <string>system-springboard-cfw-fold_display</string>+ <string>system-springboard-cfw-fold_guard</string>+ <string>system-systemhook-cfw-metal_cache_reuse</string>+ <string>system-systemversion-cfw-build_version</string>+ <string>system-tv-exp-legacy_setup</string>+ <string>system-virtiosound-cfw-hal_plugin</string>+ <string>system-virtualaudio-cfw-device_state_null_gate</string>+ <string>system-virtualaudio-cfw-microphone_graph_chains</string>+ <string>system-virtualaudio-cfw-mute_set_throw</string>+ <string>system-virtualaudio-cfw-speaker_graph_chains</string>+ <string>system-virtualaudio-cfw-speaker_protection_gate</string>+ <string>system-virtualaudio-cfw-speaker_raw_chains</string>+ <string>system-virtualaudio-cfw-speaker_route_throws</string>+ <string>system-virtualaudio-cfw-volume_mode_precondition</string>+ <string>system-watchdogd-exp-hv_vmm_cache</string>+ </array>+ </dict>+ <key>Summary</key>+ <string>Research: HomeView's own arm64e tvOS OTA over the Apple TV HD restore base, with its donor board identity, touch display, vphoned and paravirtual GPU. Native setup is retained by default.</string>+ <key>Title</key>+ <string>HomeView</string>+</dict>+</plist>diff --cc VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/standard.plistindex 2fa7e105,0ffe9fbf..c031ba12--- a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/standard.plist+++ b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/standard.plist@@@ -73,12 -73,9 +73,13 @@@<string>Block</string><key>Patches</key><array>+ <string>system-userprofilesd-exp-keybag_lookup</string>+ <string>system-breadboard-exp-mach_lookup</string>+ <string>system-homeview-exp-setup_bypass</string>+ <string>dyld-exp-homeview_environment_service</string><string>system-homepod-exp-top_cap</string><string>system-homepod-exp-setup_bypass</string>+ <string>system-homepod-exp-airplay_vm</string><string>system-homepod-exp-welcome</string><string>system-homepod-exp-siri_speech</string><string>system-homepod-exp-ota_userland</string>diff --cc VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos.plistindex c0edd12f,6f1a3f27..ac7361df--- a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos.plist+++ b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos.plist@@@ -73,12 -73,9 +73,13 @@@<string>Block</string><key>Patches</key><array>+ <string>system-userprofilesd-exp-keybag_lookup</string>+ <string>system-breadboard-exp-mach_lookup</string>+ <string>system-homeview-exp-setup_bypass</string>+ <string>dyld-exp-homeview_environment_service</string><string>system-homepod-exp-top_cap</string><string>system-homepod-exp-setup_bypass</string>+ <string>system-homepod-exp-airplay_vm</string><string>system-homepod-exp-welcome</string><string>system-homepod-exp-siri_speech</string><string>system-homepod-exp-ota_userland</string>diff --cc VPhoneGuestComponents/HomePodSetup/HomePodSetupState.hindex e4f2d912,30c893ca..2e900002--- a/VPhoneGuestComponents/HomePodSetup/HomePodSetupState.h+++ b/VPhoneGuestComponents/HomePodSetup/HomePodSetupState.h@@@ -3,9 -3,6 +3,10 @@@// Only these local completion flags belong to the bypass. Account, activation,// HomeKit and Wi-Fi state remain owned by their native services.NSArray<NSString *> *VPHomePodSetupKeys(void);++// The journalled update below, with every key set to YES while enabled.+BOOL VPSetupUpdateKeys(NSArray<NSString *> *keys, BOOL enabled, NSURL *journalURL,+ NSDictionary<NSString *, id> *current, void (^setValue)(NSString *, id),+ BOOL (^synchronize)(void), NSError **error);BOOL VPHomePodSetupUpdate(BOOL enabled, NSURL *journalURL, NSDictionary<NSString *, id> *current,void (^setValue)(NSString *, id), BOOL (^synchronize)(void), NSError **error);diff --cc VPhoneGuestComponents/HomePodSetup/HomePodSetupState.mindex 775af717,800e80d4..da5b4738--- a/VPhoneGuestComponents/HomePodSetup/HomePodSetupState.m+++ b/VPhoneGuestComponents/HomePodSetup/HomePodSetupState.m@@@ -12,12 -16,14 +16,20 @@@ static BOOL VPSetupError(NSError **erroBOOL VPHomePodSetupUpdate(BOOL enabled, NSURL *journalURL, NSDictionary<NSString *, id> *current,void (^setValue)(NSString *, id), BOOL (^synchronize)(void), NSError **error) {+ return VPSetupUpdateKeys(VPHomePodSetupKeys(), enabled, journalURL, current, setValue, synchronize, error);+}++BOOL VPSetupUpdateKeys(NSArray<NSString *> *keys, BOOL enabled, NSURL *journalURL,+ NSDictionary<NSString *, id> *current, void (^setValue)(NSString *, id),+ BOOL (^synchronize)(void), NSError **error) {+ NSMutableDictionary *values = [NSMutableDictionary dictionary];- for (NSString *key in VPHomePodSetupKeys()) values[key] = @YES;- return VPHomePodPreferenceUpdate(VPHomePodSetupKeys(), values, enabled, journalURL, current, setValue, synchronize, error);++ for (NSString *key in keys) values[key] = @YES;++ return VPHomePodPreferenceUpdate(keys, values, enabled, journalURL, current, setValue, synchronize, error);+ }++ BOOL VPHomePodPreferenceUpdate(NSArray<NSString *> *keys, NSDictionary<NSString *, id> *enabledValues,+ BOOL enabled, NSURL *journalURL, NSDictionary<NSString *, id> *current,+ void (^setValue)(NSString *, id), BOOL (^synchronize)(void), NSError **error) {NSFileManager *files = NSFileManager.defaultManager;NSDictionary *journal = nil;if ([files fileExistsAtPath:journalURL.path]) {diff --cc VPhoneGuestComponents/HomePodSetup/main.mindex 25c781c9,07c77706..bf9ebbad--- a/VPhoneGuestComponents/HomePodSetup/main.m+++ b/VPhoneGuestComponents/HomePodSetup/main.m@@@ -7,39 -7,19 +7,26 @@@#import <notify.h>#import <signal.h>#import <unistd.h>+#import <sys/sysctl.h>+#import <string.h>- int main(int argc, const char *argv[]) {+ static NSString *const VPStateDirectory = @"/var/mobile/Library/Application Support/vphone";++ // The setup completion: SetupAssistant's two keys, its native sentinel, and the+ // end of a pending HPSetup session.-static BOOL VPRunSetup(void) {++static BOOL VPRunSetup(BOOL homeView) {@autoreleasepool {- BOOL homeView = argc == 2 && strcmp(argv[1], "--homeview") == 0;- if (argc != 1 && !homeView) return 1;- if (getuid() != 501 || geteuid() != 501) {- NSLog(@"HomePod setup maintenance must run as mobile (501).");- return 1;- }- if (homeView) {- char machine[128] = {0}, model[128] = {0};- size_t machineSize = sizeof(machine), modelSize = sizeof(model);- sysctlbyname("hw.machine", machine, &machineSize, NULL, 0);- sysctlbyname("hw.model", model, &modelSize, NULL, 0);- if (strncmp(machine, "HomeAccessory17,", 16) != 0- && strcmp(model, "J490AP") != 0 && strcmp(model, "J491AP") != 0) {- NSLog(@"HomeView setup maintenance requires a HomeAccessory17 guest.");- return 1;- }- }+ NSString *name = homeView ? @"HomeView" : @"HomePod";+ // HomeView's SetupAssistant checks this override before its normal+ // SetupDone gate, in both NeedsToRun and HasCompletedInitialRun.+ // Keep actual setup choices intact; deselection restores only this key.+ NSArray<NSString *> *keys = homeView ? @[@"ForceNoBuddy"] : VPHomePodSetupKeys();- NSString *directory = @"/var/mobile/Library/Application Support/vphone";+ NSString *directory = VPStateDirectory;- NSURL *journal = [NSURL fileURLWithPath:[directory stringByAppendingPathComponent:@"HomePodSetupOriginal.plist"]];- NSDictionary *policy = [NSDictionary dictionaryWithContentsOfFile:@"/usr/share/vphone/HomePodSetup.plist"];+ NSURL *journal = [NSURL fileURLWithPath:[directory stringByAppendingPathComponent:[name stringByAppendingString:@"SetupOriginal.plist"]]];+ NSDictionary *policy = [NSDictionary dictionaryWithContentsOfFile:[NSString stringWithFormat:@"/usr/share/vphone/%@Setup.plist", name]];BOOL enabled = [policy[@"Enabled"] isEqual:@YES];BOOL hadJournal = [NSFileManager.defaultManager fileExistsAtPath:journal.path];- if (!enabled && !hadJournal) return 0;+ if (!enabled && !hadJournal) return YES;void *framework = dlopen("/System/Library/PrivateFrameworks/SetupAssistant.framework/SetupAssistant", RTLD_NOW);void (*prepare)(void) = framework ? dlsym(framework, "BYSetupAssistantPrepareLaunchSentinel") : NULL;@@@ -115,8 -93,85 +100,100 @@@if (needsSetup) status[@"NeedsSetup"] = @(needsSetup());if (completed) status[@"CompletedInitialRun"] = @(completed());if (error) status[@"Error"] = error.localizedDescription;- [status writeToFile:[directory stringByAppendingPathComponent:@"HomePodSetupStatus.plist"] atomically:YES];- NSLog(@"HomePod setup maintenance: %@", status);+ [status writeToFile:[directory stringByAppendingPathComponent:[name stringByAppendingString:@"SetupStatus.plist"]] atomically:YES];+ NSLog(@"%@ setup maintenance: %@", name, status);- return success ? 0 : 1;+ return success;+ }+ }++ // AirPlay's own VM override, useWiFiAndAWDLOnVirtualMachine in mobile's+ // com.apple.airplay. AirPlaySupport reads it once per process, so the AirPlay+ // daemons restart only when this run changed the value.+ static BOOL VPRunAirPlay(void) {+ @autoreleasepool {+ NSString *directory = VPStateDirectory;+ NSURL *journal = [NSURL fileURLWithPath:[directory stringByAppendingPathComponent:@"HomePodAirPlayOriginal.plist"]];+ NSDictionary *policy = [NSDictionary dictionaryWithContentsOfFile:@"/usr/share/vphone/HomePodAirPlay.plist"];+ BOOL enabled = [policy[@"Enabled"] isEqual:@YES];+ BOOL hadJournal = [NSFileManager.defaultManager fileExistsAtPath:journal.path];+ if (!enabled && !hadJournal) return YES;++ CFStringRef domain = CFSTR("com.apple.airplay");+ CFPreferencesSynchronize(domain, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);+ NSMutableDictionary *current = [NSMutableDictionary dictionary];+ for (NSString *key in VPHomePodAirPlayKeys()) {+ id value = CFBridgingRelease(CFPreferencesCopyValue((__bridge CFStringRef)key, domain,+ kCFPreferencesCurrentUser, kCFPreferencesAnyHost));+ if (value) current[key] = value;+ }+ NSMutableDictionary *values = [NSMutableDictionary dictionary];+ for (NSString *key in VPHomePodAirPlayKeys()) values[key] = @1;+ NSError *error = nil;+ BOOL success = VPHomePodPreferenceUpdate(VPHomePodAirPlayKeys(), values, enabled, journal, current,+ ^(NSString *key, id value) {+ CFPreferencesSetValue((__bridge CFStringRef)key, (__bridge CFPropertyListRef)value, domain,+ kCFPreferencesCurrentUser, kCFPreferencesAnyHost);+ }, ^BOOL {+ return CFPreferencesSynchronize(domain, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);+ }, &error);+ BOOL changed = NO;+ NSUInteger restarted = 0;+ if (success) {+ for (NSString *key in VPHomePodAirPlayKeys()) {+ id now = CFBridgingRelease(CFPreferencesCopyValue((__bridge CFStringRef)key, domain,+ kCFPreferencesCurrentUser, kCFPreferencesAnyHost));+ if (!(now == current[key] || [now isEqual:current[key]])) changed = YES;+ }+ if (changed) {+ void *processLibrary = dlopen("/usr/lib/libproc.dylib", RTLD_NOW);+ VPHomePodSetupProcessAPI api = {+ .listPIDs = processLibrary ? dlsym(processLibrary, "proc_listpids") : NULL,+ .processPath = processLibrary ? dlsym(processLibrary, "proc_pidpath") : NULL,+ .signalProcess = kill,+ };+ success = VPHomePodRestartProcesses(api, getuid(), VPHomePodAirPlayExecutables(), &restarted, &error);+ }+ // The journal goes only once the restored value is in place.+ if (success && !enabled) success = [NSFileManager.defaultManager removeItemAtURL:journal error:&error];+ }+ NSMutableDictionary *status = [@{@"Enabled": @(enabled), @"Succeeded": @(success), @"Changed": @(changed),+ @"Restarted": @(restarted), @"Updated": NSDate.date} mutableCopy];+ if (error) status[@"Error"] = error.localizedDescription;+ [status writeToFile:[directory stringByAppendingPathComponent:@"HomePodAirPlayStatus.plist"] atomically:YES];+ NSLog(@"HomePod AirPlay maintenance: %@", status);+ return success;+ }+ }+-int main(void) {++int main(int argc, const char *argv[]) {+ @autoreleasepool {++ BOOL homeView = argc == 2 && strcmp(argv[1], "--homeview") == 0;++ if (argc != 1 && !homeView) return 1;+ if (getuid() != 501 || geteuid() != 501) {+ NSLog(@"HomePod setup maintenance must run as mobile (501).");+ return 1;+ }++ if (homeView) {++ char machine[128] = {0}, model[128] = {0};++ size_t machineSize = sizeof(machine), modelSize = sizeof(model);++ sysctlbyname("hw.machine", machine, &machineSize, NULL, 0);++ sysctlbyname("hw.model", model, &modelSize, NULL, 0);++ if (strncmp(machine, "HomeAccessory17,", 16) != 0++ && strcmp(model, "J490AP") != 0 && strcmp(model, "J491AP") != 0) {++ NSLog(@"HomeView setup maintenance requires a HomeAccessory17 guest.");++ return 1;++ }++ }+ // Both journals live here and are written before any preference, so+ // the directory must exist before either half runs.+ [NSFileManager.defaultManager createDirectoryAtPath:VPStateDirectory withIntermediateDirectories:YES+ attributes:@{NSFilePosixPermissions: @0700} error:NULL];+ // Independent: a failure of one is retried by launchd without+ // leaving the other undone.- BOOL setup = VPRunSetup();++ // The AirPlay override is a HomePod patch; HomeView runs setup only.++ if (homeView) return VPRunSetup(YES) ? 0 : 1;++ BOOL setup = VPRunSetup(NO);+ BOOL airPlay = VPRunAirPlay();+ return setup && airPlay ? 0 : 1;}}diff --cc VPhoneKit/VPhoneCoreKit/Firmware/VPhoneFirmwareCatalog.swiftindex 42a2396b,f7006717..3272633e--- a/VPhoneKit/VPhoneCoreKit/Firmware/VPhoneFirmwareCatalog.swift+++ b/VPhoneKit/VPhoneCoreKit/Firmware/VPhoneFirmwareCatalog.swift@@@ -711,6 -682,27 +712,27 @@@ public enum VPhoneFirmwareCatalog}}+ /// The cloudOS for `device`'s release at `url`, of `version`: its pairing's,+ /// else the one the pairings give that version on its family.+ public static func recommendedCloudOS(forDevice device: String, version: String, url: String) -> VPhoneCloudOSOption {+ let guest = VPhoneGuestDevice.named(device)+ let pairings = pairings(for: device)+ let name = "\((guest?.family ?? .iPhone).osName) \(version)"+ if let pairing = pairings.first(where: { $0.iosURL == url }) ?? pairings.first(where: { $0.iosName == name }) {+ return VPhoneCloudOSOption(name: pairing.cloudosName, url: pairing.cloudosURL)+ }+ return recommendedCloudOS(for: guest?.family ?? .iPhone, version: version)+ }++ static func recommendedCloudOS(for family: VPhoneGuestDevice.Family, version: String) -> VPhoneCloudOSOption {+ switch family {- case .appleTV: VPhoneCloudOSOption(name: "cloudOS 26.4", url: cloud264)++ case .appleTV, .homeView: VPhoneCloudOSOption(name: "cloudOS 26.4", url: cloud264)+ case .homePod: researchBoardCloudOS(forVersion: version) ?? VPhoneCloudOSOption(name: "cloudOS 26.4", url: cloud264)+ case .watch: researchBoardCloudOS(forVersion: version) ?? recommendedCloudOS(forVersion: version)+ case .iPhone, .iPad: recommendedCloudOS(forVersion: version)+ }+ }+/// The cloudOS the iPhone pairings give a release of this version.static func recommendedCloudOS(forVersion version: String) -> VPhoneCloudOSOption {switch version.split(separator: ".").prefix(2).joined(separator: ".") {