Skip to content

Run a virtual iPhone on an Apple Silicon Mac.

Swift

HomePod mini guests (AudioAccessory5,1 - tvOS 27.0)

Guilherme Rambo4da7b8000b09
diff --git a/Research/0_binary_patch_comparison.md b/Research/0_binary_patch_comparison.md
index 9f83284d..4fa06358 100644
--- a/Research/0_binary_patch_comparison.md
+++ b/Research/0_binary_patch_comparison.md
@@ -1,5 +1,15 @@
# Patch Comparison: Regular / Development / Jailbreak / Experimental
+> **HomePod mini (2026-10-22).** `AudioAccessory5,1` / B520 uses its own
+> HomePod Software 27.0 (24J361) monolithic arm64e TVOS IPSW with the cloudOS
+> 26.4 boot chain. The dedicated `homepod-mini` preset retains 27 compatibility
+> and vphoned, blocks the Apple TV OTA swap, HD TPRO workaround and iPhone
+> GPU/audio/environment hooks. New `devicetree-cfw-homepod_product` copies
+> concrete `horseman`, `siri-hub` and app architecture capabilities from B520's
+> donor tree only into its installed identity. No new kernel instruction patch.
+> See [HomePod mini support](Firmware/homepod_mini_support.md) for evidence,
+> validation status and limitations.
+
> **Experimental full OTA System update (2026-10-20):**
> `system-exp-ota_userland` is off in Standard and the TV presets. For a stopped
> iPhone/iPad guest with a snapshot and prepared target firmware, it replaces
diff --git a/Research/Firmware/homepod_mini_support.md b/Research/Firmware/homepod_mini_support.md
new file mode 100644
index 00000000..804a5fa6
--- /dev/null
+++ b/Research/Firmware/homepod_mini_support.md
@@ -0,0 +1,119 @@
+# HomePod mini virtualization
+
+HomePod mini is a separate guest family, `homePod`, using the TVOS executable
+platform and monolithic filesystem. It is not an Apple TV: it has its own
+IPSW, accessory identity and services, and does not use TV remote navigation,
+the Apple TV HD restore base, or the Apple TV 4K OTA userland replacement.
+
+## Firmware evidence
+
+Inspected on 2026-10-22 from the supplied
+`AudioAccessory5,1_27.0_24J361_Restore.ipsw`:
+
+- HomePod Software 27.0, build 24J361; `AudioAccessory5,1`, `b520ap`, CPID
+ `0x8006`, BDID `0x22`, SDK platform `appletvos`.
+- File length 4,297,178,355 bytes. Apple's CDN declares SHA-256
+ `6ae3add6733be34e15924b7710cfc5e0dc97425687ab8cac38e8466add9b4ae3`.
+- Native OS image `043-04683-522.dmg.aea`; no OS/App cryptexes. The cache is
+ `System/Library/Caches/com.apple.dyld/dyld_shared_cache_arm64e`.
+- `/usr/lib/dyld` and `/sbin/launchd` are arm64e, TVOS 27.0. dyld UUID
+ `4DB71CBA-9E39-3329-A28A-D34327983DCD`, SHA-256
+ `50edaf559476cd21faa30cec1a0e35e602cf6f3737dbb119d2c2b2441e0d871f`.
+ REA native inspection evidence:
+ `ev_8551f4aa79ea0b1e08633431becb115a4f44cfd102f7c31e58d70cd42a135c8a`.
+- The B520 tree reports `model=AudioAccessory5,1`, `compatible` beginning
+ `B520AP`, `horseman=1`, concrete empty `siri-hub`, and
+ `app-macho-architecture=arm64`. That last capability describes app admission;
+ it does not mean the OS cache is plain arm64. Artwork values describe no
+ panel: idiom `0`, subtype 0, scale 0.
+- Userland includes `HPSetup.app`, AirMusic, AirPodcasts and backboardd.
+
+The firmware catalog points to the [Apple-hosted IPSW](https://updates.cdn-apple.com/2026SFallFCS/a595a3b2-2c42-470a-9417-a705aaafa05c/AudioAccessory5,1_27.0_24J361_Restore.ipsw).
+The boot chain, kernel and SEP remain cloudOS 26.4 beta (23E5207q), with
+OpenAVB/OpenSEP as for other new machines.
+
+## Implementation
+
+`usesTVOS` shares platform-dependent daemon selection, monolithic layout
+admission, hybrid SHA-384 component authentication, cache paths, and guest-patch
+validation. Apple TV-specific menus and OTA replacement still use the Apple TV
+family. The HomePod mini uses the existing TVOS-retargeted vphoned executable.
+
+`homepod-mini` selects the existing 27 userland/kernel compatibility patches
+and vphoned. GPU injection, iPhone audio/camera/sensor/environment hooks,
+Apple TV OTA replacement and plain-arm64 TPRO workarounds stay off. HomePod
+audio routing and physical accessory transports require separate validation.
+
+The new `devicetree-cfw-homepod_product` declaration copies `horseman`,
+`siri-hub` and app architecture from the actual donor tree, only for B520's
+installed identity. It uses parsed property flags; a syscfg placeholder is
+removed rather than copied as data. Existing board presentation supplies the
+model/product strings, removes phone-only capabilities and retains virtual
+hardware nodes. The restore tree retains the research identity.
+
+HomePod has no display panel. The 320×320, 72 ppi, 1× virtual canvas is a host
+diagnostic surface, not physical HomePod metadata. Templates, iOS setup
+automation and slimming are disabled for HomePod creation.
+
+## Creating a machine
+
+With a built bundle and a configured host:
+
+```zsh
+cli='/absolute/path/to/VPhone.bundle/Contents/MacOS/vphone-cli'
+"$cli" vm create homepod-mini --device AudioAccessory5,1 \
+ --iphone-source '/Users/insidegui/Downloads/AudioAccessory5,1_27.0_24J361_Restore.ipsw' \
+ --cloudos-source '/absolute/path/to/cloudOS_23E5207q_Restore.ipsw' \
+ --cpu 4 --memory 4096 --disk-size 32
+```
+
+The historical `--iphone-source` option accepts the HomePod IPSW. The catalog
+also supplies its URL. Launchpad selects the HomePod preset and disables
+templates/slimming; specified local IPSWs are inspected by manifest even when
+renamed. The CLI also infers the device from a local or cached IPSW when
+`--device` is omitted. An uncached remote source needs explicit `--device`.
+For the manual prepare/restore pipeline, select `homepod-mini` with
+`fw set-patches` before preparing. The guest family and preset ship in the
+2.11 bundle/Launchpad series; Launchpad's minimum bundle version is 2.11.0.
+
+## Validation
+
+Validated on 2026-10-22 with four CPUs, 4 GiB memory and a 32 GB disk:
+
+- The supplied IPSW's SHA-256 matches Apple's CDN metadata above.
+- Native `fw prepare` completed with cloudOS 26.4 (23E5207q), retaining B520's
+ tree and skipping GPU recovery. `fw patch` applied 241 records without an
+ undeclared-patch warning. The existing research boot-chain identity was
+ retained for restore.
+- OpenAVB/OpenSEP DFU restore completed, including system volume sealing.
+ CFW installation completed through Launchpad's installed helper, with the
+ launchd cache gate and TVOS vphoned installed, and no patch failures.
+- Three normal boots reached vphoned. On the second and final boots, using
+ 2.11 local bundles,
+ `vm start --headless --wait` reported an answer after four seconds.
+ `device.info` reports `model=AudioAccessory5,1`, `own_name=HomePod`,
+ software 27.0.0, four CPUs, approximately 4 GiB memory and a NAT IPv4 address.
+ Boot session UUIDs differed, confirming separate boots. The second guest
+ answered again after more than a minute, without a reported panic.
+- `processes.list` showed HPSetup, AirMusic, AirPodcasts, homepodsettingsd,
+ homepodsensed, homehubd, homed, audioaccessoryd, audiomxd, airplayd and
+ tvairplayd. This observes running services, not their functional correctness.
+- The complete VPhone bundle and Launchpad build with Xcode MCP; bundle
+ admission and signatures pass. Firmware identity/layout/patch regression
+ suites passed (70 tests, four unavailable reference fixtures skipped).
+ All 102 archive tests passed. Core ran 658 tests: 657 passed on the full
+ run; an unrelated TCP throughput timing test failed under concurrent VM/disk
+ work and passed on an isolated retry. Launchpad IPSW, machine identity and
+ version/binding regression harnesses passed. New localized strings compile.
+ The shared `VPhone` scheme exposes the existing complete-bundle target for
+ the documented build command. A CLI validation probe confirms that the local
+ HomePod IPSW is recognized without `--device`, before any VM is created.
+
+The research VM is `~/.vphone/machines/homepod-mini`. Evidence is retained under
+`.build/homepod-research/` (prepare, patch, restore, CFW, both guest identities,
+process lists and boot results); its console is
+`~/Library/Logs/vphone-launchpad/homepod-mini.log`.
+
+Audio output and microphone capture, Siri, AirPlay playback, activation and
+pairing with the Home app have not been validated. The host's diagnostic
+canvas does not establish a usable graphical HomePod interface.
diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/CustomFirmware/CustomFirmwareDaemons.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/CustomFirmware/CustomFirmwareDaemons.swift
index 6bf4dba7..af41d701 100644
--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/CustomFirmware/CustomFirmwareDaemons.swift
+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/CustomFirmware/CustomFirmwareDaemons.swift
@@ -71,7 +71,7 @@ public enum CustomFirmwareDaemons {
return .cryptex(try cryptexPaths(buildManifest: url))
}
guard let products = manifest["SupportedProductTypes"] as? [String], !products.isEmpty,
- products.allSatisfy({ VPhoneGuestDevice.named($0)?.family == .appleTV }),
+ products.allSatisfy({ VPhoneGuestDevice.named($0)?.usesTVOS == true }),
let erase = identities.first(where: {
($0["Info"] as? PlistDict)?["RestoreBehavior"] as? String == "Erase"
}),
diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/DeviceTree/DeviceTreeGuestDevicePatches.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/DeviceTree/DeviceTreeGuestDevicePatches.swift
index 9c7db356..992d31a4 100644
--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/DeviceTree/DeviceTreeGuestDevicePatches.swift
+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/DeviceTree/DeviceTreeGuestDevicePatches.swift
@@ -62,6 +62,7 @@ extension DeviceTreePatcher {
static let iPadIdentityPatch = "devicetree-cfw-ipad_identity"
static let iPadAudioPatch = "devicetree-cfw-ipad_audio"
static let tvAppArchitecturePatch = "devicetree-cfw-tv_app_architecture"
+ static let homePodProductPatch = "devicetree-cfw-homepod_product"
static let hapticsPatch = "devicetree-cfw-product_haptics_node"
static let microphoneArrayPatch = "devicetree-cfw-product_audio_microphone_array"
@@ -172,7 +173,21 @@ extension DeviceTreePatcher {
action: .set(architecture), patchID: tvAppArchitecturePatch))
}
+ // B520's accessory identity is independent of its artwork idiom,
+ // which is a syscfg placeholder rather than "tv". HomePod services
+ // query these capabilities through MobileGestalt.
+ if let model = value(source, "model"),
+ String(decoding: model.prefix { $0 != 0 }, as: UTF8.self) == "AudioAccessory5,1"
+ {
+ for name in ["horseman", "siri-hub", "app-macho-architecture"] {
+ let action: GuestEdit.Action = value(sourceProduct, name).map { .set($0) } ?? .remove
+ edits.append(GuestEdit(nodePath: product, property: name,
+ action: action, patchID: homePodProductPatch))
+ }
+ }
+
for (name, patchID) in copiedProductProperties {
+
let action: GuestEdit.Action = value(sourceProduct, name).map { .set($0) } ?? .remove
edits.append(GuestEdit(nodePath: product, property: name, action: action, patchID: patchID))
}
diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Manifest/FirmwareManifest.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Manifest/FirmwareManifest.swift
index 756f06c5..9b28a20e 100644
--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Manifest/FirmwareManifest.swift
+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Manifest/FirmwareManifest.swift
@@ -270,7 +270,7 @@ public enum FirmwareManifest {
device: VPhoneGuestDevice,
restoreDir: URL,
) throws -> PlistDict {
- guard device.family == .appleTV else { return identity }
+ guard device.usesTVOS else { return identity }
guard var manifest = identity["Manifest"] as? PlistDict else {
throw ManifestError.missingKey("Manifest in the hybrid build identity")
}
diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareDeviceTreePatchSet.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareDeviceTreePatchSet.swift
index 7196d5dd..f0fd4ff2 100644
--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareDeviceTreePatchSet.swift
+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareDeviceTreePatchSet.swift
@@ -215,6 +215,12 @@ public enum FirmwareDeviceTreePatchSet {
"Takes the audio node from the iPad's tree, so its acoustic ID names tunings the iPad image ships.",
),
+ property(
+ "devicetree-cfw-homepod_product",
+ "HomePod product capabilities",
+ "Copies the HomePod mini's horseman, siri-hub and app architecture properties from its own board tree, so MobileGestalt recognizes an audio accessory. Other boards and the restore tree are unchanged.",
+ ),
+
// MARK: TV Guest
property(
diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestPatchResolution.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestPatchResolution.swift
index 7aa13f01..9e3dcef6 100644
--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestPatchResolution.swift
+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestPatchResolution.swift
@@ -47,6 +47,16 @@ public enum FirmwareGuestPatchResolution {
return enabled.intersection(guestTargetIdentifiers).subtracting(admitted).sorted()
}
+ /// HomePod has its own arm64e IPSW. Sharing TVOS does not admit the
+ /// Apple TV OTA swap, GPU injection, or plain-arm64 dyld workarounds.
+ public static let homePodSupportedGuestPatches = tvSupportedGuestPatches
+ .subtracting([FirmwareGuestSystemPatchSet.tvTPRO])
+ .union(FirmwarePatchSetCatalog.tvOS27UserlandPatches)
+
+ public static func unvalidatedHomePodGuestPatches(enabled: Set<String>) -> [String] {
+ enabled.intersection(guestTargetIdentifiers).subtracting(homePodSupportedGuestPatches).sorted()
+ }
+
/// Every bundled-set patch whose bytes the guest half of an install writes —
/// the dyld shared cache, a guest Mach-O, its entitlements, a guest file, or
/// the Preboot device tree. The complement is the boot chain, which `fw
diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swift
index 38747a3e..e2562b2c 100644
--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swift
+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swift
@@ -315,6 +315,20 @@ public enum FirmwarePatchSetCatalog {
),
)
+ /// HomePod mini uses its own monolithic arm64e TVOS IPSW. Keep the 27
+ /// kernel compatibility patches, but never swap in an Apple TV OTA or
+ /// install the iPhone GPU/audio environment on this headless accessory.
+ public static let homePodMiniPreset = VPhonePatchPreset(
+ identifier: VPhonePatchPreset.homePodMiniIdentifier,
+ title: "HomePod mini",
+ summary: "Research: HomePod mini's own arm64e TVOS IPSW with vphoned, without Apple TV OTA replacement or iPhone display, camera and audio hooks.",
+ patchSets: bundledReferences,
+ selection: .block(
+ manualOnlyPatches.union(tvOSBlockedPatches.subtracting(tvOS27UserlandPatches)),
+ ),
+ )
+
/// The presets the bundle ships.
- public static let builtInPresets: [VPhonePatchPreset] = [standardPreset, experimentalPreset, tvOSPreset, tvOS4KPreset]
+
+ public static let builtInPresets: [VPhonePatchPreset] = [standardPreset, experimentalPreset, tvOSPreset, tvOS4KPreset, homePodMiniPreset]
}
diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/Core/DeviceTreeGuestDeviceTests.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/Core/DeviceTreeGuestDeviceTests.swift
index df03d09c..2abbbeb3 100644
--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/Core/DeviceTreeGuestDeviceTests.swift
+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/Core/DeviceTreeGuestDeviceTests.swift
@@ -172,6 +172,29 @@ struct DeviceTreeGuestDeviceTests {
appArchitecture: .string("app-macho-architecture", "arm64"))
}
+ /// B520 declares its accessory capabilities through concrete properties;
+ /// its artwork values are syscfg placeholders, not a TV panel identity.
+ /// Its app architecture remains "arm64" even though 27.0's dyld is arm64e.
+ static func homePodBoard(model: String = "AudioAccessory5,1", placeholderCapabilities: Bool = false) -> Node {
+ let root = board(model: model, unique: "B520AP", disablesStageManager: false)
+ return Node(properties: root.properties, children: [Node(properties: [
+ .string("name", "product"),
+ .placeholder("artwork-device-idiom", "ardi"),
+ .placeholder("artwork-device-subtype", "ards"),
+ .placeholder("artwork-scale-factor", "arsf"),
+ .string("product-name", "HomePod mini"),
+ .string("fdr-product-type", model),
+ .string("sub-product-type", model),
+ .string("unique-model", "B520AP"),
+ placeholderCapabilities ? .placeholder("horseman", "hrsm")
+ : .integer("horseman", 1),
+ placeholderCapabilities ? .placeholder("siri-hub", "shub")
+ : Property(name: "siri-hub", flags: 0, value: Data()),
+ placeholderCapabilities ? .placeholder("app-macho-architecture", "arch")
+ : .string("app-macho-architecture", "arm64"),
+ ], children: [])])
+ }
+
// MARK: - Reading the result
/// `node -> property -> (flags, value)` for the two levels the fixture has.
@@ -286,6 +309,69 @@ struct DeviceTreeGuestDeviceTests {
// MARK: - Tests
+ @Test func `HomePod installed identity copies accessory capabilities and removes placeholder artwork`() throws {
+ let patcher = DeviceTreePatcher(
+ data: Self.tree.serialized(), verbose: false, device: .audioAccessory5_1,
+ role: .installed, sourceTree: Self.homePodBoard().serialized(),
+ )
+ let records = try patcher.findAll()
+ let installed = Self.read(patcher.patchedData)
+ let product = try #require(installed["device-tree/product"])
+ #expect(Self.string(installed["device-tree"]?["model"]) == "AudioAccessory5,1")
+ #expect(Self.string(installed["device-tree"]?["target-sub-type"]) == "B520AP")
+ #expect(Self.string(product["product-name"]) == "HomePod mini")
+ for name in ["artwork-device-idiom", "artwork-device-subtype", "artwork-scale-factor"] {
+ #expect(product[name] == nil, "\(name) must not retain a syscfg placeholder")
+ }
+ #expect(Self.integer(product["horseman"]) == 1)
+ #expect(product["horseman"]?.0 == 0)
+ let hub = try #require(product["siri-hub"])
+ #expect(hub.0 == 0 && hub.1.isEmpty)
+ #expect(Self.string(product["app-macho-architecture"]) == "arm64")
+ #expect(product["app-macho-architecture"]?.0 == 0)
+ #expect(records.filter { $0.patchID == DeviceTreePatcher.homePodProductPatch }.count == 3)
+ #expect(!records.contains { $0.patchID == DeviceTreePatcher.tvAppArchitecturePatch })
+ // Restore sees the same virtual board and product as before HomePod support.
+ let restore = DeviceTreePatcher(
+ data: Self.tree.serialized(), verbose: false, device: .audioAccessory5_1,
+ role: .restore, sourceTree: Self.homePodBoard().serialized(),
+ )
+ let baseline = DeviceTreePatcher(
+ data: Self.tree.serialized(), verbose: false, device: .appleTV5_3,
+ role: .restore, sourceTree: Self.tvBoard().serialized(),
+ )
+ let restoreRecords = try restore.findAll()
+ _ = try baseline.findAll()
+ #expect(restore.patchedData == baseline.patchedData)
+ #expect(!restoreRecords.contains { $0.patchID == DeviceTreePatcher.homePodProductPatch })
+ }
+
+ @Test func `HomePod capability patch is declared and its gate leaves capabilities untouched`() throws {
+ let identifier = DeviceTreePatcher.homePodProductPatch
+ let declared = Set(FirmwareDeviceTreePatchSet.manifest.patches.map(\.identifier))
+ #expect(declared.contains(identifier))
+ let patcher = DeviceTreePatcher(
+ data: Self.tree.serialized(), verbose: false, device: .audioAccessory5_1,
+ role: .installed, sourceTree: Self.homePodBoard().serialized(),
+ )
+ patcher.gate = VPhonePatchGate(declared: declared, enabled: declared.subtracting([identifier]))
+ let records = try patcher.findAll()
+ let product = try #require(Self.read(patcher.patchedData)["device-tree/product"])
+ for name in ["horseman", "siri-hub", "app-macho-architecture"] {
+ #expect(product[name] == nil)
+ }
+ #expect(!records.contains { $0.patchID == identifier })
+ }
+
+ @Test func `HomePod capabilities require the inspected model and concrete donor values`() throws {
+ for donor in [Self.homePodBoard(model: "AudioAccessory6,1"), Self.homePodBoard(placeholderCapabilities: true)] {
+ let installed = try Self.patch(device: .audioAccessory5_1, role: .installed, board: donor)
+ for name in ["horseman", "siri-hub", "app-macho-architecture"] {
+ #expect(installed["device-tree/product"]?[name] == nil)
+ }
+ }
+ }
+
@Test func `a TV installed tree takes its donor app architecture while restore keeps the virtual board`() throws {
let (installedData, records) = try Self.patched(Self.tree.serialized(), as: .appleTV)
let installed = Self.read(installedData)
diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/CustomFirmware/CustomFirmwareDaemonsTests.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/CustomFirmware/CustomFirmwareDaemonsTests.swift
index 276702de..435adb4b 100644
--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/CustomFirmware/CustomFirmwareDaemonsTests.swift
+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/CustomFirmware/CustomFirmwareDaemonsTests.swift
@@ -250,12 +250,14 @@ struct CustomFirmwareDaemonsTests {
"Manifest": entries,
] as PlistDict]]
}
- try CustomFirmwareDaemons.savePlist(manifest(entries: entries), to: url)
- #expect(try CustomFirmwareDaemons.filesystemLayout(buildManifest: url) == .monolithic)
+ for products in [["AppleTV5,3"], ["AudioAccessory5,1"]] {
+ try CustomFirmwareDaemons.savePlist(manifest(products: products, entries: entries), to: url)
+ #expect(try CustomFirmwareDaemons.filesystemLayout(buildManifest: url) == .monolithic)
+ }
// Broken iPhone firmware and an uninspected TV board must not gain a
// fallback merely because the expected cryptex entries are missing.
- for products in [["iPhone17,3"], ["AppleTV11,1"], []] {
+ for products in [["iPhone17,3"], ["AppleTV11,1"], ["AudioAccessory1,1"], ["AudioAccessory6,1"], ["AudioAccessory5,1", "AudioAccessory6,1"], []] {
try CustomFirmwareDaemons.savePlist(manifest(products: products, entries: entries), to: url)
#expect(throws: CustomFirmwareDaemons.DaemonError.self) {
try CustomFirmwareDaemons.filesystemLayout(buildManifest: url)
@@ -263,14 +265,18 @@ struct CustomFirmwareDaemonsTests {
}
var partial = entries
partial["Cryptex1,SystemOS"] = ["Info": ["Path": "SystemOS.dmg"]] as PlistDict
- try CustomFirmwareDaemons.savePlist(manifest(entries: partial), to: url)
- #expect(throws: CustomFirmwareDaemons.DaemonError.self) {
- try CustomFirmwareDaemons.filesystemLayout(buildManifest: url)
+ for products in [["AppleTV5,3"], ["AudioAccessory5,1"]] {
+ try CustomFirmwareDaemons.savePlist(manifest(products: products, entries: partial), to: url)
+ #expect(throws: CustomFirmwareDaemons.DaemonError.self) {
+ try CustomFirmwareDaemons.filesystemLayout(buildManifest: url)
+ }
}
entries.removeValue(forKey: "SystemVolume")
- try CustomFirmwareDaemons.savePlist(manifest(entries: entries), to: url)
- #expect(throws: CustomFirmwareDaemons.DaemonError.self) {
- try CustomFirmwareDaemons.filesystemLayout(buildManifest: url)
+ for products in [["AppleTV5,3"], ["AudioAccessory5,1"]] {
+ try CustomFirmwareDaemons.savePlist(manifest(products: products, entries: entries), to: url)
+ #expect(throws: CustomFirmwareDaemons.DaemonError.self) {
+ try CustomFirmwareDaemons.filesystemLayout(buildManifest: url)
+ }
}
}
@@ -279,13 +285,20 @@ struct CustomFirmwareDaemonsTests {
let directory = try CustomFirmwareDaemonsFixtures.temporaryDirectory()
defer { try? FileManager.default.removeItem(at: directory) }
let url = directory.appending(path: "BuildManifest.plist")
- for (platform, osPath) in [("iphoneos", "OS.dmg"), ("appletvos", "../OS.dmg"), ("appletvos", "/OS.dmg")] {
+ for (product, platform, osPath) in [
+ ("AppleTV5,3", "iphoneos", "OS.dmg"),
+ ("AppleTV5,3", "appletvos", "../OS.dmg"),
+ ("AppleTV5,3", "appletvos", "/OS.dmg"),
+ ("AudioAccessory5,1", "iphoneos", "OS.dmg"),
+ ("AudioAccessory5,1", "appletvos", "../OS.dmg"),
+ ("AudioAccessory5,1", "appletvos", "/OS.dmg"),
+ ] {
var entries: PlistDict = [:]
for component in ["OS", "SystemVolume", "StaticTrustCache", "Ap,SystemVolumeCanonicalMetadata"] {
entries[component] = ["Info": ["Path": component == "OS" ? osPath : "Firmware/image"]] as PlistDict
}
try CustomFirmwareDaemons.savePlist([
- "SupportedProductTypes": ["AppleTV5,3"],
+ "SupportedProductTypes": [product],
"BuildIdentities": [["Ap,SDKPlatform": platform, "Info": ["RestoreBehavior": "Erase"], "Manifest": entries] as PlistDict],
], to: url)
#expect(throws: CustomFirmwareDaemons.DaemonError.self) {
diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwareGuestPatchResolutionTests.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwareGuestPatchResolutionTests.swift
index c579326e..ef65cfea 100644
--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwareGuestPatchResolutionTests.swift
+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwareGuestPatchResolutionTests.swift
@@ -118,6 +118,63 @@ struct FirmwareGuestPatchResolutionTests {
#expect(tv4K.enabled.symmetricDifference(tvHD.enabled) == tpro.union([gpu, ota]))
}
+ @Test
+ func `HomePod rejects explicit TV payloads while admitting its daemon and 27 compatibility patches`() {
+ let supported: Set<String> = [
+ "system-vphoned-boot-install",
+ "system-launchd_cache_loader-boot-unsecure_cache_gate",
+ "system-seputil-boot-gigalocker_uuid",
+ "system-gigalocker-boot-rename",
+ ]
+ let rejected: Set<String> = [
+ "system-extensions-boot-gpu_bundle",
+ FirmwareGuestSystemPatchSet.tvOTAUserland,
+ FirmwareGuestSystemPatchSet.tvTPRO,
+ "system-launchdaemons-boot-environment",
+ "dyld-cfw-camera",
+ ]
+ let admitted = supported.union(FirmwarePatchSetCatalog.tvOS27UserlandPatches)
+ #expect(FirmwareGuestPatchResolution.unvalidatedHomePodGuestPatches(enabled: admitted).isEmpty)
+ #expect(FirmwareGuestPatchResolution.unvalidatedHomePodGuestPatches(enabled: admitted.union(rejected)) == rejected.sorted())
+ // The TV arm64e guard admits GPU/OTA selection; HomePod's own guard
+ // must keep rejecting those even though its userland is also arm64e.
+ let tvPayloads: Set<String> = ["system-extensions-boot-gpu_bundle", FirmwareGuestSystemPatchSet.tvOTAUserland]
+ #expect(FirmwareGuestPatchResolution.unvalidatedTVGuestPatches(enabled: tvPayloads, arm64eUserland: true).isEmpty)
+ #expect(FirmwareGuestPatchResolution.unvalidatedHomePodGuestPatches(enabled: tvPayloads) == tvPayloads.sorted())
+ #expect(FirmwareGuestPatchResolution.homePodSupportedGuestPatches.isDisjoint(with: rejected))
+ }
+
+ @Test
+ func `HomePod mini uses its own arm64e image with 27 compatibility and no TV OTA or display payload`() throws {
+ let excluded: Set<String> = [
+ "system-extensions-boot-gpu_bundle",
+ FirmwareGuestSystemPatchSet.tvOTAUserland,
+ FirmwareGuestSystemPatchSet.tvTPRO,
+ FirmwareKernelCustomFirmwarePatchSet.tvTPROPagers,
+ FirmwareGuestSystemPatchSet.paravirtGPUIndexOffset,
+ "system-launchdaemons-boot-environment",
+ "dyld-cfw-camera",
+ ]
+ #expect(FirmwarePatchSetCatalog.homePodMiniPreset.identifier == VPhonePatchPreset.homePodMiniIdentifier)
+ for base in ["26.4", "27.0"] {
+ let plan = try VPhonePatchPlan.resolve(
+ preset: FirmwarePatchSetCatalog.homePodMiniPreset,
+ patchSets: FirmwarePatchSetCatalog.bundled,
+ iOSBase: VPhoneVersion(base), cloudOS: VPhoneVersion("26.4"),
+ )
+ #expect(plan.enabled.isDisjoint(with: excluded))
+ #expect(plan.isEnabled("system-vphoned-boot-install"))
+ #expect(plan.isEnabled("system-launchd_cache_loader-boot-unsecure_cache_gate"))
+ #expect(plan.isEnabled("devicetree-cfw-homepod_product"))
+ #expect(FirmwareGuestPatchResolution.unvalidatedHomePodGuestPatches(enabled: plan.enabled).isEmpty)
+ if base == "27.0" {
+ #expect(plan.enabled.isSuperset(of: FirmwarePatchSetCatalog.tvOS27UserlandPatches))
+ } else {
+ #expect(plan.enabled.isDisjoint(with: FirmwarePatchSetCatalog.tvOS27UserlandPatches))
+ }
+ }
+ }
+
@Test
func `TV TPRO patches apply to every tvOS 26 userland on the 26.4 kernel`() throws {
let tv: Set = [FirmwareGuestSystemPatchSet.tvTPRO, FirmwareKernelCustomFirmwarePatchSet.tvTPROPagers]
diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwarePatchSetCatalogTests.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwarePatchSetCatalogTests.swift
index 6a6f96a9..96212192 100644
--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwarePatchSetCatalogTests.swift
+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwarePatchSetCatalogTests.swift
@@ -135,7 +135,7 @@ struct FirmwarePatchSetCatalogTests {
// Nothing a shipped iOS preset does should drop a boot-essential
// patch: these are the combinations we claim boot. The tvOS
// presets drop exactly the iOS ones an Apple TV has no port of.
- let tvPresets = [VPhonePatchPreset.tvOSIdentifier, VPhonePatchPreset.tvOS4KIdentifier]
+ let tvPresets = [VPhonePatchPreset.tvOSIdentifier, VPhonePatchPreset.tvOS4KIdentifier, VPhonePatchPreset.homePodMiniIdentifier]
let expected = tvPresets.contains(preset.identifier)
? Set(plan.droppedBootEssentials).isSubset(of: FirmwarePatchSetCatalog.tvOSBlockedPatches)
: plan.droppedBootEssentials.isEmpty
@@ -310,7 +310,7 @@ struct FirmwarePatchSetCatalogTests {
)
#expect(!plan.isEnabled(patch))
}
- for preset in [FirmwarePatchSetCatalog.tvOSPreset, FirmwarePatchSetCatalog.tvOS4KPreset] {
+ for preset in [FirmwarePatchSetCatalog.tvOSPreset, FirmwarePatchSetCatalog.tvOS4KPreset, FirmwarePatchSetCatalog.homePodMiniPreset] {
let plan = try VPhonePatchPlan.resolve(
preset: preset, patchSets: FirmwarePatchSetCatalog.bundled,
iOSBase: VPhoneVersion("27.0"), cloudOS: VPhoneVersion("26.4"),
diff --git a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swift b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swift
index 9b911b41..eada2561 100644
--- a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swift
+++ b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swift
@@ -228,14 +228,16 @@ struct VPhoneCustomFirmwareInstaller {
}
guard saved else { throw ValidationError("OTA update needs a stopped disk/SEP/NVRAM snapshot.") }
}
- if device.family == .appleTV {
+ if device.usesTVOS {
guard let plan else {
throw ValidationError("tvOS installation needs an explicit patch plan. Resolve a TV selection with `fw set-patches` and `fw patch` first.")
}
- let unvalidated = FirmwareGuestPatchResolution.unvalidatedTVGuestPatches(
- enabled: Set(plan.enabledPatches),
- arm64eUserland: !device.hasPlainArm64Userland,
- )
+ let unvalidated = device.family == .homePod
+ ? FirmwareGuestPatchResolution.unvalidatedHomePodGuestPatches(enabled: Set(plan.enabledPatches))
+ : FirmwareGuestPatchResolution.unvalidatedTVGuestPatches(
+ enabled: Set(plan.enabledPatches),
+ arm64eUserland: !device.hasPlainArm64Userland,
+ )
guard unvalidated.isEmpty else {
throw ValidationError("These guest patches have not been validated for tvOS. Block them with `fw set-patches` before installation: \(unvalidated.joined(separator: ", "))")
}
@@ -266,7 +268,7 @@ struct VPhoneCustomFirmwareInstaller {
if isOTAUpdate, !cloned {
throw ValidationError("The OTA update needs a private APFS disk clone; the original disk was left untouched.")
}
- if device.family == .appleTV {
+ if device.usesTVOS {
// A paired dyld edit must never fall back to mutating the live disk.
// Its errors propagate below, so this clone is committed only after
// the whole install succeeds.
@@ -390,7 +392,7 @@ struct VPhoneCustomFirmwareInstaller {
// its prior set is empty whatever a stale plan might say.
let hasLaunchdBackup = (try? systemRoot.exists("System/Library/xpc/launchd.plist.bak")) ?? false
// TV installs deliberately omit vphoned and its launchd backup.
- let wasInstalled = hasLaunchdBackup || (device.family == .appleTV && receiptGuest != nil)
+ let wasInstalled = hasLaunchdBackup || (device.usesTVOS && receiptGuest != nil)
priorGuest = receiptGuest ?? (wasInstalled ? priorFallback : [])
if isOTAUpdate {
guard wasInstalled, let otaUserland else {
@@ -482,7 +484,7 @@ struct VPhoneCustomFirmwareInstaller {
if device.family != .iPhone {
notApplicableGuest.insert(FirmwareGuestSystemPatchSet.prebootIPhoneProduct)
}
- if device.family != .appleTV {
+ if !device.usesTVOS {
notApplicableGuest.insert(FirmwareGuestSystemPatchSet.tvTPRO)
}
if buildVersion?.isEmpty ?? true {
@@ -1256,7 +1258,7 @@ struct VPhoneCustomFirmwareInstaller {
// 27.x base.
// The selected TV donor has a native arm64 cache. Keep its directory
// intact; cryptex symlinks would point into images it does not ship.
- let cacheRelative = guestDevice.family == .appleTV
+ let cacheRelative = guestDevice.usesTVOS
? "System/Library/Caches/com.apple.dyld"
: "System/Cryptexes/OS/System/Library/Caches/com.apple.dyld"
let cacheArchitecture = guestDevice.hasPlainArm64Userland ? "arm64" : "arm64e"
@@ -1471,7 +1473,7 @@ struct VPhoneCustomFirmwareInstaller {
isolate(["system-extensions-boot-gpu_bundle"]) {
if let restore {
try installGPUBundle(restore: restore, system: system, owner: owner)
- if guestDevice.family == .appleTV {
+ if guestDevice.usesTVOS {
try retargetGPUBundleToTVOS(system: system, work: work)
}
gpuBundleReinstalled = true
diff --git a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/VirtualMachine/VPhoneVirtualMachineCreateCommand.swift b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/VirtualMachine/VPhoneVirtualMachineCreateCommand.swift
index e38749d8..8c5d7688 100644
--- a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/VirtualMachine/VPhoneVirtualMachineCreateCommand.swift
+++ b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/VirtualMachine/VPhoneVirtualMachineCreateCommand.swift
@@ -1,5 +1,6 @@
import ArgumentParser
import Foundation
+import VPhoneArchiveKit
import VPhoneCoreKit
import VPhonePatchKit
@@ -86,20 +87,48 @@ struct VPhoneVirtualMachineCreateCommand: ParsableCommand {
@Flag(name: .customShort("v"), help: "Increase verbosity: -v tool detail, -vv guest serial, -vvv internal trace")
var verboseCount: Int
- private var isAppleTV: Bool {
- VPhoneGuestDevice.named(device)?.family == .appleTV
+ /// A local donor can identify the guest even when --device is omitted.
+ /// Validation reads it once; explicit device selection always takes precedence.
+ private var inferredProductType: String?
+
+ private var selectedGuest: VPhoneGuestDevice? {
+ VPhoneGuestDevice.named(device ?? inferredProductType)
+ }
+
+ private var selectedDevice: String? {
+ device ?? inferredProductType
+ }
+
+ private var ipswCacheDirectory: URL {
+ ipswCache.map {
+ URL(fileURLWithPath: ($0 as NSString).expandingTildeInPath, isDirectory: true)
+ } ?? VPhoneResources.ipswCacheDirectory()
+ }
+
+ private var usesTVOS: Bool {
+ selectedGuest?.usesTVOS == true
}
/// An Apple TV takes the TV preset; one whose userland comes from an OTA
/// takes the arm64e one, with the GPU driver and the userland swap.
private var defaultPreset: String {
- guard let guest = VPhoneGuestDevice.named(device), guest.family == .appleTV else {
+ guard let guest = selectedGuest, guest.usesTVOS else {
return VPhonePatchPreset.standardIdentifier
}
+ if guest.family == .homePod { return VPhonePatchPreset.homePodMiniIdentifier }
return guest.restoreBase == nil ? VPhonePatchPreset.tvOSIdentifier : VPhonePatchPreset.tvOS4KIdentifier
}
- func validate() throws {
+ mutating func validate() throws {
+ // Named templates reject firmware options below and need no IPSW read.
+ // localArchive also recognizes an existing cached remote source without
+ // downloading or changing the cache.
+ if template == nil, device == nil, let iphoneSource,
+ let archive = try VPhoneIPSWCache.localArchive(iphoneSource, in: ipswCacheDirectory)
+ {
+ inferredProductType = VPhoneIPSWCache.guestDevice(for: archive)?.productType
+ }
+
if template != nil, noTemplate {
throw ValidationError("--template and --no-template exclude each other.")
}
@@ -109,13 +138,13 @@ struct VPhoneVirtualMachineCreateCommand: ParsableCommand {
if otaSource != nil || otaKey != nil, VPhoneGuestDevice.named(device)?.restoreBase == nil {
throw ValidationError("--ota-source and --ota-key are for a device Apple ships no IPSW for, such as --device AppleTV14,1.")
}
- if isAppleTV {
+ if usesTVOS {
// Templates and their setup boot drive iOS Setup Assistant and its apps.
if template != nil {
- throw ValidationError("An Apple TV guest is built without a template; --template cannot be used.")
+ throw ValidationError("A tvOS or HomePod guest is built without a template; --template cannot be used.")
}
if try !slimming.request.isEmpty {
- throw ValidationError("An Apple TV guest is built without a template; the slimming switches do not apply.")
+ throw ValidationError("A tvOS or HomePod guest is built without a template; the slimming switches do not apply.")
}
}
_ = try slimming.resolve()
@@ -142,7 +171,7 @@ struct VPhoneVirtualMachineCreateCommand: ParsableCommand {
let unlocks = try unlockAtStartup.map { try VPhoneVirtualMachineConfigCommand.parseSwitch($0, option: "--unlock-at-startup") }
let templateUse: VPhoneVirtualMachineCreator.TemplateUse = if let template {
.identifier(template)
- } else if noTemplate || isAppleTV {
+ } else if noTemplate || usesTVOS {
.none
} else {
.automatic
@@ -162,7 +191,7 @@ struct VPhoneVirtualMachineCreateCommand: ParsableCommand {
if templateUse == .none || templateUse == .automatic {
// Prompt for any firmware component not supplied on the command line,
// from the guest device's builds.
- sources = try VPhoneFirmwareSourceSelection.resolve(iphone: iphoneSource, cloudos: cloudosSource, device: device)
+ sources = try VPhoneFirmwareSourceSelection.resolve(iphone: iphoneSource, cloudos: cloudosSource, device: selectedDevice)
guard sources.iphoneSource != nil, sources.cloudosSource != nil else {
throw ValidationError("Specify both --iphone-source and --cloudos-source when running without a terminal.")
}
@@ -177,10 +206,8 @@ struct VPhoneVirtualMachineCreateCommand: ParsableCommand {
iphoneSource: sources.iphoneSource,
cloudosSource: sources.cloudosSource,
gpuDriverBundle: gpuDriverBundle.map { URL(fileURLWithPath: ($0 as NSString).expandingTildeInPath) },
- ipswCacheDirectory: ipswCache.map {
- URL(fileURLWithPath: ($0 as NSString).expandingTildeInPath, isDirectory: true)
- } ?? VPhoneResources.ipswCacheDirectory(),
- device: device,
+ ipswCacheDirectory: ipswCacheDirectory,
+ device: selectedDevice,
otaSource: otaSource,
otaKey: otaKey,
patchPreset: preset ?? defaultPreset,
diff --git a/VPhoneExecutable/VPhoneCommand/VPhonePatchKit/PatchSet/VPhonePatchPreset.swift b/VPhoneExecutable/VPhoneCommand/VPhonePatchKit/PatchSet/VPhonePatchPreset.swift
index 2b1a627d..1afa6410 100644
--- a/VPhoneExecutable/VPhoneCommand/VPhonePatchKit/PatchSet/VPhonePatchPreset.swift
+++ b/VPhoneExecutable/VPhoneCommand/VPhonePatchKit/PatchSet/VPhonePatchPreset.swift
@@ -82,6 +82,9 @@ public struct VPhonePatchPreset: Sendable, Hashable, Codable, Identifiable {
/// userland taken from the device's OTA.
public static let tvOS4KIdentifier = "tvos-4k"
+ /// HomePod mini's own arm64e TVOS IPSW, without an OTA userland swap.
+ public static let homePodMiniIdentifier = "homepod-mini"
+
/// Whether this is the preset a VM gets by default.
public var isStandard: Bool {
identifier == Self.standardIdentifier
diff --git a/VPhoneExecutable/VPhoneVirtualization/Resources/Info.plist b/VPhoneExecutable/VPhoneVirtualization/Resources/Info.plist
index 4478a4e1..85243871 100644
--- a/VPhoneExecutable/VPhoneVirtualization/Resources/Info.plist
+++ b/VPhoneExecutable/VPhoneVirtualization/Resources/Info.plist
@@ -8,10 +8,10 @@
<string>VPhone</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>2.11.0</string>
<key>CFBundleVersion</key>
<string>43</string>
- <key>CFBundleShortVersionString</key>
- <string>2.10.1</string>
<key>NSMicrophoneUsageDescription</key>
<string>Shares this Mac's microphone with the virtual iPhone so apps running inside it can record.</string>
</dict>
diff --git a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/homepod-mini.plist b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/homepod-mini.plist
new file mode 100644
index 00000000..9ffafc1f
--- /dev/null
+++ b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/homepod-mini.plist
@@ -0,0 +1,136 @@
+<?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>homepod-mini</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.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>system-exp-ota_userland</string>
+ <string>kernel-exp-frida_thread_set_state_entitlement_flag</string>
+ <string>kernel-cfw-paravirt_gpu_task3</string>
+ <string>kernel-exp-frida_vm_map_delete_immutable_code</string>
+ <string>kernel-exp-hv_vmm</string>
+ <string>dyld-exp-hv_vmm</string>
+ <string>system-watchdogd-exp-hv_vmm_cache</string>
+ <string>devicetree-exp-target_sub_type</string>
+ <string>devicetree-exp-compatible_secondary</string>
+ <string>devicetree-exp-product_fdr_product_type</string>
+ <string>devicetree-exp-product_sub_product_type</string>
+ <string>devicetree-exp-product_unique_model</string>
+ <string>devicetree-exp-product_gestalt_variants_rename</string>
+ <string>devicetree-exp-arm_io_device_type</string>
+ <string>devicetree-exp-arm_io_soc_generation</string>
+ <string>preboot-exp-devicetree_identity</string>
+ <string>dyld-exp-mis_trust_auth</string>
+ <string>system-preferences-exp-root_rows</string>
+ <string>dyld-exp-settings_software_update_row</string>
+ <string>dyld-boot-arm64e_x1_bootstrap</string>
+ <string>dyld-boot-iomfb_swapend</string>
+ <string>dyld-cfw-camera</string>
+ <string>kernel-boot-arm64e_x1</string>
+ <string>preboot-cfw-devicetree_board_audio</string>
+ <string>preboot-cfw-devicetree_haptics</string>
+ <string>preboot-cfw-devicetree_iphone_product</string>
+ <string>preboot-cfw-devicetree_microphone_array</string>
+ <string>restoreramdisk-boot-apfs_sha3_hash</string>
+ <string>system-apps-cfw-attitude</string>
+ <string>system-backboardd-cfw-gyroscope</string>
+ <string>system-backboardd-cfw-accelerometer</string>
+ <string>system-campo-cfw-entitlements</string>
+ <string>system-debugserver-cfw-install</string>
+ <string>system-dyld-boot-arm64e_x1_bootstrap</string>
+ <string>system-diskimagesiod-cfw-is_mount_complete</string>
+ <string>system-extensions-boot-gpu_bundle</string>
+ <string>system-tv-exp-ota_userland</string>
+ <string>system-fsck-boot-arm64e_x1_bootstrap</string>
+ <string>system-installcoordination_proxy-cfw-persona_lookup</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-mount-boot-arm64e_x1_bootstrap</string>
+ <string>system-paravirt_gpu-cfw-heap_index_offset</string>
+ <string>system-systemhook-cfw-metal_cache_reuse</string>
+ <string>system-systemversion-cfw-build_version</string>
+ <string>system-virtiosound-cfw-hal_plugin</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-dyld-exp-tv_tpro</string>
+ <string>kernel-exp-tv_tpro_pagers</string>
+ </array>
+ </dict>
+ <key>Summary</key>
+ <string>Research: HomePod mini's own arm64e TVOS IPSW with vphoned, without Apple TV OTA replacement or iPhone display, camera and audio hooks.</string>
+ <key>Title</key>
+ <string>HomePod mini</string>
+</dict>
+</plist>
diff --git a/VPhoneKit/VPhoneArchiveKitTests/BoardDeviceTreeTests.swift b/VPhoneKit/VPhoneArchiveKitTests/BoardDeviceTreeTests.swift
index bae8405a..d03512f0 100644
--- a/VPhoneKit/VPhoneArchiveKitTests/BoardDeviceTreeTests.swift
+++ b/VPhoneKit/VPhoneArchiveKitTests/BoardDeviceTreeTests.swift
@@ -171,6 +171,27 @@ struct BoardDeviceTreeTests {
#expect(VPhoneBoardDeviceTree.find(miniFirmware, in: [root]) == nil)
}
+ @Test func `HomePod mini recovers its B520 board tree from its own IPSW`() throws {
+ let root = try makeRoot()
+ defer { try? FileManager.default.removeItem(at: root) }
+ let firmware = VPhoneBoardDeviceTree.Firmware(device: .audioAccessory5_1, version: "27.0", build: "24J361")
+ let archive = try makeIPSW(
+ "AudioAccessory5,1_27.0_24J361_Restore.ipsw",
+ in: root,
+ version: "27.0",
+ build: "24J361",
+ productTypes: ["AudioAccessory5,1"],
+ boards: ["b520ap"],
+ )
+ #expect(VPhoneBoardDeviceTree.firmware(
+ treeName: "iPhoneOS_AudioAccessory5,1_27.0_24J361_Restore", device: .audioAccessory5_1,
+ ) == firmware)
+ let source = try #require(VPhoneBoardDeviceTree.find(firmware, in: [root]))
+ #expect(source.archive == archive)
+ #expect(source.member == "Firmware/all_flash/DeviceTree.b520ap.im4p")
+ #expect(source.contents == Data("tree b520ap".utf8))
+ }
+
@Test func `the library's own ipsws folder is searched after the shared cache`() {
let vm = URL(fileURLWithPath: "/Volumes/Lab/vphone/machines/ipad", isDirectory: true)
let directories = VPhoneBoardDeviceTree.searchDirectories(forVirtualMachineAt: vm)
diff --git a/VPhoneKit/VPhoneArchiveKitTests/IPSWCacheTests.swift b/VPhoneKit/VPhoneArchiveKitTests/IPSWCacheTests.swift
index 78d8d901..683026aa 100644
--- a/VPhoneKit/VPhoneArchiveKitTests/IPSWCacheTests.swift
+++ b/VPhoneKit/VPhoneArchiveKitTests/IPSWCacheTests.swift
@@ -557,6 +557,30 @@ struct IPSWCacheTests {
}
}
+ @Test func `HomePod mini pairs with cloudOS without admitting other audio accessories`() throws {
+ let root = FileManager.default.temporaryDirectory.appendingPathComponent(UUID().uuidString)
+ try FileManager.default.createDirectory(at: root, withIntermediateDirectories: true)
+ defer { try? FileManager.default.removeItem(at: root) }
+ let homePod = try ipsw(in: root, "homepod-mini", productTypes: ["AudioAccessory5,1"], deviceClasses: ["B520AP"])
+ let cloud = try ipsw(in: root, "cloud", productTypes: ["iProd99,1"], deviceClasses: ["vresearch101ap", "vphone600ap"])
+ let other = try ipsw(in: root, "homepod", productTypes: ["AudioAccessory1,1"], deviceClasses: ["b238ap"])
+
+ try VPhoneIPSWCache.checkPair(iPhone: homePod, cloudOS: cloud)
+ #expect(VPhoneIPSWCache.guestDevice(for: homePod) == .audioAccessory5_1)
+ #expect(homePod.deviceClasses == ["b520ap"])
+ #expect(VPhoneIPSWCache.guestProductTypes.contains("AudioAccessory5,1"))
+ #expect {
+ try VPhoneIPSWCache.checkPair(iPhone: other, cloudOS: cloud)
+ } throws: { error in
+ if case .notIPhoneSource? = error as? VPhoneIPSWCache.Error { true } else { false }
+ }
+ #expect {
+ try VPhoneIPSWCache.checkPair(iPhone: cloud, cloudOS: homePod)
+ } throws: { error in
+ if case .swappedSources? = error as? VPhoneIPSWCache.Error { true } else { false }
+ }
+ }
+
@Test func `an iPad IPSW the guest device list knows pairs with cloudOS`() throws {
let root = FileManager.default.temporaryDirectory.appendingPathComponent(UUID().uuidString)
try FileManager.default.createDirectory(at: root, withIntermediateDirectories: true)
diff --git a/VPhoneKit/VPhoneCoreKit/Firmware/VPhoneFirmwareCatalog.swift b/VPhoneKit/VPhoneCoreKit/Firmware/VPhoneFirmwareCatalog.swift
index 68bf4710..2bc4b5e1 100644
--- a/VPhoneKit/VPhoneCoreKit/Firmware/VPhoneFirmwareCatalog.swift
+++ b/VPhoneKit/VPhoneCoreKit/Firmware/VPhoneFirmwareCatalog.swift
@@ -430,7 +430,16 @@ public enum VPhoneFirmwareCatalog {
]),
]
- /// Full OTAs of devices without an IPSW, oldest first. Each has a
+ /// HomePod mini's native IPSW. The boot chain still comes from cloudOS;
+ /// this is a research pairing, not a claim about Siri or Home pairing.
+ static let homePodReleases: [(devices: [String], releases: [(version: String, url: String)])] = [
+ (devices: ["AudioAccessory5,1"], releases: [
+ ("27.0", "https://updates.cdn-apple.com/2026SFallFCS/a595a3b2-2c42-470a-9417-a705aaafa05c/AudioAccessory5,1_27.0_24J361_Restore.ipsw"),
+ ]),
+ ]
+
+ /// Full OTAs of devices without an IPSW, oldest first.
+ /// Each has a
/// `tvReleases` entry of its `baseVersion` for its `restoreBase`. The keys
/// are AppleDB's.
public static let otaReleases: [VPhoneOTARelease] = [
@@ -470,7 +479,7 @@ public enum VPhoneFirmwareCatalog {
/// The URL of the base device's IPSW `release` is restored over.
public static func restoreBaseURL(for release: VPhoneOTARelease) -> String? {
guard let base = VPhoneGuestDevice.named(release.productType)?.restoreBase else { return nil }
- let releases = (iPhoneReleases + iPadReleases + tvReleases).first { $0.devices.contains(base.productType) }?.releases
+ let releases = (iPhoneReleases + iPadReleases + tvReleases + homePodReleases).first { $0.devices.contains(base.productType) }?.releases
return releases?.first { $0.version == release.baseVersion }?.url
}
@@ -486,7 +495,7 @@ public enum VPhoneFirmwareCatalog {
guard let guest = VPhoneGuestDevice.named(device) else { return [] }
guard guest.presentsBoard else { return pairings }
let restored = guest.restoreBase ?? guest
- var releases = (iPhoneReleases + iPadReleases + tvReleases).first { $0.devices.contains(restored.productType) }?.releases ?? []
+ var releases = (iPhoneReleases + iPadReleases + tvReleases + homePodReleases).first { $0.devices.contains(restored.productType) }?.releases ?? []
if restored != guest {
releases = otaReleases.filter { $0.productType == guest.productType }.compactMap { ota in
guard let base = releases.first(where: { $0.version == ota.baseVersion }) else { return nil }
@@ -494,7 +503,7 @@ public enum VPhoneFirmwareCatalog {
}
}
return releases.map { release in
- let cloudOS = guest.family == .appleTV
+ let cloudOS = guest.usesTVOS
? VPhoneCloudOSOption(name: "cloudOS 26.4", url: cloud264)
: recommendedCloudOS(forVersion: release.version)
return VPhoneFirmwarePairing(
diff --git a/VPhoneKit/VPhoneCoreKit/Firmware/VPhoneFirmwarePicker.swift b/VPhoneKit/VPhoneCoreKit/Firmware/VPhoneFirmwarePicker.swift
index 978bd7ff..9b041c16 100644
--- a/VPhoneKit/VPhoneCoreKit/Firmware/VPhoneFirmwarePicker.swift
+++ b/VPhoneKit/VPhoneCoreKit/Firmware/VPhoneFirmwarePicker.swift
@@ -101,6 +101,7 @@ public enum VPhoneFirmwarePicker {
let os = switch VPhoneGuestDevice.named(pairings.first?.device)?.family {
case .iPad: "an iPadOS"
case .appleTV: "a tvOS"
+ case .homePod: "a HomePod"
case .iPhone, nil: "an iPhone"
}
let idx = try choose(
diff --git a/VPhoneKit/VPhoneCoreKit/Firmware/VPhoneResources.swift b/VPhoneKit/VPhoneCoreKit/Firmware/VPhoneResources.swift
index 5c51beff..401097b8 100644
--- a/VPhoneKit/VPhoneCoreKit/Firmware/VPhoneResources.swift
+++ b/VPhoneKit/VPhoneCoreKit/Firmware/VPhoneResources.swift
@@ -107,7 +107,7 @@ public struct VPhoneResources: Sendable {
vphoned(for: .iPhone)
}
- /// The vphoned a guest of this family runs. Apple TV takes the same arm64
+ /// The vphoned a guest of this family runs. Apple TV and HomePod take the same arm64
/// daemon marked as a tvOS executable: tvOS dyld refuses to load its
/// system libraries into an iOS-platform process.
public func vphoned(for family: VPhoneGuestDevice.Family) -> URL {
@@ -121,7 +121,7 @@ public struct VPhoneResources: Sendable {
}
public static func vphonedName(for family: VPhoneGuestDevice.Family) -> String {
- family == .appleTV ? "vphoned-tvos" : "vphoned"
+ family.usesTVOS ? "vphoned-tvos" : "vphoned"
}
public var gpuCompilerPlugin: URL {
diff --git a/VPhoneKit/VPhoneCoreKit/VirtualMachine/VPhoneGuestDevice.swift b/VPhoneKit/VPhoneCoreKit/VirtualMachine/VPhoneGuestDevice.swift
index e10c2e05..228eb478 100644
--- a/VPhoneKit/VPhoneCoreKit/VirtualMachine/VPhoneGuestDevice.swift
+++ b/VPhoneKit/VPhoneCoreKit/VirtualMachine/VPhoneGuestDevice.swift
@@ -19,14 +19,22 @@ public struct VPhoneGuestDevice: Sendable, Equatable {
case iPhone
case iPad
case appleTV
+ case homePod
public var osName: String {
switch self {
case .iPhone: "iOS"
case .iPad: "iPadOS"
case .appleTV: "tvOS"
+ case .homePod: "HomePod Software"
}
}
+
+ /// Apple TV and HomePod share the tvOS executable platform and
+ /// filesystem layout. Their user interfaces and device idioms differ.
+ public var usesTVOS: Bool {
+ self == .appleTV || self == .homePod
+ }
}
public let family: Family
@@ -36,7 +44,7 @@ public struct VPhoneGuestDevice: Sendable, Equatable {
public let deviceClass: String
/// The marketing name, for logs and prompts.
public let productName: String
- /// The guest display: a device panel, or a provisional virtual TV canvas.
+ /// The guest display: a device panel, or a provisional virtual canvas.
public let screen: VPhoneVirtualMachineManifest.ScreenConfig
public init(
@@ -57,6 +65,10 @@ public struct VPhoneGuestDevice: Sendable, Equatable {
family == .iPad
}
+ public var usesTVOS: Bool {
+ family.usesTVOS
+ }
+
/// Whether the guest boots a device tree of its own that presents this
/// board, built by `fw patch` from the board's tree in the IPSW. Every
/// device but the iPhone17,3 does; that one keeps the fixed D47 identity
@@ -171,8 +183,20 @@ public struct VPhoneGuestDevice: Sendable, Equatable {
screen: .init(width: 3840, height: 2160, pixelsPerInch: 144, scale: 2.0),
)
+ /// HomePod mini (B520AP). It has no physical display; this small virtual
+ /// canvas satisfies the VM graphics configuration and is not a panel
+ /// specification or a promise of a graphical HomePod interface.
+ public static let audioAccessory5_1 = VPhoneGuestDevice(
+ family: .homePod,
+ productType: "AudioAccessory5,1",
+ deviceClass: "b520ap",
+ productName: "HomePod mini",
+ screen: .init(width: 320, height: 320, pixelsPerInch: 72, scale: 1.0),
+ )
+
/// Whether the guest's userland is plain arm64 rather than arm64e: only
- /// the Apple TV HD's. It has no paravirtual GPU driver to load, and its
+ /// the Apple TV HD's. HomePod mini 27.0 ships arm64e dyld and launchd.
+ /// The Apple TV HD has no paravirtual GPU driver to load, and its
/// dyld needs the TV TPRO patches.
public var hasPlainArm64Userland: Bool {
self == .appleTV5_3
@@ -197,6 +221,7 @@ public struct VPhoneGuestDevice: Sendable, Equatable {
iPad16_3, iPad16_5,
iPad17_1, iPad17_3,
appleTV5_3, appleTV14_1,
+ audioAccessory5_1,
]
/// Cellular models that ship in the same IPSW as a known Wi-Fi model and map
@@ -231,7 +256,7 @@ public struct VPhoneGuestDevice: Sendable, Equatable {
public func restoreTreeName(version: String, build: String) -> String {
switch family {
case .iPhone: "\(productType)_\(version)_\(build)_Restore"
- case .iPad, .appleTV: "iPhoneOS_\(productType)_\(version)_\(build)_Restore"
+ case .iPad, .appleTV, .homePod: "iPhoneOS_\(productType)_\(version)_\(build)_Restore"
}
}
diff --git a/VPhoneKit/VPhoneCoreKitTests/Firmware/FirmwareCatalogReportTests.swift b/VPhoneKit/VPhoneCoreKitTests/Firmware/FirmwareCatalogReportTests.swift
index 530d2340..760e9b19 100644
--- a/VPhoneKit/VPhoneCoreKitTests/Firmware/FirmwareCatalogReportTests.swift
+++ b/VPhoneKit/VPhoneCoreKitTests/Firmware/FirmwareCatalogReportTests.swift
@@ -88,6 +88,28 @@ struct FirmwareCatalogReportTests {
#expect(tv.name == "Apple TV HD")
}
+ @Test func `HomePod mini pairs its native 27 IPSW with cloudOS without an OTA base`() throws {
+ let pairings = VPhoneFirmwareCatalog.pairings(for: "AudioAccessory5,1")
+ #expect(pairings.count == 1)
+ let pairing = try #require(pairings.first)
+ #expect(pairing.device == "AudioAccessory5,1")
+ #expect(pairing.iosName == "HomePod Software 27.0")
+ #expect(pairing.iosURL == "https://updates.cdn-apple.com/2026SFallFCS/a595a3b2-2c42-470a-9417-a705aaafa05c/AudioAccessory5,1_27.0_24J361_Restore.ipsw")
+ #expect(pairing.cloudosName == "cloudOS 26.4")
+ #expect(pairing.cloudosURL == VPhoneFirmwareCatalog.cloud264)
+ #expect(VPhoneGuestDevice.audioAccessory5_1.restoreBase == nil)
+ #expect(VPhoneFirmwareCatalog.otaRelease(source: pairing.iosURL) == nil)
+ #expect(VPhoneFirmwareCatalog.otaRelease(for: "AudioAccessory5,1", build: "24J361") == nil)
+ #expect(VPhoneFirmwareCatalog.pairings(for: "AudioAccessory1,1").isEmpty)
+
+ let device = try #require(VPhoneFirmwareCatalog.report.devices.first { $0.productType == "AudioAccessory5,1" })
+ #expect(device.family == "homePod" && device.name == "HomePod mini")
+ let entry = try #require(device.pairings.first)
+ #expect(entry.ios.name == pairing.iosName && entry.ios.url == pairing.iosURL)
+ #expect(entry.ios.build == nil && entry.ios.files == nil)
+ #expect(entry.recommendedCloudOS.url == VPhoneFirmwareCatalog.cloud264)
+ }
+
@Test func `i pad pairings come from an IPSW that covers the device`() {
for guest in VPhoneGuestDevice.known where guest.isPad {
let pairings = VPhoneFirmwareCatalog.pairings(for: guest.productType)
diff --git a/VPhoneKit/VPhoneCoreKitTests/VirtualMachine/GuestDeviceTests.swift b/VPhoneKit/VPhoneCoreKitTests/VirtualMachine/GuestDeviceTests.swift
index 172e52e0..59525c77 100644
--- a/VPhoneKit/VPhoneCoreKitTests/VirtualMachine/GuestDeviceTests.swift
+++ b/VPhoneKit/VPhoneCoreKitTests/VirtualMachine/GuestDeviceTests.swift
@@ -30,6 +30,39 @@ struct GuestDeviceTests {
== "iPhoneOS_AppleTV5,3_26.4_23L243_Restore")
}
+ @Test
+ func `HomePod mini has its own identity and the tvOS executable platform`() throws {
+ let device = try #require(VPhoneGuestDevice.named("AudioAccessory5,1"))
+ let manifest = ["SupportedProductTypes": ["AudioAccessory5,1"]]
+ #expect(device == .audioAccessory5_1)
+ #expect(device.family == .homePod)
+ #expect(device.productName == "HomePod mini")
+ #expect(device.family.osName == "HomePod Software")
+ #expect(device.usesTVOS && !device.isPad && device.presentsBoard)
+ #expect(!device.hasPlainArm64Userland && device.restoreBase == nil)
+ #expect(device.boardDeviceTreePath == "Firmware/all_flash/DeviceTree.b520ap.im4p")
+ #expect(VPhoneGuestDevice.detect(buildManifest: manifest) == device)
+ #expect(VPhoneGuestDevice.covered(by: manifest) == [device])
+ #expect(VPhoneGuestDevice.detect(buildManifest: ["SupportedProductTypes": ["AudioAccessory1,1"]]) == nil)
+ #expect(device.restoreTreeName(version: "27.0", build: "24J361")
+ == "iPhoneOS_AudioAccessory5,1_27.0_24J361_Restore")
+ #expect(!VPhoneGuestDevice.iPhone17_3.usesTVOS && !VPhoneGuestDevice.iPad16_1.usesTVOS)
+ #expect(VPhoneGuestDevice.appleTV5_3.usesTVOS && VPhoneGuestDevice.appleTV14_1.usesTVOS)
+ }
+
+ @Test
+ func `HomePod mini persists its identity and provisional virtual canvas`() throws {
+ let manifest = VPhoneVirtualMachineManifest.newVM().updating(guestDevice: .audioAccessory5_1)
+ let decoded = try PropertyListDecoder().decode(
+ VPhoneVirtualMachineManifest.self,
+ from: PropertyListEncoder().encode(manifest),
+ )
+ #expect(decoded.guestProductType == "AudioAccessory5,1")
+ #expect(decoded.guestDevice == .audioAccessory5_1)
+ #expect(decoded.screenConfig == .init(width: 320, height: 320, pixelsPerInch: 72, scale: 1.0))
+ #expect(decoded.updating(cpuCount: 4).guestDevice == .audioAccessory5_1)
+ }
+
@Test
func `the Apple TV 4K is an arm64e TV guest at 2x restored over the Apple TV HD`() throws {
let tv4k = try #require(VPhoneGuestDevice.named("AppleTV14,1"))
diff --git a/VPhoneKit/VPhoneCoreKitTests/VirtualMachine/LaunchLayoutTests.swift b/VPhoneKit/VPhoneCoreKitTests/VirtualMachine/LaunchLayoutTests.swift
index f332aa1f..5130087e 100644
--- a/VPhoneKit/VPhoneCoreKitTests/VirtualMachine/LaunchLayoutTests.swift
+++ b/VPhoneKit/VPhoneCoreKitTests/VirtualMachine/LaunchLayoutTests.swift
@@ -187,7 +187,7 @@ struct LaunchLayoutTests {
#expect(try layout.stageVphoned(into: bundle) == false)
}
- @Test func `stage vphoned picks the tvOS daemon for an Apple TV guest`() throws {
+ @Test func `stage vphoned picks the tvOS daemon for Apple TV and HomePod guests`() throws {
let root = FileManager.default.temporaryDirectory.appendingPathComponent(UUID().uuidString)
let guest = root.appendingPathComponent("guest-resources")
try FileManager.default.createDirectory(at: guest, withIntermediateDirectories: true)
@@ -198,13 +198,14 @@ struct LaunchLayoutTests {
#expect(resources.vphoned.lastPathComponent == "vphoned")
#expect(resources.vphoned(for: .iPad).lastPathComponent == "vphoned")
#expect(resources.vphoned(for: .appleTV).lastPathComponent == "vphoned-tvos")
+ #expect(resources.vphoned(for: .homePod).lastPathComponent == "vphoned-tvos")
let base = VPhoneVirtualMachineManifest(
cpuCount: 2,
memorySize: 1024 * 1024,
romImages: .init(avpBooter: "a", avpSEPBooter: "b"),
)
- for (device, expected) in [(VPhoneGuestDevice.appleTV5_3, Data([2])), (.iPhone17_3, Data([1]))] {
+ for (device, expected) in [(VPhoneGuestDevice.appleTV5_3, Data([2])), (.audioAccessory5_1, Data([2])), (.iPhone17_3, Data([1]))] {
let bundleDir = root.appendingPathComponent(device.productType)
try FileManager.default.createDirectory(at: bundleDir, withIntermediateDirectories: true)
let bundle = VPhoneBundle(url: bundleDir, manifest: base.updating(guestDevice: device))
diff --git a/VPhoneLaunchpad/Configuration/Version.xcconfig b/VPhoneLaunchpad/Configuration/Version.xcconfig
index 523423f0..303cd3f7 100644
--- a/VPhoneLaunchpad/Configuration/Version.xcconfig
+++ b/VPhoneLaunchpad/Configuration/Version.xcconfig
@@ -1,4 +1,4 @@
-MARKETING_VERSION = 2.10.1
+MARKETING_VERSION = 2.11.0
// Bump whenever the helper changes. The app blesses the helper again when the
// installed helper's version or bytes differ from the copy it embeds.
-CURRENT_PROJECT_VERSION = 17
+CURRENT_PROJECT_VERSION = 18
diff --git a/VPhoneLaunchpad/Tests/BundleNamesTests.swift b/VPhoneLaunchpad/Tests/BundleNamesTests.swift
index 46b2a730..4a3eaa85 100644
--- a/VPhoneLaunchpad/Tests/BundleNamesTests.swift
+++ b/VPhoneLaunchpad/Tests/BundleNamesTests.swift
@@ -17,13 +17,14 @@ struct BundleNamesTests {
// `-local` (legacy), `-local.<8+ lowercase hex>` or `-ci.<7+ hex>`.
// Anything else is kept whole, so it never parses as a version.
let expectations: [Expectation] = [
- Expectation(name: "2.10.0", bundleVersion: "2.10.0", isLocalBuild: false, isCompatible: true, isValid: true),
- Expectation(name: "2.10.0-local", bundleVersion: "2.10.0", isLocalBuild: true, isCompatible: true, isValid: true),
- Expectation(name: "2.10.0-local.ab12cd34", bundleVersion: "2.10.0", isLocalBuild: true, isCompatible: true, isValid: true),
+ Expectation(name: "2.11.0", bundleVersion: "2.11.0", isLocalBuild: false, isCompatible: true, isValid: true),
+ Expectation(name: "2.11.0-local", bundleVersion: "2.11.0", isLocalBuild: true, isCompatible: true, isValid: true),
+ Expectation(name: "2.11.0-local.ab12cd34", bundleVersion: "2.11.0", isLocalBuild: true, isCompatible: true, isValid: true),
// The build identifier is lowercase hex; uppercase is no build.
- Expectation(name: "2.10.0-local.AB12CD34", bundleVersion: "2.10.0-local.AB12CD34", isLocalBuild: false, isCompatible: false, isValid: true),
- Expectation(name: "2.10.0-local.ab12", bundleVersion: "2.10.0-local.ab12", isLocalBuild: false, isCompatible: false, isValid: true),
- Expectation(name: "2.10.0-ci.abcdef1", bundleVersion: "2.10.0", isLocalBuild: false, isCompatible: true, isValid: true),
+ Expectation(name: "2.11.0-local.AB12CD34", bundleVersion: "2.11.0-local.AB12CD34", isLocalBuild: false, isCompatible: false, isValid: true),
+ Expectation(name: "2.11.0-local.ab12", bundleVersion: "2.11.0-local.ab12", isLocalBuild: false, isCompatible: false, isValid: true),
+ Expectation(name: "2.11.0-ci.abcdef1", bundleVersion: "2.11.0", isLocalBuild: false, isCompatible: true, isValid: true),
+ Expectation(name: "2.10.1", bundleVersion: "2.10.1", isLocalBuild: false, isCompatible: false, isValid: true),
Expectation(name: "2.9.5", bundleVersion: "2.9.5", isLocalBuild: false, isCompatible: false, isValid: true),
Expectation(name: "2.8.9-local.ab12cd34", bundleVersion: "2.8.9", isLocalBuild: true, isCompatible: false, isValid: true),
Expectation(name: "../x", bundleVersion: "../x", isLocalBuild: false, isCompatible: false, isValid: false),
diff --git a/VPhoneLaunchpad/Tests/IPSWCacheTests.swift b/VPhoneLaunchpad/Tests/IPSWCacheTests.swift
index db5f8261..be77522b 100644
--- a/VPhoneLaunchpad/Tests/IPSWCacheTests.swift
+++ b/VPhoneLaunchpad/Tests/IPSWCacheTests.swift
@@ -44,6 +44,13 @@ struct IPSWCacheTests {
expect(tv?.kind == .appleTV && tv?.title == "tvOS 26.4 (23L243)", "TV title")
expect(VPhoneLaunchpadIPSWRows.kindLabel(.appleTV) == "Apple TV", "TV family label")
+ let homePod = VPhoneLaunchpadIPSW(fileName: "AudioAccessory5,1_27.0_24J361_Restore.ipsw")
+ expect(homePod?.productTypes == ["AudioAccessory5,1"], "HomePod mini product type")
+ expect(homePod?.kind == .homePod && homePod?.title == "HomePod Software 27.0 (24J361)", "HomePod title")
+ expect(VPhoneLaunchpadIPSWRows.kindLabel(.homePod) == "HomePod", "HomePod family label")
+ expect(VPhoneLaunchpadIPSW.productType(forSource: "/tmp/AudioAccessory5,1_27.0_24J361_Restore.ipsw") == "AudioAccessory5,1", "custom HomePod source name")
+ expect(VPhoneLaunchpadIPSW.productType(forSource: "https://example.com/AudioAccessory5,1_27.0_24J361_Restore.ipsw") == "AudioAccessory5,1", "remote HomePod source name")
+
let cachedPad = VPhoneLaunchpadIPSW(fileName: "iPad16_1_iPad16_2_26.6.2_23G90_Restore-0123456789ab.ipsw")
expect(cachedPad?.productTypes == ["iPad16,1", "iPad16,2"], "\(String(describing: cachedPad?.productTypes))")
@@ -123,6 +130,18 @@ struct IPSWCacheTests {
let facts = try VPhoneLaunchpadIPSW.read(zip64)
expect(facts.kind == .iPhone && facts.productTypes == ["iPhone17,3"] && facts.build == "23G90", "ZIP64 manifest")
+ // A local source can be renamed; its manifest determines its family.
+ let homePod = root.appendingPathComponent("renamed-homepod.ipsw")
+ try zip64Archive(member: "BuildManifest.plist", contents: manifestData([
+ "ProductVersion": "27.0", "ProductBuildVersion": "24J361",
+ "SupportedProductTypes": ["AudioAccessory5,1"],
+ "BuildIdentities": [["Info": ["DeviceClass": "b520ap"]]],
+ ])).write(to: homePod)
+ let homePodFacts = try VPhoneLaunchpadIPSW.read(homePod)
+ expect(homePodFacts.kind == .homePod, "HomePod manifest kind")
+ expect(VPhoneLaunchpadIPSW.productType(forSource: homePod.path) == "AudioAccessory5,1", "renamed local HomePod source")
+ expect(VPhoneLaunchpadIPSW.productType(forSource: homePod.absoluteString) == "AudioAccessory5,1", "HomePod file URL source")
+
let notZip = root.appendingPathComponent("broken.ipsw")
try Data(repeating: 0, count: 4096).write(to: notZip)
expect((try? VPhoneLaunchpadIPSW.read(notZip)) == nil, "not a zip")
@@ -206,6 +225,10 @@ struct IPSWCacheTests {
expect((["diskImage": "Disk.img"] as NSDictionary).write(to: phone.appendingPathComponent("config.plist"), atomically: true), "config.plist")
expect(VPhoneLaunchpadIPSWCache.guestProductType(in: pad) == "iPad16,1", "config product type")
expect(VPhoneLaunchpadIPSWCache.guestProductType(in: phone) == "iPhone17,3", "FirmwareOriginals product type")
+ let homePod = root.appendingPathComponent("machines/homepod-mini", isDirectory: true)
+ try manager.createDirectory(at: homePod.appendingPathComponent("FirmwareOriginals/AudioAccessory5,1_27.0_24J361_Restore", isDirectory: true), withIntermediateDirectories: true)
+ expect(VPhoneLaunchpadIPSWCache.guestProductType(in: homePod) == "AudioAccessory5,1", "HomePod restore tree product type")
+
let scan = try await VPhoneLaunchpadIPSWCache.scan(libraryRoots: [library], machineFolders: [pad, phone])
expect(scan.ipsws.count == 2 && scan.cacheDirectories.count == 2, "\(scan.ipsws.map(\.name))")
diff --git a/VPhoneLaunchpad/Tests/MachineProductTypeTests.swift b/VPhoneLaunchpad/Tests/MachineProductTypeTests.swift
index d4bdc9a2..21413e74 100644
--- a/VPhoneLaunchpad/Tests/MachineProductTypeTests.swift
+++ b/VPhoneLaunchpad/Tests/MachineProductTypeTests.swift
@@ -33,8 +33,12 @@ struct MachineProductTypeTests {
let tv = root.appendingPathComponent("tv-01", isDirectory: true)
try manager.createDirectory(at: tv.appendingPathComponent("FirmwareOriginals/iPhoneOS_AppleTV5,3_26.6_23L773_Restore"), withIntermediateDirectories: true)
expect(VPhoneLaunchpadMachine.guestProductType(in: tv) == "AppleTV5,3", "Apple TV restore tree")
+ let homePod = root.appendingPathComponent("homepod-mini", isDirectory: true)
+ try manager.createDirectory(at: homePod.appendingPathComponent("FirmwareOriginals/AudioAccessory5,1_27.0_24J361_Restore"), withIntermediateDirectories: true)
+ expect(VPhoneLaunchpadMachine.guestProductType(in: homePod) == "AudioAccessory5,1", "HomePod restore tree")
expect(VPhoneLaunchpadMachine.guestProductType(in: root.appendingPathComponent("missing")) == nil, "nothing to read")
+
// restore-info.json's device is the restore identity's, not the guest's.
let json = #"""
{"name":"ipad-mini-01","cpuCount":8,"memoryMB":8192,"diskSizeBytes":64000000000,
@@ -48,7 +52,14 @@ struct MachineProductTypeTests {
machine.guestProductType = VPhoneLaunchpadMachine.guestProductType(in: tv)
expect(machine.isAppleTV && !machine.isPad && machine.osName == "tvOS", "Apple TV guest")
+ machine.guestProductType = VPhoneLaunchpadMachine.guestProductType(in: homePod)
+ expect(machine.isHomePod && !machine.isAppleTV && !machine.isPad && machine.osName == "HomePod Software", "HomePod guest")
+ let homePodDevice = VPhoneLaunchpadFirmwareCatalog.Device(productType: "AudioAccessory5,1", name: "HomePod mini", family: "homePod", pairings: [])
+ expect(homePodDevice.isHomePod && !homePodDevice.isAppleTV && homePodDevice.requiresStandaloneRestore, "HomePod catalog family")
+ expect(homePodDevice.osName == "HomePod Software", "HomePod catalog OS label")
+
// An OTA pairing's build comes from the bundle; an IPSW's from its name.
+
let catalog = #"""
{"device":"iPhone17,3","pairings":[],"devices":[{"productType":"AppleTV14,1","name":"Apple TV 4K (3rd generation)","family":"appleTV","pairings":[
{"ios":{"name":"tvOS 26.6","url":"https://example.com/AppleTV5,3_26.6_23L773_Restore.ipsw"},"recommendedCloudOS":{"name":"cloudOS 26.4","url":"https://example.com/c"}},
diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/Control/VPhoneLaunchpadControlCommands.swift b/VPhoneLaunchpad/VPhoneLaunchpad/Control/VPhoneLaunchpadControlCommands.swift
index 7df20d1e..a28369e8 100644
--- a/VPhoneLaunchpad/VPhoneLaunchpad/Control/VPhoneLaunchpadControlCommands.swift
+++ b/VPhoneLaunchpad/VPhoneLaunchpad/Control/VPhoneLaunchpadControlCommands.swift
@@ -554,7 +554,9 @@ struct VPhoneLaunchpadControlCommands {
var iphone = request.option("iphone-source")
var cloudOS = request.option("cloudos-source")
- let device = request.option("device")
+ let device = request.option("device") ?? iphone.flatMap { source in
+ VPhoneLaunchpadIPSW.productType(forSource: source)
+ }
if iphone == nil || cloudOS == nil {
let result = try await commandLine.run(["fw", "catalog", "--json"], recordInHistory: false)
guard result.succeeded, let data = result.jsonData else {
@@ -587,20 +589,20 @@ struct VPhoneLaunchpadControlCommands {
}
return value
}
- // An Apple TV is restored on its own with the tvOS preset: templates
+ // Apple TV and HomePod restore on their own: templates
// and slimming drive iOS Setup Assistant and its apps.
- let isAppleTV = device?.hasPrefix("AppleTV") == true
+ let requiresStandaloneRestore = device?.hasPrefix("AppleTV") == true || device?.hasPrefix("AudioAccessory") == true
let (patches, guestPatches) = try await Self.patches(
request,
commandLine: commandLine,
defaultPreset: VPhoneLaunchpadPatchSelection.defaultPreset(forDevice: device),
emit: emit,
)
- let usesTemplate = !request.flag("no-template") && !isAppleTV
+ let usesTemplate = !request.flag("no-template") && !requiresStandaloneRestore
let slimming: VPhoneLaunchpadSlimming
- if isAppleTV {
+ if requiresStandaloneRestore {
if !Self.slimmingSwitches(request).isEmpty {
- throw VPhoneLaunchpadError("An Apple TV is created without a template; the slimming switches do not apply.")
+ throw VPhoneLaunchpadError("Apple TV and HomePod are created without a template; the slimming switches do not apply.")
}
var off = VPhoneLaunchpadSlimming()
off.slim = false
diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/IPSWCache/VPhoneLaunchpadIPSW.swift b/VPhoneLaunchpad/VPhoneLaunchpad/IPSWCache/VPhoneLaunchpadIPSW.swift
index e0269c6f..811d09fe 100644
--- a/VPhoneLaunchpad/VPhoneLaunchpad/IPSWCache/VPhoneLaunchpadIPSW.swift
+++ b/VPhoneLaunchpad/VPhoneLaunchpad/IPSWCache/VPhoneLaunchpadIPSW.swift
@@ -9,7 +9,7 @@ import Foundation
/// manifest cannot be read.
nonisolated struct VPhoneLaunchpadIPSW: Hashable, Sendable {
enum Kind: Hashable, Sendable {
- case iPhone, iPad, appleTV, cloudOS, unknown
+ case iPhone, iPad, appleTV, homePod, cloudOS, unknown
/// The system the IPSW installs: the first word of its title.
var systemName: String? {
@@ -17,6 +17,7 @@ nonisolated struct VPhoneLaunchpadIPSW: Hashable, Sendable {
case .iPhone: "iOS"
case .iPad: "iPadOS"
case .appleTV: "tvOS"
+ case .homePod: "HomePod Software"
case .cloudOS: "cloudOS"
case .unknown: nil
}
@@ -50,6 +51,9 @@ nonisolated struct VPhoneLaunchpadIPSW: Hashable, Sendable {
if productTypes.contains(where: { $0.hasPrefix("AppleTV") }) {
return .appleTV
}
+ if productTypes.contains(where: { $0.hasPrefix("AudioAccessory") }) {
+ return .homePod
+ }
return .unknown
}
@@ -101,8 +105,21 @@ nonisolated struct VPhoneLaunchpadIPSW: Hashable, Sendable {
return facts
}
+ /// A custom local source is inspected by manifest first; a remote source
+ /// can only be identified by its name until the CLI downloads it.
+ static func productType(forSource source: String) -> String? {
+ let source = source.trimmingCharacters(in: .whitespacesAndNewlines)
+ let url = source.hasPrefix("/") ? URL(fileURLWithPath: source) : URL(string: source)
+ guard let url else { return nil }
+ if url.isFileURL, let facts = try? read(url), let type = facts.productTypes.first {
+ return type
+ }
+ return VPhoneLaunchpadIPSW(fileName: url.lastPathComponent)?.productTypes.first
+ }
+
// MARK: File name
+
/// The facts an IPSW's name carries: `iPhone17,3_27.0_24A435_Restore.ipsw`,
/// `iPad16,1,iPad16,2_26.6.2_23G90_Restore.ipsw`, and the cache's spelling
/// of either, `iPhone17_3_27.0_24A435_Restore-3c6d6dc0803d.ipsw`.
diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/IPSWCache/VPhoneLaunchpadIPSWCache.swift b/VPhoneLaunchpad/VPhoneLaunchpad/IPSWCache/VPhoneLaunchpadIPSWCache.swift
index 84b7acb7..8946896e 100644
--- a/VPhoneLaunchpad/VPhoneLaunchpad/IPSWCache/VPhoneLaunchpadIPSWCache.swift
+++ b/VPhoneLaunchpad/VPhoneLaunchpad/IPSWCache/VPhoneLaunchpadIPSWCache.swift
@@ -151,7 +151,7 @@ nonisolated enum VPhoneLaunchpadIPSWCache {
let names = (try? FileManager.default.contentsOfDirectory(atPath: originals.path)) ?? []
// `fw prepare`'s restore tree: `iPhone17,3_…_Restore`, or for an iPad
// `iPhoneOS_iPad16,1_…_Restore`.
- for name in names.sorted() where name.hasPrefix("iPhone") && name.hasSuffix("_Restore") {
+ for name in names.sorted() where name.hasSuffix("_Restore") {
if let type = VPhoneLaunchpadIPSW(fileName: name)?.productTypes.first {
return type
}
diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/IPSWCache/VPhoneLaunchpadIPSWRows.swift b/VPhoneLaunchpad/VPhoneLaunchpad/IPSWCache/VPhoneLaunchpadIPSWRows.swift
index e371d907..bc1de45a 100644
--- a/VPhoneLaunchpad/VPhoneLaunchpad/IPSWCache/VPhoneLaunchpadIPSWRows.swift
+++ b/VPhoneLaunchpad/VPhoneLaunchpad/IPSWCache/VPhoneLaunchpadIPSWRows.swift
@@ -137,8 +137,9 @@ nonisolated enum VPhoneLaunchpadIPSWRows {
case .iPhone: 0
case .iPad: 1
case .appleTV: 2
- case .cloudOS: 3
- case .unknown: 4
+ case .homePod: 3
+ case .cloudOS: 4
+ case .unknown: 5
}
}
@@ -159,6 +160,7 @@ nonisolated enum VPhoneLaunchpadIPSWRows {
case .iPhone: String(localized: "iPhone")
case .iPad: String(localized: "iPad")
case .appleTV: String(localized: "Apple TV")
+ case .homePod: String(localized: "HomePod")
case .cloudOS: String(localized: "cloudOS")
case .unknown: String(localized: "Unknown")
}
diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/Localizable.xcstrings b/VPhoneLaunchpad/VPhoneLaunchpad/Localizable.xcstrings
index 7f202c09..5f1d0fd3 100644
--- a/VPhoneLaunchpad/VPhoneLaunchpad/Localizable.xcstrings
+++ b/VPhoneLaunchpad/VPhoneLaunchpad/Localizable.xcstrings
@@ -1,6 +1,69 @@
{
"sourceLanguage" : "en",
"strings" : {
+ "Apple TV" : {
+ "localizations" : {
+ "en" : {"stringUnit" : {"state" : "translated", "value" : "Apple TV"}},
+ "ja" : {"stringUnit" : {"state" : "translated", "value" : "Apple TV"}},
+ "ko" : {"stringUnit" : {"state" : "translated", "value" : "Apple TV"}},
+ "vi" : {"stringUnit" : {"state" : "translated", "value" : "Apple TV"}},
+ "zh-Hans" : {"stringUnit" : {"state" : "translated", "value" : "Apple TV"}}
+ }
+ },
+ "HomePod" : {
+ "localizations" : {
+ "en" : {"stringUnit" : {"state" : "translated", "value" : "HomePod"}},
+ "ja" : {"stringUnit" : {"state" : "translated", "value" : "HomePod"}},
+ "ko" : {"stringUnit" : {"state" : "translated", "value" : "HomePod"}},
+ "vi" : {"stringUnit" : {"state" : "translated", "value" : "HomePod"}},
+ "zh-Hans" : {"stringUnit" : {"state" : "translated", "value" : "HomePod"}}
+ }
+ },
+ "HomePod Software" : {
+ "localizations" : {
+ "en" : {"stringUnit" : {"state" : "translated", "value" : "HomePod Software"}},
+ "ja" : {"stringUnit" : {"state" : "translated", "value" : "HomePod ソフトウェア"}},
+ "ko" : {"stringUnit" : {"state" : "translated", "value" : "HomePod 소프트웨어"}},
+ "vi" : {"stringUnit" : {"state" : "translated", "value" : "Phần mềm HomePod"}},
+ "zh-Hans" : {"stringUnit" : {"state" : "translated", "value" : "HomePod 软件"}}
+ }
+ },
+ "Guest IPSW" : {
+ "localizations" : {
+ "en" : {"stringUnit" : {"state" : "translated", "value" : "Guest IPSW"}},
+ "ja" : {"stringUnit" : {"state" : "translated", "value" : "ゲスト IPSW"}},
+ "ko" : {"stringUnit" : {"state" : "translated", "value" : "게스트 IPSW"}},
+ "vi" : {"stringUnit" : {"state" : "translated", "value" : "IPSW máy khách"}},
+ "zh-Hans" : {"stringUnit" : {"state" : "translated", "value" : "客户机 IPSW"}}
+ }
+ },
+ "Choose a guest IPSW and a cloudOS IPSW in Advanced Options." : {
+ "localizations" : {
+ "en" : {"stringUnit" : {"state" : "translated", "value" : "Choose a guest IPSW and a cloudOS IPSW in Advanced Options."}},
+ "ja" : {"stringUnit" : {"state" : "translated", "value" : "詳細オプションでゲスト IPSW と cloudOS IPSW を選択してください。"}},
+ "ko" : {"stringUnit" : {"state" : "translated", "value" : "고급 옵션에서 게스트 IPSW와 cloudOS IPSW를 선택하세요."}},
+ "vi" : {"stringUnit" : {"state" : "translated", "value" : "Chọn IPSW máy khách và IPSW cloudOS trong Tùy chọn nâng cao."}},
+ "zh-Hans" : {"stringUnit" : {"state" : "translated", "value" : "在高级选项中选择客户机 IPSW 和 cloudOS IPSW。"}}
+ }
+ },
+ "Apple TV and HomePod are restored on their own, with keys of their own. Templates are made for iPhone and iPad." : {
+ "localizations" : {
+ "en" : {"stringUnit" : {"state" : "translated", "value" : "Apple TV and HomePod are restored on their own, with keys of their own. Templates are made for iPhone and iPad."}},
+ "ja" : {"stringUnit" : {"state" : "translated", "value" : "Apple TV と HomePod は独自のキーで個別に復元されます。テンプレートは iPhone と iPad 用です。"}},
+ "ko" : {"stringUnit" : {"state" : "translated", "value" : "Apple TV와 HomePod는 자체 키로 개별 복원됩니다. 템플릿은 iPhone과 iPad용입니다."}},
+ "vi" : {"stringUnit" : {"state" : "translated", "value" : "Apple TV và HomePod được khôi phục riêng, với khóa của riêng chúng. Mẫu dành cho iPhone và iPad."}},
+ "zh-Hans" : {"stringUnit" : {"state" : "translated", "value" : "Apple TV 和 HomePod 单独恢复,使用各自的密钥。模板只用于 iPhone 和 iPad。"}}
+ }
+ },
+ "Apple TV and HomePod keep every file, service and app." : {
+ "localizations" : {
+ "en" : {"stringUnit" : {"state" : "translated", "value" : "Apple TV and HomePod keep every file, service and app."}},
+ "ja" : {"stringUnit" : {"state" : "translated", "value" : "Apple TV と HomePod はすべてのファイル、サービス、App を保持します。"}},
+ "ko" : {"stringUnit" : {"state" : "translated", "value" : "Apple TV와 HomePod는 모든 파일, 서비스, 앱을 유지합니다."}},
+ "vi" : {"stringUnit" : {"state" : "translated", "value" : "Apple TV và HomePod giữ lại mọi tệp, dịch vụ và ứng dụng."}},
+ "zh-Hans" : {"stringUnit" : {"state" : "translated", "value" : "Apple TV 和 HomePod 会保留所有文件、服务和 App。"}}
+ }
+ },
"An Apple TV is restored on its own, with keys of its own. Templates are made for iPhone and iPad." : {
"localizations" : {
"en" : { "stringUnit" : { "state" : "translated", "value" : "An Apple TV is restored on its own, with keys of its own. Templates are made for iPhone and iPad." } },
diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachine.swift b/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachine.swift
index 334aa991..10e9fbe0 100644
--- a/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachine.swift
+++ b/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachine.swift
@@ -150,9 +150,13 @@ nonisolated struct VPhoneLaunchpadMachine: Decodable, Hashable, Identifiable, Se
guestProductType?.hasPrefix("AppleTV") == true
}
- /// The guest OS's name: iPadOS on an iPad, tvOS on an Apple TV.
+ var isHomePod: Bool {
+ guestProductType?.hasPrefix("AudioAccessory") == true
+ }
+
+ /// The guest OS's name.
var osName: String {
- isAppleTV ? "tvOS" : isPad ? "iPadOS" : "iOS"
+ isHomePod ? "HomePod Software" : isAppleTV ? "tvOS" : isPad ? "iPadOS" : "iOS"
}
/// config.plist's `guestProductType`, else the product type in the name
@@ -168,7 +172,7 @@ nonisolated struct VPhoneLaunchpadMachine: Decodable, Hashable, Identifiable, Se
let originals = folder.appendingPathComponent("FirmwareOriginals", isDirectory: true)
let names = (try? FileManager.default.contentsOfDirectory(atPath: originals.path)) ?? []
for name in names.sorted() where name.hasSuffix("_Restore") {
- if let type = name.split(separator: "_").first(where: { $0.wholeMatch(of: /(iPhone|iPad|AppleTV)\d+,\d+/) != nil }) {
+ if let type = name.split(separator: "_").first(where: { $0.wholeMatch(of: /(iPhone|iPad|AppleTV|AudioAccessory)\d+,\d+/) != nil }) {
return String(type)
}
}
@@ -258,7 +262,7 @@ nonisolated struct VPhoneLaunchpadFirmwareCatalog: Decodable, Sendable {
/// The product type `fw prepare --device` takes.
let productType: String
let name: String
- /// `iPhone`, `iPad` or `appleTV`.
+ /// `iPhone`, `iPad`, `appleTV` or `homePod`.
let family: String
let pairings: [Pairing]
@@ -274,9 +278,18 @@ nonisolated struct VPhoneLaunchpadFirmwareCatalog: Decodable, Sendable {
family == "appleTV"
}
+ var isHomePod: Bool {
+ family == "homePod"
+ }
+
+ /// HomePod and Apple TV do not use iOS templates or slimming.
+ var requiresStandaloneRestore: Bool {
+ isAppleTV || isHomePod
+ }
+
/// The system its IPSWs install.
var osName: String {
- isAppleTV ? "tvOS" : isPad ? "iPadOS" : "iOS"
+ isHomePod ? "HomePod Software" : isAppleTV ? "tvOS" : isPad ? "iPadOS" : "iOS"
}
/// The name with its product type, `iPhone 16 (iPhone17,3)`: Launchpad
diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadNewMachineView.swift b/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadNewMachineView.swift
index 536fb50e..95a4aac8 100644
--- a/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadNewMachineView.swift
+++ b/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadNewMachineView.swift
@@ -33,6 +33,8 @@ struct VPhoneLaunchpadNewMachineView: View {
@State private var pairing: String?
@State private var usesCustomSources = false
@State private var iphoneSource = ""
+ @State private var customGuestProductType: String?
+ @State private var inspectedCustomSource: String?
@State private var cloudOSSource = ""
@State private var cpu = Self.defaultCPU
@State private var memoryMB = Self.defaultMemoryMB
@@ -168,6 +170,7 @@ struct VPhoneLaunchpadNewMachineView: View {
private var canCreate: Bool {
nameProblem == nil && advancedProblem == nil && sources != nil && bundleVersion != nil
+ && (!usesCustomSources || inspectedCustomSource == iphoneSource)
}
var body: some View {
@@ -194,11 +197,25 @@ struct VPhoneLaunchpadNewMachineView: View {
.task(id: bundleVersion) { await loadCatalog() }
.task(id: bundleVersion) { await loadPatchCatalog() }
.task { await loadDownloaded() }
+ .task(id: usesCustomSources ? iphoneSource : "") {
+ let source = iphoneSource
+ let type = await Task.detached {
+ VPhoneLaunchpadIPSW.productType(forSource: source)
+ }.value
+ guard !Task.isCancelled, usesCustomSources, source == iphoneSource else { return }
+ let previous = customGuestProductType
+ customGuestProductType = type
+ applyGuestDefaults(previousProductType: previous)
+ inspectedCustomSource = source
+ }
+ .onChange(of: usesCustomSources) { previous, _ in
+ applyGuestDefaults(previousProductType: previous ? customGuestProductType : selectedGuest?.productType)
+ }
.task { await model.machines.refreshTemplates() }
// Off when there is no template to clone; it can still be turned on
// to build one.
.onChange(of: templateAvailable, initial: true) {
- if let templateAvailable, !isAppleTVGuest {
+ if let templateAvailable, !requiresStandaloneRestore {
usesTemplate = templateAvailable
}
}
@@ -240,9 +257,9 @@ struct VPhoneLaunchpadNewMachineView: View {
hardwarePage
advancedSections(.hardware)
case .template:
- VPhoneLaunchpadSlimmingSections(part: .template, usesTemplate: $usesTemplate, templateAvailable: templateAvailable, slimming: $slimming, forAppleTV: isAppleTVGuest)
+ VPhoneLaunchpadSlimmingSections(part: .template, usesTemplate: $usesTemplate, templateAvailable: templateAvailable, slimming: $slimming, requiresStandaloneRestore: requiresStandaloneRestore)
case .slimming:
- VPhoneLaunchpadSlimmingSections(part: .slimming, usesTemplate: $usesTemplate, templateAvailable: templateAvailable, slimming: $slimming, forAppleTV: isAppleTVGuest)
+ VPhoneLaunchpadSlimmingSections(part: .slimming, usesTemplate: $usesTemplate, templateAvailable: templateAvailable, slimming: $slimming, requiresStandaloneRestore: requiresStandaloneRestore)
case .firmware:
bundleSection
firmwareSourceSection
@@ -378,7 +395,7 @@ struct VPhoneLaunchpadNewMachineView: View {
.lineLimit(1)
.truncationMode(.middle)
} else {
- Text("Choose an iPhone IPSW and a cloudOS IPSW in Advanced Options.").foregroundStyle(.red)
+ Text("Choose a guest IPSW and a cloudOS IPSW in Advanced Options.").foregroundStyle(.red)
}
} else if let selectedGuest, let cloudOS = selectedPairing?.recommendedCloudOS.name {
Text("Recommended firmware pairings for \(selectedGuest.detailedName), with \(cloudOS).")
@@ -551,7 +568,7 @@ struct VPhoneLaunchpadNewMachineView: View {
Toggle("Use Specified Firmware", isOn: $usesCustomSources)
if usesCustomSources {
- sourceField("iPhone IPSW", $iphoneSource)
+ sourceField("Guest IPSW", $iphoneSource)
sourceField("cloudOS IPSW", $cloudOSSource)
} else {
LabeledContent("cloudOS", value: selectedPairing?.recommendedCloudOS.name ?? "—")
@@ -691,31 +708,38 @@ struct VPhoneLaunchpadNewMachineView: View {
/// Select a guest device and its newest release.
private func choose(_ productType: String?) {
- let wasAppleTV = isAppleTVGuest
- let wasGuest = guest
+ let previous = guestProductType
guest = productType
pairing = selectedGuest?.defaultPairing?.id
- // Each Apple TV starts from a preset of its own.
- guard isAppleTVGuest != wasAppleTV || isAppleTVGuest && wasGuest != productType else { return }
- // An Apple TV guest is restored on its own with a tvOS preset:
- // templates and slimming drive iOS Setup Assistant and its apps.
+ applyGuestDefaults(previousProductType: previous)
+ }
+
+ /// Custom IPSWs carry the guest identity in their manifest or file name.
+ private var guestProductType: String? {
+ usesCustomSources ? customGuestProductType : selectedGuest?.productType
+ }
+
+ /// Apple TV and HomePod are restored without iOS templates or slimming.
+ private var requiresStandaloneRestore: Bool {
+ guestProductType?.hasPrefix("AppleTV") == true || guestProductType?.hasPrefix("AudioAccessory") == true
+ }
+
+ private func applyGuestDefaults(previousProductType: String?) {
+ let wasStandalone = previousProductType?.hasPrefix("AppleTV") == true || previousProductType?.hasPrefix("AudioAccessory") == true
+ // Preserve custom iPhone/iPad patch and template settings when
+ // switching between guests that share the iOS creation workflow.
+ guard wasStandalone != requiresStandaloneRestore
+ || requiresStandaloneRestore && previousProductType != guestProductType else { return }
patches = VPhoneLaunchpadPatchSelection()
- if isAppleTVGuest {
- patches.preset = VPhoneLaunchpadPatchSelection.defaultPreset(forDevice: productType)
- usesTemplate = false
+ patches.preset = VPhoneLaunchpadPatchSelection.defaultPreset(forDevice: guestProductType)
+ usesTemplate = requiresStandaloneRestore ? false : templateAvailable ?? true
+ slimming = VPhoneLaunchpadSlimming()
+ if requiresStandaloneRestore {
slimming.slim = false
- } else {
- usesTemplate = templateAvailable ?? true
- slimming = VPhoneLaunchpadSlimming()
}
Task { await loadPatchCatalog() }
}
- /// An Apple TV from the catalog, which is built without a template.
- private var isAppleTVGuest: Bool {
- !usesCustomSources && selectedGuest?.isAppleTV == true
- }
-
/// Read again whenever the preset or the version changes: `inPreset`, which
/// the note and the editor read the checkmarks against, is reported per
/// preset, and each version declares its own patches.
@@ -761,9 +785,9 @@ struct VPhoneLaunchpadNewMachineView: View {
bundleVersion: bundleVersion,
iphoneSource: iphone,
cloudOSSource: cloudOS,
- // An iPad IPSW often covers two sizes; name the one chosen. An
- // Apple TV is named too, so the restore tree and log say which.
- device: usesCustomSources ? nil : selectedGuest.flatMap { $0.isPad || $0.isAppleTV ? $0.productType : nil },
+ // An iPad IPSW often covers two sizes; name the one chosen.
+ // Apple TV and HomePod are named too, so the restore tree identifies them.
+ device: guestProductType,
cpuCount: cpu,
memoryMB: memoryMB,
diskSizeGB: diskSizeGB,
diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadPatchCatalog.swift b/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadPatchCatalog.swift
index 0f8e270f..bd7bfc5b 100644
--- a/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadPatchCatalog.swift
+++ b/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadPatchCatalog.swift
@@ -284,9 +284,13 @@ nonisolated struct VPhoneLaunchpadPatchSelection: Hashable, Sendable {
/// the OTA, with the paravirtual GPU driver.
static let tvOS4KPreset = "tvos-4k"
+ /// The HomePod mini's arm64e userland has a preset of its own.
+ static let homePodMiniPreset = "homepod-mini"
+
/// The preset a new machine of `productType` starts from.
static func defaultPreset(forDevice productType: String?) -> String {
switch productType {
+ case "AudioAccessory5,1": homePodMiniPreset
case "AppleTV14,1": tvOS4KPreset
case let type? where type.hasPrefix("AppleTV"): tvOSPreset
default: defaultPreset
diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadSlimmingView.swift b/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadSlimmingView.swift
index 94eda07c..e9fc61f1 100644
--- a/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadSlimmingView.swift
+++ b/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadSlimmingView.swift
@@ -15,9 +15,9 @@ struct VPhoneLaunchpadSlimmingSections: View {
/// IPSWs, which the list cannot be matched against.
var templateAvailable: Bool?
@Binding var slimming: VPhoneLaunchpadSlimming
- /// An Apple TV is restored on its own and not slimmed: templates and
+ /// Apple TV and HomePod are restored on their own and not slimmed: templates and
/// slimming drive iOS Setup Assistant and its apps.
- var forAppleTV = false
+ var requiresStandaloneRestore = false
@State private var choosesApps = false
var body: some View {
@@ -27,10 +27,10 @@ struct VPhoneLaunchpadSlimmingSections: View {
case .slimming:
Section {
Toggle("Slim System", isOn: $slimming.slim)
- .disabled(forAppleTV)
+ .disabled(requiresStandaloneRestore)
} footer: {
- if forAppleTV {
- Text("An Apple TV keeps every file, service and app.")
+ if requiresStandaloneRestore {
+ Text("Apple TV and HomePod keep every file, service and app.")
.foregroundStyle(.secondary)
} else if !usesTemplate, slimming.slim {
Text("Without a template the machine is slimmed on its own, with a setup boot of its own. Setup Assistant is skipped.")
@@ -45,13 +45,13 @@ struct VPhoneLaunchpadSlimmingSections: View {
private var templateSection: some View {
Section {
Toggle("Use Template", isOn: $usesTemplate)
- .disabled(forAppleTV)
+ .disabled(requiresStandaloneRestore)
} header: {
Text("Template")
} footer: {
VStack(alignment: .leading, spacing: 4) {
- if forAppleTV {
- Text("An Apple TV is restored on its own, with keys of its own. Templates are made for iPhone and iPad.")
+ if requiresStandaloneRestore {
+ Text("Apple TV and HomePod are restored on their own, with keys of their own. Templates are made for iPhone and iPad.")
} else {
if templateAvailable == false {
Text("No template is available for this firmware. Turning this on saves a sample of the machine in the template library.")
@@ -92,7 +92,7 @@ struct VPhoneLaunchpadSlimmingSections: View {
}
}
}
- .disabled(!slimming.slim)
+ .disabled(requiresStandaloneRestore || !slimming.slim)
}
private var trimNote: String {
@@ -139,7 +139,7 @@ struct VPhoneLaunchpadSlimmingSections: View {
}
.foregroundStyle(.secondary)
}
- .disabled(!slimming.slim)
+ .disabled(requiresStandaloneRestore || !slimming.slim)
}
private var appsPopover: some View {
diff --git a/VPhoneLaunchpad/VPhoneLaunchpadShared/VPhoneLaunchpadBundleStore.swift b/VPhoneLaunchpad/VPhoneLaunchpadShared/VPhoneLaunchpadBundleStore.swift
index d04dcfde..6c024a11 100644
--- a/VPhoneLaunchpad/VPhoneLaunchpadShared/VPhoneLaunchpadBundleStore.swift
+++ b/VPhoneLaunchpad/VPhoneLaunchpadShared/VPhoneLaunchpadBundleStore.swift
@@ -71,7 +71,7 @@ nonisolated struct VPhoneLaunchpadBundleReceipt: Codable, Equatable, Sendable {
/// must not trust the app.
nonisolated enum VPhoneLaunchpadNames {
/// Minimum bundle version for Launchpad's CLI and receipt contract.
- private static let minimumBundleComponents = (2, 10, 0)
+ private static let minimumBundleComponents = (2, 11, 0)
static let minimumBundleVersion =
"\(minimumBundleComponents.0).\(minimumBundleComponents.1).\(minimumBundleComponents.2)"