Run a virtual iPhone on an Apple Silicon Mac.
Swift
Let SpringBoard carry libmisfix so a signed app launches on 27.0
Lakr7a413718d573
diff --git a/Research/0_binary_patch_comparison.md b/Research/0_binary_patch_comparison.mdindex 2669480b..94e6e191 100644--- a/Research/0_binary_patch_comparison.md+++ b/Research/0_binary_patch_comparison.md@@ -473,6 +473,7 @@ do NOT execute these).| 17 | `mov x0,#0 ; retab` over the two instructions after the prologue `pacibsp` of `checkTrustAndAuthorization` — **all bases** | DSC `libmis.dylib` | **Free-certificate app-launch fix (online authorization).** A guest restored by this project is hacktivated — `mobileactivationd.should_hactivate` forces `-[DeviceType should_hactivate]` to YES so the VM never contacts Apple's activation service. The consequence nobody had traced until now is that it also never receives an **activation record**: `/private/var/root/Library/Lockdown/` holds `data_ark.plist`, `escrow_records` and `pair_records` but no `activation_records/`, while `data_ark.plist` still says `-ActivationStateAcknowledged = true`. With no activation record there is no device identity to sign an authorization request with, so the chain is `online-auth-agent: Failed to copy activation record.` (MobileActivation `-1`) → `Couldn't get device identity … "online-auth-agent is not allowed to use this API."` (MobileActivation `-25`) → `Could not perform authorization attempt`, and `Preferences: MDMProvisioningProfileTrust failed to verify provisioning profile <uuid> with error 4`. libmis's `checkTrustAndAuthorization` therefore returns `0xE8008026`, which SpringBoard reports as `validation failed because of missing trust and/or authorization (0xe8008026)` followed by `signature state: Profile Needs Network Validation, reason: Requires Network Validation`, and FrontBoard refuses the launch (`FBSOpenApplicationErrorDomain 3`, *"…or its profile has not been explicitly trusted by the user"*). **This only bites free personal-team profiles**; a paid team's profile is not marked as needing online authorization, and Settings' "Verify App" can never clear the free one because the network step it offers is exactly the step that cannot complete. **Not to be confused with `0xE8008012`** (`misagent: attempt to install invalid profile`), which is the ordinary "this UDID is not in the profile's `ProvisionedDevices`" refusal and is correct behaviour — installation itself needs no patch. Fix: short-circuit `checkTrustAndAuthorization` to return success. Its prologue seeds the failure code into the register it returns (`mov w21,#0x8026 ; movk w21,#0xe800,lsl #16`) and the body subtracts its way to the neighbouring MIS errors (`sub w21,w21,#0x2` → `0xE8008024`, `#0x25` → `0xE8008001`, `#0x9` → `0xE800801D`) or replaces it with 0; both call sites inside `MISValidateSignatureAndCopyInfoWithProgress` treat 0 as success. The two instructions after the prologue's `pacibsp` (`sub sp,sp,#0xa0` and `stp x28,x27,[sp,#0x40]`) become `mov x0,#0 ; retab`. **`pacibsp` is deliberately kept** rather than overwritten: it signs LR with SP as the modifier and `retab` authenticates against the SP it sees, so returning before the frame is built leaves the pair balanced — a plain `ret` over `pacibsp` would also work but makes the larger claim. The optional out-parameter is safe to leave unwritten: one caller passes NULL for it outright (`mov x5,#0`), the other pre-zeroes the slot (`str xzr,[sp,#0x68]`) and skips the merge while it is still NULL (`cbz x8`). Fully dynamic, and the function is **static — it carries no symbol**, so neither the cache's `.symbols` table nor `ipsw symaddr` can name it: it is anchored instead on the log string that names it outright, `"cdHash (%p) or matchedProfileIDs (%p) NULL in checkTrustAndAuthorization"` (one of four `checkTrustAndAuthorization` / `checking trust and authorization` literals, all four of which xref inside this one function), whose containing image is confirmed to be `/usr/lib/libmis.dylib` via `findMachOHeaderBefore` + `readInstallName`; the ADRP+ADD pair that materialises the literal is matched on Capstone operand semantics, the nearest preceding `pacibsp` gives the function start, and that prologue is then **required** to seed `0xE8008026` within 48 instructions before anything is written — two independent routes that must agree, in the manner of `CustomFirmwareMobileActivation.locateIMP`. Replacement bytes are `ARM64.movX0_0` + `ARM64.retab`, both existing keystone-checked constants (no new encoder, no keystone trip). Modified 16 KiB page re-attested. **Install gate: none, but OFF in `standard` since 2026-09-30** — the guest is hacktivated on every base, so the failure exists on every base; the declaration (`dyld-exp-mis_trust_auth`, in `com.vphone.patchset.guest.system`, renamed from `dyld-cfw-` when it left `standard`) carries no `applicability` and is not `bootEssential`. See "The MIS online-authorization patch leaves `standard`" at the end of this document for why it is now opt-in and what replaced it. Self-gating: a cache whose libmis lacks the naming literal reports absent and exits 0, an already-patched cache is a no-op (the byte comparison is against this patch's own output), and a cache with the literal but **neither** the seeding prologue **nor this patch's own `pacibsp ; mov x0, #0 ; retab`** is an **error** rather than a guess. **The second half of that sentence is a fix, made 2026-09-30 for issue #532, and it matters:** `locateSite` originally *required* the seed, and the seed is not guaranteed to outlive the write. On the 26.6.2 cache the compiler puts it at `functionVMA + 0x4C` (`checkTrustAndAuthorization @ 0x1BC6AE364`, seed at `0x1BC6AE3B0`), well clear of the two words at `+4`, so the byte comparison saw its own output and a second `cfw install` was already a no-op. On the 27.0 guest in the report the seed *was* the two words this patch overwrites (`checkTrustAndAuthorization @ 0x22406F814`), the first run destroyed it, and every later run died with `Patch site not found: … does not seed 0xE8008026 — MIS has been rewritten`, taking the whole install down after `dsc_maxslide` and before everything that follows. `DyldSharedCacheMISTrustAuthPatcher.isShortCircuited` now recognises the patch's own three words off the Capstone decode (`pacibsp`, `mov` with decoded destination `x0` and decoded immediate 0, `retab`) — the same "recognise your own output" fix `DyldSharedCacheXPCLWCRPatcher.findPatchedShape` and `DyldSharedCacheLockdownModePatcher.findErrorGate` got on 2026-09-22 — and `Site.shape` now carries `.seedsFailure(seedVMA:resultRegister:)` or `.alreadyShortCircuited` instead of a non-optional seed address. The genuine "MIS has been rewritten" hard failure is unchanged for a prologue that is neither shape. Covered by `DyldSharedCacheMISTrustAuthPatcherTests`, which builds a synthetic one-chunk cache (mapping table, `LC_ID_DYLIB` = `/usr/lib/libmis.dylib`, the naming literal, an ADRP+ADD that materialises it, and a real `CS_CodeDirectory` with SHA-256 page slots) in **both** seed layouts, because the 24A435 fixture can only exhibit the one that already worked. **VALIDATED on-device (2026-09-30, `iPhone17,3 26.6.2 (23G90)` + cloudOS 26.4 (23E5207q), JB, fresh `vm new` → `fw patch` → `restore` → `cfw install` into a new VM `05-mis-test`): an app signed with a free personal-team certificate now installs, verifies, launches, and Xcode `attach` to it succeeds.** The shape was first derived statically, from the `libmis.dylib` Xcode extracted from the live guest `01-use-me-rh` (`iPhone99,11 26.6.2 (23G90)` + cloudOS 26.4) into `iOS DeviceSupport/…/Symbols/usr/lib/`, where the two `#0x8026` immediates in the entire library are both inside this function; the patcher then reached exactly that site through the DSC chunk path, with both routes agreeing — `checkTrustAndAuthorization @ 0x1BC6AE364 in /usr/lib/libmis.dylib`, named by the literal referenced at `0x1BC6AE6B4`, prologue seeding `w21=0xE8008026` at `0x1BC6AE3B0`, written at `0x1BC6AE368` — and one 16 KiB page re-attested (slot 3260 of `dyld_shared_cache_arm64e.19`). The guest then booted normally through Setup Assistant to the home screen, so TXM accepts the re-attested page: the patch does not brick boot **on 26.6.2**. **It does on 27.0** (issue #532, `17,3_27.0_24A435` + cloudOS `26.4-23E5207q`): `TXM [Error]: Errno: selector: 45 | 78`, then `dyld[1]: Library not loaded: /usr/lib/libSystem.B.dylib … (no such file, no dyld cache)`, then `initproc failed to start`. Excluding only `mis_trust_auth` boots. That is not reproducible here — no 27.0 guest exists on this machine — so it is reported, not measured. **The direction taken is to stop editing the cache for this and express the same behaviour as a userspace hook instead**, and the disassembly says that is possible *without* rewriting any return value, because the whole branch is reachable from the caller's options dictionary. Read off libmis on `01-use-me-rh` (`iPhone99,11 26.6.2 (23G90)`, `MISValidateSignatureAndCopyInfoWithProgress @ 0x1BC6ABA4C`): the options are parsed into stack bytes by a `getBoolOption(dict, CFStringRef, char *out)` helper (`0x1BC674C60`) that **writes only when the key is present**, so every flag defaults to 0; `UnauthoritativeLaunch` or `AuthoritativeLaunch` then force `RespectUppTrustAndAuthorization = 1`, `HonorBlocklist = 1`, `ValidateSignatureOnly = 1`, `OnlineAuthorization = 0` as a *default set* that an explicit key still overrides; the explicit `RespectUppTrustAndAuthorization` read lands in `[sp+0x97]`, and `checkTrustAndAuthorization` is **only called at all** when the word derived from it (`[sp+0x2C]`) is nonzero — `ldr w8,[sp,#0x2c] ; cbz w8, <skip>` immediately before the call at `0x1BC6ACCE8`. Passing `RespectUppTrustAndAuthorization = kCFBooleanFalse` therefore skips the call, and `0xE8008026` cannot be produced on this path. Inside the callee the same flag arrives twice — `w4` gates the trust/authorization tests that re-seed `0xE8008026`, `w3` (`respectUpp && !predicate`) gates the second test whose failure yields `0xE8008025` — and `w2` is `HonorBlocklist`, forwarded to `appApprovalState`, whose states map to `0xE8008024` (2), `0xE800801D` (4) and `0xE8008001` (unknown). One route already exists in stock code: at `0x1BC6ABEE4` libmis asks MobileGestalt `IsVirtualDevice` and, when that is true **and** a second answer compares equal to `CFSTR("Internal")`, forces `RespectUppTrustAndAuthorization = 0` and `OnlineAuthorization = 0` outright — worth probing before any hook is written. **A hook must steer the call, not the return:** on the `0xE8008026` path the function logs `validation failed because of missing trust and/or authorization (0x%x)` and branches straight to the shared cleanup at `0x1BC6ABB48`, which releases and returns the status **without ever writing the `info` out-parameter** — the dictionary carrying `CdHash`, `Entitlements`, `SignerType`, `TeamID`, `SigningID`, `ProfileUUID` and the rest is built only on the success path at `0x1BC6ACF74`. Rewriting the return code to 0 would hand the caller success with an untouched `info`. **That hook now exists and ships** — `libmisfix.dylib` (`VPhoneGuestComponents/MISFix/MISFixSignature.c`) passes `RespectUppTrustAndAuthorization = kCFBooleanFalse` alongside `AllowAdHocSigning`, and `cfw install` injects it into `installd` and `misagent` — which is why this patch left `standard`. See `DyldSharedCacheMISTrustAuthPatcher` and the `cfw patch-mis-trust-auth` verb. | Y | Y | Y || 18 | `LC_LOAD_WEAK_DYLIB /usr/lib/libmisfix.dylib` injected into `installd`, which interposes `MISValidateSignatureAndCopyInfo` and `MISValidateSignatureAndCopyInfoWithProgress` — **all bases** | `/usr/libexec/installd` (+ new guest dylib `libmisfix.dylib`) | **Xcode-install fix: let the guest install an app it did not get from Apple.** `xcrun devicectl device install app` with a bundle that is ad-hoc signed, fake-signed or signed by anything other than an Apple leaf fails at `0xE8008014`. Measured, not inferred: a probe app linked against `libmis` on `05-mis-test` (`iPhone99,11 26.6.2 (23G90)` + cloudOS 26.4) walked the option matrix over a real `.app` and found that **the whole gate is this one call** — no options → `0xE8008014`; `AllowAdHocSigning = kCFBooleanTrue` → **`0x0` with a complete `info` dictionary** (`CdHash`, `SignerType`, `SigningID`, `TeamID`, `SignatureVersion`, `IsNativeForPlatform`), so the hook has to synthesise nothing and the `info`-out-parameter hazard that rules out rewriting row 17's return value does not arise here; and stripping the signature off entirely is *not* a way through — that stays `0xE800801C` even with the option. Everything behind the call already accepts uncertificated code on a CFW guest (kernel AMFI, `lsd`, SpringBoard), so nothing else needs patching. Two findings cost real time and are recorded so nobody repeats them: **the first argument is a path `CFStringRef`, not a `CFURLRef`** — passing a URL crashes the caller with `-[NSURL length]: unrecognized selector`; and **the option keys are plain `CFString`s, not exported symbols** — `kMISValidationOptionAllowAdHocSigning` is absent from the cache's export trie, so grepping for the symbol says "this option does not exist on 26.6.2", which is wrong. The keys `libmis` parses are `UnauthoritativeLaunch`, `AuthoritativeLaunch`, `ExpectedHash`, `AllowAdHocSigning`, `ValidateSignatureOnly`, `LogResourceErrors`, `UniversalFileOffset`, `UseSoftwareSigningCert`, `OnlineAuthorization`, `OnlineCheckType`, `RespectUppTrustAndAuthorization`, `HonorBlocklist`, `DetachedSignature`, `TrustCacheOnly`, `SkipProfileIdentifierPolicy`, `AllowLaunchWarnings`, `GetLocalLaunchWarningData`, `MainExecutablePath` and `OnlineAuthorizationOnAllMatchingProfiles`. Fix: `vpWidenedOptions` copies the caller's dictionary (or creates one when it is NULL), sets `AllowAdHocSigning = true` and `RespectUppTrustAndAuthorization = false`, and forwards. The second key is row 17's behaviour expressed from the caller's side — same outcome, **no cache page written and no re-attestation**, which is the whole point given that row 17 is what bricks a 27.0 boot (issue #532). Delivery is `dyld` interposition: `__DATA,__interpose` lands in `__AUTH_CONST` on arm64e (signed pointers) and dyld honours it anyway, including for the shared cache's own uses of the interposed symbol — measured on `05-mis-test`, a linked call with no options returns `0x0` hooked against `0xE8008014` unhooked. The dylib is built by `VPhoneGuestComponents/Makefile` against `libmis.tbd` and `libMobileGestalt`, with `-Wl,-not_for_dyld_shared_cache`, and installed as `/usr/lib/libmisfix.dylib`; injection goes through the existing `patchMachO(… injectedDylibPath:)` path, which captures entitlements before the edit and re-signs with `VPhoneSigner` afterwards — verified to preserve `com.apple.installd` and all 31 of installd's entitlements. **Not applied to SpringBoard**, which would close the free-personal-team *launch* gate the same way: SpringBoard's Mach-O has no free header space (`load-command padding at 0x548 is not empty; inserting would overwrite 56 bytes of the first section`), so that path needs the `SystemHook` `posix_spawn` route instead and row 17 remains the only fix for it today. Declared `system-installd-cfw-adhoc_signature` in `com.vphone.patchset.guest.system`; no `applicability`, not `bootEssential`, on in `standard`. **Partially validated (2026-09-30, `06-xcode-27`, `17,3 27.0 (24A435)` + cloudOS 26.4 (23E5207q)):** `cfw install` reports `[+] LC_LOAD_WEAK_DYLIB /usr/lib/libmisfix.dylib -> installd`, the guest boots through Setup Assistant to the home screen, and `installd` is running with the dylib loaded — so the injection breaks neither the daemon nor the boot. The end-to-end install has **not** been demonstrated on that guest: `devicectl` will not complete a session against it on this host (`device info details` hangs with nothing reaching `lockdownd`), which is a host-side CoreDevice problem unrelated to this patch. See `VPhoneGuestComponents/MISFix/MISFixSignature.c` and `Research/Guest/xcode_install_signature_gate.md`. | Y | Y | Y || 19 | The same `libmisfix.dylib` injected into `misagent`, where it interposes `MGCopyAnswer` / `MGCopyAnswerWithError` and answers `UniqueDeviceID` from a config file — **all bases** | `/usr/libexec/misagent` (+ `/usr/lib/libmisfix.plist`) | **Let a provisioning profile written for a device you already own install on the guest.** `0xE8008012` (`misagent: attempt to install invalid profile`) is the ordinary refusal when the profile's `ProvisionedDevices` does not list this device — correct behaviour, and distinct from row 17's `0xE8008026`. It blocks the case the user actually wants: reusing a paid team's already-registered device rather than burning a registration slot on every VM. The UDID being compared comes from `MGCopyAnswer(kMGUniqueDeviceID)`, and three cheaper routes were ruled out by measurement before any hook was written. (1) **AMFI cannot supply it**: `security.codesigning.config` is a 4-byte flags word (read back as `0x000000CC`), not a string, so `amfi_emulate_device_udid` is dead on this board. (2) **No daemon can write it**: `/private/var/root/Library/Lockdown/data_ark.plist` carries no `UniqueDeviceID` — lockdown derives it each boot. (3) **The real source is out of reach**: TXM composes `UniqueDeviceID` from the device tree's `/chosen/chip-id`, `/chosen/unique-chip-id` and `/product/udid-version` *before the kernel runs*, and `chip-id` is fixed at `0x0000FE01` while `unique-chip-id` is the ECID the SHSH blob is bound to — changing it means the VM no longer restores. So `MGCopyAnswer` is necessarily where this is done. Fix: interpose it in `misagent` only, return a `+1` copy (matching `MGCopyAnswer`'s contract) of the configured string for `UniqueDeviceID`, and fall through untouched for every other property. Configuration is `/var/db/vphone/misfix.plist`, falling back to `/usr/lib/libmisfix.plist`, cached against mtime and size so editing the file takes effect on the next query with no restart — that is the "put it in the plist and it applies" entry point. The shipped plist is **empty**: with no `UniqueDeviceID` key the interpose returns NULL and the patch is inert, so it changes nothing until someone deliberately pastes a real device's UDID in. `installMISFixDefaults` writes the fallback plist **only when it is absent**, so re-running `cfw install` never clobbers a configured value. **Accepted inconsistency, agreed with the user rather than hidden:** only `misagent`'s profile matching sees the borrowed UDID. Xcode, lockdown and `devicectl` keep reporting the VM's own (`0000FE01-…`), because those come from a different process that is not hooked. The two therefore disagree, which is exactly what makes the profile match while the device stays identifiable as itself. Declared `system-misagent-cfw-device_identity` in `com.vphone.patchset.guest.system`; no `applicability`, not `bootEssential`, on in `standard` but inert without a configured UDID. **Partially validated (2026-09-30, `06-xcode-27`):** `cfw install` reports `[+] LC_LOAD_WEAK_DYLIB /usr/lib/libmisfix.dylib -> misagent` and `misagent` runs normally on the booted guest. Installing a real paid-team IPA against a borrowed UDID is **not** yet demonstrated, for the same host-side `devicectl` reason as row 18. See `VPhoneGuestComponents/MISFix/MISFixDeviceIdentity.c`, `MISFixConfig.c` and `Research/Guest/xcode_install_signature_gate.md`. | Y | Y | Y |+| 20 | The same `libmisfix.dylib` linked into `SpringBoard` with `LC_LOAD_WEAK_DYLIB /mf` (a root alias for it), `LC_SOURCE_VERSION` dropped to make header room — **all bases** | `/System/Library/CoreServices/SpringBoard.app/SpringBoard` (+ `/mf`) | **Let an installed developer-signed app launch.** SpringBoard validates the app with MIS again before launch and, on a hacktivated guest, fails row 17's `checkTrustAndAuthorization` with `0xE8008026` ("Unable to Verify App"). The hook's `MISValidateSignatureAndCopyInfoWithProgress` detour passes `RespectUppTrustAndAuthorization = false`, so the check is never called — row 17's effect with no shared-cache write, which is what makes it usable on 27.0. SystemHook's spawn route never reaches SpringBoard (its xpcproxy carries no SystemHook), so the load command is the only route. Its header has 16 spare bytes, hence the 32-byte `/mf` command and the dropped `LC_SOURCE_VERSION`; no code or data bytes change, and it is re-signed ad hoc with its own entitlements. **Validated on test-27.0 (24A435), cold boot: AirBuild launches.** `MISFixInstallPolicy` stays out of it. Declared `system-springboard-cfw-launch_authorization`; no `applicability`, not `bootEssential`, on in `standard`. See "SpringBoard carries libmisfix too (2026-09-30)" below. | Y | Y | Y |### Swift port status — the eight DSC patchers (2026-09-23)@@ -1945,3 +1946,106 @@ IPA had been repacked on the host with `zip -r`, which writes AppleDouble`._*` files next to every resource; they break the sealed resource envelope.`COPYFILE_DISABLE=1 zip -X` after deleting them, and the same bundle installs.Worth remembering before reading `0xE8008017` as a guest-side gate.++## SpringBoard carries libmisfix too (2026-09-30)++Row 20. On test-27.0 (`iPhone17,3 27.0 (24A435)`) a paid team's IPA installed+through installd — `ValidatedByProfile = true` — and was then refused at+launch with "Unable to Verify App":++```+SpringBoard[36]: Trust evaluate failure: [leaf IssuerCommonName LeafMarkerOid SubjectCommonName]+SpringBoard[36]: validation failed because of missing trust and/or authorization (0xe8008026)+```++That is row 17's failure, raised by SpringBoard's own launch-time call into+libmis. libmisfix already declines that check — `RespectUppTrustAndAuthorization+= false` in `MISFixSignature.c` — but SpringBoard never carried it.++**Why the spawn hook missed it.** `SystemHook-vphone.c`'s `vpIsMISFixTarget`+has listed SpringBoard since the hook was written, and it was never reached.+Across several boots `vphone-systemhook.log` has an xpcproxy line for every+neighbouring label (`runningboardd` pid 35, `peopled` pid 37, `backboardd`,+`installd`, `misagent`) and none for `com.apple.SpringBoard`, whose process is+pid 36 with ppid 1; `vphone-launchdhook-spawn.log` lists xpcproxy children 32–35+and 37–44 and skips 36. So launchd starts SpringBoard directly, not through+xpcproxy. launchd imports only `posix_spawn` and `posix_spawnp`, both of which+the launchd hook interposes, but that hook logs only xpcproxy, bootstrap and+`/Applications` paths, so a direct spawn leaves no line either way. What is+certain is the other end: SystemHook's constructor writes a line for any+`.app/` executable, and SpringBoard's never appears, so SpringBoard does not+carry SystemHook. Its job is the one with `"_Conclave":+"com.apple.springboard.conclave"`; whether the insert is dropped for a+conclave process or never made is not settled, and does not need to be:+installd and misagent work because they do not depend on that route —+`cfw install` links libmisfix into them with `LC_LOAD_WEAK_DYLIB` — and+SpringBoard now gets the same.++**Why 26.4 looked fine.** test-26.4's `PatchPlan.plist` was written before+`dyld-exp-mis_trust_auth` left `standard`, so that guest's cache still carried+row 17 and SpringBoard's check was short-circuited there. 24A435 is outside+row 17's gate, so 27.0 was the first guest where the launch depended on the+hook.++**Fix.** `system-springboard-cfw-launch_authorization`: the same+`patchMachO` installd gets, applied to+`System/Library/CoreServices/SpringBoard.app/SpringBoard` and re-signed ad hoc+with its own entitlements and identifier.++**The header had no room, and that shaped the fix.** 24A435's SpringBoard has+`sizeofcmds` 1336 and its first section at file offset 1384: 16 spare bytes.+`inject-dylib` refused `/usr/lib/libmisfix.dylib` outright — `load-command+padding at 0x548 is not empty; inserting would overwrite 56 bytes of the first+section`. Even a 32-byte command only fits once `.strip` frees the 16-byte+`LC_CODE_SIGNATURE`, and then there is nothing left for the signer to put it+back. Two things make the 48 bytes:++- The command names a root alias, `/mf` → `/usr/lib/libmisfix.dylib`, the same+ device as launchd's `/vh`, so it is 32 bytes.+- `inject-dylib --reclaim-source-version` (`reclaimsSourceVersion`) drops+ `LC_SOURCE_VERSION` — a version stamp dyld does not read — and moves the+ commands after it up by 16 bytes. It runs only when the padding cannot hold+ the command plus the 16 bytes a stripped signature needs back, only under+ `.strip`, and only when the caller asks. Dylib ordinals do not move: no+ dylib command is removed and the new one is appended last.++Result on the real file: `sizeofcmds` 1352, ending exactly at 1384; every byte+before the signature blob other than the header and load commands is+unchanged; entitlements and identifier read back identical. The reclaim path+is covered by `reclaiming LC_SOURCE_VERSION makes room for the command and the+signature` in `CustomFirmwareMachOTests`, which leaves a compiled binary+exactly SpringBoard's kind of room, checks nothing past it is written, then+signs and runs it with the dylib loaded.++Inside SpringBoard,+libmisfix installs the MIS detours only: `MISFixInstallPolicy.c` now returns+at once outside installd, so MobileInstallation is never loaded into+SpringBoard or misagent to be swizzled. SpringBoard is not added to vphoned's+`udidHookedDaemons`: it never asks for the UDID, and stopping it restarts the+home screen.++**An existing VM does not get this by re-running `cfw install` alone.** The+installer asks the VM's `PatchPlan.plist`, and a plan written before this+declaration existed does not list it. `cfw install` also needs the VM's+prepared restore tree, which test-27.0 no longer had and the host had no disk+for, so the validation below applied the same two steps by hand: the+`inject-dylib --reclaim-source-version` and `sign --merge` verbs `cfw install`+runs, then the result written over the guest's SpringBoard through vphoned+(original kept as `SpringBoard.bak`), plus the `/mf` symlink.++**Validated on test-27.0 (2026-09-30).**++```+libmisfix[36]: loaded into /System/Library/CoreServices/SpringBoard.app/SpringBoard+libmisfix[36]: detour: MISValidateSignatureAndCopyInfoWithProgress at 0x22406d13c in libmis.dylib+libmisfix[36]: MISValidateSignature(…/AirBuild.app) -> 0x0+apps.launch plus.yellow.AirBuild -> {"frontmost_verified":true,"pid":375}+```++after a cold `vm stop` / `vm start`: SpringBoard reaches the home screen,+carries libmisfix from boot, no new `.ips` from SpringBoard, installd or+misagent, and AirBuild — a paid team's dev-signed IPA installed through+installd — opens to its own sign-in screen instead of "Unable to Verify App".+trustd still logs `Trust evaluate failure: [leaf IssuerCommonName LeafMarkerOid+SubjectCommonName]`; that evaluation is what `checkTrustAndAuthorization`+consumes, and it is no longer asked.diff --git a/VPhoneDaemon/Daemon/GuestAPI+DeviceIdentity.swift b/VPhoneDaemon/Daemon/GuestAPI+DeviceIdentity.swiftindex 7b67a648..828c4217 100644--- a/VPhoneDaemon/Daemon/GuestAPI+DeviceIdentity.swift+++ b/VPhoneDaemon/Daemon/GuestAPI+DeviceIdentity.swift@@ -46,7 +46,9 @@ extension GuestAPI {/// The daemons `cfw install` injects libmisfix into, and so the ones holding/// a UDID answer that a change has to invalidate. Keep in step with the/// `injectedDylibPath: "/usr/lib/libmisfix.dylib"` call sites in- /// `VPhoneCustomFirmwareInstaller`.+ /// `VPhoneCustomFirmwareInstaller`, bar SpringBoard: it carries the hook+ /// for the launch check alone, never asks for the UDID, and stopping it+ /// would take the home screen down with it.static let udidHookedDaemons = ["misagent", "installd"]static func executeDeviceIdentity(_ method: String, _ params: [String: Any]) throws -> [String: Any]? {diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/CustomFirmware/CustomFirmwareInjectDylib.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/CustomFirmware/CustomFirmwareInjectDylib.swiftindex 579e5002..a125332b 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/CustomFirmware/CustomFirmwareInjectDylib.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/CustomFirmware/CustomFirmwareInjectDylib.swift@@ -22,6 +22,13 @@// `ncmds` / `sizeofcmds` in the header change. What *does* move is the code// signature — `.strip` removes it and truncates the slice, which is why the// policy is part of this API rather than a separate pass.+//+// Some binaries leave almost no padding. SpringBoard on 24A435 has 16 bytes:+// even after `.strip` frees its 16-byte LC_CODE_SIGNATURE, a 32-byte command+// fits only by leaving the re-signer no room to put the signature back. For+// those, `reclaimsSourceVersion` drops LC_SOURCE_VERSION — a version stamp+// nothing reads at load time — and moves the commands after it up. Opt-in,+// because it is the one case where an existing command is removed.import Foundationimport VPhonePatchKit@@ -62,6 +69,10 @@ private extension Data {replaceSubrange(offset ..< offset + count, with: Data(repeating: 0, count: count))}+ func isZero(_ range: Range<Int>) -> Bool {+ !self[range].contains(where: { $0 != 0 })+ }+func holds(_ offset: Int, _ length: Int) -> Bool {offset >= 0 && length >= 0 && offset + length <= count}@@ -83,6 +94,8 @@ public struct CustomFirmwareDylibInjection: Sendable {public let isWeak: Bool/// True when LC_CODE_SIGNATURE and its blob were removed.public let removedCodeSignature: Bool+ /// True when LC_SOURCE_VERSION was dropped to make room.+ public let removedSourceVersion: Bool/// Slots re-hashed under `.keepAndReattest`. Empty under `.strip`.public let rehashedSlots: [CustomFirmwareSlotRehash]}@@ -114,6 +127,9 @@ public enum CustomFirmwareInjectDylib {static let lcSegment64: UInt32 = 0x19static let lcSymtab: UInt32 = 0x02static let lcCodeSignature: UInt32 = 0x1D+ static let lcSourceVersion: UInt32 = 0x2A+ /// sizeof(struct linkedit_data_command): what a re-signer adds back after `.strip`.+ static let codeSignatureCommandSize = 16static let lcLoadDylib: UInt32 = 0x0Cstatic let lcLoadWeakDylib: UInt32 = 0x8000_0018@@ -134,6 +150,7 @@ public enum CustomFirmwareInjectDylib {weak: Bool = true,policy: CodeSignaturePolicy = .strip,allowNonEmptyPadding: Bool = false,+ reclaimsSourceVersion: Bool = false,) throws -> [CustomFirmwareDylibInjection] {guard FileManager.default.fileExists(atPath: url.path) else {throw PatcherError.fileNotFound(url.path)@@ -145,6 +162,7 @@ public enum CustomFirmwareInjectDylib {weak: weak,policy: policy,allowNonEmptyPadding: allowNonEmptyPadding,+ reclaimsSourceVersion: reclaimsSourceVersion,)try data.write(to: url)return injections@@ -158,6 +176,7 @@ public enum CustomFirmwareInjectDylib {weak: Bool = true,policy: CodeSignaturePolicy = .strip,allowNonEmptyPadding: Bool = false,+ reclaimsSourceVersion: Bool = false,) throws -> [CustomFirmwareDylibInjection] {if data.startIndex != 0 {data = Data(data)@@ -169,6 +188,7 @@ public enum CustomFirmwareInjectDylib {weak: weak,policy: policy,allowNonEmptyPadding: allowNonEmptyPadding,+ reclaimsSourceVersion: reclaimsSourceVersion,)switch data.loadBEValue(UInt32.self, at: 0) {case fatMagic:@@ -196,6 +216,7 @@ public enum CustomFirmwareInjectDylib {let weak: Boollet policy: CodeSignaturePolicylet allowNonEmptyPadding: Bool+ let reclaimsSourceVersion: Bool}// MARK: Universal Binaries@@ -311,6 +332,27 @@ public enum CustomFirmwareInjectDylib {let pathBytes = Array(options.dylibPath.utf8)let paddedPathSize = (pathBytes.count & ~(pathPadding - 1)) + pathPaddinglet commandSize = dylibCommandSize + paddedPathSize++ // A stripped signature comes back when the binary is re-signed, and+ // its command needs 16 bytes after ours.+ var removedSourceVersion = false+ let needed = commandSize + (removedCodeSignature ? codeSignatureCommandSize : 0)+ let freeEnd = commandsOffset + sizeofcmds+ if options.reclaimsSourceVersion,+ let sourceVersion = layout.sourceVersion,+ !data.isZero(freeEnd ..< Swift.min(freeEnd + needed, data.count))+ {+ guard case .strip = options.policy else {+ throw PatcherError.invalidFormat("reclaiming LC_SOURCE_VERSION needs the .strip signature policy")+ }+ let tail = sourceVersion.commandOffset + sourceVersion.commandSize+ let moved = Data(data[tail ..< freeEnd])+ data.replaceSubrange(sourceVersion.commandOffset ..< sourceVersion.commandOffset + moved.count, with: moved)+ data.zeroBytes(at: freeEnd - sourceVersion.commandSize, count: sourceVersion.commandSize)+ ncmds -= 1+ sizeofcmds -= sourceVersion.commandSize+ removedSourceVersion = true+ }let commandOffset = commandsOffset + sizeofcmdsguard data.holds(commandOffset, commandSize), commandOffset + commandSize <= headerOffset + sliceSize else {@@ -370,6 +412,7 @@ public enum CustomFirmwareInjectDylib {loadCommandSize: commandSize,isWeak: options.weak,removedCodeSignature: removedCodeSignature,+ removedSourceVersion: removedSourceVersion,rehashedSlots: rehashed,)}@@ -387,6 +430,7 @@ public enum CustomFirmwareInjectDylib {struct SliceLayout {var codeSignature: CodeSignatureCommand?var codeSignatureIsLast = false+ var sourceVersion: (commandOffset: Int, commandSize: Int)?/// Offset of the __LINKEDIT LC_SEGMENT_64 command, and its slice-relative extent.var linkEditCommandOffset: Int?var linkEditFileOffset = 0@@ -424,6 +468,8 @@ public enum CustomFirmwareInjectDylib {dataSize: Int(data.loadLEValue(UInt32.self, at: offset + 12)),)layout.codeSignatureIsLast = index == ncmds - 1+ case lcSourceVersion:+ layout.sourceVersion = (offset, cmdsize)case lcSegment64:guard data.holds(offset, 72) else {throw PatcherError.invalidFormat("LC_SEGMENT_64 is truncated")diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestSystemPatchSet.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestSystemPatchSet.swiftindex 22f69303..a774d640 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestSystemPatchSet.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestSystemPatchSet.swift@@ -81,11 +81,10 @@ public enum FirmwareGuestSystemPatchSet {summary: """Accepts a provisioning profile that wants online authorization, by short-circuiting \the check in the shared cache. Off by default: libmisfix.dylib already declines the \- same check from userspace in installd and misagent, and editing the cache for it \- stops an iOS 27 guest booting. Turn it on only on a 26.x base, and only to launch \- an app signed with a free personal-team certificate — that launch goes through \- SpringBoard, which the hook does not cover. Not offered on iOS 27, where it stops \- the guest booting.+ same check from userspace in installd, misagent and SpringBoard, and editing the \+ cache for it stops an iOS 27 guest booting. Kept for a 26.x guest whose SpringBoard \+ was installed without system-springboard-cfw-launch_authorization. Not offered on \+ iOS 27, where it stops the guest booting.""",target: .dyldSharedCache,applicability: misTrustAuthBases,@@ -160,6 +159,19 @@ public enum FirmwareGuestSystemPatchSet {""",target: .guestExecutable(path: "/usr/libexec/misagent"),),+ VPhonePatchDeclaration(+ identifier: "system-springboard-cfw-launch_authorization",+ title: "SpringBoard launch authorization",+ summary: """+ Lets an installed developer-signed app launch. SpringBoard validates the app \+ with MIS again before launching it, and MIS asks for online authorization a \+ guest without an activation record can never get, so the launch is refused \+ with 0xE8008026 and "Unable to Verify App". The same hook, loaded into \+ SpringBoard, declines that check the way it does in installd. This replaces \+ dyld-exp-mis_trust_auth without writing the shared cache.+ """,+ target: .guestExecutable(path: "/System/Library/CoreServices/SpringBoard.app/SpringBoard"),+ ),VPhonePatchDeclaration(identifier: "system-debugserver-cfw-install",title: "debugserver",diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swiftindex 2c51c8a9..cdd40063 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swift@@ -68,7 +68,8 @@ public enum FirmwarePatchSetCatalog {/// libmis only calls `checkTrustAndAuthorization` when that flag is set, so/// `0xE8008026` — "missing trust and/or authorization", which a hacktivated/// guest with no activation record can never satisfy — is never produced.- /// `cfw install` injects that hook into `installd` and `misagent`.+ /// `cfw install` injects that hook into `installd`, `misagent` and+ /// `SpringBoard`.////// Leaving the patch on costs more than it buys. On iOS 27 it stops the guest/// booting: TXM rejects the re-attested page, dyld cannot map@@ -77,11 +78,12 @@ public enum FirmwarePatchSetCatalog {/// neither the seeding prologue the patcher matches nor the patcher's own/// output, so `cfw install` fails outright before it writes anything.///- /// What it still buys, and why it stays declared rather than being deleted:- /// the hook only covers the processes it is injected into, so an app signed- /// with a *free personal-team* certificate can be installed but is still- /// refused at launch, where SpringBoard asks MIS itself. A VM that wants that- /// on a 26.x base can check this box; on 27 it should not.+ /// Why it stays declared rather than being deleted: the hook only covers the+ /// processes it is injected into, and until+ /// `system-springboard-cfw-launch_authorization` SpringBoard was not one of+ /// them, so an installed app was refused at launch. A 26.x guest whose+ /// SpringBoard predates that patch can check this box instead of running+ /// `cfw install` again; on 27 it should not.public static let misTrustAuthPatch = "dyld-exp-mis_trust_auth"/// The former EXP patches that make the guest claim to be an iPhone17,3.diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/CustomFirmware/CustomFirmwareMachOTests.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/CustomFirmware/CustomFirmwareMachOTests.swiftindex b10b0c9d..f6f79ac7 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/CustomFirmware/CustomFirmwareMachOTests.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/CustomFirmware/CustomFirmwareMachOTests.swift@@ -614,4 +614,77 @@ struct CustomFirmwareInjectDylibTests {try #require(after.status == 0, "injected hello failed: \(after.output)")#expect(after.output == "world hello\n")}++ /// SpringBoard's shape: room for the command, but not for the signature a+ /// re-signer puts back after it. Dropping LC_SOURCE_VERSION has to make that+ /// room, leave every byte past it alone, and leave a binary dyld still runs.+ @Test func `reclaiming LC_SOURCE_VERSION makes room for the command and the signature`() throws {+ let fixtures = MachOFixture.repositoryRoot+ .appending(path: "VPhoneExecutable/VPhoneCommand/FirmwarePatcherTestFixtures/DylibInjection")+ let directory = FileManager.default.temporaryDirectory+ .appending(path: "DylibInjection-\(UUID().uuidString)")+ try FileManager.default.createDirectory(at: directory, withIntermediateDirectories: true)+ defer { try? FileManager.default.removeItem(at: directory) }++ let executable = directory.appending(path: "hello")+ let dylib = directory.appending(path: "swizzle.dylib")+ let clang = URL(filePath: "/usr/bin/clang")+ let buildExecutable = try MachOFixture.run(+ clang,+ [+ "-fobjc-arc", "-framework", "Foundation", "-Wl,-headerpad,0x4000",+ fixtures.appending(path: "hello.m").path, "-o", executable.path,+ ],+ )+ try #require(buildExecutable.status == 0, "hello fixture: \(buildExecutable.output)")+ let buildDylib = try MachOFixture.run(+ clang,+ [+ "-dynamiclib", "-fobjc-arc", "-framework", "Foundation",+ fixtures.appending(path: "swizzle.m").path, "-o", dylib.path,+ ],+ )+ try #require(buildDylib.status == 0, "swizzle fixture: \(buildDylib.output)")++ // Leave exactly enough zero padding for the command once the 16-byte+ // LC_CODE_SIGNATURE is stripped, and mark the first byte past it.+ var data = try Data(contentsOf: executable)+ let ncmds = data.loadLE(UInt32.self, at: 16)+ let commandsEnd = 32 + Int(data.loadLE(UInt32.self, at: 20))+ let pathBytes = dylib.path.utf8.count+ let commandSize = 24 + (pathBytes & ~7) + 8+ let marker = commandsEnd + commandSize - 16+ data[marker] = 0xFF+ try data.write(to: executable)++ let injection = try #require(+ try CustomFirmwareInjectDylib.inject(+ dylibPath: dylib.path,+ into: executable,+ reclaimsSourceVersion: true,+ ).first,+ )+ #expect(injection.removedCodeSignature)+ #expect(injection.removedSourceVersion)++ var after = try Data(contentsOf: executable)+ #expect(after[marker] == 0xFF, "the byte past the reclaimed room must not be written")+ // Out: LC_CODE_SIGNATURE and LC_SOURCE_VERSION. In: the dylib.+ #expect(after.loadLE(UInt32.self, at: 16) == ncmds - 1)+ #expect(Int(after.loadLE(UInt32.self, at: 20)) == commandsEnd - 32 - 16 - 16 + commandSize)+ #expect(MachOFixture.dylibLoadCommands(in: after).last?.path == dylib.path)+ #expect(MachOFixture.dylibLoadCommands(in: after).count == MachOFixture.dylibLoadCommands(in: data).count + 1)++ // codesign needs the reserved 16 bytes, and zero ones.+ after[marker] = 0+ try after.write(to: executable)+ let sign = try MachOFixture.run(+ URL(filePath: "/usr/bin/codesign"),+ ["--force", "--sign", "-", "--timestamp=none", executable.path],+ )+ try #require(sign.status == 0, "signing reclaimed hello: \(sign.output)")+ let run = try MachOFixture.run(executable, [])+ try #require(run.status == 0, "reclaimed hello failed: \(run.output)")+ #expect(run.output == "world hello\n")+ }}diff --git a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swift b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swiftindex ac9eb2df..e95e140e 100644--- a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swift+++ b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swift@@ -677,6 +677,24 @@ struct VPhoneCustomFirmwareInstaller {injectedDylibPath: "/usr/lib/libmisfix.dylib",)}+ if on("system-springboard-cfw-launch_authorization") {+ // SpringBoard asks MIS again before it launches an app, and no+ // spawn hook reaches it: launchd starts it directly, in its+ // conclave, and it never carries SystemHook. A load command is the+ // one route that always holds.+ // Its header has 16 spare bytes, so the command names the short+ // alias and LC_SOURCE_VERSION makes room for the new signature.+ try installLibraryAlias(system: system, alias: "mf", target: "/usr/lib/libmisfix.dylib")+ try patchMachO(+ system: system,+ work: work,+ path: "System/Library/CoreServices/SpringBoard.app/SpringBoard",+ identifier: "com.apple.springboard",+ preserveEntitlements: true,+ injectedDylibPath: "/mf",+ reclaimsSourceVersion: true,+ )+ }if on("system-debugserver-cfw-install") {try patchDebugserver(system: system, work: work)}@@ -921,16 +939,20 @@ struct VPhoneCustomFirmwareInstaller {}// launchd has little free header space for another load command.// /vh fits the same 32-byte command as the old /b without reusing it.- let alias = "vh"- let target = "/usr/lib/launchdhook-vphone.dylib"+ try installLibraryAlias(system: system, alias: "vh", target: "/usr/lib/launchdhook-vphone.dylib")+ try installMISFixDefaults(system: system)+ }++ /// A symlink at the volume root, so a load command in a binary with little+ /// header space can name a library in seven bytes or fewer.+ private func installLibraryAlias(system: VPhoneConfinedDirectory, alias: String, target: String) throws {if try system.exists(alias) {guard try system.readLink(alias) == target else {- throw ValidationError("Another file already uses /vh on the VM system volume. Remove it, then install CFW again.")+ throw ValidationError("Another file already uses /\(alias) on the VM system volume. Remove it, then install CFW again.")}} else {try system.createSymlink(target: target, at: alias)}- try installMISFixDefaults(system: system)}/// libmisfix's settings file, and only when the guest has none.@@ -1059,6 +1081,7 @@ struct VPhoneCustomFirmwareInstaller {identifier: String? = nil,preserveEntitlements: Bool = false,injectedDylibPath: String? = nil,+ reclaimsSourceVersion: Bool = false,) throws {let backup = "\(path).bak"if try !system.exists(backup) {@@ -1076,7 +1099,10 @@ struct VPhoneCustomFirmwareInstaller {try patch(verb, [staged.path])}if let injectedDylibPath {- try patch("inject-dylib", [staged.path, injectedDylibPath])+ try patch(+ "inject-dylib",+ [staged.path, injectedDylibPath] + (reclaimsSourceVersion ? ["--reclaim-source-version"] : []),+ )}try VPhoneSigner.sign(fileAt: staged,diff --git a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwarePatchCommand.swift b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwarePatchCommand.swiftindex 71d9fd1e..e5c6a9d0 100644--- a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwarePatchCommand.swift+++ b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwarePatchCommand.swift@@ -164,17 +164,22 @@ struct VPhoneCustomFirmwareInjectDylibCommand: ParsableCommand {@Argument(help: "Path the guest will load the dylib from (e.g. /b)")var dylibPath: String+ @Flag(help: "Drop LC_SOURCE_VERSION when the header has no room for the command and the re-signed signature")+ var reclaimSourceVersion = false+func run() throws {let injections = try CustomFirmwareInjectDylib.inject(dylibPath: dylibPath,into: binary,weak: true,policy: .strip,+ reclaimsSourceVersion: reclaimSourceVersion,)for injection in injections {let stripped = injection.removedCodeSignature ? ", signature stripped" : ""+ let reclaimed = injection.removedSourceVersion ? ", LC_SOURCE_VERSION dropped" : ""print(" [+] LC_LOAD_WEAK_DYLIB \(dylibPath) -> \(binary.lastPathComponent) "- + "(slice +0x\(String(injection.sliceOffset, radix: 16))\(stripped))")+ + "(slice +0x\(String(injection.sliceOffset, radix: 16))\(stripped)\(reclaimed))")}}}diff --git a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/standard.plist b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/standard.plistindex cad93c49..b4015116 100644--- a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/standard.plist+++ b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/standard.plist@@ -16,8 +16,8 @@EXP variant; the camera does not need them, and with the concealment they leftguests without location (issue #438). The fourth is the MISonline-authorization short-circuit: libmisfix.dylib declines the same check from- userspace in installd and misagent, so editing the shared cache for it buys- nothing there, costs an iOS 27 guest its boot (issue #532), and on 24A435 cannot+ userspace in installd, misagent and SpringBoard, so editing the shared cache for+ it buys nothing there, costs an iOS 27 guest its boot (issue #532), and on 24A435 cannoteven be applied. See FirmwarePatchSetCatalog.misTrustAuthPatch.Each patch's own version gate still decides whether it lands on this pairing ofdiff --git a/VPhoneGuestComponents/MISFix/MISFixConfig.c b/VPhoneGuestComponents/MISFix/MISFixConfig.cindex 9c403021..bc72c75e 100644--- a/VPhoneGuestComponents/MISFix/MISFixConfig.c+++ b/VPhoneGuestComponents/MISFix/MISFixConfig.c@@ -2,6 +2,7 @@#include <dlfcn.h>#include <fcntl.h>+#include <mach-o/dyld.h>#include <os/log.h>#include <ptrauth.h>#include <stdarg.h>@@ -173,6 +174,15 @@ int MISFixConfiguredFlag(CFStringRef key) {return CFBooleanGetValue((CFBooleanRef)value) ? 1 : 0;}+int MISFixProcessIs(const char *name) {+ char path[4096];+ uint32_t size = sizeof(path);+ if (name == NULL || _NSGetExecutablePath(path, &size) != 0)+ return 0;+ const char *slash = strrchr(path, '/');+ return strcmp(slash != NULL ? slash + 1 : path, name) == 0;+}+const char *MISFixCallerImage(const void *address) {if (address == NULL)return "?";diff --git a/VPhoneGuestComponents/MISFix/MISFixConfig.h b/VPhoneGuestComponents/MISFix/MISFixConfig.hindex d37c5bbe..c27e3058 100644--- a/VPhoneGuestComponents/MISFix/MISFixConfig.h+++ b/VPhoneGuestComponents/MISFix/MISFixConfig.h@@ -70,6 +70,15 @@ void MISFixNote(const char *format, ...) __attribute__((format(printf, 1, 2)));/// calls too.const char *MISFixCallerImage(const void *address);+/// Whether this process's executable is named `name`, compared on the last+/// path component.+///+/// The same dylib is linked into installd, misagent and SpringBoard, and not+/// every hook belongs in all three: MobileInstallation's policy is installd's+/// alone, and loading that framework into SpringBoard to swizzle it would+/// change a process the hook has no business in.+int MISFixProcessIs(const char *name);+/// The image of whoever called the function this appears in.#define MISFixCaller() MISFixCallerImage(__builtin_return_address(0))diff --git a/VPhoneGuestComponents/MISFix/MISFixInstallPolicy.c b/VPhoneGuestComponents/MISFix/MISFixInstallPolicy.cindex d5c10f8d..5a87ea30 100644--- a/VPhoneGuestComponents/MISFix/MISFixInstallPolicy.c+++ b/VPhoneGuestComponents/MISFix/MISFixInstallPolicy.c@@ -188,7 +188,12 @@ static BOOL vpAllowAdhocSigning(id self, SEL selector) {return YES;}+/// installd only. The same dylib is linked into misagent and SpringBoard, and+/// neither runs an install; `vpSwizzle` would dlopen MobileInstallation into+/// them just to find a class they never use.__attribute__((constructor)) static void vpInstallPolicyHooks(void) {+ if (!MISFixProcessIs("installd"))+ return;vpOriginalInstallProfiles = (MISFixCheckIMP)vpSwizzle("MIInstallableBundle","_installEmbeddedProfilesWithError:",diff --git a/VPhoneGuestComponents/SystemHook/SystemHook-vphone.c b/VPhoneGuestComponents/SystemHook/SystemHook-vphone.cindex d8e15562..b8c8d058 100644--- a/VPhoneGuestComponents/SystemHook/SystemHook-vphone.c+++ b/VPhoneGuestComponents/SystemHook/SystemHook-vphone.c@@ -60,11 +60,20 @@ static int vpPathHasSuffix(const char *path, const char *suffix) {// is in MobileInstallation and calls libmis. This is the install.// misagent installs the embedded profile and checks ProvisionedDevices.// SpringBoard asks MIS again at launch, which is the half neither daemon-// covers: an app signed with a free personal-team certificate-// could be installed and then refused at launch with 0xE8008026.+// covers: an installed app is refused at launch with 0xE8008026.//// Matched on the end of the path so a bootstrap or cryptex copy of the same// binary is caught too.+//+// This list is a second route, not the one the hook depends on. `cfw install`+// links libmisfix into all three with a load command, and for SpringBoard+// that is the only route that works: SpringBoard never carries this dylib.+// Measured on test-27.0 (2026-09-30): launchd starts it without an xpcproxy+// (the launchd hook's spawn log has every neighbouring child pid but not+// SpringBoard's), and SpringBoard's own constructor line, which any `.app/`+// path would write to vphone-systemhook.log, never appears. Its job runs in a+// conclave (`_Conclave` in com.apple.SpringBoard.plist); whether the insert+// is dropped there or never made is not settled.static int vpIsMISFixTarget(const char *path) {if (!path)return 0;