Skip to content

Run a virtual iPhone on an Apple Silicon Mac.

Swift

HomeView distance sensing override

Guilherme Ramboe1ef98f6aeec
diff --git a/Research/0_binary_patch_comparison.md b/Research/0_binary_patch_comparison.md
index 16e08a73..4f411f65 100644
--- a/Research/0_binary_patch_comparison.md
+++ b/Research/0_binary_patch_comparison.md
@@ -1,5 +1,28 @@
# Patch Comparison: Regular / Development / Jailbreak / Experimental
+> **HomeView distance simulation (2026-10-30, runtime validation pending).**
+> `dyld-exp-homeview_environment_service` opens only BreadBoardServices'
+> environment-service internal-install branch on the reviewed 27.2 userland.
+> The preceding client entitlement check remains intact; no global internal
+> build identity is changed. The reveal follows the native Platform getter's
+> call and validates the service's separate rejection paths with Capstone.
+> Writes use cache-page re-attestation and the existing undo log. The patch is
+> off in every shipped preset and is admitted only for HomeView installs.
+> The guest RPC uses the native environment request, near/increased detail and
+> far/decreased detail. Native reset clears all environment overrides and
+> requires explicit acknowledgement. Retail runtime probes confirmed the
+> internal-build gate; no live distance override or patch deployment has been
+> performed. See [distance investigation](Firmware/homeview_distance.md).
+> Offline validation passes against an APFS cache clone: unique reviewed gate,
+> one instruction and one page hash changed, repeat is a no-op, and undo restores
+> every cache file byte-identically. Finished bundle build/admission and 94
+> focused Xcode tests pass; the live Near/Far UI effect is still unverified.
+> After user authorization, HomeView received this patch and guest environment
+> `2.15.0-local.b1ed0817`. Native ABI validation was corrected to accept the
+> protocol's `Vv` (oneway void) qualifier, with a focused regression test. The
+> installed daemon now activates the service and fetches native detail as root.
+> No distance override was written by the agent; the user will test Near/Far/reset.
+
> **HomeView guest-profile backend lookup (2026-10-30).** The BreadBoard
> display exception clears its first assertion, but its native guest-profile
> fetch still fails with an NSError chain ending in sandbox restriction 159
diff --git a/Research/Firmware/homeview_distance.md b/Research/Firmware/homeview_distance.md
new file mode 100644
index 00000000..86ded4c1
--- /dev/null
+++ b/Research/Firmware/homeview_distance.md
@@ -0,0 +1,293 @@
+# HomeView distance-adaptive UI
+
+Investigation: tvOS 27.2 HomeView 24V514, HomeAccessory17,1 / J490AP. This ledger distinguishes shipped-code observations from runtime proof. Initial research and implementation left installed bundles unchanged; the user subsequently authorized deployment, recorded below.
+
+Current deployment: HomeView is running with host and guest environment
+`2.15.0-local.b1ed0817`. The scoped service patch is applied and the installed
+daemon's read-only `homeview.distance.get` succeeds. Near/Far/reset input and
+visual behavior are left for the user's requested manual test.
+
+## Native model and distance mapping
+
+The shell owns `LevelOfDetail.Aggregator` and `LevelOfDetail.SessionSource`. Session selection prefers an active person matching the current persona, with an active-person fallback. The perceived-person distance enum has `near` and `far` cases. The selected near case maps to native UI detail **2 (increased)**; far maps to **0 (decreased)**. Native detail **1** is named **standard**; a separate physical middle-distance zone has not been established.
+
+Evidence: BreadBoardFramework SHA-256 `f3336f3e9aade1bdfb02fcb50a10880f42c26f892119f635a29aa9e97573bd93`, Session derivation `0x250f8c3a8` (`ev_ac0a387ce9f0972ece5ec99c28ed7e2bcb5f3b3689f8cfe10bd93eb445b18893`) and fallback `0x250f8ca6c` (`ev_86d6cd02a5d0493d477b7cadd302b89f8fab6e8b7a09e22d13606f8e59f7f809`). Session publisher `0x250f8c7b4` (`ev_f3606c84411e83f32f2825ca14a599bc9a6bde809c545c7b1d3472aefedd5903`). Enum descriptions in BreadBoardServices `0x25123eb98` (`ev_cdf38a4bea1ac2b0611537839c3293c7bb696b4c146de332c8017bb847fef2a2`). Live read-only request construction independently printed decreased/standard/increased for 0/1/2, with other override fields absent.
+
+This is an override of the actual distance-derived aggregator. It is not a display-style substitution: aggregator apply `0x250f7f3ec` stores optional detail (`ev_37e5a162f944c92f37e733891a27dbbcb15c13de9f3a80f09e70e8b07336c4d6`); publishing chooses override when present, otherwise source detail (`ev_44c9d112f001161709bcb9ab19ddb1edc7df519ec80a9b8197f241c9d564b6be`). Environment publisher calls this path (`ev_f73fa7e23f2a01d9f7d4d60448063a89e6a3c54ea04a05297fca60bdb5a43308`). BreadBoardUIServices contains the downstream `BBSUILevelOfDetailTrait` and staged detail updates.
+
+Native input types include `LevelOfDetail.PassiveCameraAdaptor`, `AttentionAwarenessSource`, `NearbyPersonPresenceProvider`, and `NearbyInteractionMonitor`; the latter imports `NIDevicePresenceConfiguration`. Perceived entities carry distance, metricDistance, gaze, engagement, persona and recognition confidence. The shell consumes EntityKit distance/pose/gazing/presence/engagement/persona observations; perceptiond is an on-device mobile service with Conclave configuration. The types alone do not establish the upstream sensor hardware or its pairing requirements. The exact EntityKit query and separate known-device NearbyInteraction path are recorded below. The override service itself takes no phone/pairing input and applies directly to the shell's local detail aggregator.
+
+Physical units, thresholds and hysteresis remain unverified. EntityKit has `DistanceProvider`, `DistanceConstants`, near/far/armsReach coding keys and logs for `nearMeters`, `midMeters`, and `armsReachMeters`, plus an optional `DistanceOverrides.json` load path; no such JSON resource is present in the supplied root's EntityKit directory. These strings alone do not establish numeric thresholds. The host control therefore exposes detail modes, not a fabricated meters slider.
+
+## Service ABI and reset scope
+
+BreadBoardServices SHA-256 `ec3350999682d66598d151fcf7bc918e132e39ea50ba010bad5ea6de05defc5d` provides `BBSEnvironmentServiceServerInterface`:
+
+- `fetchCurrentEnvironmentWithReply:`
+- `applyEnvironmentOverrides:completion:`
+- `resetEnvironmentOverridesWithCompletion:`
+
+Requests are `BBSEnvironmentOverrideRequest initWithActivePersonaUniqueIdentifier:displayStyle:levelOfDetail:backlightState:`. Persona is nullable NSString; the remaining fields are nullable NSNumber. Integer detail is restricted to 0...2 (the native description path traps on invalid cases). Nil style/persona/backlight fields preserve previous overrides; they do not clear those fields. Constructor evidence `ev_d531a53b1f54fe27377ba6cd20459e708ab5ed995efc0545998b16f434ea0a9a`.
+
+Server apply merges the request into a single stored optional Overrides value: `0x2511406e4` (`ev_5f0d7d723acc4d4e20ae9e91328ea1ac388407311bfd9913ed5a08f5fda1f6b6`), merge implementation BBS `0x251265458` (`ev_96b738ccaa783c321987c6e3bc118cb496637d095e9d0dd2dc21812e951f360c`), commit and publication `0x25114081c` (`ev_fe3a39859793a4882200c3fc22a4e4e974ad027cbfdd8be96a9e3af6f8da6bb4`). Reset constructs the entire optional Overrides=nil and republishes the environment: `0x251140d20` (`ev_2157eadda8515c1a400f5117ee901a1e368203a7a23cdd1d79e786a3b74abe64`) and `0x251140de4` (`ev_d80a30447f7d3ea907dd9958d44a84f1267f6e9e6b9466ee7cd4571e65ca94d1`). Thus reset scope includes persona, display style, detail and backlight simulation. No selective clear-detail API is established. Fetch returns effective environment values without an override mask, so effective detail cannot identify an override's origin.
+
+Transport construction follows native `BBSEnvironment.Controller`: endpoint mach name `com.apple.breadboardservices`, service `com.apple.breadboard.environment-service`, instance nil (`ev_dafb2ff094158ddcb009d766d61d928a1b88f954e84ee46e4fbb88b59520f2f7`). A copied BSMutableServiceInterface wraps the canonical server protocol using BSObjCProtocol (`ev_594bd54164b6ffaec25126820a9aeae90655c464d98b2d8dc73409ba1f6f121e`). BSServiceInitiatingConnection options use the default multiplexer; configure sets interface, userInitiated service dispatch queue, and lifecycle handlers, then activate. Native PLS reads the remote target asynchronously after activation.
+
+The server gate checks client entitlement `com.apple.private.breadboard.environment.read-write`, then a separate availability predicate; rejection logs distinguish “Client is not entitled” and “Service is unavailable” (`ev_059065e22f243acd69c0b1b41c4e3fc3adb2bf12c04c47ff8725d6337a101ae7`). That availability predicate remains under investigation.
+
+## Current runtime boundary
+
+A temporary native arm64e helper, signed with platform-application, the exact read/write entitlement and the mach-lookup exception, was uploaded to `/var/tmp/homeview-distance-probe` through the existing guest control socket. Read-only fetch under both root and mobile UID501 returned BSServiceConnectionErrorDomain code 3, “XPC error received on message reply handler.” Waiting for the activation handler instead times out after five seconds. BreadBoard remains running PID39 with last exit 0. No environment mutation, reset, pairing or bundle installation has been performed; no near/far screenshot proof exists yet. The helper must be removed after diagnostics.
+
+The in-progress RPC implementation is bounded and fails closed on service/ABI errors. `homeview.distance.set` modes near/standard/far use native integer detail2/1/0. Explicit automatic reset requires `reset_environment:true` and discloses `reset_scope:"environment"`. Unknown initial ownership is reported as mode unknown, override_active null. A successful effective readback alone must never imply that another tool's override is absent. Final connection recovery, readback and runtime tests are pending; host UI integration on an installed updated bundle remains pending user availability/authorization.
+
+## Reveal and validation procedure
+
+Extract BreadBoardFramework, BreadBoardServices, BreadBoardUIServices and EntityKit from the supplied HomeView shared cache with ipsw `dyld extract --slide --objc`; open the matching extracted image in REA. Follow Session detail selection through Aggregator publication and Environment publisher, then trace request merge and reset separately. Use the addresses as documentation of this exact artifact, not runtime offsets.
+
+Before any mutation, resolve service activation/gate failure. Then establish a test-owned baseline, capture native environment and screenshot, apply far and near while keeping the helper/connection alive, verify native completion plus independent readback and visual layout changes, reset with explicit environment-wide acknowledgement, and confirm restored automatic state. Do not complete setup, provision HomeKit, pair or sign in for this test. No claim of runtime success should be made until these steps pass.
+
+## Host controls and deployment boundary
+
+The HomeView Controls panel has a Viewing Distance section. Near, Standard
+Detail and Far send the native detail overrides; Standard Detail is not a
+physical middle-distance claim. Current mode is Unknown until the daemon can
+establish ownership. Refresh reads native effective state. A failed write
+invalidates the displayed mode and requires a new read, since a lost reply may
+follow a committed write. Disconnect invalidates outstanding replies so an old
+connection cannot overwrite a newer read.
+
+Automatic uses a button explicitly labeled Reset Environment Simulation. Its
+help text lists persona, display style, detail and backlight because the native
+reset clears those overrides together. Near/Far requests supply nil for the
+unrelated request fields. These controls are shown only for HomeView; an older
+guest without the capability reports that distance simulation is unavailable.
+
+After an updated bundle and environment are authorized and installed, the
+experimental `dyld-exp-homeview_environment_service` patch must be explicitly
+selected. It is off in every shipped preset. It is admitted only for HomeView
+and gated to the reviewed 27.2 userland; changing its selection uses the normal
+guest patch install/undo path. It opens only the environment service's
+internal-install branch, retaining the client entitlement check. Global
+`os_variant_has_internal_content` remains unchanged. The added vphoned
+entitlement is `com.apple.private.breadboard.environment.read-write`.
+
+RPC examples for the future installed environment (not executed as live writes
+during this investigation):
+
+```zsh
+vphone-launchpad-cli guest rpc HomeView homeview.distance.get '{}'
+vphone-launchpad-cli guest rpc HomeView homeview.distance.set '{"mode":"far"}'
+vphone-launchpad-cli guest rpc HomeView homeview.distance.set '{"mode":"near"}'
+vphone-launchpad-cli guest rpc HomeView homeview.distance.set \
+ '{"mode":"automatic","reset_environment":true}'
+```
+
+The result contains `available`, `mode`, `level_of_detail`, `override_active`,
+`applied` and `reset_scope:"environment"`. Unknown ownership has
+`mode:"unknown"`, `override_active:null`; an effective value alone cannot reveal
+another client's override. Successful writes require native acknowledgement and
+a separate fetch, and the requested nonautomatic detail must match that fetch.
+
+The full goal remains incomplete until the authorized installed bundle can
+activate the service, Near/Far visibly change native UI, reset restores native
+behavior, and the actual host controls pass those same transitions. Offline
+patch tests and model tests do not prove those runtime behaviors. Root/mobile
+client identity and override lifetime across disconnects remain runtime checks.
+
+## Offline validation, 2026-10-30
+
+- Xcode MCP built the finished VPhone bundle successfully after the final
+ patcher fix; bundle admission passed. Build log:
+ `/var/folders/xd/m1z8xjr17n96_qtw6tb5z0hw0000gn/T/ActionArtifacts/default/BuildProject/BuildProject-Log-20261030-200349.txt`.
+- Xcode ran 94 focused patch catalog, resolution, declaration, version,
+ selection, plan, gate and semantic HomeView patcher tests successfully.
+ The environment-selected full-cache XCTest fixture was skipped because that
+ environment variable was absent; the separate real-cache CLI test below was
+ executed. Results:
+ `/var/folders/xd/m1z8xjr17n96_qtw6tb5z0hw0000gn/T/ActionArtifacts/default/RunSomeTests/EA7474D8-052E-4A12-AD60-E4326B00BFAB.txt`.
+- The host model tests pass all four modes, refusal, unavailable/malformed
+ replies, unknown ownership, a committed write with a lost reply, and an old
+ read arriving after reconnect. Daemon logic tests pass 410 checks, including
+ explicit reset acknowledgement policy.
+- Cloned the supplied cache to `.build/homeview-cache-validation` with APFS
+ clones. The actual built CLI's dry run located exactly `0x251269fec`.
+ Applying changed `e00e0036` to `1f2003d5` and re-attested only slot 922 in
+ `.48`. Independent `ipsw dyld disass` confirmed the preceding `cbz w28`
+ entitlement rejection and internal getter call were untouched. Byte comparison
+ of that chunk found only the four instruction bytes and its 32-byte slot
+ hash changed. Repeating reported already patched with no signature writes.
+- `cfw patch-dsc-revert` restored the one captured instruction and re-attested
+ its page. Every cloned cache file then compared byte-identically to the
+ supplied cache. Both original and restored `.48` have SHA-256
+ `e1b3a717e9e93b81f6542aa7ee11ded01a0e83b5c91fa8b65ba7bc67ee87dd67`.
+- No installed bundle, guest cache, VM binding, setup state, phone pairing or
+ account was changed. Temporary diagnostic helpers were removed. Near/Far
+ visual behavior and the installed host control remain unverified.
+
+## EntityKit distance input and separate device-presence input
+
+The following is static shipped-artifact evidence from the HomeView 27.2 cache. It identifies the shell's consumed observations; it does not establish every upstream sensor producer or prove that an actual donor device's sensing works without account setup or pairing.
+
+`EntityMonitor` owns `EntityKit.DynamicEntityModel`, an `entitiesPublisher` of `Set<PerceivedEntity>`, a persona-provider closure, and a listener task. `PeopleMonitor` separately owns an entity-listener task and a people publisher. These fields are visible in the recovered ObjC/Swift class metadata. The default entity-model construction at `0x251155fa4–0x251155fbc` calls `DynamicEntityModel.init()`; it takes no phone or pairing parameter.
+
+The entity query requests eight components: `EKC.Distance`, `PersonaIdentifier`, `UserIdentities`, `Pose`, `Gazing`, `Presence`, `Engagement`, and `IdentityAggressors`. Its filter combines `EKC.Classification.person` and `EKC.Presence.viscinity` (the spelling is the shipped enum case), visible at `0x250f83bb8–0x250f83cf8`. At `0x250f8479c–0x250f84828`, `EntityMonitor` selects `EntityDescriptor.anyEntity`, obtains `DynamicEntityModel.remoteModel`, and invokes `stream(query:from:)`. The returned `EntityModel.RemoteQueryAsyncIterator` feeds conversion routines `0x250f866bc` and `0x250f86784`.
+
+The conversion at `0x250f86e4c–0x250f86ec0` deliberately collapses EntityKit's distance categories:
+
+| EntityKit `EKC.Distance` | `PerceivedEntity.Distance` |
+| --- | --- |
+| `armsReach`, `near` | `near` (byte 0) |
+| `mid`, `far`, other cases | `far` (byte 1) |
+
+Thus an upstream `mid` observation does not imply the shell's standard-detail mode. Separately, `0x250f86fb8–0x250f86fec` reads `EKC.Pose.position` and computes its distance to `CartePoint.origin`; an absent pose produces positive infinity. This is the entity's metric-distance field, rather than a conversion of the discrete near/far label into invented meter values. Session detail selection then uses the selected entity's discrete distance as described above.
+
+`NearbyInteractionMonitor` is a distinct device-presence path. At `0x251126874–0x251126938`, it builds `NIRegionPredicate` values named `inner` and `outer` using device-presence presets 4 and 5, creates `NIDevicePresenceConfiguration` with `initWithInnerBoundary:outerBoundary:error:`, and sets `allowedDevices` to 2. The native `NIInternalUtils.NIRelationshipSpecifierToString:` at `0x21c51b4ec` indexes a table at `0x2609905c0`; table entry 2 points to the literal `Known Devices` at `0x21c55751d`. That exact label does not establish which account or pairing relationships qualify. The delegate callback `session:object:didUpdateRegion:previousRegion:` at `0x2511278e0` reads `deviceIdentifier` and updates a set of nearby object identifiers. This device-presence code is not the converter of `EKC.Distance` into `PerceivedEntity.Distance`.
+
+For the host simulation control, the native environment override consumes only the level-of-detail request and has no phone/pairing input. For physical sensing, the established app-side pipeline is EntityKit person observations into entity/session detail selection, alongside a separate known-device NearbyInteraction path. Whether EntityKit's upstream producer or the known-device source requires particular setup or pairing in a given hardware configuration remains unverified; nearby/perception entitlements alone do not answer that question.
+
+Artifact and scratch evidence locations:
+
+- Extracted `BreadBoardFramework`: `/tmp/homeview-extract/BreadBoardFramework`, SHA-256 `f3336f3e9aade1bdfb02fcb50a10880f42c26f892119f635a29aa9e97573bd93`.
+- Extracted `NearbyInteraction`: `/tmp/homeview-transport/NearbyInteraction`, SHA-256 `eb22c7fa056d3580403cf70497742874cb50fd2841aef18441474d3e95dabf74`.
+- Full annotated cache disassembly for the app framework: `/tmp/homeview-transport/BreadBoardFramework.asm`, SHA-256 `d07d314452902870b227c85188aca845c9cc18b83c81c5748b3b6fcc426652bf`.
+- Metadata inventory: `/tmp/homeview-bbf-objc.txt`; symbol inventory: `/tmp/homeview-transport/bbf-symbols.txt`.
+
+The disassembly was produced with `ipsw dyld disass --image BreadBoardFramework --cache /tmp/homeview-address-cache --demangle` against the supplied original cache. NearbyInteraction enum-table and description methods were inspected with the same cache's address-based disassembly and extracted-image `ipsw macho dump`. These are reproducible static observations, not a successful physical-sensor replay. No bundle install, pairing, account setup, environment mutation or REA target switch was performed for this subsection.
+
+## Retail service gate resolved
+
+The separate service predicate is the exported BreadBoardFoundation `Platform.isInternalInstall` getter (`_$s20BreadBoardFoundation8PlatformO17isInternalInstallSbvgZ`) at `0x250f0f6f8`. It caches exactly `os_variant_has_internal_content("com.apple.BreadBoard")`, without a preference lookup in this getter. Foundation SHA-256 `f0d08b9cdee8c4292391977ebe87798edf0cedb0478c7e1b78e582f7e639ddaa`; initializer evidence `ev_4380af1e616bf43713680d006f2186b177411bbb1bdfd49d462b477e94ca181c`, getter `ev_77bae608fff892ca3168788c6fe025a9fdf47d4ac002513883227577a5fe88c5`. A bounded read-only native guest call independently returned `internal_content=false`.
+
+In the environment server's accepting-connection function `0x251269eb8` (only `func_251269eb8` in this artifact's symbol inventory), the entitlement result is guarded by `cbz w28` at `0x251269fe4`. The following call at `0x251269fe8` resolves via stub `0x258063a60` to the Foundation internal-install getter. `tbz w0,#0` at `0x251269fec` selects the “Service is unavailable” rejection path at `0x25126a1c8`. This explains an entitled client being refused on the retail guest. The implemented optional DSC patch changes only this environment-service branch and preserves the prior client entitlement check; it does not change os_variant or Platform.isInternalInstall globally. Clone-based application, repeat and undo passed as recorded above. No such patch has been deployed to the VM.
+
+The bridge retains a bounded native connection attempt so a later scoped service repair can work without falsifying global internal-install status. Activation failures report that the retail service requires the scoped simulation-service patch. Timeout/disconnect invalidates ownership; reconnect retires the old connection and ignores stale generation callbacks. Detail getters are checked against runtime NSInteger method encodings. Writes require native acknowledgement and a separate fetch with matching native level before returning applied=true. The explicit environment-wide reset guard is enforced at the RPC boundary. Total native bound is up to five seconds each for activation, mutation reply and independent readback.
+
+Both temporary diagnostic helpers were removed from the guest by exact filename. No environment overrides were written or cleared, and no processes, settings, pairings or bundles were modified. Near/far visual verification remains pending a repaired service in an authorized updated bundle.
+
+## Bridge final review
+
+Runtime checks validate the request constructor's object argument ABI, primitive NSInteger detail getters, and all three canonical protocol methods' void return/object/block argument shapes. Nested callback signatures are derived from inspected native callers because Objective-C protocol method encodings retain only `@?` for a block. An atomic disconnect check before returning ownership/readback rejects a connection lost during the acknowledgement/fetch sequence. Activation timeout marks the connection for retirement; a later request creates a fresh connection, and generation checks ignore retired-connection callbacks.
+
+Guest-independent RPC policy checks verify that automatic reset without explicit acknowledgement is rejected before native transport, acknowledged reset is admitted, near/standard/far require no broad-reset acknowledgement, and unsupported enum strings are rejected. The daemon logic suite passed 410 checks with zero failures. Native arm64e tvOS compilation with `-Werror -fsyntax-only` passed.
+
+Both root and mobile UID501 read-only probes failed at the retail internal-install gate, so those attempts do not establish whether an activated service admits cross-user clients. The endpoint is a launchd Mach service hosted by mobile BreadBoard; there is no evidence yet that the guest daemon must change UID to use it. Keep the daemon's existing identity until an authorized repaired-service runtime test provides an actual identity-specific failure.
+
+## Override lifetime and mutation reply ordering
+
+Static lifetime audit of these same artifacts establishes shared publisher state, rather than a per-client override bag. BreadBoardFramework wiring at `0x251196ee8` creates an `EnvironmentAggregator`; its read/apply/reset closures all capture the same publisher reference (the three context stores at `0x251196f5c`, `0x251196f70`, and `0x251196f84`). That aggregator is passed to `BBSEnvironment.Listener` at `0x251196ff8`. `LevelOfDetailPublisher` metadata identifies its one optional `_overrides` value. In BreadBoardServices, listener construction `0x251269c60` allocates its Coordinator from the supplied controller before creating the connection listener. Accepted connections configure that Coordinator as `interfaceTarget` in `0x2512684e8`; they do not create a separate publisher or override value. Wiring evidence: `ev_8fd96d375cec79e2f7d4412704b83418f5640ffc97581ccd858c86fa4c960318`, listener construction `ev_5f03078019404c11f708a3fd52a02c4a76844d5c74089868fa040f7e9c12d795`, connection configuration `ev_657e1ad6b3b5514f6df7cb4d17c6a38706ea2dc9d187171949bccf9628de5bec`.
+
+The accepted connection's invalidation callback is `0x25126a6f4`, whose captured context contains the client PID and whose body calls `0x2512685ec`. The latter only logs `Connection invalidated {connection=%@, client.pid=%d}` and releases logging temporaries; it does not invoke apply/reset or access the controlling publisher. Invalidation therefore has no native reset action in this inspected path. The static implication is that closing Controls, retiring a daemon client connection, or losing a client does not automatically restore automatic detail while the shell publisher remains alive. Explicit reset or another override operation changes the shared state; no persistence across publisher/BreadBoard restart is established. Callback evidence `ev_19d973924673cf0b91c42e6c4d793d69bc9dae9eecd163817f337095af196931`, full invalidation body `ev_e785c7fc81fd42aeec47db8e28cb1f764d43d2da68c8a4ce232725e7a740f77b`. Actual disconnect/restart behavior remains a runtime validation item because the retail gate prevented successful service activation during this investigation.
+
+Mutation replies are completion results, rather than acknowledgements sent before the operation runs. `applyEnvironmentOverrides:completion:` (`0x251269364`) starts an async task; `0x251268f80` dispatches the controller's async apply witness and resumes at `0x2512690ec`. Only its success continuation `0x2512691f0` constructs `BBSEnvironmentValues` from the returned environment. The outer continuation `0x25126959c` then invokes the original reply block with environment in `x1` and nil error in `x2`; on failure it supplies nil environment and a converted `NSError`. Reset (`0x2512699b4`) likewise awaits its controller reset witness in `0x251269708`, resumes through `0x2512698b8`, and wraps the environment in `0x251268b40`; its outer reply continuation `0x2512568cc` / `0x25125550c` uses the same `(environment, NSError)` result convention. Apply-witness evidence `ev_62eceb9e518354745d6dc89281bca2387d7fdfa80f25295f539c83957b5c22e7`, apply result continuation `ev_8be08cb2611380323fcac68dc3ba12e7cf53a53b66c2d7827796da45f1db4009`, reset witness `ev_b3dd08b0facb0a59652eed052154f67435bcc5b2b2e1a0700502d0d92d2b50e0`, reset result continuation `ev_c3f39df806a3f99dc82ea16ca32204e3a7a9634f46d8e63ccf92d1201983d150`.
+
+The already-recorded publisher commit paths store the merged/nil `_overrides`, update publication, await `0x25113f4d0`, then invoke the current-environment reader `0x25113fe04` before returning (apply tail `0x2511409fc–0x251140aa4`; reset tail `0x251140fc8–0x25114106c`). Thus the server's successful mutation reply follows the async publisher commit and carries its resulting environment. It is not evidence that a UI frame has rendered, and another client can subsequently change the shared state; the bridge's separate fetch and future visual verification remain appropriate.
+
+Additional reproducible disassembly: `/tmp/homeview-transport/BreadBoardServices.asm`, SHA-256 `e8c1eec5e35eecee6826d37fbbb753302ae115a3a06ef915e30f6d013b48a52a`; the BreadBoardFramework disassembly and binary hashes are recorded above. This audit performed no guest calls, environment writes, bundle updates or source-code changes. REA sessions were closed after inspection.
+
+## Prepared rollout input, not applied
+
+The VM remains bound to host/guest environment `2.15.0-local.176e4e80`
+(`launchpad.json` read back on 2026-10-30). Its recorded selection is `homeview`
+with only the existing setup bypass explicitly allowed. Preparing distance
+simulation must preserve that current choice: `fw export-preset` with a new
+`--allow` argument replaces a VM's override list rather than appending to it.
+
+The actual built CLI exported these local artifacts without changing the VM:
+
+```zsh
+vphone-cli fw export-preset HomeView \
+ --output .build/homeview-distance-validation/homeview-current.plist
+vphone-cli fw export-preset \
+ --preset .build/homeview-distance-validation/homeview-current.plist \
+ --allow dyld-exp-homeview_environment_service \
+ --output .build/homeview-distance-validation/homeview-distance.plist
+```
+
+Both exported selections are block lists. Comparing them proves that the
+distance preset removes exactly `dyld-exp-homeview_environment_service` from
+the blocked set and adds no blocked entries. Patch sets and parameters are
+identical, and the existing setup bypass stays allowed. These are reviewable
+inputs for a future authorized test, not a changed machine configuration.
+Re-export if the VM's choices change before deployment. Applying this preset,
+installing the updated bundle/environment and booting its native service
+remain pending user availability.
+
+## Completion audit
+
+| Requirement | Current authoritative evidence | Status |
+| --- | --- | --- |
+| Identify what drives the distance-adaptive UI | EntityKit person query, categorical conversion, session selection and local detail aggregator traced in the supplied 24V514 binaries | Established statically; physical sensor behavior not replayed |
+| Determine whether an iPhone VM is needed for simulation | Native override takes local detail values, and its inspected apply path commits directly to the shared publisher; separate known-device presence path documented | No pairing input is needed by this simulation path; upstream physical-sensing prerequisites remain unverified |
+| Add host controls | HomeView-only SwiftUI section and model compile in the finished bundle; mode/readback/error/reconnect tests pass; actual section renders at the 460-point minimum width with mocked readbacks | Implemented and layout reviewed; input and installed control flow still unverified |
+| Add functioning guest transport | Canonical protocol/constructor ABI checked; reply order traced through async commit; installed daemon successfully activates and fetches native state after the oneway-void fix | Live read transport and root-client access verified; mutations still await the user's test |
+| Enable the retail service reversibly | Optional declared patch changes one service gate, preserves entitlement checks, re-attests its page; actual CLI repeat/undo proves byte-identical cache restoration | Applied to HomeView after authorization and recorded in its Guest receipt; remains off by default in shipped presets |
+| Prove Near/Far adapt the actual native UI and reset restores native behavior | Requires an activated guest service, native readbacks, and before/after screenshots through the actual host controls | Missing; cannot claim end-to-end success |
+| Honor the no-update constraint | No installation preceded the user's explicit authorization; subsequent deployment uses Launchpad's helper | Honored; authorization now provided |
+
+The goal is not complete. The user will test Near/Far/reset on the updated VM.
+No additional phone VM, account provisioning or global internal-build change is
+justified by the available evidence.
+
+## Local host layout verification
+
+A standalone Swift/AppKit harness compiled the unchanged production distance
+section and model with a mock observable guest control. Self-captured
+`NSHostingView` images at the actual Controls minimum width of 460 points show
+the initial Unknown state, Automatic/reset state, and unsupported capability
+state. The complete reset label and its environment-wide scope explanation
+are readable, and no production text overlaps or clips. Evidence is under
+`.build/homeview-distance-ui`: `self-initial.png`, `self-reset-layout.png`,
+`self-unavailable-layout.png`, and `verification.md`.
+
+This verifies rendering with mocked readbacks, not button input or live guest
+behavior. The external CUA observer stalled before returning a hierarchy or
+screenshot and was intentionally canceled; its exact helper was terminated.
+The subsequent self-contained rendering runs exited normally. SwiftUI exposed
+no actionable controls through the attempted in-process NSView/AX routes, so
+no selection/apply/reset interaction is claimed. The mock log contains only
+reads; model tests remain the evidence for request construction. No installed
+bundle or VM was modified by either attempt.
+
+## Authorized deployment and read-only readiness check
+
+The user authorized bundle/environment installation on 2026-10-30 and reserved
+Near/Far/reset testing for themselves. Launchpad installed local build
+`2.15.0-local.938b13aa` with host policy/preflight passing. The VM's `homeview`
+selection retained its existing setup bypass and explicitly added only
+`dyld-exp-homeview_environment_service`. `cfw update-environment` applied the
+reviewed instruction at `0x251269fec`, re-attested slot 922 in `.48`, and recorded
+the service patch in the Guest receipt. The first boot reached vphoned, but
+the daemon's initial native ABI validator rejected the service before opening
+its connection.
+
+A temporary read-only runtime probe found the protocol's exact return encoding
+is **`Vv` (oneway void)**, not plain `v`. Its three method encodings are
+`Vv24@0:8@?16`, `Vv32@0:8@16@?24`, and `Vv24@0:8@?16`; the request constructor
+is `@48@0:8@16@24@32@40`. The validator now removes standard Objective-C type
+qualifiers before checking the underlying ABI. A native regression test uses
+oneway protocol fixtures, the exact observed encoding, an invalid callback
+type and a missing method. It passes without weakening the argument-count or
+block checks.
+
+The corrected native bridge, compiled into a temporary root probe with the
+daemon's exact entitlements, successfully activated and fetched the native
+environment without any override write. Both diagnostic files were removed
+from the guest. Xcode then built the finished bundle successfully (log
+`BuildProject-Log-20261030-203939.txt` in the same ActionArtifacts directory
+recorded above). Launchpad installed **`2.15.0-local.b1ed0817`**, with policy
+and host preflight passing, stopped HomeView, updated its guest environment,
+and restarted it. Its host and guest environment bindings both name this
+version; the boot chain remains `2.15.0-local.0f803fd7`.
+
+The installed daemon's read-only RPC now returns:
+
+```json
+{"applied":0,"available":true,"level_of_detail":2,"mode":"unknown","override_active":null,"reset_scope":"environment"}
+```
+
+This verifies the patched service activates for vphoned running as root and
+returns the expected native state. Unknown ownership remains intentional;
+an effective detail value does not reveal another client's override mask.
+No Near/Far/standard/automatic mutation was sent by the agent. HomeView is
+left running for the user's test under **Device → Controls → Viewing Distance**.
diff --git a/VPhoneDaemon/Configuration/VPhoneDaemon.entitlements b/VPhoneDaemon/Configuration/VPhoneDaemon.entitlements
index 529432c2..3af0ecac 100644
--- a/VPhoneDaemon/Configuration/VPhoneDaemon.entitlements
+++ b/VPhoneDaemon/Configuration/VPhoneDaemon.entitlements
@@ -89,6 +89,8 @@
<true/>
<key>com.apple.private.coreservices.can-register-install-results</key>
<true/>
+ <key>com.apple.private.breadboard.environment.read-write</key>
+ <true/>
<key>com.apple.private.coreservices.canmaplsdatabase</key>
<true/>
<key>com.apple.private.coreservices.lsaw</key>
diff --git a/VPhoneDaemon/Daemon/GuestAPI+Extended.swift b/VPhoneDaemon/Daemon/GuestAPI+Extended.swift
index 342dff37..3081e822 100644
--- a/VPhoneDaemon/Daemon/GuestAPI+Extended.swift
+++ b/VPhoneDaemon/Daemon/GuestAPI+Extended.swift
@@ -26,6 +26,7 @@ extension GuestAPI {
executeAttitude,
executeHomePodDisplay,
executeHomePodDebug,
+ executeHomeViewDistance,
executeScript,
]
for area in areas {
diff --git a/VPhoneDaemon/Daemon/GuestAPI+HomeViewDistance.swift b/VPhoneDaemon/Daemon/GuestAPI+HomeViewDistance.swift
new file mode 100644
index 00000000..378a09f8
--- /dev/null
+++ b/VPhoneDaemon/Daemon/GuestAPI+HomeViewDistance.swift
@@ -0,0 +1,42 @@
+import Foundation
+import VphonedNative
+
+enum GuestHomeViewDistance {
+ static var capabilities: [String] {
+ vp_homeview_distance_available() ? ["homeview_distance"] : []
+ }
+
+ static func call(mode: String? = nil) throws -> [String: Any] {
+ let pointer = mode.map { $0.withCString { vp_homeview_distance_copy_json($0) } }
+ ?? vp_homeview_distance_copy_json(nil)
+ guard let pointer else {
+ throw GuestAPIError.operationFailed("HomeView distance service returned no reply")
+ }
+ defer { free(pointer) }
+ let data = Data(bytes: pointer, count: strlen(pointer))
+ guard let envelope = try JSONSerialization.jsonObject(with: data) as? [String: Any] else {
+ throw GuestAPIError.operationFailed("Invalid HomeView distance service reply")
+ }
+ guard envelope["ok"] as? Bool == true else {
+ throw GuestAPIError.operationFailed(envelope["error"] as? String ?? "HomeView distance operation failed")
+ }
+ return envelope["result"] as? [String: Any] ?? [:]
+ }
+}
+
+extension GuestAPI {
+ static func executeHomeViewDistance(_ method: String, _ params: [String: Any]) throws -> [String: Any]? {
+ switch method {
+ case "homeview.distance.get":
+ return try GuestHomeViewDistance.call()
+ case "homeview.distance.set":
+ let mode = try string(params, "mode")
+ if let rejection = GuestHomeViewDistancePolicy.rejection(mode: mode, resetEnvironment: params["reset_environment"] as? Bool == true) {
+ throw GuestAPIError.invalidRequest(rejection)
+ }
+ return try GuestHomeViewDistance.call(mode: mode)
+ default:
+ return nil
+ }
+ }
+}
diff --git a/VPhoneDaemon/Daemon/GuestAPI.swift b/VPhoneDaemon/Daemon/GuestAPI.swift
index 6cf93a04..8e9ab27b 100644
--- a/VPhoneDaemon/Daemon/GuestAPI.swift
+++ b/VPhoneDaemon/Daemon/GuestAPI.swift
@@ -153,7 +153,7 @@ enum GuestAPI {
"motion_gyroscope_toggle",
"motion_attitude",
] + pointerCapabilities() + scriptCapabilities() + GuestHomePodDisplay.capabilities
- + GuestHomePodDebug.capabilities,
+ + GuestHomePodDebug.capabilities + GuestHomeViewDistance.capabilities,
]
}
diff --git a/VPhoneDaemon/Daemon/GuestHomeViewDistancePolicy.swift b/VPhoneDaemon/Daemon/GuestHomeViewDistancePolicy.swift
new file mode 100644
index 00000000..80d9bf3d
--- /dev/null
+++ b/VPhoneDaemon/Daemon/GuestHomeViewDistancePolicy.swift
@@ -0,0 +1,17 @@
+import Foundation
+
+/// RPC validation is independent of the native transport so an unacknowledged
+/// environment-wide reset is rejected before opening a guest service connection.
+enum GuestHomeViewDistancePolicy {
+ static let modes: Set<String> = ["automatic", "near", "standard", "far"]
+
+ static func rejection(mode: String, resetEnvironment: Bool) -> String? {
+ guard modes.contains(mode) else {
+ return "mode must be automatic, near, standard or far"
+ }
+ if mode == "automatic", !resetEnvironment {
+ return "automatic requires reset_environment=true; native reset clears persona, display style, detail and backlight simulation overrides"
+ }
+ return nil
+ }
+}
diff --git a/VPhoneDaemon/Native/Include/VphonedNative.h b/VPhoneDaemon/Native/Include/VphonedNative.h
index bdc0b065..c8bd0a53 100644
--- a/VPhoneDaemon/Native/Include/VphonedNative.h
+++ b/VPhoneDaemon/Native/Include/VphonedNative.h
@@ -93,6 +93,14 @@ bool vp_homepod_debug_available(void);
/// Validated operation result or error, returned as malloc-owned JSON.
char * _Null_unspecified vp_homepod_debug_copy_json(const char * _Null_unspecified operation, const char * _Null_unspecified arguments_json);
+/// HomeView's native distance-derived level-of-detail override. A NULL mode
+/// reads the current environment; otherwise automatic, near, standard or far.
+/// Automatic clears all native environment simulation overrides. Its RPC caller
+/// must require explicit reset_environment acknowledgement before invoking it.
+/// Availability here is an artifact/ABI capability, not a live service verdict.
+bool vp_homeview_distance_available(void);
+char * _Null_unspecified vp_homeview_distance_copy_json(const char * _Null_unspecified mode);
+
/// Load the IOKit digitizer symbols used for multi-finger injection. Idempotent,
/// safe to call more than once; returns false (injection then stays a no-op)
/// on bases that do not expose the private symbols.
diff --git a/VPhoneDaemon/Native/vphoned_homeview_distance.m b/VPhoneDaemon/Native/vphoned_homeview_distance.m
new file mode 100644
index 00000000..e923bcff
--- /dev/null
+++ b/VPhoneDaemon/Native/vphoned_homeview_distance.m
@@ -0,0 +1,216 @@
+/* HomeView's native, distance-derived level-of-detail service. The wire API is
+ * BBSEnvironmentServiceServerInterface in BreadBoardServices 27.2 (24V514).
+ * See Research/Firmware/homeview_distance.md for the inspected ABI and limits.
+ */
+#import <Foundation/Foundation.h>
+#import <objc/message.h>
+#import <objc/runtime.h>
+#include <dlfcn.h>
+#include <sys/sysctl.h>
+#include <unistd.h>
+#include <stdatomic.h>
+
+static Class vpHomeViewRequestClass(void) {
+ if (access("/System/Library/CoreServices/BreadBoard.app/BreadBoard", F_OK) != 0) return Nil;
+ char machine[128] = {0}, model[128] = {0};
+ size_t machineSize = sizeof(machine), modelSize = sizeof(model);
+ sysctlbyname("hw.machine", machine, &machineSize, NULL, 0);
+ sysctlbyname("hw.model", model, &modelSize, NULL, 0);
+ if (strncmp(machine, "HomeAccessory17,", 16) != 0
+ && strcmp(model, "J490AP") != 0 && strcmp(model, "J491AP") != 0) return Nil;
+ static dispatch_once_t once;
+ dispatch_once(&once, ^{
+ dlopen("/System/Library/PrivateFrameworks/BreadBoardServices.framework/BreadBoardServices", RTLD_NOW | RTLD_LOCAL);
+ });
+ return NSClassFromString(@"BBSEnvironmentOverrideRequest");
+}
+
+bool vp_homeview_distance_available(void) {
+ return vpHomeViewRequestClass() != Nil;
+}
+
+@protocol VPBBSEnvironmentRemote
+- (void)fetchCurrentEnvironmentWithReply:(void (^)(id, NSError *))reply;
+- (void)applyEnvironmentOverrides:(id)request completion:(void (^)(id, NSError *))reply;
+- (void)resetEnvironmentOverridesWithCompletion:(void (^)(id, NSError *))reply;
+@end
+@interface NSObject (VPHomeViewPrivate)
++ (id)endpointForMachName:(NSString *)name service:(NSString *)service instance:(id)instance;
++ (id)interfaceWithIdentifier:(NSString *)identifier;
++ (id)protocolForProtocol:(Protocol *)protocol;
++ (id)defaultMultiplexer;
++ (id)userInitiated;
++ (id)queueWithName:(NSString *)name serviceQuality:(id)quality;
+- (void)setMultiplexer:(id)value;
+- (void)setServer:(id)value;
+- (void)setInterface:(id)value;
+- (void)setQueue:(id)value;
+- (void)setActivationHandler:(id)value;
+- (void)setInterruptionHandler:(id)value;
+- (void)setInvalidationHandler:(id)value;
+- (id)initWithEndpoint:(id)endpoint options:(void (^)(id))options;
+- (void)configure:(void (^)(id))configuration;
+- (void)activate;
+- (void)invalidate;
+- (id)remoteTarget;
+- (id)initWithActivePersonaUniqueIdentifier:(id)persona displayStyle:(id)style levelOfDetail:(id)detail backlightState:(id)backlight;
+- (NSInteger)levelOfDetail;
+@end
+
+static id vpDistanceConnection;
+static NSString *vpDistanceMode;
+static atomic_bool vpDistanceDisconnected;
+static atomic_uint vpDistanceGeneration;
+static NSLock *vpDistanceLock;
+static dispatch_once_t vpDistanceLockOnce;
+
+static BOOL vpDistanceIntegerGetter(Class cls, SEL selector) {
+ Method method = class_getInstanceMethod(cls, selector);
+ if (!method || method_getNumberOfArguments(method) != 2) return NO;
+ char *type = method_copyReturnType(method);
+ BOOL valid = type && (strcmp(type, @encode(NSInteger)) == 0);
+ free(type);
+ return valid;
+}
+
+static const char *vpDistanceUnqualifiedType(const char *type) {
+ // Distributed-object protocols encode `oneway void` as Vv. Qualifiers
+ // describe calling semantics, not a different register/argument layout.
+ while (*type && strchr("rnNoORV", *type)) type++;
+ return type;
+}
+
+static BOOL vpDistanceProtocolABI(Protocol *protocol) {
+ // Runtime protocol metadata verifies the outer callback is an ObjC block.
+ // Its nested (environment, NSError) signature comes from the inspected
+ // native callers; Objective-C method encodings do not retain block arguments.
+ for (NSString *name in @[@"fetchCurrentEnvironmentWithReply:", @"applyEnvironmentOverrides:completion:", @"resetEnvironmentOverridesWithCompletion:"]) {
+ BOOL apply = [name hasPrefix:@"apply"];
+ struct objc_method_description description = protocol_getMethodDescription(protocol, NSSelectorFromString(name), YES, YES);
+ if (!description.types) return NO;
+ NSMethodSignature *signature = [NSMethodSignature signatureWithObjCTypes:description.types];
+ if (strcmp(vpDistanceUnqualifiedType(signature.methodReturnType), @encode(void)) || signature.numberOfArguments != (apply ? 4 : 3)) return NO;
+ if (apply && strcmp(vpDistanceUnqualifiedType([signature getArgumentTypeAtIndex:2]), @encode(id))) return NO;
+ if (strcmp(vpDistanceUnqualifiedType([signature getArgumentTypeAtIndex:apply ? 3 : 2]), "@?")) return NO;
+ }
+ return YES;
+}
+
+static BOOL vpDistanceServiceABI(Protocol *protocol) {
+ if (!vpDistanceProtocolABI(protocol)) return NO;
+ Method constructor = class_getInstanceMethod(vpHomeViewRequestClass(), @selector(initWithActivePersonaUniqueIdentifier:displayStyle:levelOfDetail:backlightState:));
+ if (!constructor) return NO;
+ NSMethodSignature *signature = [NSMethodSignature signatureWithObjCTypes:method_getTypeEncoding(constructor)];
+ if (strcmp(signature.methodReturnType, @encode(id)) || signature.numberOfArguments != 6) return NO;
+ for (NSUInteger argument = 2; argument < 6; argument++) if (strcmp([signature getArgumentTypeAtIndex:argument], @encode(id))) return NO;
+ return YES;
+}
+
+static id<VPBBSEnvironmentRemote> vpDistanceRemote(void) {
+ if (atomic_exchange(&vpDistanceDisconnected, false)) {
+ atomic_fetch_add(&vpDistanceGeneration, 1);
+ [vpDistanceConnection invalidate];
+ vpDistanceConnection = nil;
+ vpDistanceMode = nil;
+ }
+ if (!vpDistanceConnection) {
+ NSString *service = @"com.apple.breadboard.environment-service";
+ Protocol *protocol = NSProtocolFromString(@"BBSEnvironmentServiceServerInterface");
+ if (!protocol || !vpDistanceServiceABI(protocol)) return nil;
+ id endpoint = [NSClassFromString(@"BSServiceConnectionEndpoint") endpointForMachName:@"com.apple.breadboardservices" service:service instance:nil];
+ id interface = [NSClassFromString(@"BSMutableServiceInterface") interfaceWithIdentifier:service];
+ [interface setServer:[NSClassFromString(@"BSObjCProtocol") protocolForProtocol:protocol]];
+ interface = [interface copy];
+ id queue = [NSClassFromString(@"BSServiceDispatchQueue") queueWithName:service serviceQuality:[NSClassFromString(@"BSServiceQuality") userInitiated]];
+ if (!endpoint || !interface || !queue) return nil;
+ vpDistanceConnection = [[NSClassFromString(@"BSServiceInitiatingConnection") alloc] initWithEndpoint:endpoint options:^(id options) {
+ [options setMultiplexer:[NSClassFromString(@"BSServiceInitiatingConnectionMultiplexer") defaultMultiplexer]];
+ }];
+ dispatch_semaphore_t activated = dispatch_semaphore_create(0);
+ unsigned generation = atomic_load(&vpDistanceGeneration);
+ [vpDistanceConnection configure:^(id config) {
+ [config setInterface:interface];
+ [config setQueue:queue];
+ [config setActivationHandler:^(id connection) { (void)connection; dispatch_semaphore_signal(activated); }];
+ [config setInterruptionHandler:^{ if (atomic_load(&vpDistanceGeneration) == generation) atomic_store(&vpDistanceDisconnected, true); }];
+ [config setInvalidationHandler:^{ if (atomic_load(&vpDistanceGeneration) == generation) atomic_store(&vpDistanceDisconnected, true); }];
+ }];
+ [vpDistanceConnection activate];
+ if (dispatch_semaphore_wait(activated, dispatch_time(DISPATCH_TIME_NOW, 5*NSEC_PER_SEC))) {
+ atomic_store(&vpDistanceDisconnected, true);
+ return nil;
+ }
+ }
+ return [vpDistanceConnection remoteTarget];
+}
+
+static NSDictionary *vpDistanceReply(const char *mode) {
+ if (!vp_homeview_distance_available()) return @{@"ok":@NO,@"error":@"HomeView distance simulation is unavailable on this guest"};
+ NSString *requested = mode ? [NSString stringWithUTF8String:mode] : nil;
+ if (requested && ![@[@"automatic",@"near",@"standard",@"far"] containsObject:requested]) return @{@"ok":@NO,@"error":@"Invalid HomeView distance mode"};
+ id<VPBBSEnvironmentRemote> remote = vpDistanceRemote();
+ if (!remote) return @{@"ok":@NO,@"error":@"HomeView environment service did not activate; retail firmware requires the scoped environment simulation service patch"};
+ if (atomic_load(&vpDistanceDisconnected)) { vpDistanceMode = nil; return @{@"ok":@NO,@"error":@"HomeView environment service disconnected; reconnect required"}; }
+ __block id environment;
+ __block NSError *error;
+ dispatch_semaphore_t completion = dispatch_semaphore_create(0);
+ void (^reply)(id,NSError *) = ^(id value,NSError *failure) { environment=value; error=failure; dispatch_semaphore_signal(completion); };
+ if (requested) vpDistanceMode = nil;
+ if ([requested isEqual:@"automatic"]) [remote resetEnvironmentOverridesWithCompletion:reply];
+ else if (requested) {
+ if (!vpDistanceIntegerGetter(vpHomeViewRequestClass(), @selector(levelOfDetail))) return @{@"ok":@NO,@"error":@"HomeView request detail getter ABI mismatch"};
+ NSInteger detail = [requested isEqual:@"near"] ? 2 : [requested isEqual:@"far"] ? 0 : 1;
+ id request = [[vpHomeViewRequestClass() alloc] initWithActivePersonaUniqueIdentifier:nil displayStyle:nil levelOfDetail:@(detail) backlightState:nil];
+ if (!request || [request levelOfDetail] != detail) return @{@"ok":@NO,@"error":@"HomeView level-of-detail request ABI mismatch"};
+ [remote applyEnvironmentOverrides:request completion:reply];
+ } else [remote fetchCurrentEnvironmentWithReply:reply];
+ if (dispatch_semaphore_wait(completion, dispatch_time(DISPATCH_TIME_NOW, 5*NSEC_PER_SEC))) {
+ vpDistanceMode = nil;
+ return @{@"ok":@NO,@"error":@"HomeView environment service timed out; override state is unknown"};
+ }
+ if (requested && (error || !environment)) vpDistanceMode = nil;
+ if (error || !environment) return @{@"ok":@NO,@"error":error ? [NSString stringWithFormat:@"%@: %@",error,error.userInfo] : @"HomeView environment service returned no state"};
+ if (requested) {
+ dispatch_semaphore_t readDone = dispatch_semaphore_create(0);
+ environment = nil;
+ error = nil;
+ [remote fetchCurrentEnvironmentWithReply:^(id value, NSError *failure) {
+ environment = value;
+ error = failure;
+ dispatch_semaphore_signal(readDone);
+ }];
+ if (dispatch_semaphore_wait(readDone, dispatch_time(DISPATCH_TIME_NOW, 5*NSEC_PER_SEC))) return @{@"ok":@NO,@"error":@"HomeView override acknowledgement received but independent readback timed out; override state is unknown"};
+ if (error || !environment) return @{@"ok":@NO,@"error":@"HomeView override acknowledgement received but independent readback failed; override state is unknown"};
+ }
+ if (!vpDistanceIntegerGetter([environment class], @selector(levelOfDetail))) return @{@"ok":@NO,@"error":@"HomeView environment readback ABI mismatch"};
+ NSInteger level = [environment levelOfDetail];
+ if (level < 0 || level > 2) return @{@"ok":@NO,@"error":@"HomeView environment returned an unsupported detail level"};
+ if (atomic_load(&vpDistanceDisconnected)) {
+ vpDistanceMode = nil;
+ return @{@"ok":@NO,@"error":@"HomeView environment disconnected during readback; override state is unknown"};
+ }
+ if (!requested && vpDistanceMode && ![vpDistanceMode isEqual:@"automatic"]) {
+ NSInteger expected = [vpDistanceMode isEqual:@"near"] ? 2 : [vpDistanceMode isEqual:@"far"] ? 0 : 1;
+ if (level != expected) vpDistanceMode = nil;
+ }
+ if (requested) {
+ // Ownership is recorded only after acknowledgement and a separate fetch.
+ NSInteger expected = [requested isEqual:@"near"] ? 2 : [requested isEqual:@"far"] ? 0 : 1;
+ if (![requested isEqual:@"automatic"] && level != expected) return @{@"ok":@NO,@"error":@"HomeView detail override readback did not match"};
+ vpDistanceMode = requested;
+ }
+ return @{@"ok":@YES,@"result":@{@"available":@YES,@"mode":vpDistanceMode ?: @"unknown",@"level_of_detail":@(level),@"override_active":vpDistanceMode ? @(![vpDistanceMode isEqual:@"automatic"]) : NSNull.null,@"applied":@(requested != nil),@"reset_scope":@"environment"}};
+}
+
+char *vp_homeview_distance_copy_json(const char *mode) {
+ @autoreleasepool {
+ dispatch_once(&vpDistanceLockOnce, ^{ vpDistanceLock = [NSLock new]; });
+ [vpDistanceLock lock];
+ NSDictionary *reply;
+ @try { reply = vpDistanceReply(mode); }
+ @catch (NSException *exception) { reply = @{@"ok":@NO,@"error":[@"HomeView environment ABI exception: " stringByAppendingString:exception.reason ?: exception.name]}; }
+ [vpDistanceLock unlock];
+ NSData *data = [NSJSONSerialization dataWithJSONObject:reply options:0 error:NULL];
+ return data ? strdup([[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding].UTF8String) : NULL;
+ }
+}
diff --git a/VPhoneDaemon/Tests/HomeViewDistanceABITests.m b/VPhoneDaemon/Tests/HomeViewDistanceABITests.m
new file mode 100644
index 00000000..082c85b8
--- /dev/null
+++ b/VPhoneDaemon/Tests/HomeViewDistanceABITests.m
@@ -0,0 +1,32 @@
+#import "../Native/vphoned_homeview_distance.m"
+#include <assert.h>
+
+@protocol VPHomeViewOneWayFixture
+- (oneway void)fetchCurrentEnvironmentWithReply:(void (^)(id, NSError *))reply;
+- (oneway void)applyEnvironmentOverrides:(id)request completion:(void (^)(id, NSError *))reply;
+- (oneway void)resetEnvironmentOverridesWithCompletion:(void (^)(id, NSError *))reply;
+@end
+
+@protocol VPHomeViewWrongReplyFixture
+- (oneway void)fetchCurrentEnvironmentWithReply:(id)reply;
+- (oneway void)applyEnvironmentOverrides:(id)request completion:(void (^)(id, NSError *))reply;
+- (oneway void)resetEnvironmentOverridesWithCompletion:(void (^)(id, NSError *))reply;
+@end
+
+@protocol VPHomeViewMissingMethodFixture
+- (oneway void)fetchCurrentEnvironmentWithReply:(void (^)(id, NSError *))reply;
+@end
+
+int main(void) { @autoreleasepool {
+ assert(vpDistanceProtocolABI(@protocol(VPHomeViewOneWayFixture)));
+ assert(!vpDistanceProtocolABI(@protocol(VPHomeViewWrongReplyFixture)));
+ assert(!vpDistanceProtocolABI(@protocol(VPHomeViewMissingMethodFixture)));
+ // Exact encoding observed on the installed HomeView 24V514 guest.
+ NSMethodSignature *signature = [NSMethodSignature signatureWithObjCTypes:"Vv24@0:8@?16"];
+ assert(strcmp(signature.methodReturnType, "Vv") == 0);
+ assert(strcmp(vpDistanceUnqualifiedType(signature.methodReturnType), "v") == 0);
+ assert(strcmp(vpDistanceUnqualifiedType("rn@?"), "@?") == 0);
+ assert(strcmp(vpDistanceUnqualifiedType("q"), "q") == 0);
+ assert(strcmp(vpDistanceUnqualifiedType("i"), "v") != 0);
+ puts("HomeView distance ABI: oneway void accepted; invalid callback and missing method refused");
+} return 0; }
diff --git a/VPhoneDaemon/Tests/LogicTests.swift b/VPhoneDaemon/Tests/LogicTests.swift
index b9beb8af..c4b7b562 100644
--- a/VPhoneDaemon/Tests/LogicTests.swift
+++ b/VPhoneDaemon/Tests/LogicTests.swift
@@ -40,10 +40,26 @@ enum LogicTests {
processSpawnPolicy()
bootstrapPlatform()
setupAssistantState()
+ homeViewDistancePolicy()
print("\(checks) checks, \(failures) failures")
exit(failures == 0 ? 0 : 1)
}
+ static func homeViewDistancePolicy() {
+ expect(GuestHomeViewDistancePolicy.rejection(mode: "automatic", resetEnvironment: false) != nil,
+ "environment-wide reset requires explicit acknowledgement before native transport")
+ expect(GuestHomeViewDistancePolicy.rejection(mode: "automatic", resetEnvironment: true) == nil,
+ "acknowledged environment-wide reset is admitted")
+ for mode in ["near", "standard", "far"] {
+ expect(GuestHomeViewDistancePolicy.rejection(mode: mode, resetEnvironment: false) == nil,
+ "detail-only override preserves unrelated fields without a reset acknowledgement")
+ }
+ for mode in ["", "Near", "middle", "3", "automatic "] {
+ expect(GuestHomeViewDistancePolicy.rejection(mode: mode, resetEnvironment: true) != nil,
+ "strict native enum mapping rejects unsupported mode \(mode)")
+ }
+ }
+
static func processSpawnPolicy() {
let valid = GuestProcessSpawnPolicy.validate(executable: "ps", arguments: ["-axo", "pid=,ppid=,args="], timeout: 3)
expect(valid == nil, "standard ps discovery request is accepted")
diff --git a/VPhoneDaemon/Tests/run-homeview-distance-abi-tests.sh b/VPhoneDaemon/Tests/run-homeview-distance-abi-tests.sh
new file mode 100755
index 00000000..ab5fb85a
--- /dev/null
+++ b/VPhoneDaemon/Tests/run-homeview-distance-abi-tests.sh
@@ -0,0 +1,9 @@
+#!/bin/zsh
+set -euo pipefail
+tests="${0:a:h}"
+repo="${tests:h:h}"
+out="$repo/.build/homeview-distance-abi-tests"
+mkdir -p "$out"
+xcrun --sdk macosx clang -fobjc-arc -fblocks -Wall -Wextra -Werror \
+ "$tests/HomeViewDistanceABITests.m" -framework Foundation -o "$out/HomeViewDistanceABITests"
+"$out/HomeViewDistanceABITests"
diff --git a/VPhoneDaemon/Tests/run-logic-tests.sh b/VPhoneDaemon/Tests/run-logic-tests.sh
index bd1cbe10..4a3f98db 100755
--- a/VPhoneDaemon/Tests/run-logic-tests.sh
+++ b/VPhoneDaemon/Tests/run-logic-tests.sh
@@ -19,6 +19,7 @@ trap '/bin/rm -rf "$temporary"' EXIT
"$daemon/Daemon/GuestProcessSpawnPolicy.swift" \
"$daemon/Daemon/Bootstrap/GuestBootstrapPlatform.swift" \
"$daemon/Daemon/GuestSetupAssistantState.swift" \
+ "$daemon/Daemon/GuestHomeViewDistancePolicy.swift" \
"$daemon/Tests/LogicTests.swift" \
-o "$temporary/logic-tests"
diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/DyldSharedCache/Patchers/DyldSharedCacheHomeViewEnvironmentPatcher.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/DyldSharedCache/Patchers/DyldSharedCacheHomeViewEnvironmentPatcher.swift
new file mode 100644
index 00000000..758782e3
--- /dev/null
+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/DyldSharedCache/Patchers/DyldSharedCacheHomeViewEnvironmentPatcher.swift
@@ -0,0 +1,190 @@
+import Foundation
+import VPhonePatchKit
+
+/// Enables HomeView's entitled environment service on retail installations.
+/// The entitlement rejection remains intact; only the following internal-install
+/// branch is removed. Discovery is scoped to BreadBoardServices and verifies
+/// its entitlement and distinct rejection messages before admitting one site.
+public enum DyldSharedCacheHomeViewEnvironmentPatcher {
+ public struct Failure: Error, CustomStringConvertible { public let description: String }
+ public struct Site: Sendable {
+ public let address: UInt64
+ public let before: Data
+ public let replacement: Data
+ public let alreadyPatched: Bool
+ }
+
+ static let servicesImage = "/System/Library/PrivateFrameworks/BreadBoardServices.framework/BreadBoardServices"
+ static let foundationImage = "/System/Library/PrivateFrameworks/BreadBoardFoundation.framework/BreadBoardFoundation"
+ static let getterSymbol = "_$s20BreadBoardFoundation8PlatformO17isInternalInstallSbvgZ"
+ static let entitlement = "com.apple.private.breadboard.environment.read-write"
+ static let notEntitled = "Client is not entitled {client.pid=%d}"
+ static let unavailable = "Service is unavailable"
+
+ public static func discover(in chunks: DyldSharedCacheChunkSet) throws -> Site {
+ let resolver = try DyldSharedCacheSymbolResolver(chunks: chunks)
+ let getter = try resolver.address(of: getterSymbol, inImage: foundationImage)
+ let headerAddress = try resolver.headerAddress(ofImage: servicesImage)
+ let prefix = try chunks.readAtVMA(headerAddress, length: 32)
+ guard prefix.loadLE(UInt32.self, at: 0) == 0xFEED_FACF else {
+ throw Failure(description: "BreadBoardServices has no Mach-O header")
+ }
+ let commandBytes = Int(prefix.loadLE(UInt32.self, at: 20))
+ guard commandBytes <= 1_048_576 else {
+ throw Failure(description: "BreadBoardServices load commands are oversized")
+ }
+ let header = try chunks.readAtVMA(headerAddress, length: 32 + commandBytes)
+ let sections = MachOParser.parseSections(from: header)
+ guard let text = sections["__TEXT,__text"], let strings = sections["__TEXT,__cstring"],
+ let logs = sections["__TEXT,__oslogstring"],
+ text.size > 0, text.size <= 16_777_216, text.size % 4 == 0,
+ strings.size > 0, strings.size <= 16_777_216,
+ logs.size > 0, logs.size <= 16_777_216
+ else { throw Failure(description: "BreadBoardServices discovery sections missing or invalid") }
+ func literal(_ value: String, in section: MachOSectionInfo) throws -> UInt64 {
+ let literals = try chunks.readAtVMA(section.address, length: Int(section.size))
+ let needle = Data((value + "\0").utf8)
+ guard let range = literals.range(of: needle),
+ literals.range(of: needle, in: range.upperBound ..< literals.endIndex) == nil
+ else { throw Failure(description: "BreadBoardServices literal missing or ambiguous: \(value)") }
+ return section.address + UInt64(range.lowerBound)
+ }
+ let decoder = ARM64Disassembler()
+ let instructions = decoder.disassemble(
+ try chunks.readAtVMA(text.address, length: Int(text.size)), at: text.address,
+ )
+ let sites = findSites(
+ in: instructions, getter: getter,
+ entitlement: try literal(entitlement, in: strings),
+ notEntitled: try literal(notEntitled, in: logs),
+ unavailable: try literal(unavailable, in: logs),
+ readStub: { address in
+ decoder.disassemble(try chunks.readAtVMA(address, length: 12), at: address)
+ },
+ )
+ return try uniqueSite(sites)
+ }
+
+ public static func patch(in chunks: DyldSharedCacheChunkSet, dryRun: Bool = false) throws -> Site {
+ let site = try discover(in: chunks)
+ guard !dryRun else { return site }
+ let span = DyldSharedCacheWriteSpan(vma: site.address, length: 4)
+ let preview = try DyldSharedCacheCodeSignature.reattest(
+ in: chunks, modifiedSpans: [span], dryRun: true, log: nil,
+ )
+ guard preview.isFullyAttested, preview.pagesAttested == 1 else {
+ throw Failure(description: "cannot attest HomeView environment service page")
+ }
+ if !site.alreadyPatched { try chunks.write(at: site.address, site.replacement) }
+ let result = try DyldSharedCacheCodeSignature.reattest(in: chunks, modifiedSpans: [span])
+ guard result.isFullyAttested, result.pagesAttested == 1,
+ try chunks.readAtVMA(site.address, length: 4) == site.replacement
+ else { throw Failure(description: "HomeView environment service page verification failed") }
+ return site
+ }
+
+ static func uniqueSite(_ sites: [Site]) throws -> Site {
+ guard sites.count == 1, let site = sites.first else {
+ throw Failure(description: "HomeView environment service gate missing or ambiguous")
+ }
+ return site
+ }
+
+ /// Direct import stub used by this cache: ADRP X16; ADD X16,X16,#low; BR X16.
+ /// Reject pointer loads, authenticated dispatch, and changed scratch registers.
+ static func stubDestination(_ code: [ARM64Instruction]) -> UInt64? {
+ guard code.count == 3, code[0].detail?.operands.first?.reg == .x(16),
+ code[1].detail?.operands.first?.reg == .x(16), code[2].mnemonic == "br",
+ let branch = code[2].detail?.operands, branch.count == 1,
+ branch[0].type == .register, branch[0].reg == .x(16)
+ else { return nil }
+ return materializedAddress(code[0], code[1])
+ }
+
+ static func materializedAddress(_ page: ARM64Instruction, _ add: ARM64Instruction) -> UInt64? {
+ guard page.isDecoded, add.isDecoded, page.address + 4 == add.address,
+ page.mnemonic == "adrp", add.mnemonic == "add",
+ let p = page.detail?.operands, p.count == 2,
+ p[0].type == .register, p[1].type == .immediate, p[1].imm > 0,
+ let a = add.detail?.operands, a.count == 3,
+ a[0].type == .register, a[1].type == .register, a[1].reg == p[0].reg,
+ a[2].type == .immediate, a[2].imm >= 0, a[2].imm < 4096,
+ a[2].shift.amount == 0
+ else { return nil }
+ return UInt64(p[1].imm) + UInt64(a[2].imm)
+ }
+
+ static func immediate(_ instruction: ARM64Instruction, _ index: Int) -> UInt64? {
+ guard let operands = instruction.detail?.operands, operands.indices.contains(index),
+ operands[index].type == .immediate, operands[index].imm > 0
+ else { return nil }
+ return UInt64(operands[index].imm)
+ }
+
+ static func literalReferences(_ instructions: ArraySlice<ARM64Instruction>, to address: UInt64) -> [UInt64] {
+ guard instructions.count >= 2 else { return [] }
+ return zip(instructions, instructions.dropFirst()).compactMap { page, add in
+ materializedAddress(page, add) == address ? add.address : nil
+ }
+ }
+
+ static func findSites(
+ in code: [ARM64Instruction], getter: UInt64, entitlement: UInt64,
+ notEntitled: UInt64, unavailable: UInt64,
+ readStub: (UInt64) throws -> [ARM64Instruction],
+ ) -> [Site] {
+ guard code.count >= 4 else { return [] }
+ var sites: [Site] = []
+ for index in 1 ..< code.count - 1 {
+ let call = code[index], denial = code[index - 1], gate = code[index + 1]
+ guard call.mnemonic == "bl", let target = immediate(call, 0),
+ denial.mnemonic == "cbz", let denialOperands = denial.detail?.operands,
+ denialOperands.count == 2, denialOperands[0].type == .register,
+ let resultRegister = (0 ..< 31).first(where: { denialOperands[0].reg == .w($0) }),
+ let denied = immediate(denial, 1), denied > gate.address,
+ (gate.mnemonic == "tbz" || gate.mnemonic == "nop"),
+ denial.address + 4 == call.address, call.address + 4 == gate.address
+ else { continue }
+ if gate.mnemonic == "tbz" {
+ guard let operands = gate.detail?.operands, operands.count == 3,
+ operands[0].type == .register, operands[0].reg == .w(0),
+ operands[1].type == .immediate, operands[1].imm == 0
+ else { continue }
+ }
+ guard target == getter || (try? readStub(target)).flatMap(stubDestination) == getter else { continue }
+ let lead = code[max(0, index - 24) ..< index - 1]
+ guard !literalReferences(lead, to: entitlement).isEmpty else { continue }
+ // The entitlement Boolean must survive the intervening release calls.
+ let savedResult = lead.indices.contains { k in
+ guard k > lead.startIndex, code[k].mnemonic == "mov",
+ let operands = code[k].detail?.operands, operands.count == 2
+ else { return false }
+ return operands[0].type == .register && operands[0].reg == .x(resultRegister)
+ && operands[1].type == .register && operands[1].reg == .x(0)
+ && code[k - 1].mnemonic == "bl"
+ && index - k <= 8
+ }
+ guard savedResult else { continue }
+ // Both named failure paths must be in the same bounded function tail.
+ // Stop at its first return, so another function cannot supply anchors.
+ let tail = code.dropFirst(index + 2).prefix(512).prefix { !$0.isReturn }
+ let entitlementLogs = literalReferences(tail, to: notEntitled)
+ let availabilityLogs = literalReferences(tail, to: unavailable)
+ guard entitlementLogs.count == 1, availabilityLogs.count == 1,
+ let entitledLog = entitlementLogs.first, let unavailableLog = availabilityLogs.first,
+ denied <= entitledLog, entitledLog < unavailableLog,
+ tail.contains(where: { $0.address == denied })
+ else { continue }
+ if gate.mnemonic == "tbz" {
+ guard let destination = immediate(gate, 2), destination > entitledLog,
+ destination <= unavailableLog, tail.contains(where: { $0.address == destination })
+ else { continue }
+ }
+ sites.append(Site(
+ address: gate.address, before: Data(gate.bytes), replacement: ARM64.nop,
+ alreadyPatched: gate.mnemonic == "nop",
+ ))
+ }
+ return sites
+ }
+}
diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestPatchResolution.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestPatchResolution.swift
index 8dc6eb88..0cd3d8eb 100644
--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestPatchResolution.swift
+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestPatchResolution.swift
@@ -82,7 +82,7 @@ public enum FirmwareGuestPatchResolution {
.subtracting([FirmwareGuestSystemPatchSet.tvTPRO, FirmwareGuestSystemPatchSet.tvLegacySetup,
FirmwareGuestSystemPatchSet.tvSetupDisplayLookup, FirmwareGuestSystemPatchSet.tvSetupFocus,
FirmwareGuestSystemPatchSet.tvLocalActivation])
- .union([FirmwareGuestSystemPatchSet.homeViewProfileLookup, FirmwareGuestSystemPatchSet.homeViewDisplayLookups, FirmwareGuestSystemPatchSet.homeViewSetupBypass])
+ .union([FirmwareGuestSystemPatchSet.homeViewProfileLookup, FirmwareGuestSystemPatchSet.homeViewDisplayLookups, FirmwareGuestSystemPatchSet.homeViewSetupBypass, FirmwareGuestSystemPatchSet.homeViewEnvironmentService])
public static func unvalidatedHomeViewGuestPatches(enabled: Set<String>) -> [String] {
enabled.intersection(guestTargetIdentifiers).subtracting(homeViewSupportedGuestPatches).sorted()
diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestSystemPatchSet.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestSystemPatchSet.swift
index 8fc8d144..44bc0103 100644
--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestSystemPatchSet.swift
+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestSystemPatchSet.swift
@@ -54,6 +54,7 @@ public enum FirmwareGuestSystemPatchSet {
public static let homeViewProfileLookup = "system-userprofilesd-exp-keybag_lookup"
public static let homeViewDisplayLookups = "system-breadboard-exp-mach_lookup"
public static let homeViewSetupBypass = "system-homeview-exp-setup_bypass"
+ public static let homeViewEnvironmentService = "dyld-exp-homeview_environment_service"
public static let homeViewSetupPath = "/usr/share/vphone/HomeViewSetup.plist"
public static let tvTPRO = "system-dyld-exp-tv_tpro"
public static let tvSetupDisplayLookup = "system-setupbackground-exp-pineboard_lookup"
@@ -95,6 +96,13 @@ public enum FirmwareGuestSystemPatchSet {
name: "Guest System",
summary: "Shared-cache policy gates, patched system daemons and the vphone guest payload",
patches: [
+ VPhonePatchDeclaration(
+ identifier: homeViewEnvironmentService,
+ title: "HomeView distance simulation service",
+ summary: "Enables BreadBoard's native environment simulation service on retail HomeView 27.2 by opening only its internal-install gate. Preserves the service's client entitlement check and global build identity. Experimental, off by default; native near/far runtime validation is pending.",
+ target: .dyldSharedCache,
+ applicability: VPhonePatchApplicability(iOSBase: .release(major: 27, minor: 2)),
+ ),
VPhonePatchDeclaration(
identifier: homePodCryptexClass,
title: "HomePod Cryptex product class",
diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swift
index 082be773..86d43291 100644
--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swift
+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swift
@@ -68,6 +68,7 @@ public enum FirmwarePatchSetCatalog {
Set(FirmwareKernelFridaPatchSet.manifest.patches.map(\.identifier))
.union(hypervisorConcealmentPatches)
.union(experimentalIdentityPatches)
+ .union([FirmwareGuestSystemPatchSet.homeViewEnvironmentService])
.union([FirmwareGuestSystemPatchSet.homeViewProfileLookup, FirmwareGuestSystemPatchSet.homeViewDisplayLookups, FirmwareGuestSystemPatchSet.homeViewSetupBypass, FirmwareGuestSystemPatchSet.otaUserland, FirmwareGuestSystemPatchSet.homePodTopCap, FirmwareGuestSystemPatchSet.homePodSetupBypass, FirmwareGuestSystemPatchSet.homePodAudioProduct, FirmwareGuestSystemPatchSet.homePodWelcome, FirmwareGuestSystemPatchSet.homePodSiriSpeech, FirmwareGuestSystemPatchSet.homePodOTAUserland, FirmwareGuestSystemPatchSet.homePodSoundGlow, FirmwareGuestSystemPatchSet.homePodCryptexStaging, FirmwareGuestSystemPatchSet.homePodCryptexClass, FirmwareGuestSystemPatchSet.homePodAdHocInstall])
.union([FirmwareKernelCustomFirmwarePatchSet.tvTPROPagers, misTrustAuthPatch, FirmwareGuestSystemPatchSet.settingsRootRows, FirmwareGuestSystemPatchSet.settingsSoftwareUpdate, FirmwareGuestSystemPatchSet.tvTPRO, FirmwareGuestSystemPatchSet.tvOTAUserland, FirmwareGuestSystemPatchSet.tvSetupDisplayLookup, FirmwareGuestSystemPatchSet.tvSetupFocus, FirmwareGuestSystemPatchSet.tvLocalActivation, FirmwareGuestSystemPatchSet.tvLegacySetup])
.union([FirmwareGuestSystemPatchSet.prebootFoldableProductId])
@@ -227,7 +228,7 @@ public enum FirmwarePatchSetCatalog {
freshly restored 26.4 guest does not survive. The HomePod-only top cap is off.
""",
patchSets: bundledReferences,
- selection: .block([FirmwareGuestSystemPatchSet.homeViewProfileLookup, FirmwareGuestSystemPatchSet.homeViewDisplayLookups, FirmwareGuestSystemPatchSet.homeViewSetupBypass, FirmwareGuestSystemPatchSet.tvLegacySetup, FirmwareGuestSystemPatchSet.tvSetupDisplayLookup, FirmwareGuestSystemPatchSet.tvSetupFocus, FirmwareGuestSystemPatchSet.tvLocalActivation, FirmwareGuestSystemPatchSet.homePodTopCap, FirmwareGuestSystemPatchSet.homePodSetupBypass, FirmwareGuestSystemPatchSet.homePodAudioProduct, FirmwareGuestSystemPatchSet.homePodWelcome, FirmwareGuestSystemPatchSet.homePodSiriSpeech, FirmwareGuestSystemPatchSet.homePodOTAUserland, FirmwareGuestSystemPatchSet.homePodSoundGlow, FirmwareGuestSystemPatchSet.homePodCryptexStaging, FirmwareGuestSystemPatchSet.homePodCryptexClass, FirmwareGuestSystemPatchSet.homePodAdHocInstall]),
+ selection: .block([FirmwareGuestSystemPatchSet.homeViewEnvironmentService, FirmwareGuestSystemPatchSet.homeViewProfileLookup, FirmwareGuestSystemPatchSet.homeViewDisplayLookups, FirmwareGuestSystemPatchSet.homeViewSetupBypass, FirmwareGuestSystemPatchSet.tvLegacySetup, FirmwareGuestSystemPatchSet.tvSetupDisplayLookup, FirmwareGuestSystemPatchSet.tvSetupFocus, FirmwareGuestSystemPatchSet.tvLocalActivation, FirmwareGuestSystemPatchSet.homePodTopCap, FirmwareGuestSystemPatchSet.homePodSetupBypass, FirmwareGuestSystemPatchSet.homePodAudioProduct, FirmwareGuestSystemPatchSet.homePodWelcome, FirmwareGuestSystemPatchSet.homePodSiriSpeech, FirmwareGuestSystemPatchSet.homePodOTAUserland, FirmwareGuestSystemPatchSet.homePodSoundGlow, FirmwareGuestSystemPatchSet.homePodCryptexStaging, FirmwareGuestSystemPatchSet.homePodCryptexClass, FirmwareGuestSystemPatchSet.homePodAdHocInstall]),
)
/// The iOS payloads, hooks and shared-cache patches an Apple TV guest has no
diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/DyldSharedCache/DyldSharedCacheHomeViewEnvironmentTests.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/DyldSharedCache/DyldSharedCacheHomeViewEnvironmentTests.swift
new file mode 100644
index 00000000..5c232b08
--- /dev/null
+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/DyldSharedCache/DyldSharedCacheHomeViewEnvironmentTests.swift
@@ -0,0 +1,145 @@
+import Darwin
+@testable import FirmwarePatcher
+import Foundation
+import Testing
+import VPhonePatchKit
+
+@Suite("HomeView environment service cache")
+struct DyldSharedCacheHomeViewEnvironmentTests {
+ private let decoder = ARM64Disassembler()
+ private let base: UInt64 = 0x1_8010_0000
+ private let getter: UInt64 = 0x1_8010_4000
+ private let entitlement: UInt64 = 0x1_8020_0100
+ private let notEntitled: UInt64 = 0x1_8020_0200
+ private let unavailable: UInt64 = 0x1_8020_0300
+
+ private func code(at address: UInt64? = nil, patched: Bool = false, bit: UInt32 = 0) throws -> [ARM64Instruction] {
+ let start = address ?? base
+ var bytes = Data()
+ func append(_ instruction: Data?) throws { bytes += try #require(instruction) }
+ func reference(_ target: UInt64, register: UInt32 = 3) throws {
+ try append(ARM64Encoder.encodeADRP(rd: register, pc: start + UInt64(bytes.count), target: target))
+ try append(ARM64Encoder.encodeAddImm12(rd: register, rn: register, imm12: UInt32(target & 4095)))
+ }
+ try reference(entitlement, register: 8)
+ try append(ARM64Encoder.encodeBL(from: Int(start + 8), to: Int(getter + 4)))
+ bytes += ARM64Encoder.encodeMovX(rd: 19, rm: 0)
+ try append(ARM64Encoder.encodeBL(from: Int(start + 16), to: Int(getter + 8)))
+ try append(ARM64Encoder.encodeBL(from: Int(start + 20), to: Int(getter + 8)))
+ try append(ARM64Encoder.encodeCompareBranch(nonzero: false, register: 19, from: Int(start + 24), to: Int(start + 44)))
+ try append(ARM64Encoder.encodeBL(from: Int(start + 28), to: Int(getter)))
+ if patched { bytes += ARM64.nop }
+ else { try append(ARM64Encoder.encodeTestBitBranch(nonzero: false, register: 0, bit: bit, from: Int(start + 32), to: Int(start + 52))) }
+ bytes += ARM64.nop
+ try append(ARM64Encoder.encodeB(from: Int(start + 40), to: Int(start + 60)))
+ try reference(notEntitled)
+ try reference(unavailable)
+ bytes += ARM64.ret
+ return decoder.disassemble(bytes, at: start)
+ }
+
+ private func sites(_ code: [ARM64Instruction], getter: UInt64? = nil, unavailable: UInt64? = nil) -> [DyldSharedCacheHomeViewEnvironmentPatcher.Site] {
+ DyldSharedCacheHomeViewEnvironmentPatcher.findSites(
+ in: code, getter: getter ?? self.getter, entitlement: entitlement,
+ notEntitled: notEntitled, unavailable: unavailable ?? self.unavailable,
+ readStub: { _ in [] },
+ )
+ }
+
+ @Test func `only availability gate is selected and patched form is rediscovered`() throws {
+ let original = try code()
+ let site = try DyldSharedCacheHomeViewEnvironmentPatcher.uniqueSite(sites(original))
+ #expect(site.address == base + 32)
+ #expect(!site.alreadyPatched)
+ #expect(site.before == Data(original[8].bytes))
+ #expect(site.replacement == ARM64.nop)
+ let repeatSite = try DyldSharedCacheHomeViewEnvironmentPatcher.uniqueSite(sites(code(patched: true)))
+ #expect(repeatSite.address == site.address)
+ #expect(repeatSite.alreadyPatched)
+ }
+
+ @Test func `wrong getter bit or rejection anchor is refused`() throws {
+ #expect(sites(try code(), getter: getter + 12).isEmpty)
+ #expect(sites(try code(bit: 1)).isEmpty)
+ #expect(sites(try code(), unavailable: unavailable + 4).isEmpty)
+ var damaged = try code()
+ damaged[6] = try #require(decoder.disassembleOne(ARM64.nop, at: base + 24))
+ #expect(sites(damaged).isEmpty)
+ damaged = try code()
+ damaged[3] = try #require(decoder.disassembleOne(ARM64Encoder.encodeMovX(rd: 20, rm: 0), at: base + 12))
+ #expect(sites(damaged).isEmpty)
+ }
+
+ @Test func `multiple matching services are refused`() throws {
+ let matches = sites(try code() + code(at: base + 0x100))
+ #expect(matches.count == 2)
+ #expect(throws: DyldSharedCacheHomeViewEnvironmentPatcher.Failure.self) {
+ _ = try DyldSharedCacheHomeViewEnvironmentPatcher.uniqueSite(matches)
+ }
+ }
+
+ @Test func `import stub must branch through the materialized x16 address`() throws {
+ let stub: UInt64 = base + 0x200
+ var pair = decoder.disassemble(
+ try #require(ARM64Encoder.encodeADRP(rd: 16, pc: stub, target: getter))
+ + #require(ARM64Encoder.encodeAddImm12(rd: 16, rn: 16, imm12: UInt32(getter & 4095))),
+ at: stub,
+ )
+ func branch(_ register: ARM64Register) -> ARM64Instruction {
+ // Semantic fixture for the indirect branch; real-cache coverage below
+ // exercises Capstone decoding of the actual imported stub's BR word.
+ ARM64Instruction(
+ isDecoded: true, address: stub + 8, size: 4, bytes: [], mnemonic: "br", operandString: "",
+ detail: .init(conditionCode: nil, updatesFlags: false, postIndex: false, operands: [
+ .init(type: .register, reg: register, imm: 0, mem: .init(base: .invalid, index: .invalid, disp: 0)),
+ ]), isJump: true, isCall: false, isReturn: false,
+ )
+ }
+ pair.append(branch(.x(16)))
+ #expect(DyldSharedCacheHomeViewEnvironmentPatcher.stubDestination(pair) == getter)
+ pair[2] = branch(.x(17))
+ #expect(DyldSharedCacheHomeViewEnvironmentPatcher.stubDestination(pair) == nil)
+ }
+
+ @Test(.enabled(if: ProcessInfo.processInfo.environment["VPHONE_HOMEVIEW_CACHE_FIXTURE"] != nil))
+ func `HomeView 27_2 fixture dry run repeat and undo`() throws {
+ let source = try URL(fileURLWithPath: #require(ProcessInfo.processInfo.environment["VPHONE_HOMEVIEW_CACHE_FIXTURE"]))
+ let fm = FileManager.default
+ var root = URL(fileURLWithPath: #filePath)
+ for _ in 0 ..< 5 { root.deleteLastPathComponent() }
+ let work = root.appendingPathComponent(".build/tmp/homeview-cache-test-\(UUID().uuidString)")
+ try fm.createDirectory(at: work, withIntermediateDirectories: true)
+ defer { try? fm.removeItem(at: work) }
+ for url in try fm.contentsOfDirectory(at: source, includingPropertiesForKeys: nil)
+ where url.lastPathComponent.hasPrefix("dyld_shared_cache_arm64e")
+ {
+ guard clonefile(url.path, work.appendingPathComponent(url.lastPathComponent).path, 0) == 0 else {
+ throw CocoaError(.fileWriteUnknown)
+ }
+ }
+ let chunks = try DyldSharedCacheChunkSet(directory: work, captureUndo: true)
+ let dry = try DyldSharedCacheHomeViewEnvironmentPatcher.patch(in: chunks, dryRun: true)
+ // Reviewed 24V514 fixture, not a discovery offset in the patcher.
+ #expect(dry.address == 0x251269fec)
+ #expect(!dry.alreadyPatched)
+ #expect(chunks.takeUndoLog()?.records.isEmpty == true)
+ let (file, _) = try chunks.fileRange(of: .init(vma: dry.address, length: 4))
+ let original = try Data(contentsOf: file)
+ let entitlementGate = try chunks.readAtVMA(dry.address - 8, length: 4)
+ #expect(decoder.disassembleOne(entitlementGate)?.mnemonic == "cbz")
+ _ = try DyldSharedCacheHomeViewEnvironmentPatcher.patch(in: chunks)
+ let patched = try Data(contentsOf: file)
+ #expect(patched != original)
+ #expect(try chunks.readAtVMA(dry.address - 8, length: 4) == entitlementGate)
+ var undo = try #require(chunks.takeUndoLog())
+ #expect(undo.records.count == 1)
+ undo.stamp(patchID: "dyld-exp-homeview_environment_service")
+ let repeated = try DyldSharedCacheHomeViewEnvironmentPatcher.patch(in: chunks)
+ #expect(repeated.alreadyPatched)
+ #expect(chunks.takeUndoLog()?.records.isEmpty == true)
+ #expect(try Data(contentsOf: file) == patched)
+ let spans = try undo.restore(patchIDs: undo.patchIDs, in: work)
+ #expect(try DyldSharedCacheCodeSignature.reattest(in: chunks, modifiedSpans: spans).isFullyAttested)
+ #expect(try Data(contentsOf: file) == original)
+ }
+}
diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwareGuestPatchResolutionTests.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwareGuestPatchResolutionTests.swift
index 6041e09e..ea68b2cf 100644
--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwareGuestPatchResolutionTests.swift
+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwareGuestPatchResolutionTests.swift
@@ -12,6 +12,25 @@ import VPhonePatchKit
@Suite("Guest patch resolution")
struct FirmwareGuestPatchResolutionTests {
+ @Test func `HomeView environment simulation is explicit and limited to its reviewed base`() throws {
+ let id = FirmwareGuestSystemPatchSet.homeViewEnvironmentService
+ for preset in FirmwarePatchSetCatalog.builtInPresets {
+ let plan = try VPhonePatchPlan.resolve(
+ preset: preset, patchSets: FirmwarePatchSetCatalog.bundled,
+ iOSBase: VPhoneVersion("27.2"), cloudOS: VPhoneVersion("26.4")
+ )
+ #expect(!plan.isEnabled(id))
+ }
+ #expect(FirmwareGuestPatchResolution.unvalidatedHomeViewGuestPatches(enabled: [id]).isEmpty)
+ #expect(FirmwareGuestPatchResolution.unvalidatedTVGuestPatches(enabled: [id], arm64eUserland: true) == [id])
+ #expect(FirmwareGuestPatchResolution.unvalidatedHomePodGuestPatches(enabled: [id]) == [id])
+ let declaration = try #require(FirmwarePatchSetCatalog.allDeclarations.first { $0.identifier == id })
+ #expect(declaration.applicability.matches(iOSBase: VPhoneVersion("27.2"), cloudOS: VPhoneVersion("26.4")))
+ for version in ["26.4", "27.0", "27.1", "27.3"] {
+ #expect(!declaration.applicability.matches(iOSBase: VPhoneVersion(version), cloudOS: VPhoneVersion("26.4")))
+ }
+ }
+
@Test func `HomeView keeps native setup and its bypass is an explicit reversible selection`() throws {
let plan = try VPhonePatchPlan.resolve(
preset: FirmwarePatchSetCatalog.homeViewPreset, patchSets: FirmwarePatchSetCatalog.bundled,
diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwarePatchSetCatalogTests.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwarePatchSetCatalogTests.swift
index 225fc511..81806ae2 100644
--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwarePatchSetCatalogTests.swift
+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwarePatchSetCatalogTests.swift
@@ -258,6 +258,7 @@ struct FirmwarePatchSetCatalogTests {
&& $0.identifier != FirmwareGuestSystemPatchSet.homeViewProfileLookup
&& $0.identifier != FirmwareGuestSystemPatchSet.homeViewDisplayLookups
&& $0.identifier != FirmwareGuestSystemPatchSet.homeViewSetupBypass
+ && $0.identifier != FirmwareGuestSystemPatchSet.homeViewEnvironmentService
&& $0.identifier != FirmwareGuestSystemPatchSet.homePodTopCap
&& $0.identifier != FirmwareGuestSystemPatchSet.homePodSetupBypass
&& $0.identifier != FirmwareGuestSystemPatchSet.homePodWelcome
diff --git a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareDyldSharedCacheVerbsCommand.swift b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareDyldSharedCacheVerbsCommand.swift
index f61b3c90..693c27db 100644
--- a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareDyldSharedCacheVerbsCommand.swift
+++ b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareDyldSharedCacheVerbsCommand.swift
@@ -74,6 +74,7 @@ enum VPhoneCustomFirmwareDyldSharedCacheVerbs {
/// Registered into `vphone-cli cfw` by `VPhoneCustomFirmwareCommand`.
static var all: [ParsableCommand.Type] {
[
+ VPhoneCustomFirmwarePatchHomeViewEnvironmentCommand.self,
VPhoneCustomFirmwarePatchSettingsSoftwareUpdateCommand.self,
VPhoneCustomFirmwarePatchArm64eX1BootstrapCacheCommand.self,
VPhoneCustomFirmwarePatchArm64eX1CacheCommand.self,
diff --git a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swift b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swift
index d942f556..e8c641ab 100644
--- a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swift
+++ b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swift
@@ -232,6 +232,9 @@ struct VPhoneCustomFirmwareInstaller {
if effectiveEnabled.contains(FirmwareGuestSystemPatchSet.homeViewSetupBypass), device.family != .homeView {
throw ValidationError("The HomeView setup bypass is supported only for a HomeView guest.")
}
+ if effectiveEnabled.contains(FirmwareGuestSystemPatchSet.homeViewEnvironmentService), device.family != .homeView {
+ throw ValidationError("The HomeView environment simulation service requires a HomeView guest.")
+ }
if effectiveEnabled.contains(FirmwareGuestSystemPatchSet.homePodTopCap), device.family != .homePod {
throw ValidationError("The HomePod top-cap patch is supported only for a HomePod guest.")
}
@@ -1711,6 +1714,7 @@ struct VPhoneCustomFirmwareInstaller {
dyld.append(("dyld-boot-iomfb_swapend", "patch-iomfb-swapend", [dsc, "--target-size", "0x560"]))
}
dyld += [
+ (FirmwareGuestSystemPatchSet.homeViewEnvironmentService, "patch-homeview-environment", [dsc]),
(FirmwareGuestSystemPatchSet.settingsSoftwareUpdate, "patch-settings-software-update", [dsc]),
(FirmwarePatchSetCatalog.misTrustAuthPatch, "patch-mis-trust-auth", [dsc]),
("dyld-exp-hv_vmm", "patch-hv-vmm-dsc", [dsc]),
@@ -2292,7 +2296,8 @@ struct VPhoneCustomFirmwareInstaller {
failures: inout [String],
) throws {
func enabled(_ id: String) -> Bool {
- plan?.isEnabled(id) ?? !FirmwareGuestSystemPatchSet.settingsRowPatches.contains(id)
+ if id == FirmwareGuestSystemPatchSet.homeViewEnvironmentService { return plan?.isEnabled(id) == true }
+ return plan?.isEnabled(id) ?? !FirmwareGuestSystemPatchSet.settingsRowPatches.contains(id)
}
func requireBootstrap(_ id: String, error: any Error) throws {
if id == FirmwareGuestSystemPatchSet.arm64eX1CacheBootstrap {
diff --git a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwarePatchHomeViewEnvironmentCommand.swift b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwarePatchHomeViewEnvironmentCommand.swift
new file mode 100644
index 00000000..260ad575
--- /dev/null
+++ b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwarePatchHomeViewEnvironmentCommand.swift
@@ -0,0 +1,24 @@
+import ArgumentParser
+import FirmwarePatcher
+import Foundation
+
+struct VPhoneCustomFirmwarePatchHomeViewEnvironmentCommand: ParsableCommand {
+ static let configuration = CommandConfiguration(
+ commandName: "patch-homeview-environment",
+ abstract: "Enable HomeView's entitled environment simulation service and re-attest its cache page",
+ )
+ @Argument(transform: URL.init(fileURLWithPath:)) var chunksDirectory: URL
+ @Flag var dryRun = false
+ @OptionGroup var undo: DyldSharedCacheUndoOptions
+
+ func run() throws {
+ let chunks = try DyldSharedCacheChunkSet(directory: chunksDirectory, captureUndo: undo.captures)
+ let site = try DyldSharedCacheHomeViewEnvironmentPatcher.patch(in: chunks, dryRun: dryRun)
+ let before = site.before.map { String(format: "%02x", $0) }.joined()
+ let after = site.replacement.map { String(format: "%02x", $0) }.joined()
+ print("HomeView environment service: 0x\(String(site.address, radix: 16)) \(before) -> \(after), already patched: \(site.alreadyPatched)")
+ if let captured = chunks.takeUndoLog() {
+ try undo.persist(captured, dryRun: dryRun)
+ }
+ }
+}
diff --git a/VPhoneExecutable/VPhoneVirtualization/Resources/Localizable.xcstrings b/VPhoneExecutable/VPhoneVirtualization/Resources/Localizable.xcstrings
index e8eea10c..4c3579ac 100644
--- a/VPhoneExecutable/VPhoneVirtualization/Resources/Localizable.xcstrings
+++ b/VPhoneExecutable/VPhoneVirtualization/Resources/Localizable.xcstrings
@@ -1,6 +1,42 @@
{
"sourceLanguage" : "en",
"strings" : {
+ "Apply" : {
+
+ },
+ "Automatic" : {
+
+ },
+ "Current" : {
+
+ },
+ "Far" : {
+
+ },
+ "Near" : {
+
+ },
+ "Near and Far simulate HomeView’s distance-driven detail levels without changing other environment overrides." : {
+
+ },
+ "Reset Environment Simulation" : {
+
+ },
+ "Resets all native environment simulation overrides, including persona, display style, detail, and backlight." : {
+
+ },
+ "Simulated Distance" : {
+
+ },
+ "Standard Detail" : {
+
+ },
+ "This guest environment does not support distance simulation." : {
+
+ },
+ "Viewing Distance" : {
+
+ },
"Angle" : {
},
diff --git a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/experimental.plist b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/experimental.plist
index 95fe8bad..b9b145f1 100644
--- a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/experimental.plist
+++ b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/experimental.plist
@@ -96,6 +96,7 @@
<string>system-userprofilesd-exp-keybag_lookup</string>
<string>system-breadboard-exp-mach_lookup</string>
<string>system-homeview-exp-setup_bypass</string>
+ <string>dyld-exp-homeview_environment_service</string>
<string>system-homepod-exp-top_cap</string>
<string>system-setupbackground-exp-pineboard_lookup</string>
<string>system-setup-exp-deferred_focus</string>
diff --git a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/homepod-mini.plist b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/homepod-mini.plist
index a83e1fca..273f397a 100644
--- a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/homepod-mini.plist
+++ b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/homepod-mini.plist
@@ -76,6 +76,7 @@
<string>system-userprofilesd-exp-keybag_lookup</string>
<string>system-breadboard-exp-mach_lookup</string>
<string>system-homeview-exp-setup_bypass</string>
+ <string>dyld-exp-homeview_environment_service</string>
<string>system-exp-ota_userland</string>
<string>kernel-exp-frida_thread_set_state_entitlement_flag</string>
<string>kernel-exp-frida_tpro_off</string>
diff --git a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/homeview.plist b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/homeview.plist
index 93d9fedd..96fdb6ee 100644
--- a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/homeview.plist
+++ b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/homeview.plist
@@ -128,6 +128,7 @@
<string>system-homepod-exp-top_cap</string>
<string>system-homepod-exp-welcome</string>
<string>system-homeview-exp-setup_bypass</string>
+ <string>dyld-exp-homeview_environment_service</string>
<string>system-installcoordination_proxy-cfw-persona_lookup</string>
<string>system-installd-exp-homepod_adhoc</string>
<string>system-jetsamproperties-cfw-disable_allowed</string>
diff --git a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/standard.plist b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/standard.plist
index 697fffe0..2fa7e105 100644
--- a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/standard.plist
+++ b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/standard.plist
@@ -76,6 +76,7 @@
<string>system-userprofilesd-exp-keybag_lookup</string>
<string>system-breadboard-exp-mach_lookup</string>
<string>system-homeview-exp-setup_bypass</string>
+ <string>dyld-exp-homeview_environment_service</string>
<string>system-homepod-exp-top_cap</string>
<string>system-homepod-exp-setup_bypass</string>
<string>system-homepod-exp-welcome</string>
diff --git a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos-4k.plist b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos-4k.plist
index dac49df7..532e965b 100644
--- a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos-4k.plist
+++ b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos-4k.plist
@@ -76,6 +76,7 @@
<string>system-userprofilesd-exp-keybag_lookup</string>
<string>system-breadboard-exp-mach_lookup</string>
<string>system-homeview-exp-setup_bypass</string>
+ <string>dyld-exp-homeview_environment_service</string>
<string>system-tv-exp-legacy_setup</string>
<string>system-homepod-exp-top_cap</string>
<string>system-homepod-exp-setup_bypass</string>
diff --git a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos.plist b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos.plist
index c1b1cd15..c0edd12f 100644
--- a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos.plist
+++ b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos.plist
@@ -76,6 +76,7 @@
<string>system-userprofilesd-exp-keybag_lookup</string>
<string>system-breadboard-exp-mach_lookup</string>
<string>system-homeview-exp-setup_bypass</string>
+ <string>dyld-exp-homeview_environment_service</string>
<string>system-homepod-exp-top_cap</string>
<string>system-homepod-exp-setup_bypass</string>
<string>system-homepod-exp-welcome</string>
diff --git a/VPhoneExecutable/VPhoneVirtualization/Tests/HomeViewDistanceTests.swift b/VPhoneExecutable/VPhoneVirtualization/Tests/HomeViewDistanceTests.swift
new file mode 100644
index 00000000..1d293c4e
--- /dev/null
+++ b/VPhoneExecutable/VPhoneVirtualization/Tests/HomeViewDistanceTests.swift
@@ -0,0 +1,109 @@
+import Foundation
+
+enum VPhoneLocalization { static let bundle = Bundle.main }
+
+@main
+@MainActor
+struct HomeViewDistanceTests {
+ static func main() async {
+ let store = Store()
+ let model = VPhoneHomeViewDistanceModel { method, params in
+ store.calls.append((method, params["mode"] as? String))
+ if method == "homeview.distance.set", params["mode"] as? String == "automatic" {
+ precondition(params["reset_environment"] as? Bool == true)
+ }
+ if store.unavailable { return ["available": false, "reason": "Native service unavailable"] }
+ if method == "homeview.distance.set", !store.rejectsWrite { store.state = params["mode"] as! String }
+ return ["available": true, "mode": store.state, "applied": !store.rejectsWrite,
+ "level_of_detail": store.state == "near" ? 2 : store.state == "far" ? 0 : 1,
+ "override_active": store.state != "automatic"]
+ }
+ await model.refresh()
+ precondition(model.isAvailable && model.mode == .automatic && model.error == nil)
+ for mode in VPhoneHomeViewDistanceModel.Mode.allCases {
+ model.selection = mode
+ await model.apply()
+ precondition(model.mode == mode && model.error == nil && !model.isBusy)
+ precondition(store.calls.last?.0 == "homeview.distance.set" && store.calls.last?.1 == mode.rawValue)
+ }
+ store.rejectsWrite = true
+ model.selection = .near
+ await model.apply()
+ precondition(model.error != nil && model.mode == nil && !model.isAvailable)
+ let refusedCount = store.calls.count
+ await model.apply()
+ precondition(store.calls.count == refusedCount)
+ store.rejectsWrite = false
+ await model.refresh()
+ precondition(model.mode == .far && model.isAvailable && model.error == nil)
+ store.unavailable = true
+ await model.refresh()
+ precondition(!model.isAvailable && model.mode == nil && model.error == "Native service unavailable")
+ let count = store.calls.count
+ await model.apply()
+ precondition(store.calls.count == count)
+
+ let malformed = VPhoneHomeViewDistanceModel { _, _ in ["available": true, "mode": "unknown"] }
+ await malformed.refresh()
+ precondition(!malformed.isAvailable && malformed.mode == nil && malformed.error != nil)
+ let unowned = VPhoneHomeViewDistanceModel { _, _ in
+ ["available": true, "mode": "unknown", "level_of_detail": 2, "override_active": NSNull()]
+ }
+ await unowned.refresh()
+ precondition(unowned.isAvailable && unowned.mode == nil && unowned.error == nil)
+ let stale = VPhoneHomeViewDistanceModel { _, _ in
+ ["available": true, "mode": "near", "level_of_detail": 0, "override_active": true]
+ }
+ await stale.refresh()
+ precondition(!stale.isAvailable && stale.mode == nil && stale.error != nil)
+ let failed = VPhoneHomeViewDistanceModel { _, _ in throw NSError(domain: "test", code: 1) }
+ await failed.refresh()
+ precondition(!failed.isBusy && !failed.isAvailable && failed.error != nil)
+ // Transport failure does not prove a write was rejected. The simulated
+ // guest commits Near, then loses its reply; Refresh must discover Near.
+ let uncertainStore = Store()
+ let uncertain = VPhoneHomeViewDistanceModel { method, params in
+ if method == "homeview.distance.set" {
+ uncertainStore.state = params["mode"] as! String
+ throw NSError(domain: "reply lost", code: 1)
+ }
+ return ["available": true, "mode": uncertainStore.state, "applied": false,
+ "level_of_detail": uncertainStore.state == "near" ? 2 : 1,
+ "override_active": uncertainStore.state != "automatic"]
+ }
+ await uncertain.refresh()
+ uncertain.selection = .near
+ await uncertain.apply()
+ precondition(uncertain.mode == nil && !uncertain.isAvailable && uncertain.error != nil)
+ await uncertain.refresh()
+ precondition(uncertain.mode == .near && uncertain.isAvailable && uncertain.error == nil)
+ let delayedStore = Store()
+ let delayed = VPhoneHomeViewDistanceModel { _, _ in
+ if delayedStore.calls.isEmpty {
+ delayedStore.calls.append(("held read", nil))
+ return await withCheckedContinuation { delayedStore.pending = $0 }
+ }
+ return ["available": true, "mode": "far", "level_of_detail": 0, "override_active": true]
+ }
+ let oldRead = Task { await delayed.refresh() }
+ while delayedStore.pending == nil { await Task.yield() }
+ delayed.disconnected()
+ precondition(delayed.mode == nil && !delayed.isAvailable && !delayed.isBusy)
+ await delayed.refresh()
+ precondition(delayed.mode == .far)
+ delayedStore.pending?.resume(returning:
+ ["available": true, "mode": "near", "level_of_detail": 2, "override_active": true])
+ await oldRead.value
+ precondition(delayed.mode == .far && delayed.isAvailable && !delayed.isBusy)
+ print("HomeView distance controls: readback, all modes, refusal, unavailable service and invalid replies passed")
+ }
+ @MainActor
+ final class Store {
+ var calls: [(String, String?)] = []
+ var state = "automatic"
+ var rejectsWrite = false
+ var unavailable = false
+ var pending: CheckedContinuation<[String: Any], Never>?
+ }
+
+}
diff --git a/VPhoneExecutable/VPhoneVirtualization/Tests/run-homeview-distance-tests.sh b/VPhoneExecutable/VPhoneVirtualization/Tests/run-homeview-distance-tests.sh
new file mode 100755
index 00000000..d70eaf3d
--- /dev/null
+++ b/VPhoneExecutable/VPhoneVirtualization/Tests/run-homeview-distance-tests.sh
@@ -0,0 +1,12 @@
+#!/bin/zsh
+set -euo pipefail
+
+tests="${0:a:h}"
+repo="${tests:h:h:h}"
+out="$repo/.build/homeview-distance-tests"
+mkdir -p "$out"
+xcrun --sdk macosx swiftc -swift-version 6 -strict-concurrency=complete -parse-as-library \
+ -module-cache-path "$out/module-cache" \
+ "$tests:h/UI/UserInterface/Panels/Controls/VPhoneHomeViewDistanceModel.swift" \
+ "$tests/HomeViewDistanceTests.swift" -o "$out/HomeViewDistanceTests"
+"$out/HomeViewDistanceTests" "$@"
diff --git a/VPhoneExecutable/VPhoneVirtualization/UI/GuestCommunication/VPhoneGuestControl.swift b/VPhoneExecutable/VPhoneVirtualization/UI/GuestCommunication/VPhoneGuestControl.swift
index ebbc0016..30394bc0 100644
--- a/VPhoneExecutable/VPhoneVirtualization/UI/GuestCommunication/VPhoneGuestControl.swift
+++ b/VPhoneExecutable/VPhoneVirtualization/UI/GuestCommunication/VPhoneGuestControl.swift
@@ -59,6 +59,7 @@ final class VPhoneGuestControl {
@ObservationIgnored private var orderedLocation: Task<Void, Never>?
@ObservationIgnored private var locationGeneration: UInt64 = 0
@ObservationIgnored var isHomePodGuest = false
+ @ObservationIgnored var isHomeViewGuest = false
private(set) var isConnected = false
private(set) var guestCapabilities: [String] = []
private(set) var guestIPAddress: String?
diff --git a/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Panels/Controls/VPhoneControlsView.swift b/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Panels/Controls/VPhoneControlsView.swift
index 8f4b1146..737b3487 100644
--- a/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Panels/Controls/VPhoneControlsView.swift
+++ b/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Panels/Controls/VPhoneControlsView.swift
@@ -7,6 +7,9 @@ struct VPhoneControlsView: View {
VStack(spacing: 0) {
Form {
displaySection
+ if model.control.isHomeViewGuest {
+ VPhoneHomeViewDistanceSection(control: model.control)
+ }
audioSection
if model.control.isHomePodGuest {
VPhoneHomePodDebugSection(control: model.control)
diff --git a/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Panels/Controls/VPhoneHomeViewDistanceModel.swift b/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Panels/Controls/VPhoneHomeViewDistanceModel.swift
new file mode 100644
index 00000000..190a93f2
--- /dev/null
+++ b/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Panels/Controls/VPhoneHomeViewDistanceModel.swift
@@ -0,0 +1,124 @@
+import Foundation
+import Observation
+
+/// The guest owns the distance-to-detail mapping. No arbitrary metre values
+/// are invented for a sensor whose calibration is specific to the hardware.
+@MainActor
+@Observable
+final class VPhoneHomeViewDistanceModel {
+ enum Mode: String, CaseIterable, Identifiable {
+ case automatic, near, standard, far
+ var id: String { rawValue }
+ var title: String {
+ switch self {
+ case .automatic: String(localized: "Automatic", bundle: VPhoneLocalization.bundle)
+ case .near: String(localized: "Near", bundle: VPhoneLocalization.bundle)
+ case .standard: String(localized: "Standard Detail", bundle: VPhoneLocalization.bundle)
+ case .far: String(localized: "Far", bundle: VPhoneLocalization.bundle)
+ }
+ }
+ }
+
+ typealias Request = @MainActor (String, [String: Any]) async throws -> [String: Any]
+ @ObservationIgnored private let request: Request
+ @ObservationIgnored private var connectionGeneration: UInt64 = 0
+ var selection = Mode.standard
+ private(set) var mode: Mode?
+ private(set) var isAvailable = false
+ private(set) var isBusy = false
+ private(set) var error: String?
+
+ init(request: @escaping Request) { self.request = request }
+
+ func disconnected() {
+ connectionGeneration &+= 1
+ mode = nil
+ isAvailable = false
+ isBusy = false
+ error = nil
+ }
+
+ func refresh() async {
+ guard !isBusy else { return }
+ let generation = connectionGeneration
+ isBusy = true
+ defer { if generation == connectionGeneration { isBusy = false } }
+ do {
+ let value = try await request("homeview.distance.get", [:])
+ guard generation == connectionGeneration else { return }
+ try receive(value)
+ if let mode { selection = mode }
+ error = nil
+ } catch {
+ guard generation == connectionGeneration else { return }
+ isAvailable = false
+ mode = nil
+ self.error = String(describing: error)
+ }
+ }
+
+ func apply() async {
+ guard isAvailable, !isBusy else { return }
+ let generation = connectionGeneration
+ let wanted = selection
+ isBusy = true
+ defer { if generation == connectionGeneration { isBusy = false } }
+ do {
+ var params: [String: Any] = ["mode": wanted.rawValue]
+ if wanted == .automatic { params["reset_environment"] = true }
+ let value = try await request("homeview.distance.set", params)
+ guard generation == connectionGeneration else { return }
+ guard value["applied"] as? Bool == true else {
+ throw DistanceError("The guest did not confirm the distance change.")
+ }
+ try receive(value)
+ guard mode == wanted else { throw DistanceError("The guest reported a different distance override.") }
+ error = nil
+ } catch {
+ guard generation == connectionGeneration else { return }
+ // A lost reply can follow a committed native write. Refresh before
+ // presenting a current mode or allowing another mutation.
+ mode = nil
+ isAvailable = false
+ self.error = String(describing: error)
+ }
+ }
+
+ private func receive(_ value: [String: Any]) throws {
+ guard value["available"] as? Bool == true else {
+ throw DistanceError(value["reason"] as? String ?? "Distance simulation is unavailable in this guest environment.")
+ }
+ guard let detail = value["level_of_detail"] as? Int, (0 ... 2).contains(detail),
+ let raw = value["mode"] as? String else {
+ throw DistanceError("The guest returned an invalid distance state.")
+ }
+ // Effective detail alone does not identify the active override. A newly
+ // connected daemon must not label another client's state Automatic.
+ if raw == "unknown", value["override_active"] is NSNull {
+ mode = nil
+ isAvailable = true
+ return
+ }
+ guard let received = Mode(rawValue: raw),
+ let overridden = value["override_active"] as? Bool,
+ overridden == (received != .automatic) else {
+ throw DistanceError("The guest returned inconsistent distance state.")
+ }
+ let expected: Int? = switch received {
+ case .automatic: nil
+ case .near: 2
+ case .standard: 1
+ case .far: 0
+ }
+ if let expected, detail != expected {
+ throw DistanceError("The guest has not applied the requested distance detail level.")
+ }
+ mode = received
+ isAvailable = true
+ }
+
+ private struct DistanceError: Error, CustomStringConvertible {
+ let description: String
+ init(_ description: String) { self.description = description }
+ }
+}
diff --git a/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Panels/Controls/VPhoneHomeViewDistanceSection.swift b/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Panels/Controls/VPhoneHomeViewDistanceSection.swift
new file mode 100644
index 00000000..6c8634fa
--- /dev/null
+++ b/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Panels/Controls/VPhoneHomeViewDistanceSection.swift
@@ -0,0 +1,63 @@
+import SwiftUI
+
+struct VPhoneHomeViewDistanceSection: View {
+ let control: VPhoneGuestControl
+ @State private var model: VPhoneHomeViewDistanceModel
+
+ init(control: VPhoneGuestControl) {
+ self.control = control
+ _model = State(initialValue: VPhoneHomeViewDistanceModel { method, params in
+ try await control.call(method, params: params)
+ })
+ }
+
+ var body: some View {
+ Section("Viewing Distance") {
+ LabeledContent("Current") {
+ Text(model.mode?.title ?? String(localized: "Unknown", bundle: VPhoneLocalization.bundle))
+ }
+ Picker("Simulated Distance", selection: $model.selection) {
+ ForEach(VPhoneHomeViewDistanceModel.Mode.allCases) { mode in
+ Text(mode.title).tag(mode)
+ }
+ }
+ .disabled(!model.isAvailable || model.isBusy)
+ HStack {
+ Button { Task { await model.apply() } } label: {
+ if model.selection == .automatic {
+ Text("Reset Environment Simulation")
+ } else {
+ Text("Apply")
+ }
+ }
+ .disabled(!model.isAvailable || model.isBusy)
+ Spacer()
+ Button("Refresh") { Task { await model.refresh() } }
+ .disabled(model.isBusy)
+ }
+ Text(model.selection == .automatic
+ ? String(localized: "Resets all native environment simulation overrides, including persona, display style, detail, and backlight.", bundle: VPhoneLocalization.bundle)
+ : String(localized: "Near and Far simulate HomeView’s distance-driven detail levels without changing other environment overrides.", bundle: VPhoneLocalization.bundle))
+ .font(.caption)
+ .foregroundStyle(.secondary)
+ if let error = model.error {
+ Text(verbatim: error)
+ .font(.callout)
+ .foregroundStyle(.red)
+ .textSelection(.enabled)
+ }
+ if control.isConnected && !control.guestCapabilities.contains("homeview_distance") {
+ Text("This guest environment does not support distance simulation.")
+ .font(.caption)
+ .foregroundStyle(.secondary)
+ }
+ }
+ .task(id: control.isConnected && control.guestCapabilities.contains("homeview_distance")) {
+ if control.isConnected && control.guestCapabilities.contains("homeview_distance") {
+ await model.refresh()
+ } else {
+ model.disconnected()
+ }
+ }
+ }
+}
diff --git a/VPhoneExecutable/VPhoneVirtualization/UI/VPhoneBootCommand+VirtualMachine.swift b/VPhoneExecutable/VPhoneVirtualization/UI/VPhoneBootCommand+VirtualMachine.swift
index 1f56a89e..a477a223 100644
--- a/VPhoneExecutable/VPhoneVirtualization/UI/VPhoneBootCommand+VirtualMachine.swift
+++ b/VPhoneExecutable/VPhoneVirtualization/UI/VPhoneBootCommand+VirtualMachine.swift
@@ -35,6 +35,7 @@ extension VPhoneBootCommand {
usesTVOS: manifest.guestDevice.usesTVOS,
isTVGuest: manifest.guestDevice.family == .appleTV,
isHomePodGuest: manifest.guestDevice.family == .homePod,
+ isHomeViewGuest: manifest.guestDevice.family == .homeView,
isWatchGuest: manifest.guestDevice.family == .watch,
isFoldableGuest: manifest.guestDevice == .iPhone19_4
)
diff --git a/VPhoneExecutable/VPhoneVirtualization/UI/VPhoneVirtualMachineAppDelegate.swift b/VPhoneExecutable/VPhoneVirtualization/UI/VPhoneVirtualMachineAppDelegate.swift
index 61eeac69..5b97b2b0 100644
--- a/VPhoneExecutable/VPhoneVirtualization/UI/VPhoneVirtualMachineAppDelegate.swift
+++ b/VPhoneExecutable/VPhoneVirtualization/UI/VPhoneVirtualMachineAppDelegate.swift
@@ -114,6 +114,7 @@ class VPhoneVirtualMachineAppDelegate: NSObject, NSApplicationDelegate {
let control = VPhoneGuestControl()
control.isHomePodGuest = options.isHomePodGuest
+ control.isHomeViewGuest = options.isHomeViewGuest
self.control = control
if !command.dfu {
control.unlocksAtStartup = vm.unlocksAtStartup
diff --git a/VPhoneExecutable/VPhoneVirtualization/UI/VirtualMachine/VPhoneVirtualMachine.swift b/VPhoneExecutable/VPhoneVirtualization/UI/VirtualMachine/VPhoneVirtualMachine.swift
index d1849309..964b4c8b 100644
--- a/VPhoneExecutable/VPhoneVirtualization/UI/VirtualMachine/VPhoneVirtualMachine.swift
+++ b/VPhoneExecutable/VPhoneVirtualization/UI/VirtualMachine/VPhoneVirtualMachine.swift
@@ -50,6 +50,7 @@ class VPhoneVirtualMachine: NSObject, VZVirtualMachineDelegate {
var usesTVOS = false
var isTVGuest = false
var isHomePodGuest = false
+ var isHomeViewGuest = false
/// The guest runs watchOS: its side button is a key of its own (consumer
/// Help), apart from the crown (Home) and the power key.
var isWatchGuest = false