Skip to content

Run a virtual iPhone on an Apple Silicon Mac.

Swift

Xcode persona and signature gate patches

Guilherme Rambo8ee4b2726817
diff --git a/Research/0_binary_patch_comparison.md b/Research/0_binary_patch_comparison.md
index ab6b09ba..c9084c21 100644
--- a/Research/0_binary_patch_comparison.md
+++ b/Research/0_binary_patch_comparison.md
@@ -1,5 +1,23 @@
# Patch Comparison: Regular / Development / Jailbreak / Experimental
+> **HomePod local app installation (2026-10-23).**
+> `system-installd-exp-homepod_adhoc` is selected only by `homepod-mini` on
+> HomePod 27. It loads a dedicated TVOS arm64e build of the existing MIS
+> signature-option and MobileInstallation ad-hoc adapters into installd via
+> `/hm`. Native MIS still validates the signature and produces its metadata;
+> the verifier's `allowAdhocSigning` switch accepts the missing certificate.
+> No embedded-profile bypass, device identity, profile scope or spawn hooks
+> are compiled into this library. Opt-out restores installd's original backup
+> before removing the alias and library. HomePod lacks misagent, so the test
+> app uses the research tvOS SDK and a local signature with no profile.
+> See `Research/Guest/xcode_install_signature_gate.md` for validation.
+> TempPod passes real Xcode installation, headless execution, source breakpoint,
+> stepping, variable inspection and Objective-C expression evaluation. Live
+> opt-out restores installd and launchd byte-identically to their original
+> backups and removes the owned aliases/marker/libraries; the default preset
+> has been restored. Full bundle admission, 77 selected Swift tests and the
+> persona ABI/policy harness pass.
+
> **HomePod Xcode installation persona (2026-10-23).**
> The existing `system-installcoordination_proxy-cfw-persona_lookup` now has a
> HomePod 27 deployment, selected by `homepod-mini`. TempPod reproduced the
@@ -10,7 +28,7 @@
> Other sandbox calls retain their arguments and native result. No spawn,
> jetsam or iPhone environment hooks are included. Opt-out restores launchd
> from its original backup before removing the marker, alias and library.
-> Live Xcode install/launch validation is in progress; see
+> Xcode installation, process launch and LLDB stack inspection pass; see
> `Research/Guest/ios27_xcode_persona_lookup.md`.
> **HomePod cryptex DDI staging (2026-10-23).**
@@ -38,7 +56,10 @@
> patched. Reveal/validation procedure is in the same research document.
> TempPod now reports `connected` with a compatible, usable 27B48 tvOS cryptex
> DDI. Device/process/app/file queries and Xcode Device Hub DDI readiness pass.
-> Display preview remains pending; debugger and app launch are not yet verified.
+> HomePod has no display, so Device Hub live preview is unsupported as expected;
+> Xcode app installation, launch and LLDB stack inspection now pass. The
+> initial UIKit template asserts when it requests a display-backed window
+> scene; application UI support is separate from DDI readiness.
> Live opt-out restores cryptexd and the whole personalized DeviceTree to their
> pre-patch bytes, removing the injected library. Full bundle admission, 76
> selected Swift tests, and the scoped native adapter harness pass.
diff --git a/Research/Guest/developer_disk_images.md b/Research/Guest/developer_disk_images.md
index 2f4942b0..c362f92f 100644
--- a/Research/Guest/developer_disk_images.md
+++ b/Research/Guest/developer_disk_images.md
@@ -8,11 +8,16 @@ CoreDevice reports `connected`, `isCryptexDDI: true`, `contentIsCompatible:
true`, and `isUsable: true`. Process, app, device-detail and crash-log file
queries succeed. Xcode 27.2's Device Hub lists it under Available and shows
DDI Services Enabled, File System Live, and Tunnel State Connected. Its Apps
-inspector completes. Display preview still stays at “Connecting display…”;
-DeviceKit error 4002 reports DDI services available but FramebufferProviderStates
-`none`, timing out after 60 seconds. This is a separate live-view failure.
-Debugger attachment, app installation/launch and every Xcode feature have not
-been validated. DDI readiness does not establish those features.
+inspector completes. HomePod has no display, so live preview is unsupported as
+expected. DeviceKit's FramebufferProviderStates `none` and preview timeout do
+not indicate a DDI failure.
+Xcode app installation, launch and LLDB attachment/stack inspection now pass
+with the separate persona, signature and research SDK setup described in
+`ios27_xcode_persona_lookup.md` and `xcode_install_signature_gate.md`. The UIKit
+template's display-backed window scene asserts on HomePod; that limitation is
+independent of DDI communication. The headless Foundation test app now runs
+under Xcode: source breakpoint, stepping, variable inspection and Objective-C
+expression evaluation pass. Other Xcode features remain unverified.
`system-cryptexd-exp-homepod_staging` injects a small TVOS arm64e library
directly into HomePod 27's cryptexd, preserving entitlements and its original
diff --git a/Research/Guest/ios27_xcode_persona_lookup.md b/Research/Guest/ios27_xcode_persona_lookup.md
index 0a8a7b18..9ab56399 100644
--- a/Research/Guest/ios27_xcode_persona_lookup.md
+++ b/Research/Guest/ios27_xcode_persona_lookup.md
@@ -24,9 +24,18 @@ and marker rejection cases. No iPhone spawn/display/jetsam hooks are loaded.
The marker, alias and library are removed after restoring launchd on opt-out;
an unrelated `/vp` is refused instead of replaced or removed.
-Live installation/launch validation is in progress. Evidence captures:
+Xcode subsequently completed installation and launched HomePodApp under LLDB
+(PID 230). The initial template then asserted while creating a UIWindowScene
+without a display configuration; this is separate from UserManager and DDI
+communication. `process status` and a symbolicated backtrace worked through
+Xcode's debugger. Further signature and SDK setup is recorded in
+`xcode_install_signature_gate.md`. Evidence captures:
`/tmp/temppod-persona-proxy-log.json` and `/tmp/temppod-persona-kernel-log.json`.
+Live opt-out on TempPod restored `/sbin/launchd` byte-identically to its original
+backup (SHA-256 `6081657a8dbddfec0aca6e12990ca04dc6bdc5370b431b9c3b608c032012fbfa`),
+and removed `/vp`, the scoped marker and its library. The guest booted normally.
+
## Original iPhone investigation
Environment: pcc-research-01; iOS 27.0.1 (24A446), cloudOS 26.4 (23E5207q);
diff --git a/Research/Guest/xcode_install_signature_gate.md b/Research/Guest/xcode_install_signature_gate.md
index 59da3330..21db4c18 100644
--- a/Research/Guest/xcode_install_signature_gate.md
+++ b/Research/Guest/xcode_install_signature_gate.md
@@ -1,5 +1,84 @@
# The two gates between Xcode and a vphone guest
+## HomePod 27 port (2026-10-23)
+
+TempPod 27.2/24K120 (AudioAccessory5,1) reached three independent installation
+gates through Xcode 27.2 Run, after the DDI and UserManager lookup repairs:
+
+1. The public tvOS SDK drops device family 5 while generating `UIDeviceFamily`,
+ even with `TARGETED_DEVICE_FAMILY = 3,5`. Its `SupportedTargets.appletvos`
+ `DeviceFamilies` array defines only Apple TV (3).
+2. With the family repaired, a developer-signed app reaches an absent
+ `com.apple.misagent` service and fails installing its embedded profile.
+ HomePod ships neither the daemon nor its launch plist. The app instead uses
+ ad-hoc signing through the user's `researchsdk` mechanism.
+3. MIS accepts the local signature with the existing signature options, but
+ MobileInstallation then fails to extract a certificate signer identity
+ (`MIInstallerErrorDomain` 13, `LibMISErrorNumber` -402620415, verifier line
+ 422). Its existing `allowAdhocSigning` property is needed too.
+
+`system-installd-exp-homepod_adhoc` ports these two signature adapters to a
+dedicated TVOS arm64e library loaded only into HomePod's installd. The
+`VPHONE_MIS_SIGNATURE_ONLY` build excludes the embedded-profile bypass; no
+identity, profile scope or general environment hooks are linked. Both native
+validation stages still produce their real signature metadata. The patch is
+27-only, enabled by `homepod-mini`, and blocked by the iPhone and TV presets.
+Opt-out restores installd from `.bak` before removing `/hm` and the library.
+
+The researchsdk generator at `/Users/insidegui/Developer/_projects/researchsdk`
+now adds HomePod's numeric family to **both** SDKSettings formats in the cloned
+tvOS SDK. It also selects Apple TV resource compilation because Interface
+Builder rejects a `homepod` storyboard target. HomePodApp uses the full research
+SDK path, `TARGETED_DEVICE_FAMILY = 3,5`, manual local signing and normal Xcode
+CodeSign. Its temporary metadata/signing build phase was removed. Xcode
+generates `[3,5]` itself, and `codesign --verify --strict` passes with no embedded
+profile. The app also needs the standard `application-identifier` entitlement
+(`$(PRODUCT_BUNDLE_IDENTIFIER)` for this local research signature), in addition
+to `get-task-allow` for LLDB. Without it, installd correctly returns error 63.
+
+On TempPod with bundle `2.12.0-local.92401773`, Xcode Run installed the app and
+launched PID 230 under LLDB. `process status` and `bt 5` returned a stopped
+process and symbolicated system stack after the UIKit template asserted on its
+missing HomePod display configuration. The installd capture
+`/tmp/temppod-homepod-signature-installer.json` shows MIS result 0, native
+`CdHash`, `SigningID`, `SignerType=1`, `ValidatedByProfile=false`,
+`IsNativeForPlatform=true`, and “Install successful” in 0.05 seconds. A plain
+UIScene cannot substitute for UIWindowScene under the application's system
+role; UIKit reports that minimum-class constraint separately. These errors
+demonstrate working launch/debugger communication, not support for HomePod UI.
+
+The full VPhone bundle passes admission and 77 selected catalogue, selection,
+version, declaration, plan, gate and guest-resolution tests pass. The persona
+native ABI/policy harness also passes. SDK-family insertion was applied twice
+to scratch copies of Apple's settings: both JSON/plist formats retain exactly
+two dictionary entries (3 and 5) with no duplicate; shell syntax and plist
+validation pass.
+
+Live opt-out restored installd byte-identically to its original backup
+(SHA-256 `6dd955e206ca3227ad28bda202718b7357c019e107ed79132f61a6a36d9b21cd`),
+and removed `/hm` and the HomePod signature library. The persona patch was
+disabled in the same run and launchd also matched its original backup. TempPod
+booted successfully with both adapters disabled. The normal preset was then
+restored for the final installation/debugger check.
+
+After restoring the preset (no overrides), Xcode installed and launched the
+headless Foundation version as PID 210. It uses a run-loop timer rather than
+UIApplicationMain, preserving the template UI source files for future work.
+LLDB stopped at `researchHeartbeat`, `main.m:8`; `p heartbeatCount` returned 2,
+`thread step-over` advanced it to 3, and
+`po [NSProcessInfo processInfo].processName` returned `HomePodApp`. The breakpoint
+was deleted and execution resumed. CoreDevice's process enumeration independently
+listed PID 210, and `ddiServices` reported the 27B48 cryptex compatible and usable
+after the reboot. Xcode's device picker identifies `TempPod (Internal)` with
+the `tvOS 27.2 Research` SDK. Template window scenes remain unsupported because
+HomePod has no display; the headless process is the validated research target.
+The process continued logging five-second heartbeats after resuming, without
+the earlier UIKit assertion. It is left running under Xcode's debugger, and
+the temporary MIS `LogQueries` configuration has been removed. Olive and the
+default bundle were not changed.
+
+## Original iPhone investigation
+
Measured 2026-09-30 on `05-mis-test` (iPhone base 26.6.2 / 23G90, cloudOS 26.4
/ 23E5207q, `jb` variant), booted, with `mis_trust_auth` applied.
diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestPatchResolution.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestPatchResolution.swift
index decd3775..a95e261a 100644
--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestPatchResolution.swift
+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestPatchResolution.swift
@@ -57,6 +57,7 @@ public enum FirmwareGuestPatchResolution {
FirmwareGuestSystemPatchSet.homePodOTAUserland, FirmwareGuestSystemPatchSet.homePodSoundGlow,
FirmwareGuestSystemPatchSet.homePodCryptexStaging, FirmwareGuestSystemPatchSet.homePodCryptexClass,
FirmwareGuestSystemPatchSet.installCoordinationPersona,
+ FirmwareGuestSystemPatchSet.homePodAdHocInstall,
FirmwareGuestSystemPatchSet.virtioSoundDriver])
.union(FirmwarePatchSetCatalog.tvOS27UserlandPatches)
diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestSystemPatchSet.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestSystemPatchSet.swift
index 3a175135..b6478298 100644
--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestSystemPatchSet.swift
+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestSystemPatchSet.swift
@@ -22,6 +22,8 @@ public enum FirmwareGuestSystemPatchSet {
public static let installCoordinationPersona = "system-installcoordination_proxy-cfw-persona_lookup"
public static let installCoordinationPersonaMarker = "/usr/lib/vphone-installcoordination-persona-lookup"
public static let homePodInstallPersonaLibrary = "/usr/lib/libvphoneinstallpersona.dylib"
+ public static let homePodAdHocInstall = "system-installd-exp-homepod_adhoc"
+ public static let homePodMISFixLibrary = "/usr/lib/libvphonehomepodmisfix.dylib"
public static let metalCacheReuse = "system-systemhook-cfw-metal_cache_reuse"
public static let metalCacheReuseMarker = "/usr/lib/vphone-metal-cache-reuse"
public static let gyroscope = "system-backboardd-cfw-gyroscope"
@@ -82,6 +84,13 @@ public enum FirmwareGuestSystemPatchSet {
target: .prebootDeviceTree,
applicability: ios27,
),
+ VPhonePatchDeclaration(
+ identifier: homePodAdHocInstall,
+ title: "HomePod local app signatures",
+ summary: "Ports the existing MIS signature-option adapter to HomePod installd so locally signed research apps install without the provisioning service HomePod does not ship. Keeps MIS's native signature validation and returned metadata; no device identity or profile scope hooks.",
+ target: .guestExecutable(path: "/usr/libexec/installd"),
+ applicability: ios27,
+ ),
VPhonePatchDeclaration(
identifier: homePodCryptexStaging,
title: "HomePod developer image staging",
diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swift
index 4ee9e496..9955dfb6 100644
--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swift
+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swift
@@ -68,7 +68,7 @@ public enum FirmwarePatchSetCatalog {
Set(FirmwareKernelFridaPatchSet.manifest.patches.map(\.identifier))
.union(hypervisorConcealmentPatches)
.union(experimentalIdentityPatches)
- .union([FirmwareGuestSystemPatchSet.otaUserland, FirmwareGuestSystemPatchSet.homePodTopCap, FirmwareGuestSystemPatchSet.homePodSetupBypass, FirmwareGuestSystemPatchSet.homePodAudioProduct, FirmwareGuestSystemPatchSet.homePodWelcome, FirmwareGuestSystemPatchSet.homePodSiriSpeech, FirmwareGuestSystemPatchSet.homePodOTAUserland, FirmwareGuestSystemPatchSet.homePodSoundGlow, FirmwareGuestSystemPatchSet.homePodCryptexStaging, FirmwareGuestSystemPatchSet.homePodCryptexClass])
+ .union([FirmwareGuestSystemPatchSet.otaUserland, FirmwareGuestSystemPatchSet.homePodTopCap, FirmwareGuestSystemPatchSet.homePodSetupBypass, FirmwareGuestSystemPatchSet.homePodAudioProduct, FirmwareGuestSystemPatchSet.homePodWelcome, FirmwareGuestSystemPatchSet.homePodSiriSpeech, FirmwareGuestSystemPatchSet.homePodOTAUserland, FirmwareGuestSystemPatchSet.homePodSoundGlow, FirmwareGuestSystemPatchSet.homePodCryptexStaging, FirmwareGuestSystemPatchSet.homePodCryptexClass, FirmwareGuestSystemPatchSet.homePodAdHocInstall])
.union([FirmwareKernelCustomFirmwarePatchSet.tvTPROPagers, misTrustAuthPatch, FirmwareGuestSystemPatchSet.settingsRootRows, FirmwareGuestSystemPatchSet.settingsSoftwareUpdate, FirmwareGuestSystemPatchSet.tvTPRO, FirmwareGuestSystemPatchSet.tvOTAUserland])
/// ProMotion: the 120 Hz timing for the paravirtual display.
@@ -226,7 +226,7 @@ public enum FirmwarePatchSetCatalog {
freshly restored 26.4 guest does not survive. The HomePod-only top cap is off.
""",
patchSets: bundledReferences,
- selection: .block([FirmwareGuestSystemPatchSet.homePodTopCap, FirmwareGuestSystemPatchSet.homePodSetupBypass, FirmwareGuestSystemPatchSet.homePodAudioProduct, FirmwareGuestSystemPatchSet.homePodWelcome, FirmwareGuestSystemPatchSet.homePodSiriSpeech, FirmwareGuestSystemPatchSet.homePodOTAUserland, FirmwareGuestSystemPatchSet.homePodSoundGlow, FirmwareGuestSystemPatchSet.homePodCryptexStaging, FirmwareGuestSystemPatchSet.homePodCryptexClass]),
+ selection: .block([FirmwareGuestSystemPatchSet.homePodTopCap, FirmwareGuestSystemPatchSet.homePodSetupBypass, FirmwareGuestSystemPatchSet.homePodAudioProduct, FirmwareGuestSystemPatchSet.homePodWelcome, FirmwareGuestSystemPatchSet.homePodSiriSpeech, FirmwareGuestSystemPatchSet.homePodOTAUserland, FirmwareGuestSystemPatchSet.homePodSoundGlow, FirmwareGuestSystemPatchSet.homePodCryptexStaging, FirmwareGuestSystemPatchSet.homePodCryptexClass, FirmwareGuestSystemPatchSet.homePodAdHocInstall]),
)
/// The iOS payloads, hooks and shared-cache patches an Apple TV guest has no
@@ -334,7 +334,7 @@ public enum FirmwarePatchSetCatalog {
summary: "Research: HomePod mini's own arm64e TVOS IPSW with vphoned, its donor-driven top cap, local setup completion and virtio audio using an audio-only B520 route, without changing the VM product token or adding Apple TV OTA replacement or iPhone display, camera and routing hooks.",
patchSets: bundledReferences,
selection: .block(
- manualOnlyPatches.subtracting([FirmwareGuestSystemPatchSet.homePodTopCap, FirmwareGuestSystemPatchSet.homePodSetupBypass, FirmwareGuestSystemPatchSet.homePodWelcome, FirmwareGuestSystemPatchSet.homePodSiriSpeech, FirmwareGuestSystemPatchSet.homePodOTAUserland, FirmwareGuestSystemPatchSet.homePodSoundGlow, FirmwareGuestSystemPatchSet.homePodCryptexStaging, FirmwareGuestSystemPatchSet.homePodCryptexClass])
+ manualOnlyPatches.subtracting([FirmwareGuestSystemPatchSet.homePodTopCap, FirmwareGuestSystemPatchSet.homePodSetupBypass, FirmwareGuestSystemPatchSet.homePodWelcome, FirmwareGuestSystemPatchSet.homePodSiriSpeech, FirmwareGuestSystemPatchSet.homePodOTAUserland, FirmwareGuestSystemPatchSet.homePodSoundGlow, FirmwareGuestSystemPatchSet.homePodCryptexStaging, FirmwareGuestSystemPatchSet.homePodCryptexClass, FirmwareGuestSystemPatchSet.homePodAdHocInstall])
.union(tvOSBlockedPatches.subtracting(tvOS27UserlandPatches).subtracting([FirmwareGuestSystemPatchSet.virtioSoundDriver, FirmwareGuestSystemPatchSet.installCoordinationPersona])),
),
)
diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwareGuestPatchResolutionTests.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwareGuestPatchResolutionTests.swift
index 5b885fc2..a3e725ce 100644
--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwareGuestPatchResolutionTests.swift
+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwareGuestPatchResolutionTests.swift
@@ -34,8 +34,8 @@ struct FirmwareGuestPatchResolutionTests {
#expect(FirmwareGuestPatchResolution.unvalidatedTVGuestPatches(enabled: [identifier], arm64eUserland: true) == [identifier])
}
- @Test(arguments: [FirmwareGuestSystemPatchSet.homePodCryptexStaging, FirmwareGuestSystemPatchSet.homePodCryptexClass])
- func `HomePod cryptex staging is independent of the iPhone environment and reversible in selection`(identifier: String) throws {
+ @Test(arguments: [FirmwareGuestSystemPatchSet.homePodCryptexStaging, FirmwareGuestSystemPatchSet.homePodCryptexClass, FirmwareGuestSystemPatchSet.homePodAdHocInstall])
+ func `HomePod developer compatibility is independent of the iPhone environment and reversible in selection`(identifier: String) throws {
for base in ["26.4", "27.0", "27.2", "28.0"] {
for preset in FirmwarePatchSetCatalog.builtInPresets {
let plan = try VPhonePatchPlan.resolve(
@@ -59,8 +59,12 @@ struct FirmwareGuestPatchResolutionTests {
#expect(FirmwareGuestPatchResolution.unvalidatedHomePodGuestPatches(enabled: [identifier]).isEmpty)
#expect(FirmwareGuestPatchResolution.unvalidatedTVGuestPatches(enabled: [identifier], arm64eUserland: true) == [identifier])
let declaration = try #require(FirmwarePatchSetCatalog.allDeclarations.first { $0.identifier == identifier })
- #expect(declaration.target == (identifier == FirmwareGuestSystemPatchSet.homePodCryptexStaging
- ? .guestExecutable(path: "/usr/libexec/cryptexd") : .prebootDeviceTree))
+ let expectedTarget: VPhonePatchTarget = switch identifier {
+ case FirmwareGuestSystemPatchSet.homePodCryptexStaging: .guestExecutable(path: "/usr/libexec/cryptexd")
+ case FirmwareGuestSystemPatchSet.homePodAdHocInstall: .guestExecutable(path: "/usr/libexec/installd")
+ default: .prebootDeviceTree
+ }
+ #expect(declaration.target == expectedTarget)
#expect(!declaration.bootEssential)
}
diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwarePatchSetCatalogTests.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwarePatchSetCatalogTests.swift
index 0bf9e37a..bb7a6cb1 100644
--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwarePatchSetCatalogTests.swift
+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwarePatchSetCatalogTests.swift
@@ -244,6 +244,7 @@ struct FirmwarePatchSetCatalogTests {
&& $0.identifier != FirmwareGuestSystemPatchSet.homePodSoundGlow
&& $0.identifier != FirmwareGuestSystemPatchSet.homePodCryptexStaging
&& $0.identifier != FirmwareGuestSystemPatchSet.homePodCryptexClass
+ && $0.identifier != FirmwareGuestSystemPatchSet.homePodAdHocInstall
&& $0.applicability.matches(iOSBase: version, cloudOS: cloud)
}.map(\.identifier))
#expect(experimental.enabled.subtracting(standard.enabled) == applicableManual)
diff --git a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swift b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swift
index 78edf05a..7c230a71 100644
--- a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swift
+++ b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swift
@@ -226,7 +226,7 @@ struct VPhoneCustomFirmwareInstaller {
if effectiveEnabled.contains(FirmwareGuestSystemPatchSet.homePodSiriSpeech), device.family != .homePod {
throw ValidationError("The HomePod Siri-speech patch is supported only for a HomePod guest.")
}
- if !effectiveEnabled.isDisjoint(with: [FirmwareGuestSystemPatchSet.homePodCryptexStaging, FirmwareGuestSystemPatchSet.homePodCryptexClass]), device.family != .homePod {
+ if !effectiveEnabled.isDisjoint(with: [FirmwareGuestSystemPatchSet.homePodCryptexStaging, FirmwareGuestSystemPatchSet.homePodCryptexClass, FirmwareGuestSystemPatchSet.homePodAdHocInstall]), device.family != .homePod {
throw ValidationError("The HomePod cryptex staging patch is supported only for a HomePod guest.")
}
if effectiveEnabled.contains(FirmwareGuestSystemPatchSet.homePodSoundGlow), device.family != .homePod {
@@ -1923,7 +1923,44 @@ struct VPhoneCustomFirmwareInstaller {
}
}
- isolate([]) { try restoreMISFixTargets(system: system) }
+ if !isHomePod {
+ isolate([]) { try restoreMISFixTargets(system: system) }
+ }
+
+ // HomePod has no misagent/provisioning service. Its research SDK signs
+ // apps ad hoc; load only the existing MIS signature-option adapter in
+ // installd, without iPhone identity, profile or spawn hooks.
+ let adHocInstall = FirmwareGuestSystemPatchSet.homePodAdHocInstall
+ isolate([adHocInstall]) {
+ let library = FirmwareGuestSystemPatchSet.homePodMISFixLibrary
+ let path = String(library.dropFirst())
+ let executable = "usr/libexec/installd"
+ if on(adHocInstall) {
+ guard isHomePod else {
+ throw ValidationError("HomePod ad-hoc installation requires a HomePod guest.")
+ }
+ let payload = try VPhoneGuestBinaries.resolve((library as NSString).lastPathComponent)
+ try system.replaceFile(path, fromFileAt: payload, mode: 0o755, owner: Self.guestOwner)
+ try installLibraryAlias(system: system, alias: "hm", target: library)
+ try patchMachO(system: system, work: work, path: executable,
+ preserveEntitlements: true, injectedDylibPath: "/hm")
+ live.insert(adHocInstall)
+ } else if isHomePod || priorGuest.contains(adHocInstall) {
+ if try revertMachO(system: system, work: work, path: executable) {
+ print(" [+] \(adHocInstall): restored installd from backup")
+ } else if priorGuest.contains(adHocInstall) {
+ live.insert(adHocInstall)
+ throw ValidationError("HomePod ad-hoc installation has no installd backup; cannot safely remove its library.")
+ }
+ if try system.exists("hm") {
+ guard try system.readLink("hm") == library else {
+ throw ValidationError("Another file uses /hm; leaving it intact.")
+ }
+ try system.removeItem("hm")
+ }
+ try system.removeItem(path)
+ }
+ }
isolate(["system-debugserver-cfw-install"]) {
if on("system-debugserver-cfw-install") {
diff --git a/VPhoneExecutable/VPhoneVirtualization/Build/StageBundle.sh b/VPhoneExecutable/VPhoneVirtualization/Build/StageBundle.sh
index 9e2d0186..001da1d7 100755
--- a/VPhoneExecutable/VPhoneVirtualization/Build/StageBundle.sh
+++ b/VPhoneExecutable/VPhoneVirtualization/Build/StageBundle.sh
@@ -93,6 +93,7 @@ daemon_sdk="$(/usr/bin/otool -l "$guest/vphoned" | /usr/bin/awk '/LC_BUILD_VERSI
/bin/cp "$guest_products/attitude/libvphoneattitude.dylib" "$guest/libvphoneattitude.dylib"
/bin/cp "$guest_products/cryptexstaging/libvphonecryptexstaging.dylib" "$guest/libvphonecryptexstaging.dylib"
/bin/cp "$guest_products/homepodpersona/libvphoneinstallpersona.dylib" "$guest/libvphoneinstallpersona.dylib"
+/bin/cp "$guest_products/homepodmisfix/libvphonehomepodmisfix.dylib" "$guest/libvphonehomepodmisfix.dylib"
/bin/cp "$guest_products/homepoddisplay/libvphonehomepoddisplay.dylib" "$guest/libvphonehomepoddisplay.dylib"
/bin/cp "$guest_products/homepodsetup/vphone-homepod-setup" "$guest/vphone-homepod-setup"
/bin/cp "$guest_products/homepodsetup/com.vphone.homepod-setup.plist" "$guest/com.vphone.homepod-setup.plist"
diff --git a/VPhoneExecutable/VPhoneVirtualization/Build/ValidateBundle.sh b/VPhoneExecutable/VPhoneVirtualization/Build/ValidateBundle.sh
index 2dfc57bb..71fe0c6a 100755
--- a/VPhoneExecutable/VPhoneVirtualization/Build/ValidateBundle.sh
+++ b/VPhoneExecutable/VPhoneVirtualization/Build/ValidateBundle.sh
@@ -146,7 +146,7 @@ fi
for name in vphoned vphoned-tvos vphoned-watchos launchdhook-vphone.dylib SystemHook-vphone.dylib libcamfix.dylib \
libvcamcaptured.dylib libmisfix.dylib libhapticsfix.dylib libbatteryhealthfix.dylib libdevicehubfix.dylib libdevicename.dylib \
- libprefsfix.dylib libsigninfix.dylib libvphonegyro.dylib libvphoneaccelerometer.dylib libvphoneattitude.dylib libvphonehomepoddisplay.dylib libvphonecryptexstaging.dylib libvphoneinstallpersona.dylib vphone-homepod-setup libAppleParavirtCompilerPluginIOGPUFamily.dylib; do
+ libprefsfix.dylib libsigninfix.dylib libvphonegyro.dylib libvphoneaccelerometer.dylib libvphoneattitude.dylib libvphonehomepoddisplay.dylib libvphonecryptexstaging.dylib libvphoneinstallpersona.dylib libvphonehomepodmisfix.dylib vphone-homepod-setup libAppleParavirtCompilerPluginIOGPUFamily.dylib; do
require_signed_macho "$guest/$name"
done
for name in vphoned.plist libcamfix.plist libvcamcaptured.plist libmisfix.plist com.vphone.homepod-setup.plist; do
@@ -200,7 +200,7 @@ while IFS= read -r file; do
"$frameworks/"*)
[[ "$platform" != IOS ]] || { print -u2 "iOS binary in Contents/Frameworks: ${file#$bundle/}"; exit 1; }
;;
- "$guest/vphoned-tvos"|"$guest/libvphonehomepoddisplay.dylib"|"$guest/libvphonecryptexstaging.dylib"|"$guest/libvphoneinstallpersona.dylib"|"$guest/vphone-homepod-setup")
+ "$guest/vphoned-tvos"|"$guest/libvphonehomepoddisplay.dylib"|"$guest/libvphonecryptexstaging.dylib"|"$guest/libvphoneinstallpersona.dylib"|"$guest/libvphonehomepodmisfix.dylib"|"$guest/vphone-homepod-setup")
# tvOS dyld refuses an iOS-platform daemon on an Apple TV guest.
[[ "$platform" == TVOS ]] || { print -u2 "Non-tvOS binary: ${file#$bundle/}"; exit 1; }
;;
diff --git a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/experimental.plist b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/experimental.plist
index 12e655d7..0800ac1d 100644
--- a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/experimental.plist
+++ b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/experimental.plist
@@ -99,6 +99,7 @@
<string>system-homepod-exp-siri_speech</string>
<string>system-homepod-exp-ota_userland</string>
<string>system-homepod-exp-sound_glow</string>
+ <string>system-installd-exp-homepod_adhoc</string>
<string>system-cryptexd-exp-homepod_staging</string>
<string>preboot-homepod-exp-cryptex_class</string>
<string>preboot-homepod-exp-audio_product</string>
diff --git a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/standard.plist b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/standard.plist
index a07ebda9..61be34f2 100644
--- a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/standard.plist
+++ b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/standard.plist
@@ -79,6 +79,7 @@
<string>system-homepod-exp-siri_speech</string>
<string>system-homepod-exp-ota_userland</string>
<string>system-homepod-exp-sound_glow</string>
+ <string>system-installd-exp-homepod_adhoc</string>
<string>system-cryptexd-exp-homepod_staging</string>
<string>preboot-homepod-exp-cryptex_class</string>
<string>preboot-homepod-exp-audio_product</string>
diff --git a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos-4k.plist b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos-4k.plist
index 407d989d..870a9e54 100644
--- a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos-4k.plist
+++ b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos-4k.plist
@@ -79,6 +79,7 @@
<string>system-homepod-exp-siri_speech</string>
<string>system-homepod-exp-ota_userland</string>
<string>system-homepod-exp-sound_glow</string>
+ <string>system-installd-exp-homepod_adhoc</string>
<string>system-cryptexd-exp-homepod_staging</string>
<string>preboot-homepod-exp-cryptex_class</string>
<string>preboot-homepod-exp-audio_product</string>
diff --git a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos.plist b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos.plist
index 7a930b42..4282353f 100644
--- a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos.plist
+++ b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos.plist
@@ -79,6 +79,7 @@
<string>system-homepod-exp-siri_speech</string>
<string>system-homepod-exp-ota_userland</string>
<string>system-homepod-exp-sound_glow</string>
+ <string>system-installd-exp-homepod_adhoc</string>
<string>system-cryptexd-exp-homepod_staging</string>
<string>preboot-homepod-exp-cryptex_class</string>
<string>preboot-homepod-exp-audio_product</string>
diff --git a/VPhoneGuestComponents/MISFix/MISFixInstallPolicy.c b/VPhoneGuestComponents/MISFix/MISFixInstallPolicy.c
index d5b96735..dba55b8e 100644
--- a/VPhoneGuestComponents/MISFix/MISFixInstallPolicy.c
+++ b/VPhoneGuestComponents/MISFix/MISFixInstallPolicy.c
@@ -156,6 +156,7 @@ static IMP vpSwizzle(const char *className, const char *selectorName, IMP replac
/// A caller handed `YES` alongside a populated `NSError *` is a shape no
/// ordinary method produces, and installd does read the out-parameter. The
/// error object itself is left to the autorelease pool it came from.
+#ifndef VPHONE_MIS_SIGNATURE_ONLY
static void vpClearError(void *error) {
if (error != NULL)
*(void **)error = NULL;
@@ -172,6 +173,7 @@ static BOOL vpInstallEmbeddedProfiles(id self, SEL selector, void *error) {
MISFixNote("embedded profile refused; installing without one");
return YES;
}
+#endif
// MARK: - The signer identity
@@ -194,10 +196,12 @@ static BOOL vpAllowAdhocSigning(id self, SEL selector) {
__attribute__((constructor)) static void vpInstallPolicyHooks(void) {
if (!MISFixProcessIs("installd"))
return;
+#ifndef VPHONE_MIS_SIGNATURE_ONLY
vpOriginalInstallProfiles = (MISFixCheckIMP)vpSwizzle(
"MIInstallableBundle",
"_installEmbeddedProfilesWithError:",
(IMP)&vpInstallEmbeddedProfiles
);
+#endif
vpSwizzle("MICodeSigningVerifier", "allowAdhocSigning", (IMP)&vpAllowAdhocSigning);
}
diff --git a/VPhoneGuestComponents/Makefile b/VPhoneGuestComponents/Makefile
index 69f3c78c..3024c545 100644
--- a/VPhoneGuestComponents/Makefile
+++ b/VPhoneGuestComponents/Makefile
@@ -102,6 +102,9 @@ CRYPTEXSTAGING := $(STAGE)/cryptexstaging/libvphonecryptexstaging.dylib
CRYPTEXSTAGING_SOURCE := CryptexStagingFix/libvphonecryptexstaging.c
HOMEPODPERSONA := $(STAGE)/homepodpersona/libvphoneinstallpersona.dylib
HOMEPODPERSONA_INPUTS := HomePodInstallPersona/libvphoneinstallpersona.c LaunchHook/InstallCoordinationPersona.h
+HOMEPODMISFIX := $(STAGE)/homepodmisfix/libvphonehomepodmisfix.dylib
+HOMEPODMISFIX_SOURCES := MISFix/MISFixSignature.c MISFix/MISFixDetour.c MISFix/MISFixConfig.c MISFix/MISFixInstallPolicy.c
+HOMEPODMISFIX_INPUTS := $(HOMEPODMISFIX_SOURCES) MISFix/MISFixDetour.h MISFix/MISFixConfig.h
HOMEPODSETUP := $(STAGE)/homepodsetup/vphone-homepod-setup
HOMEPODSETUP_SOURCES := $(call find_sources,HomePodSetup)
HOMEPODSETUP_INPUTS := $(call find_headers,HomePodSetup) HomePodSetup/com.vphone.homepod-setup.plist
@@ -138,7 +141,7 @@ GPU_DYNAMIC_LOOKUP_SYMS := \
VIRTIOSOUND := $(STAGE)/virtiosound/VPhoneVirtIOSound.driver
VIRTIOSOUND_SOURCES := $(wildcard VirtIOSound/*.m VirtIOSound/*.c)
VIRTIOSOUND_INCLUDES := $(wildcard VirtIOSound/*.h) VirtIOSound/Info.plist VirtIOSound/AudioServerDriver.tbd
-ARTIFACTS := $(CAMFIX) $(VCAMCAPTURED) $(LAUNCHHOOK) $(SYSTEMHOOK) $(MISFIX) $(HAPTICSFIX) $(BATTERYHEALTHFIX) $(DEVICEHUBFIX) $(DEVICENAME) $(PREFSFIX) $(SIGNINFIX) $(GYROSCOPE) $(ACCELEROMETER) $(ATTITUDE) $(HOMEPODDISPLAY) $(CRYPTEXSTAGING) $(HOMEPODPERSONA) $(HOMEPODSETUP) $(GPU_PLUGIN) $(VIRTIOSOUND)
+ARTIFACTS := $(CAMFIX) $(VCAMCAPTURED) $(LAUNCHHOOK) $(SYSTEMHOOK) $(MISFIX) $(HAPTICSFIX) $(BATTERYHEALTHFIX) $(DEVICEHUBFIX) $(DEVICENAME) $(PREFSFIX) $(SIGNINFIX) $(GYROSCOPE) $(ACCELEROMETER) $(ATTITUDE) $(HOMEPODDISPLAY) $(CRYPTEXSTAGING) $(HOMEPODPERSONA) $(HOMEPODMISFIX) $(HOMEPODSETUP) $(GPU_PLUGIN) $(VIRTIOSOUND)
PLISTS := $(STAGE)/camfix/libcamfix.plist $(STAGE)/vcamcaptured/libvcamcaptured.plist \
$(STAGE)/misfix/libmisfix.plist
GPU_PROVENANCE := $(STAGE)/gpu/README.md
@@ -184,7 +187,7 @@ gpu: $(GPU_PLUGIN)
package: all
@rm -f $(ARCHIVE)
- @/usr/bin/tar -cf $(ARCHIVE) -C $(STAGE) camfix vcamcaptured launchhook systemhook misfix hapticsfix batteryhealthfix devicehubfix devicename prefsfix signinfix gyroscope accelerometer attitude homepoddisplay cryptexstaging homepodpersona homepodsetup gpu virtiosound
+ @/usr/bin/tar -cf $(ARCHIVE) -C $(STAGE) camfix vcamcaptured launchhook systemhook misfix hapticsfix batteryhealthfix devicehubfix devicename prefsfix signinfix gyroscope accelerometer attitude homepoddisplay cryptexstaging homepodpersona homepodmisfix homepodsetup gpu virtiosound
@echo "Packaged $(ARCHIVE)"
test-loader-links:
@@ -384,6 +387,14 @@ $(HOMEPODDISPLAY): $(HOMEPODDISPLAY_SOURCES) $(HOMEPODDISPLAY_INPUTS)
-o $@ $(HOMEPODDISPLAY_SOURCES) -framework Foundation -Wl,-not_for_dyld_shared_cache
@codesign --force --sign - $@
+$(HOMEPODMISFIX): $(HOMEPODMISFIX_INPUTS)
+ @mkdir -p $(STAGE)/homepodmisfix
+ xcrun --sdk appletvos clang -arch arm64e -mtvos-version-min=27.0 -Os -dynamiclib \
+ -install_name /usr/lib/libvphonehomepodmisfix.dylib \
+ -DVPHONE_MIS_SIGNATURE_ONLY=1 -o $@ $(HOMEPODMISFIX_SOURCES) -framework CoreFoundation -lmis -lobjc \
+ -Wl,-not_for_dyld_shared_cache
+ @codesign --force --sign - $@
+
$(HOMEPODPERSONA): $(HOMEPODPERSONA_INPUTS)
@mkdir -p $(STAGE)/homepodpersona
xcrun --sdk appletvos clang -arch arm64e -mtvos-version-min=27.0 -Os \