Run a virtual iPhone on an Apple Silicon Mac.
Swift
Drop the unsecure-cache gate from the Apple Watch preset too
Maximilian Paß5ad62e54f802
diff --git a/Research/0_binary_patch_comparison.md b/Research/0_binary_patch_comparison.mdindex 2d828733..4218faa4 100644--- a/Research/0_binary_patch_comparison.md+++ b/Research/0_binary_patch_comparison.md@@ -4311,7 +4311,7 @@ gone. The preset names three sets:| `filesystem-boot-gpu_driver` | Installs the PCC paravirtual GPU driver `fw prepare` staged || `filesystem-boot-mobileactivationd_should_hactivate` | The `should_hactivate` patch, in the image || `filesystem-boot-vphoned` | vphoned and its launch daemon, in the image |-| `filesystem-exp-launchd_cache_loader_unsecure_cache_gate` (was `filesystem-boot-…`) | NOPs launchd_cache_loader's `launchd_unsecure_cache=` gate. `minimal` no longer selects it: `filesystem-boot-vphoned` signs the edited `launchd.plist` instead; see "The stock launchd_cache_loader takes a re-signed launchd.plist" below |+| `filesystem-exp-launchd_cache_loader_unsecure_cache_gate` (was `filesystem-boot-…`) | NOPs launchd_cache_loader's `launchd_unsecure_cache=` gate. `minimal` and `watchos` no longer select it: `filesystem-boot-vphoned` signs the edited `launchd.plist` instead; see "The stock launchd_cache_loader takes a re-signed launchd.plist" below || `filesystem-exp-watch_audio` | Watch images only, via `watchos`: the watchOS-marked virtio sound HAL plugin, a generic-DSP speaker chain, the three VirtualAudio playback routing-gate bypasses, and on watchOS 26.4 the MediaExperience device-class NOP for the virtual-device audio budget. Cannot be toggled without another restore || `manifest-boot-digest_rehash` | Rewrites every BuildManifest digest to the files the restore now sends; for an AEA archive, the digest of its decrypted image, which is what Apple's manifests hold and what an 18.x restore checks the written image against |@@ -5980,9 +5980,11 @@ file. It no longer needs it: `filesystem-boot-vphoned` signs the edited filethe way Apple signs it, and the static trust cache the restore image alreadyrebuilds (and TSS signs) carries the new cdhashes. The patch is now`filesystem-exp-launchd_cache_loader_unsecure_cache_gate`, not boot-essential,-left out of `minimal`; `renamedPatches` migrates a VM's old record. `watchos`-still selects it: its loader shows the same `Code: … Sig: …` path in the-watch boot logs, but no watch guest has booted without it yet.+left out of `minimal` and `watchos`; `renamedPatches` migrates a VM's old+record. A Watch7,18 watchOS 26.4 (23T240) guest on cloudOS 26.4 (23E244),+restored with the gate blocked, booted to the pairing screen with vphoned up:+its stock loader logged "cdhash: … 0xeacd92f9… is trusted" for the re-signed+`launchd.plist.sig` and "Cache sent to launchd successfully" (2026-11-02).What the loader checks (`/usr/libexec/launchd_cache_loader`, libxpc-2894.140.12,iOS 18.6 22G86, read from the disassembly):diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swiftindex 801c838f..b9af425e 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swift@@ -456,7 +456,8 @@ public enum FirmwarePatchSetCatalog {minimalBootChainPatches.union(watchOSDeviceTreePatches).union(FirmwareResearchBoardPatchSet.manifest.patches.map(\.identifier))- .union(FirmwareRestoreImagePatchSet.manifest.patches.map(\.identifier)),+ .union(FirmwareRestoreImagePatchSet.manifest.patches.map(\.identifier))+ .subtracting([FirmwareRestoreImagePatchSet.launchdCacheLoader]),),)diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareRestoreImagePatchSet.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareRestoreImagePatchSet.swiftindex 20b67beb..f92815eb 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareRestoreImagePatchSet.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareRestoreImagePatchSet.swift@@ -8,12 +8,12 @@// chain, kernel and TXM stay stock, and nothing writes the System volume after the// restore, because that would break the seal.//-// Only the `minimal` preset and its watch form, `watchos`, name this set.-// `watchos` allows all of it, `minimal` all but the launchd_cache_loader gate.-// Every patch in it but the three experiments is boot-essential for them, and-// naming it nowhere else keeps `standard` from counting them as dropped. A-// watchOS image has no cryptexes: for a watch the merge only reseals the image-// with the guest payload.+// Only the `minimal` preset and its watch form, `watchos`, name this set,+// and both allow all of it but the launchd_cache_loader gate. Every patch in+// it but the three experiments is boot-essential for them, and naming it+// nowhere else keeps `standard` from counting them as dropped. A watchOS image+// has no cryptexes: for a watch the merge only reseals the image with the+// guest payload.import Foundationimport VPhonePatchKit@@ -29,9 +29,8 @@ public enum FirmwareRestoreImagePatchSet {public static let surfaceCompression = "filesystem-boot-ios18_surface_compression"public static let mobileActivation = "filesystem-boot-mobileactivationd_should_hactivate"public static let vphoned = "filesystem-boot-vphoned"- /// No longer needed by `minimal`: the vphoned step re-signs the edited- /// launchd.plist and the trust cache takes its cdhashes. `watchos` keeps it- /// until a watch guest has booted without it.+ /// No longer needed by `minimal` or `watchos`: the vphoned step re-signs the+ /// edited launchd.plist and the trust cache takes its cdhashes.public static let launchdCacheLoader = "filesystem-exp-launchd_cache_loader_unsecure_cache_gate"public static let virtualBluetooth = "filesystem-exp-btvc_le_connection"public static let watchAudio = "filesystem-exp-watch_audio"diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwarePatchSetCatalogTests.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwarePatchSetCatalogTests.swiftindex 2e45c86c..3ce665a7 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwarePatchSetCatalogTests.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwarePatchSetCatalogTests.swift@@ -248,7 +248,8 @@ struct FirmwarePatchSetCatalogTests {iOSBase: VPhoneVersion("26.4"),cloudOS: VPhoneVersion("26.4"),)- #expect(watch.enabled == restoreImage+ #expect(!watch.isEnabled(FirmwareRestoreImagePatchSet.launchdCacheLoader))+ #expect(watch.enabled == restoreImage.subtracting([FirmwareRestoreImagePatchSet.launchdCacheLoader]).union(FirmwarePatchSetCatalog.watchOSDeviceTreePatches).union(bootChain).union(researchBoard))}diff --git a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/watchos.plist b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/watchos.plistindex b6ef1716..723e2fc5 100644--- a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/watchos.plist+++ b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/watchos.plist@@ -54,7 +54,6 @@<string>filesystem-boot-mobileactivationd_should_hactivate</string><string>filesystem-boot-vphoned</string><string>filesystem-exp-btvc_le_connection</string>- <string>filesystem-exp-launchd_cache_loader_unsecure_cache_gate</string><string>filesystem-exp-watch_audio</string><string>ibec-boot-boot_args</string><string>ibec-boot-bootx_precondition</string>