Skip to content

Run a virtual iPhone on an Apple Silicon Mac.

Swift

Merge upstream/main into homepod-ddi

Guilherme Rambobdb5d83d1053
diff --cc Research/0_binary_patch_comparison.md
index c9084c21,c26e9ab6..1a22fbbe
--- a/Research/0_binary_patch_comparison.md
+++ b/Research/0_binary_patch_comparison.md
@@@ -1,69 -1,18 +1,82 @@@
# 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
+> iPhone's Protobox denial of the installation proxy's UserManager lookup.
+> HomePod loads a dedicated TVOS arm64e `libvphoneinstallpersona.dylib` in
+> launchd via the short `/vp` alias. It reuses the existing root-owned marker,
+> exact service/path/signing-identity and kernel-validated audit-token checks.
+> 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.
+> Xcode installation, process launch and LLDB stack inspection pass; see
+> `Research/Guest/ios27_xcode_persona_lookup.md`.
+
+> **HomePod cryptex DDI staging (2026-10-23).**
+> `system-cryptexd-exp-homepod_staging` is a selectable HomePod 27 guest patch,
+> enabled by `homepod-mini` and excluded from the iOS/Apple TV presets. It
+> injects the TVOS arm64e `libvphonecryptexstaging.dylib` into cryptexd through
+> a load command, preserving the daemon's entitlements and an original `.bak`.
+> Deselecting restores the daemon before removing the library. Only failed
+> `F_SETPROTECTIONCLASS` calls returning `EPERM` become `ENOTSUP`, the daemon's
+> existing unsupported-filesystem fallback. Other fcntl calls tail-forward
+> their complete ABI arguments. Apple ticket/signature/trust-cache/graft checks
+> remain on the native path. DDI persistence and nonce persistence use Apple's
+> until-reboot mode. The research SEP's digest-storage failure is tolerated only
+> for error 104 in the cryptex POSIX domain and an info plist naming Apple's DDI,
+> `/System/Developer`, and DeveloperModeRequired true; the preceding native
+> signature lock is unchanged. This does not enable the broad iPhone environment or its
+> display hooks. Validation and deployment results are recorded in
+> `Research/Guest/developer_disk_images.md`.
+> TempPod confirmed the staging errno, then exposed an authenticated APFS
+> `clas` mismatch (tvOS ticket `0xf4`, research kernel `0xf2`). The independent
+> `preboot-homepod-exp-cryptex_class` repair sets or adds only the concrete uint32
+> `/product/cryptex1-product-class` to `0xf4`, which the kernel's native Image4
+> runtime reads. It preserves equality verification and global product-id;
+> Preboot backup composition makes it reversible. No kernel instruction is
+> 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.
+> 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.
+
+ > **vphoned on iOS 18 (2026-10-23):** the daemon strongly imports Span types
+ > from `@rpath/libswiftCompatibilitySpan.dylib`, but the guest payload omitted
+ > the back-deployment library. The bundle now carries the signed iPhoneOS
+ > library, and the existing vphoned installation steps (both restore-image
+ > injection and full/environment-only CFW install) copy it to
+ > `/usr/lib/vphone/libswiftCompatibilitySpan.dylib`. The iOS daemon gains that
+ > fallback rpath after `/usr/lib/swift`, preserving the system implementation
+ > on iOS 26+. The restore-image trust-cache scan includes the added file.
+ > Bundle admission checks its signature/platform and the daemon's search path.
+ > No new patch, preset, instruction replacement, or version change is needed;
+ > TV/watch daemon payloads are unchanged. This fixes a confirmed missing
+ > dependency; an iOS 18 guest boot still needs runtime validation.
+
> **HomePod integration with upstream main (2026-10-23).**
> Merged upstream `d14231a4` into the HomePod branch, retaining upstream's
> 2.12 compatibility contract, Apple Watch, research-board and sealed restore
diff --cc VPhoneExecutable/VPhoneVirtualization/Build/ValidateBundle.sh
index 71fe0c6a,4f348bfb..80361fd0
--- a/VPhoneExecutable/VPhoneVirtualization/Build/ValidateBundle.sh
+++ b/VPhoneExecutable/VPhoneVirtualization/Build/ValidateBundle.sh
@@@ -144,11 -144,27 +144,27 @@@ if /usr/bin/grep -q 'AVPSEPBooter-' "$r
exit 1
fi
- for name in vphoned vphoned-tvos vphoned-watchos launchdhook-vphone.dylib SystemHook-vphone.dylib libcamfix.dylib \
+ for name in vphoned vphoned-tvos vphoned-watchos libswiftCompatibilitySpan.dylib 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 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
+ # iOS 18 must be able to resolve the compatibility library without Xcode.
+ # /usr/lib/swift remains first for guests whose standard library has Span.
+ daemon_rpaths="$(/usr/bin/otool -l "$guest/vphoned" | /usr/bin/awk '
+ $2 == "LC_RPATH" { rpath = 1; next }
+ rpath && $1 == "path" { print $2; rpath = 0 }
+ ')"
+ [[ "${daemon_rpaths%%$'\n'*}" == /usr/lib/swift &&
+ "$daemon_rpaths" == *$'\n/usr/lib/vphone' ]] || {
+ print -u2 "vphoned must search system Swift libraries before its bundled fallback"
+ exit 1
+ }
+ /usr/bin/otool -L "$guest/vphoned" | /usr/bin/awk 'NR > 1 {print $1}' |
+ /usr/bin/grep -Fx '@rpath/libswiftCompatibilitySpan.dylib' >/dev/null || {
+ print -u2 "vphoned does not use the bundled Span compatibility library"
+ exit 1
+ }
for name in vphoned.plist libcamfix.plist libvcamcaptured.plist libmisfix.plist com.vphone.homepod-setup.plist; do
[[ -f "$guest/$name" ]] || { print -u2 "Missing guest configuration: $name"; exit 1; }
done