Run a virtual iPhone on an Apple Silicon Mac.
Swift
refactor: use PascalCase script folders
Lakr8501bf17bade
diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex ccd2f740..985c897a 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -27,14 +27,14 @@ jobs:- name: Build and bundle (portable .app)env:SWIFT_JOBS: "4"- run: ./scripts/build.sh+ run: ./Scripts/build.sh- name: Verify application bundlerun: |set -euo pipefailcodesign --verify --strict .build/vphone-cli.apptest -x .build/vphone-cli.app/Contents/Resources/guest/vphoned- zsh scripts/check_aux.sh+ zsh Scripts/check_aux.sh- name: Package appenv:diff --git a/.gitignore b/.gitignoreindex 51972828..de2ccf33 100644--- a/.gitignore+++ b/.gitignore@@ -333,7 +333,7 @@ __marimo__//updates-cdn/research/jb_asm_refs/references/-scripts/vphoned/vphoned+Scripts/VPhoned/vphoned/cfw_input/Sources/VPhoneCore/VPhoneBuildInfo.swift# libarchive drops zero-byte tar.XXXXXXXX files in the process's workingdiff --git a/.gitmodules b/.gitmodulesindex 92bf6ef1..31b9b0b9 100644--- a/.gitmodules+++ b/.gitmodules@@ -1,3 +1,3 @@[submodule "scripts/repos/insert_dylib"]- path = scripts/repos/insert_dylib+ path = Scripts/Repos/InsertDyliburl = https://github.com/tyilo/insert_dylib.gitdiff --git a/AGENTS.md b/AGENTS.mdindex f78f534a..ea8d435f 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -4,16 +4,16 @@ Virtual iPhone boot tool using Apple's Virtualization.framework with PCC researc## Quick Reference-- **Build:** `zsh scripts/build.sh` (builds, signs, and bundles the app)-- **Test:** `swift test`; then `zsh scripts/check_aux.sh` for bundle admission gates+- **Build:** `zsh Scripts/build.sh` (builds, signs, and bundles the app)+- **Test:** `swift test`; then `zsh Scripts/check_aux.sh` for bundle admission gates- **Boot (GUI):** `vphone-cli vm launch <name>`- **Boot (DFU):** `vphone-cli vm launch <name> --dfu`- **AMFI refuses `vphone-vm`?** Use the bundled `vphone-amfi-allow` helper as shown in `docs/guides/host-setup.md`. Repeat after every build because it allowlists cdhashes. See Key Patterns.- **Restore:** `vphone-cli restore`, in process. Vendored libirecovery + idevicerestore (`Sources/MobileRecoveryCore`, `Sources/MobileRestoreCore`) over the `AppleMobileDeviceLibrary` xcframeworks. No interpreter, no environment to provision, no setup step. See `research/restore/p2_restore_off_python.md`.- **Platform:** macOS 15+ (Sequoia). `vphone-vm` needs amfid to accept its private entitlements: either SIP off with `amfi_get_out_of_my_way=1`, or SIP on (`--without debug`) plus an allowlist bypass the user runs. Both are in `docs/guides/host-setup.md`; neither is installed by this project.- **Language:** Swift 6.0 (SwiftPM), private APIs via [Dynamic](https://github.com/mhdhejazi/Dynamic). This package's own manifest is `swift-tools-version:6.0`, but the **toolchain floor is Swift 6.2**: `libcapstone-spm` declares 6.2 so that it can reach `CSetting.disableWarning` instead of `.unsafeFlags`, which is what lets it be depended on by version at all.-- **Dependencies:** Host and guest SwiftPM packages resolve dependencies by URL and version; `Package.resolved` pins the full graphs. The only git submodule is `scripts/repos/insert_dylib`, a build-time test reference. **No Python anywhere, and no Homebrew package at runtime** — see Tiers below.-- **Tiers.** Three environments run code here and the rules differ. **build** (the machine that builds the `.app`) may use Xcode, `xcrun`, clang, swift, git and Homebrew. **dist** (the shipped `.app`, on a clean macOS) may use `/usr/lib`, `/System` and the bundle — nothing else, no `PATH` lookup. **guest** (inside the VM) is out of host self-containment scope. Every script declares its tier on **line 2** (`# vphone-tier: dist`); `scripts/dist_manifest.sh` reads those and is what `scripts/build.sh` stages from, so a script that declares nothing ships nowhere. `scripts/check_aux.sh` runs the admission gates. The dist tier's registered-exception list is **empty** and a release requires it to stay that way.+- **Dependencies:** Host and guest SwiftPM packages resolve dependencies by URL and version; `Package.resolved` pins the full graphs. The only git submodule is `Scripts/Repos/InsertDylib`, a build-time test reference. **No Python anywhere, and no Homebrew package at runtime** — see Tiers below.+- **Tiers.** Three environments run code here and the rules differ. **build** (the machine that builds the `.app`) may use Xcode, `xcrun`, clang, swift, git and Homebrew. **dist** (the shipped `.app`, on a clean macOS) may use `/usr/lib`, `/System` and the bundle — nothing else, no `PATH` lookup. **guest** (inside the VM) is out of host self-containment scope. Every script declares its tier on **line 2** (`# vphone-tier: dist`); `Scripts/dist_manifest.sh` reads those and is what `Scripts/build.sh` stages from, so a script that declares nothing ships nowhere. `Scripts/check_aux.sh` runs the admission gates. The dist tier's registered-exception list is **empty** and a release requires it to stay that way.## Workflow Rules@@ -178,13 +178,13 @@ Sources/├── VPhoneTouchIDMonitor.swift # BiometricKit delegate sink└── VPhoneScreenRecorder.swift # VM screen recording to file-scripts/ # Build scripts and payloads only; no runtime shell+Scripts/ # Build scripts and payloads only; no runtime shell├── build.sh [b] # Compile, sign and bundle├── dist_manifest.sh [b] # Payload allowlist staged by build.sh├── check_aux.sh [b] # The self-containment admission gates├── setup_tools.sh [b] # Builds insert_dylib, the Mach-O byte-parity test reference-├── vphoned/ # Guest SwiftNIO/IcliKit package plus native installer/keychain/camera code-└── repos/ # Toolchain source (git submodule: insert_dylib)+├── VPhoned/ # Guest SwiftNIO/IcliKit package plus native installer/keychain/camera code+└── Repos/ # Toolchain source (git submodule: InsertDylib)siblings/ # Guest component sources/provenance; separate package├── camfix/ vcamcaptured/ # Camera hooks and filter plists@@ -197,7 +197,7 @@ research/ # Detailed firmware/patch documentation### Key Patterns- **Three host binaries, one of them entitled.** `vphone-cli` carries no entitlements, so it launches on any host and is always there to explain what is wrong. `vphone-vm` holds all 7 private keys and is the only thing amfid can refuse. `vphone-archive` does the unpacking. **Do not sign `vphone-cli` with entitlements** — that is how it used to be, and it is why the entry point could not start without a bypass already running.-- **The AMFI bypass is ours, and it writes heap, not code.** `vphone-amfi-allow` (`Sources/VPhoneAMFIAllow/`, this project's copy of [Lakr233/amfi-allow](https://github.com/Lakr233/amfi-allow)) puts the cdhashes of both `vphone-vm` copies into `/Library/Preferences/com.apple.security.coderequirements.plist` — a file AMFI already reads — and flips one byte of `_isRunningInternalBuild` in amfid's `AMFIRequirementsManager` singleton so it consults that file. It is an **allowlist**, scoped to the cdhashes you name; do not describe it as a global switch. The helper's `allow`, `status`, and `off` commands manage it; see `docs/guides/host-setup.md`. It is a **per-build** step, because a cdhash changes with every signature. It must be **arm64e** to match amfid's slice, and `scripts/build.sh` builds it with clang. The heap write is the load-bearing detail: `vphone-letmein` and LLDB-based tools dirty an executable page, and on a host with `vm.cs_system_enforcement = 1` the kernel kills amfid for that and takes the guest with it.+- **The AMFI bypass is ours, and it writes heap, not code.** `vphone-amfi-allow` (`Sources/VPhoneAMFIAllow/`, this project's copy of [Lakr233/amfi-allow](https://github.com/Lakr233/amfi-allow)) puts the cdhashes of both `vphone-vm` copies into `/Library/Preferences/com.apple.security.coderequirements.plist` — a file AMFI already reads — and flips one byte of `_isRunningInternalBuild` in amfid's `AMFIRequirementsManager` singleton so it consults that file. It is an **allowlist**, scoped to the cdhashes you name; do not describe it as a global switch. The helper's `allow`, `status`, and `off` commands manage it; see `docs/guides/host-setup.md`. It is a **per-build** step, because a cdhash changes with every signature. It must be **arm64e** to match amfid's slice, and `Scripts/build.sh` builds it with clang. The heap write is the load-bearing detail: `vphone-letmein` and LLDB-based tools dirty an executable page, and on a host with `vm.cs_system_enforcement = 1` the kernel kills amfid for that and takes the guest with it.- **Guest launches go through `VPhoneGuestLaunchPlanner`** (`VPhoneCore`). It resolves `vphone-vm` as a sibling of the running image — never through `PATH` — checks its two PV=3 entitlements, then probes with `vphone-vm --help` for SIGKILL. A refusal is reported with the exact command the user has to run; the planner never arranges a bypass itself. Never spawn the guest directly.- **Restore runs in `vphone-cli`'s own process.** `VPhoneRestore` calls `vphone_restore_run()` in `MobileRestoreCore`; there is no subprocess, no bridge script and no environment to resolve first. The three commands the old Python bridge exposed became `restore --get-shsh`, `restore` and `restore --offline`; its fourth, `usbmux-list`, had no call site and was not ported. `research/restore/p2_restore_off_python.md` has the decision and the behaviour table.- **Private API access:** Via [Dynamic](https://github.com/mhdhejazi/Dynamic) library (runtime method dispatch from pure Swift). No ObjC bridge.@@ -238,7 +238,7 @@ one verb per patch, driven by `scripts/cfw_install*.sh` only.- Disassembly is Capstone via `ARM64Disassembler` (the `libcapstone-spm` package). Assembly is `ARM64Encoder` plus the pre-encoded constants in `ARM64` (`ARM64Constants.swift`) — together they replace keystone's `asm()` / `asm_at()`, and `ARM64.nop` / `ARM64.movW0_0` are the old `NOP` / `MOV_W0_0`. IM4P containers go through `IM4PHandler` (the `libimg4-spm` package), which replaces pyimg4. Both resolve by URL; there is no `vendor/` directory to check out first.- Dynamic pattern finding (string anchors, ADRP+ADD xrefs, BL frequency) — no hardcoded offsets.- Each patch logged with offset and before/after state.-- No interpreter, no Python environment, no native-library repair: `scripts/build.sh` builds the complete app.+- No interpreter, no Python environment, no native-library repair: `Scripts/build.sh` builds the complete app.### Python@@ -251,10 +251,10 @@ There is none, and adding any is a regression.restore backend was the last holdout and is now `Sources/VPhoneRestore` overtwo vendored C targets — see `research/restore/p2_restore_off_python.md`.- A patch, a probe, a format reader or a device protocol belongs in Swift,- where it is built, signed, gated by `scripts/check_aux.sh` and tested with+ where it is built, signed, gated by `Scripts/check_aux.sh` and tested witheverything else. Adding an interpreter back brings with it a provisioningstep, a silent system-`python3` fallback, and a dependency closure- `scripts/check_aux.sh` cannot see.+ `Scripts/check_aux.sh` cannot see.- There is no counter-example left. `amfidont` used to be cited as one — athird-party tool the user installed into their own Python — and it is gonetoo: the AMFI bypass is `Sources/VPhoneAMFIAllow`, one C file built by@@ -271,7 +271,7 @@ There is none, and adding any is a regression.## Build & Sign-The binary requires private entitlements for PV=3 virtualization. Always use `zsh scripts/build.sh` — never `swift build` alone, as the unsigned binary will fail at runtime.+The binary requires private entitlements for PV=3 virtualization. Always use `zsh Scripts/build.sh` — never `swift build` alone, as the unsigned binary will fail at runtime.## Design Systemdiff --git a/Package.swift b/Package.swiftindex 2cfbc7a7..d8312183 100644--- a/Package.swift+++ b/Package.swift@@ -52,7 +52,7 @@ let package = Package(.product(name: "MachOKit", package: "MachOKit"),// The cryptex patcher re-signs what it rewrites. That used to be// three `runProcess("/opt/homebrew/bin/ldid", …)` calls, which is- // the one thing in this package that made `scripts/check_aux.sh` fail.+ // the one thing in this package that made `Scripts/check_aux.sh` fail."VPhoneSign",// And it unpacks three archives onto the volume it is building,// which were the last three `runProcess("/usr/bin/tar", …)` calls@@ -88,7 +88,7 @@ let package = Package(// Ad-hoc and PKCS#12 Mach-O code signing, byte for byte what ldid// writes. It replaces ldid, which is the only program this project// shipped that links Homebrew (libcrypto.3, libplist-2.0.4) and so- // the only one that failed `scripts/check_aux.sh`. Nothing here is outside+ // the only one that failed `Scripts/check_aux.sh`. Nothing here is outside// the system frameworks: CryptoKit for the hashes, Security for the// PKCS#12 and the CMS..target(@@ -108,7 +108,7 @@ let package = Package(// The backend is IOKit, not libusb: on a host whose SDK has// IOKit/usb/IOUSBLib.h, upstream's configure.ac picks IOKit and never// looks for libusb. That is deliberate here too, because a libusb- // backend would mean a Homebrew dylib in the link, and `scripts/check_aux.sh`+ // backend would mean a Homebrew dylib in the link, and `Scripts/check_aux.sh`// exists to keep those out..target(name: "MobileRecoveryCore",@@ -149,7 +149,7 @@ let package = Package(// top: config.h, which is what ./configure would have written, and the// libzip stub. libzip is the one PKG_CHECK_MODULES dependency with no// counterpart here, and linking Homebrew's copy would put an absolute- // path in the closure that `scripts/check_aux.sh` gate 1 rejects. It is only+ // path in the closure that `Scripts/check_aux.sh` gate 1 rejects. It is only// reachable when reading a .ipsw archive or re-signing a .bbfw, and// this project restores from an extracted directory onto a device with// no baseband — zip.h has the full argument.@@ -253,7 +253,7 @@ let package = Package(// VPhoneRestore is the line that ends the venv: `restore` and// `vm create` reach it directly instead of spawning a Python.// It is also what finally puts libirecovery, idevicerestore, libcurl- // and libz inside .build/vphone-cli.app, where `scripts/check_aux.sh` gate 1+ // and libz inside .build/vphone-cli.app, where `Scripts/check_aux.sh` gate 1// can see them..executableTarget(name: "vphone-cli",@@ -285,7 +285,7 @@ let package = Package(path: "Sources/VPhoneAskForPermission",),// `vphone-amfi-allow` is NOT here, and cannot be: SwiftPM emits arm64- // and it has to be arm64e to read amfid's ObjC runtime. `scripts/build.sh`+ // and it has to be arm64e to read amfid's ObjC runtime. `Scripts/build.sh`// compiles it with clang; see the header of its one C file.//// A `vphone-letmein` target stood here too: a C program that wrotediff --git a/README.md b/README.mdindex cdb4e861..6c69069e 100644--- a/README.md+++ b/README.md@@ -43,11 +43,11 @@ Building from source needs Xcode, including its iPhoneOS SDK for vphoned:```shgit clone --recurse-submodules https://github.com/Lakr233/vphone-cli.gitcd vphone-cli-zsh scripts/build.sh+zsh Scripts/build.sh.build/release/vphone-cli --help```-`scripts/build.sh` builds, signs, and bundles the binaries. Run `swift test` for the Swift tests and `zsh scripts/check_aux.sh` for the bundle checks. After every rebuild, a host using the AMFI allowlist must allow the new signed binaries because their cdhashes change. See [host setup](docs/guides/host-setup.md).+`Scripts/build.sh` builds, signs, and bundles the binaries. Run `swift test` for the Swift tests and `zsh Scripts/check_aux.sh` for the bundle checks. After every rebuild, a host using the AMFI allowlist must allow the new signed binaries because their cdhashes change. See [host setup](docs/guides/host-setup.md).## Everyday commandsdiff --git a/scripts/repos/insert_dylib b/Scripts/Repos/InsertDylibsimilarity index 100%rename from scripts/repos/insert_dylibrename to Scripts/Repos/InsertDylibdiff --git a/scripts/vphoned/Daemon/APIWire.swift b/Scripts/VPhoned/Daemon/APIWire.swiftsimilarity index 100%rename from scripts/vphoned/Daemon/APIWire.swiftrename to Scripts/VPhoned/Daemon/APIWire.swiftdiff --git a/scripts/vphoned/Daemon/GuestAPI.swift b/Scripts/VPhoned/Daemon/GuestAPI.swiftsimilarity index 100%rename from scripts/vphoned/Daemon/GuestAPI.swiftrename to Scripts/VPhoned/Daemon/GuestAPI.swiftdiff --git a/scripts/vphoned/Daemon/GuestEventPublisher.swift b/Scripts/VPhoned/Daemon/GuestEventPublisher.swiftsimilarity index 100%rename from scripts/vphoned/Daemon/GuestEventPublisher.swiftrename to Scripts/VPhoned/Daemon/GuestEventPublisher.swiftdiff --git a/scripts/vphoned/Daemon/GuestFileTransfer.swift b/Scripts/VPhoned/Daemon/GuestFileTransfer.swiftsimilarity index 100%rename from scripts/vphoned/Daemon/GuestFileTransfer.swiftrename to Scripts/VPhoned/Daemon/GuestFileTransfer.swiftdiff --git a/scripts/vphoned/Daemon/GuestHTTPHandler.swift b/Scripts/VPhoned/Daemon/GuestHTTPHandler.swiftsimilarity index 100%rename from scripts/vphoned/Daemon/GuestHTTPHandler.swiftrename to Scripts/VPhoned/Daemon/GuestHTTPHandler.swiftdiff --git a/scripts/vphoned/Daemon/GuestWebSocketHandler.swift b/Scripts/VPhoned/Daemon/GuestWebSocketHandler.swiftsimilarity index 100%rename from scripts/vphoned/Daemon/GuestWebSocketHandler.swiftrename to Scripts/VPhoned/Daemon/GuestWebSocketHandler.swiftdiff --git a/scripts/vphoned/Daemon/IcliCommand.swift b/Scripts/VPhoned/Daemon/IcliCommand.swiftsimilarity index 100%rename from scripts/vphoned/Daemon/IcliCommand.swiftrename to Scripts/VPhoned/Daemon/IcliCommand.swiftdiff --git a/scripts/vphoned/Daemon/OpenAPIDocument.swift b/Scripts/VPhoned/Daemon/OpenAPIDocument.swiftsimilarity index 100%rename from scripts/vphoned/Daemon/OpenAPIDocument.swiftrename to Scripts/VPhoned/Daemon/OpenAPIDocument.swiftdiff --git a/scripts/vphoned/Daemon/main.swift b/Scripts/VPhoned/Daemon/main.swiftsimilarity index 100%rename from scripts/vphoned/Daemon/main.swiftrename to Scripts/VPhoned/Daemon/main.swiftdiff --git a/scripts/vphoned/include/VphonedNative.h b/Scripts/VPhoned/Include/VphonedNative.hsimilarity index 100%rename from scripts/vphoned/include/VphonedNative.hrename to Scripts/VPhoned/Include/VphonedNative.hdiff --git a/scripts/vphoned/Package.resolved b/Scripts/VPhoned/Package.resolvedsimilarity index 100%rename from scripts/vphoned/Package.resolvedrename to Scripts/VPhoned/Package.resolveddiff --git a/scripts/vphoned/Package.swift b/Scripts/VPhoned/Package.swiftsimilarity index 94%rename from scripts/vphoned/Package.swiftrename to Scripts/VPhoned/Package.swiftindex eb0a6f6c..8c1ccce0 100644--- a/scripts/vphoned/Package.swift+++ b/Scripts/VPhoned/Package.swift@@ -18,10 +18,10 @@ let package = Package(name: "VphonedNative",path: ".",sources: nativeSources,- publicHeadersPath: "include",+ publicHeadersPath: "Include",cSettings: [.headerSearchPath("."),- .headerSearchPath("vendor/libarchive"),+ .headerSearchPath("Vendor/LibArchive"),.define("VPHONED_BUILD_HASH", to: "\"\(gitHash)\""),.unsafeFlags(["-fobjc-arc"]),],diff --git a/scripts/vphoned/vendor/libarchive/archive.h b/Scripts/VPhoned/Vendor/LibArchive/archive.hsimilarity index 100%rename from scripts/vphoned/vendor/libarchive/archive.hrename to Scripts/VPhoned/Vendor/LibArchive/archive.hdiff --git a/scripts/vphoned/vendor/libarchive/archive_entry.h b/Scripts/VPhoned/Vendor/LibArchive/archive_entry.hsimilarity index 100%rename from scripts/vphoned/vendor/libarchive/archive_entry.hrename to Scripts/VPhoned/Vendor/LibArchive/archive_entry.hdiff --git a/scripts/vphoned/entitlements.plist b/Scripts/VPhoned/entitlements.plistsimilarity index 100%rename from scripts/vphoned/entitlements.plistrename to Scripts/VPhoned/entitlements.plistdiff --git a/scripts/vphoned/unarchive.h b/Scripts/VPhoned/unarchive.hsimilarity index 100%rename from scripts/vphoned/unarchive.hrename to Scripts/VPhoned/unarchive.hdiff --git a/scripts/vphoned/unarchive.m b/Scripts/VPhoned/unarchive.msimilarity index 100%rename from scripts/vphoned/unarchive.mrename to Scripts/VPhoned/unarchive.mdiff --git a/scripts/vphoned/vphoned.plist b/Scripts/VPhoned/vphoned.plistsimilarity index 100%rename from scripts/vphoned/vphoned.plistrename to Scripts/VPhoned/vphoned.plistdiff --git a/scripts/vphoned/vphoned_install.h b/Scripts/VPhoned/vphoned_install.hsimilarity index 100%rename from scripts/vphoned/vphoned_install.hrename to Scripts/VPhoned/vphoned_install.hdiff --git a/scripts/vphoned/vphoned_install.m b/Scripts/VPhoned/vphoned_install.msimilarity index 100%rename from scripts/vphoned/vphoned_install.mrename to Scripts/VPhoned/vphoned_install.mdiff --git a/scripts/vphoned/vphoned_keychain.h b/Scripts/VPhoned/vphoned_keychain.hsimilarity index 100%rename from scripts/vphoned/vphoned_keychain.hrename to Scripts/VPhoned/vphoned_keychain.hdiff --git a/scripts/vphoned/vphoned_keychain.m b/Scripts/VPhoned/vphoned_keychain.msimilarity index 100%rename from scripts/vphoned/vphoned_keychain.mrename to Scripts/VPhoned/vphoned_keychain.mdiff --git a/scripts/vphoned/vphoned_native.m b/Scripts/VPhoned/vphoned_native.msimilarity index 98%rename from scripts/vphoned/vphoned_native.mrename to Scripts/VPhoned/vphoned_native.mindex 419800b7..850d1eb9 100644--- a/scripts/vphoned/vphoned_native.m+++ b/Scripts/VPhoned/vphoned_native.m@@ -1,4 +1,4 @@-#import "include/VphonedNative.h"+#import "Include/VphonedNative.h"#import "vphoned_install.h"#import "vphoned_keychain.h"#import <CommonCrypto/CommonDigest.h>diff --git a/scripts/vphoned/vphoned_response.h b/Scripts/VPhoned/vphoned_response.hsimilarity index 100%rename from scripts/vphoned/vphoned_response.hrename to Scripts/VPhoned/vphoned_response.hdiff --git a/scripts/vphoned/vphoned_vcam.h b/Scripts/VPhoned/vphoned_vcam.hsimilarity index 100%rename from scripts/vphoned/vphoned_vcam.hrename to Scripts/VPhoned/vphoned_vcam.hdiff --git a/scripts/vphoned/vphoned_vcam.m b/Scripts/VPhoned/vphoned_vcam.msimilarity index 100%rename from scripts/vphoned/vphoned_vcam.mrename to Scripts/VPhoned/vphoned_vcam.mdiff --git a/scripts/build.sh b/Scripts/build.shsimilarity index 95%rename from scripts/build.shrename to Scripts/build.shindex 3924ba41..718228ca 100755--- a/scripts/build.sh+++ b/Scripts/build.sh@@ -9,7 +9,7 @@# resulting `vphone-cli` binary — this script is the only build entrypoint.## Usage:-# ./scripts/build.sh # build + sign + bundle + guest binaries+# ./Scripts/build.sh # build + sign + bundle + guest binariesset -euo pipefailSCRIPT_DIR="${0:A:h}"@@ -139,11 +139,11 @@ IOS_SDK="$(xcrun --sdk iphoneos --show-sdk-path)" \|| { echo "Error: iPhoneOS SDK is required on the build machine" >&2; exit 1; }mkdir -p .build/guestecho "=== Building vphoned (arm64, iphoneos) ==="-GIT_HASH="$GIT_HASH" swift build --package-path scripts/vphoned \+GIT_HASH="$GIT_HASH" swift build --package-path Scripts/VPhoned \--scratch-path .build/vphoned-swiftpm --triple arm64-apple-ios15.0 \--sdk "$IOS_SDK" -c release --product vphoned \--jobs "${SWIFT_JOBS:-4}"-GUEST_BIN_DIR="$(swift build --package-path scripts/vphoned \+GUEST_BIN_DIR="$(swift build --package-path Scripts/VPhoned \--scratch-path .build/vphoned-swiftpm --triple arm64-apple-ios15.0 \--sdk "$IOS_SDK" -c release --show-bin-path)"cp -f "$GUEST_BIN_DIR/vphoned" .build/guest/vphoned@@ -162,7 +162,7 @@ cp -f "$ICLI_BIN_DIR/icli" .build/guest/icliecho "=== Signing vphoned ==="cp .build/guest/vphoned .build/vphoned"$BINARY" sign \- --entitlements scripts/vphoned/entitlements.plist --merge \+ --entitlements Scripts/VPhoned/entitlements.plist --merge \.build/vphonedcp .build/vphoned .build/vphoned.signedecho " signed → .build/vphoned.signed"@@ -204,8 +204,10 @@ mkdir -p "${RES}/scripts"# An ALLOWLIST, from each script's own `# vphone-tier:` line. This used to be a# list of exclusions, which meant anything new shipped by default — and so the# .app carried build.sh, check_aux.sh and setup_tools.sh, the last of which runs-# `brew install`. See scripts/dist_manifest.sh for the three tiers.-zsh scripts/dist_manifest.sh | rsync -a --files-from=- scripts/ "${RES}/scripts/"+# `brew install`. See Scripts/dist_manifest.sh for the three tiers.+zsh Scripts/dist_manifest.sh | sed '/^vphoned\//d' | rsync -a --files-from=- Scripts/ "${RES}/scripts/"+mkdir -p "${RES}/scripts/vphoned"+cp -f Scripts/VPhoned/vphoned.plist Scripts/VPhoned/entitlements.plist "${RES}/scripts/vphoned/"# Only vphoned and icli ship into the guest; old build outputs may still contain# binaries for the removed bootstrap and must not leak into the bundle.mkdir -p "${RES}/guest"diff --git a/scripts/check_aux.sh b/Scripts/check_aux.shsimilarity index 98%rename from scripts/check_aux.shrename to Scripts/check_aux.shindex 4e4d501b..79d7c6a6 100755--- a/scripts/check_aux.sh+++ b/Scripts/check_aux.sh@@ -17,7 +17,7 @@# hold ONE list applied to the entire repository, so `xcrun` in a build script# and `xcrun` in something the .app ships counted the same — and the list# shrinking said nothing about whether the product was any closer to standing on-# its own. Each script declares its tier on line 2; see scripts/dist_manifest.sh.+# its own. Each script declares its tier on line 2; see Scripts/dist_manifest.sh.## The gates, none of which proves self-containment on its own:#@@ -135,8 +135,8 @@ check_tiers() {TIER[$name]="$tier"case "$tier" inbuild|dist|guest) ;;- undeclared) fail "gate 0: scripts/$name has no '# vphone-tier:' on line 2" ;;- *) fail "gate 0: scripts/$name declares unknown tier '$tier'" ;;+ undeclared) fail "gate 0: Scripts/$name has no '# vphone-tier:' on line 2" ;;+ *) fail "gate 0: Scripts/$name declares unknown tier '$tier'" ;;esacdone < <(zsh "$SCRIPT_DIR/dist_manifest.sh" --tiers)(( ${#TIER} )) || { fail "gate 0: no scripts found"; return }@@ -254,7 +254,7 @@ check_bundle_contents() {# Nothing may appear under Resources/scripts that the manifest did not put# there — a stale file from an older bundle is exactly as dangerous as a- # wrongly-declared one, and `scripts/build.sh` builds over whatever is already on+ # wrongly-declared one, and `Scripts/build.sh` builds over whatever is already on# disk.local -a manifest=()while IFS= read -r name; do manifest+=("$name"); done \@@ -311,7 +311,7 @@ check_sources() {# lines is the difference between a gate people read and one they learn to# ignore. `which is enough for...` in a comment is not a PATH lookup.local -a dist_clean=()- for file in scripts/*.sh; do+ for file in Scripts/*.sh; dotier="${TIER[${file:t}]:-undeclared}"[[ "$tier" == guest ]] && continue # runs in iOS; not our PATH[[ "$tier" == build ]] && continue # may assume Xcode and Homebrew@@ -413,9 +413,9 @@ check_sources() {# check_aux.sh excludes itself, because a scanner that looks for a word# necessarily contains it.hits=$(grep -rnE 'python[0-9.]*' --include='*.sh' \- scripts/ Tests/ 2>/dev/null \+ Scripts/ Tests/ 2>/dev/null \| grep -vE '^[^:]+:[0-9]+:[[:space:]]*#' \- | grep -vE '^scripts/check_aux\.sh:' \+ | grep -vE '^Scripts/check_aux\.sh:' \| grep -vE '(echo|print)[[:space:]]')if [[ -n "$hits" ]]; thenwhile IFS= read -r line; do@@ -532,7 +532,7 @@ check_smoke() {print -P "%Bvphone-cli admission gates%b"if [[ ! -d "$BUNDLE" ]]; then- red "no bundle at $BUNDLE — run 'zsh scripts/build.sh' first"+ red "no bundle at $BUNDLE — run 'zsh Scripts/build.sh' first"exit 2fidiff --git a/scripts/dist_manifest.sh b/Scripts/dist_manifest.shsimilarity index 87%rename from scripts/dist_manifest.shrename to Scripts/dist_manifest.shindex 53879352..48cd7e00 100755--- a/scripts/dist_manifest.sh+++ b/Scripts/dist_manifest.sh@@ -14,8 +14,9 @@## Every script declares which it is, on line 2: `# vphone-tier: <tier>`#-# This prints the dist payload — paths relative to scripts/, one per line, for-# `rsync -a --files-from=-`. It is an ALLOWLIST derived from those declarations,+# This prints the dist payload — paths relative to Contents/Resources/scripts/.+# build.sh maps the VPhoned plist source files back to the shipped vphoned/ path.+# It is an ALLOWLIST derived from those declarations,# which is the point: the bundler used to work from a list of exclusions, so# anything new shipped by default and the build-only `setup_tools.sh`,# `build.sh` and `check_aux.sh` all ended up inside the .app. An@@ -58,9 +59,9 @@ done# vphone-cli itself opens it by name; the greppable proof is in the comment.## What is deliberately ABSENT is as important:-# repos/ toolchain submodules — build tier, sources only+# Repos/ toolchain submodules — build tier, sources only# ../siblings/ guest sources and GPU provenance; not copied into the# shipped app (GPU extraction runs in native fw prepare)-# vphoned/*.m *.h vendor/ same, and it is the bulk of scripts/+# VPhoned/*.m *.h Vendor/ same, and it is the bulk of Scripts/print -r -- "vphoned/vphoned.plist" # LaunchDaemon plist, injectLaunchDaemonsprint -r -- "vphoned/entitlements.plist" # guest_sign_ent for vphoneddiff --git a/scripts/setup_tools.sh b/Scripts/setup_tools.shsimilarity index 90%rename from scripts/setup_tools.shrename to Scripts/setup_tools.shindex b33f0075..46da2022 100755--- a/scripts/setup_tools.sh+++ b/Scripts/setup_tools.sh@@ -17,16 +17,16 @@# /System/Library/SecurityResearch. It was also the last file# in the bundle linking /opt/homebrew's libcrypto.3.#-# So: no Homebrew, no interpreter, no environment. `scripts/build.sh` builds the app.+# So: no Homebrew, no interpreter, no environment. `Scripts/build.sh` builds the app.#-# Run: zsh scripts/setup_tools.sh before the optional byte-parity test.+# Run: zsh Scripts/setup_tools.sh before the optional byte-parity test.set -euo pipefailSCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"PROJECT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"TOOLS_PREFIX="${TOOLS_PREFIX:-$PROJECT_DIR/.tools}"-REPOS_DIR="$SCRIPT_DIR/repos"+REPOS_DIR="$SCRIPT_DIR/Repos"ensure_repo_submodule() {local rel_path="$1"@@ -55,8 +55,8 @@ INSERT_DYLIB_BIN="$TOOLS_PREFIX/bin/insert_dylib"if [[ -x "$INSERT_DYLIB_BIN" ]]; thenecho " Already built: $INSERT_DYLIB_BIN"else- INSERT_DYLIB_DIR="$REPOS_DIR/insert_dylib"- ensure_repo_submodule "scripts/repos/insert_dylib"+ INSERT_DYLIB_DIR="$REPOS_DIR/InsertDylib"+ ensure_repo_submodule "Scripts/Repos/InsertDylib"echo " Building insert_dylib..."mkdir -p "$TOOLS_PREFIX/bin"clang -o "$INSERT_DYLIB_BIN" "$INSERT_DYLIB_DIR/insert_dylib/main.c" -framework Security -O2diff --git a/Sources/FirmwarePatcher/Binary/InPlaceRewrite.swift b/Sources/FirmwarePatcher/Binary/InPlaceRewrite.swiftindex 2244ab71..fc820da4 100644--- a/Sources/FirmwarePatcher/Binary/InPlaceRewrite.swift+++ b/Sources/FirmwarePatcher/Binary/InPlaceRewrite.swift@@ -19,7 +19,7 @@// So a buffer that will be mutated and written back over its own file is READ.// Nothing that comes through here is large: these are single Mach-Os out of a// guest filesystem — launchd is 639 KB, the biggest is mobileactivationd at-// 4.6 MB — so the copy costs nothing worth having, and `scripts/check_aux.sh` knows+// 4.6 MB — so the copy costs nothing worth having, and `Scripts/check_aux.sh` knows// this spelling is the deliberate one.import Foundationdiff --git a/Sources/FirmwarePatcher/CryptexFilesystem/CryptexFilesystemPatcherGuestPayload.swift b/Sources/FirmwarePatcher/CryptexFilesystem/CryptexFilesystemPatcherGuestPayload.swiftindex dc723aa7..855741ee 100644--- a/Sources/FirmwarePatcher/CryptexFilesystem/CryptexFilesystemPatcherGuestPayload.swift+++ b/Sources/FirmwarePatcher/CryptexFilesystem/CryptexFilesystemPatcherGuestPayload.swift@@ -97,7 +97,7 @@ extension CryptexFilesystemPatcher {/// sources shipped inside the .app — which meant installing CFW onto a VM/// required Xcode and the iPhoneOS SDK on a machine whose only job is to run/// that VM. vphoned is cross-compiled at build time now- /// (`scripts/build.sh`) and staged into the bundle.+ /// (`Scripts/build.sh`) and staged into the bundle.func stageVphoned(to vphonedBin: URL) throws {let prebuilt = try VPhoneGuestBinaries.resolve("vphoned")try FileManager.default.copyItem(at: prebuilt, to: vphonedBin)diff --git a/Sources/FirmwarePatcher/CustomFirmware/CustomFirmwareInjectDylib.swift b/Sources/FirmwarePatcher/CustomFirmware/CustomFirmwareInjectDylib.swiftindex f78d0fe3..bbfa8e86 100644--- a/Sources/FirmwarePatcher/CustomFirmware/CustomFirmwareInjectDylib.swift+++ b/Sources/FirmwarePatcher/CustomFirmware/CustomFirmwareInjectDylib.swift@@ -1,6 +1,6 @@// CustomFirmwareInjectDylib.swift — LC_LOAD_DYLIB / LC_LOAD_WEAK_DYLIB insertion.//-// Replaces the `insert_dylib` binary built from `scripts/repos/insert_dylib`,+// Replaces the `insert_dylib` binary built from `Scripts/Repos/InsertDylib`,// whose only caller is the launchdhook injection in `cfw_install_jb.sh` and// `cfw_install_exp.sh`://diff --git a/Sources/MobileRestoreCore/zip.h b/Sources/MobileRestoreCore/zip.hindex a24a7f11..7c812d5a 100644--- a/Sources/MobileRestoreCore/zip.h+++ b/Sources/MobileRestoreCore/zip.h@@ -14,7 +14,7 @@* libimobiledevice, its glue, libusbmuxd and libtatsu come from the* AppleMobileDeviceLibrary xcframeworks, and zlib and libcurl are in* /usr/lib. Linking Homebrew's libzip would put an absolute /opt/homebrew- * path in the dependency closure, which is exactly what `scripts/check_aux.sh`+ * path in the dependency closure, which is exactly what `Scripts/check_aux.sh`* gate 1 exists to reject.** WHAT IS LOSTdiff --git a/Sources/VPhoneAMFIAllow/vphone-amfi-allow.c b/Sources/VPhoneAMFIAllow/vphone-amfi-allow.cindex a143c553..f324ef10 100644--- a/Sources/VPhoneAMFIAllow/vphone-amfi-allow.c+++ b/Sources/VPhoneAMFIAllow/vphone-amfi-allow.c@@ -3,7 +3,7 @@//// This is the project's copy of github.com/Lakr233/amfi-allow (MIT), which is// one C file and no dependencies, so it is carried here rather than pulled in:-// it cannot be a SwiftPM dependency, because `scripts/build.sh` has to build it+// it cannot be a SwiftPM dependency, because `Scripts/build.sh` has to build it// for arm64e and SwiftPM only emits arm64. Keep it in step with upstream; the// only local changes are this header and the usage text.//diff --git a/Sources/VPhoneCLI/VPhoneFirmwareAEACLI.swift b/Sources/VPhoneCLI/VPhoneFirmwareAEACLI.swiftindex 76a52bf9..63f14e3e 100644--- a/Sources/VPhoneCLI/VPhoneFirmwareAEACLI.swift+++ b/Sources/VPhoneCLI/VPhoneFirmwareAEACLI.swift@@ -4,7 +4,7 @@// fw_prepare.sh, and they are the last of them. `ipsw` is a fine program —// statically linked Go, nothing but system libraries — but it is a program the// user has to install with Homebrew before a .app that is supposed to be-// self-contained can finish a job, which is the thing `scripts/check_aux.sh` exists+// self-contained can finish a job, which is the thing `Scripts/check_aux.sh` exists// to stop.//// ipsw fw aea --key <f> -> vphone-cli fw aea-key <f>diff --git a/Sources/VPhoneCore/VPhoneGuestBinaries.swift b/Sources/VPhoneCore/VPhoneGuestBinaries.swiftindex 84c4c827..16b746d5 100644--- a/Sources/VPhoneCore/VPhoneGuestBinaries.swift+++ b/Sources/VPhoneCore/VPhoneGuestBinaries.swift@@ -13,7 +13,7 @@ public enum VPhoneGuestBinaries {switch self {case let .missing(name, searched):"""- no prebuilt guest binary '\(name)'. Run 'zsh scripts/build.sh'.+ no prebuilt guest binary '\(name)'. Run 'zsh Scripts/build.sh'.Looked in: \(searched.map(\.path).joined(separator: ", "))"""}diff --git a/Sources/VPhoneCore/VPhoneGuestLauncher.swift b/Sources/VPhoneCore/VPhoneGuestLauncher.swiftindex d9647105..2b123b0b 100644--- a/Sources/VPhoneCore/VPhoneGuestLauncher.swift+++ b/Sources/VPhoneCore/VPhoneGuestLauncher.swift@@ -17,7 +17,7 @@ public enum VPhoneGuestLaunchError: Error, CustomStringConvertible {return """\(name) is missing — expected it next to this binary at:\(url.path)- The install looks incomplete. Rebuild with `zsh scripts/build.sh`.+ The install looks incomplete. Rebuild with `zsh Scripts/build.sh`."""case let .blockedByAMFI(guest, cdHash):@@ -40,7 +40,7 @@ public enum VPhoneGuestLaunchError: Error, CustomStringConvertible {case let .missingEntitlements(guest):return """vphone-vm is missing the private PV=3 entitlements: \(guest.path)- Run `zsh scripts/build.sh` to sign this binary, then allow the new signature+ Run `zsh Scripts/build.sh` to sign this binary, then allow the new signaturethrough the host's AMFI policy before launching a VM."""diff --git a/Sources/VPhoneCore/VPhoneResources.swift b/Sources/VPhoneCore/VPhoneResources.swiftindex 25b2596a..117582e9 100644--- a/Sources/VPhoneCore/VPhoneResources.swift+++ b/Sources/VPhoneCore/VPhoneResources.swift@@ -153,7 +153,7 @@ public struct VPhoneResources: Sendable {// was the dangerous one: a `PATH` fallback makes a missing environment look// like a working one, right up until a restore fails on a stranger's// machine. Nothing in this package may resolve an interpreter again — see- // the "Python" section in AGENTS.md, and `scripts/check_aux.sh`, which now+ // the "Python" section in AGENTS.md, and `Scripts/check_aux.sh`, which now// fails outright on a python3 lookup instead of registering it.// With the interpreter went the last `PATH` lookup in this package. Everydiff --git a/Sources/VPhoneCore/VPhoneSudo.swift b/Sources/VPhoneCore/VPhoneSudo.swiftindex aac44e4f..b69df09e 100644--- a/Sources/VPhoneCore/VPhoneSudo.swift+++ b/Sources/VPhoneCore/VPhoneSudo.swift@@ -120,7 +120,7 @@ public enum VPhoneSudoError: Error, CustomStringConvertible {case let .helperMissing(path):"""vphone-ask-for-permission is not next to this binary (looked at \(path)).- It is built by `scripts/build.sh`; without it there is no way to ask for a \+ It is built by `Scripts/build.sh`; without it there is no way to ask for a \password from a window session with no terminal."""}diff --git a/Tests/VPhoneSignTests/VPhoneSignFixtures.swift b/Tests/VPhoneSignTests/VPhoneSignFixtures.swiftindex 3355c41b..992b98b3 100644--- a/Tests/VPhoneSignTests/VPhoneSignFixtures.swift+++ b/Tests/VPhoneSignTests/VPhoneSignFixtures.swift@@ -78,7 +78,7 @@//// Adding a live `ldid` call back — a `which`, a hardcoded Homebrew path, an// environment variable — is the same regression the "Python" section of-// AGENTS.md forbids for an interpreter: a dependency `scripts/check_aux.sh` cannot+// AGENTS.md forbids for an interpreter: a dependency `Scripts/check_aux.sh` cannot// see, and a silent skip when it is missing.import CryptoKitdiff --git a/docs/README.md b/docs/README.mdindex 7e1b80e9..0ecb17ad 100644--- a/docs/README.md+++ b/docs/README.md@@ -21,5 +21,5 @@ These pages give a translated overview and quick start. The English guides above- [Research index](../research/README.md) groups the patch and implementation records by subject.- [Patch inventory](../research/0_binary_patch_comparison.md) is the canonical per-component comparison.-- `zsh scripts/build.sh` builds and bundles the application; `swift test` and `zsh scripts/check_aux.sh` run the tests and bundle checks.+- `zsh Scripts/build.sh` builds and bundles the application; `swift test` and `zsh Scripts/check_aux.sh` run the tests and bundle checks.- `vphone-cli <group> --help` shows the CLI command surface.diff --git a/docs/README_ja.md b/docs/README_ja.mdindex 6b1ff5e2..0254d1bf 100644--- a/docs/README_ja.md+++ b/docs/README_ja.md@@ -31,7 +31,7 @@ cloudOS 26.4(`23E5207q`)との組み合わせで、iPhone17,3 の iOS 26.6.2```shgit clone --recurse-submodules https://github.com/Lakr233/vphone-cli.gitcd vphone-cli-zsh scripts/build.sh+zsh Scripts/build.sh.build/release/vphone-cli host preflight```diff --git a/docs/README_ko.md b/docs/README_ko.mdindex 9c993908..29c94ced 100644--- a/docs/README_ko.md+++ b/docs/README_ko.md@@ -31,7 +31,7 @@ cloudOS 26.4(`23E5207q`)와 함께 iPhone17,3 iOS 26.6.2(`23G90`), 27.0(`24A435````shgit clone --recurse-submodules https://github.com/Lakr233/vphone-cli.gitcd vphone-cli-zsh scripts/build.sh+zsh Scripts/build.sh.build/release/vphone-cli host preflight```diff --git a/docs/README_zh.md b/docs/README_zh.mdindex 17bd4413..ebfe76bd 100644--- a/docs/README_zh.md+++ b/docs/README_zh.md@@ -31,7 +31,7 @@ vphone-cli vm launch myphone```shgit clone --recurse-submodules https://github.com/Lakr233/vphone-cli.gitcd vphone-cli-zsh scripts/build.sh+zsh Scripts/build.sh.build/release/vphone-cli host preflight```diff --git a/docs/guides/host-setup.md b/docs/guides/host-setup.mdindex f245aa6c..00830bce 100644--- a/docs/guides/host-setup.md+++ b/docs/guides/host-setup.md@@ -9,11 +9,11 @@ The VM needs an Apple Silicon Mac running macOS 15 or newer. PV=3 research guestA distributed `.app` needs no Homebrew, Python or Xcode **at runtime**. A source build needs Xcode and its iPhoneOS SDK to compile vphoned. From a source checkout:```sh-zsh scripts/build.sh+zsh Scripts/build.sh.build/release/vphone-cli host preflight```-Use `scripts/build.sh` rather than bare `swift build`: the latter does not perform the required signing and bundling. `host preflight` checks the entitled companion before any VM is started. If AMFI refuses it, the error prints the bundled allowlist helper command.+Use `Scripts/build.sh` rather than bare `swift build`: the latter does not perform the required signing and bundling. `host preflight` checks the entitled companion before any VM is started. If AMFI refuses it, the error prints the bundled allowlist helper command.## Permit the entitled VM binarydiff --git a/research/0_binary_patch_comparison.md b/research/0_binary_patch_comparison.mdindex 71a30775..54de67b9 100644--- a/research/0_binary_patch_comparison.md+++ b/research/0_binary_patch_comparison.md@@ -416,7 +416,7 @@ and neither changing a byte:* The three idempotence divergences in the section above stand: the Swiftrecognises its own output where the Python double-applies or exits 1.-**Not removed:** `scripts/repos/insert_dylib`. Nothing in the product runs it —+**Not removed:** `Scripts/Repos/InsertDylib`. Nothing in the product runs it —`CFWInjectDylib` does the injection in process — but`CFWMachOTests.matchesInsertDylib` still runs the real binary as an independentbyte-parity reference, gated on its presence. Deleting the submodule would turn@@ -1119,7 +1119,7 @@ cache rebuild.- added still screenshot actions that can copy the captured image to the pasteboard or save a PNG to disk using the same private capture path.- `make build` is used as the sanity check path; live VM validation is still needed to confirm the exact screenshot object type returned on macOS 15.- 2026-03-15 tooling source sync update:- - removed ad-hoc `git clone` source fetching from `scripts/setup_tools.sh` and `scripts/setup_libimobiledevice.sh`.+ - removed ad-hoc `git clone` source fetching from `Scripts/setup_tools.sh` and `scripts/setup_libimobiledevice.sh`.- added pinned git-submodule sources under `scripts/repos/` for: `trustcache`, `insert_dylib`, `libplist`, `libimobiledevice-glue`, `libusbmuxd`, `libtatsu`, `libimobiledevice`, `libirecovery`, `idevicerestore`.- setup scripts now initialize required submodules via `git submodule update --init --recursive <path>` and stage build copies under local tool build directories.- 2026-06-15 cloudOS 26.5 (23F77) JB retargeting — P0 (sudo/setuid):diff --git a/research/guest/devmode_xpc_protocol.md b/research/guest/devmode_xpc_protocol.mdindex 58662ce9..703fd69a 100644--- a/research/guest/devmode_xpc_protocol.md+++ b/research/guest/devmode_xpc_protocol.md@@ -104,7 +104,7 @@ Added as `devmode` capability in vphoned guest agent:### Entitlements-Added to `scripts/vphoned/entitlements.plist`:+Added to `Scripts/VPhoned/entitlements.plist`:```xml<key>com.apple.private.amfi.developer-mode-control</key>diff --git a/research/history/intg_update_status.md b/research/history/intg_update_status.mdindex 72b6b76b..67b9fbe4 100644--- a/research/history/intg_update_status.md+++ b/research/history/intg_update_status.md@@ -34,7 +34,7 @@| **D4** shell → zero | P3 required, P4 in scope | **0%.** The dist tier is ten `.sh` files; the tiers and gates are what make it possible to convert them one at a time without losing track of what ships |D4 going up is not an accounting artifact. `cfw-kit/` (1,036 lines) and-`scripts/check_aux.sh` (327) are both new on this branch; everything else nets+`Scripts/check_aux.sh` (327) are both new on this branch; everything else netsto −85. The 5,098 lines of Python that left `scripts/patchers/` did not take anyshell with them, because the installers called into that Python and now callinto `vphone-cli cfw` instead — same scripts, different callee. `cfw_install*.sh`@@ -110,11 +110,11 @@ Two corrections to the earlier ledger's arithmetic:> whether the product was any closer to standing on its own. Kept because the> shape of the old list is what the tier split was a response to.>-> **Now**: `zsh scripts/check_aux.sh` reports gates 0, 1, 1b, 1c, 2 and 3 all+> **Now**: `zsh Scripts/check_aux.sh` reports gates 0, 1, 1b, 1c, 2 and 3 all> green, with the **dist tier's registered list empty**. See> [`d2_d3_self_containment.md`](../host/d2_d3_self_containment.md).-`zsh scripts/check_aux.sh --fast`, as of the previous revision:+`zsh Scripts/check_aux.sh --fast`, as of the previous revision:- **Gate 1 (dependency closure)** and **gate 1b (relocation)** both reportnothing. This is the change since the last revision of this file, which@@ -152,7 +152,7 @@ against 5,895 in 22 files at `6d5ce7d`. The largest single files:| `scripts/cfw_install.sh` | 579 || `scripts/cfw_install_dev.sh` | 512 || `scripts/cfw_install_jb.sh` | 484 |-| `scripts/check_aux.sh` | 327 |+| `Scripts/check_aux.sh` | 327 || `scripts/vphone_jb_setup.sh` | 312 || `cfw-kit/` (5 files) | 1,036 |@@ -290,9 +290,9 @@ Re-run these rather than trusting the tables:git ls-files '*.py' # D1: must print nothinggrep -rn '_resolve_python3' scripts/ Sources/ Makefile # must print nothinggrep -rn '<<.*PY' scripts/ # heredocs: must print nothing-grep -rn 'python' scripts/*.sh # comments only, no call sites+grep -rn 'python' Scripts/*.sh # comments only, no call sites-zsh scripts/check_aux.sh --fast # D2: gates 1, 1b, 2+zsh Scripts/check_aux.sh --fast # D2: gates 1, 1b, 2find .build/vphone-cli.app -type f # D2: what the bundle shipsgit ls-files scripts cfw-kit | grep '\.sh$' | xargs wc -l # D4diff --git a/research/host/d2_d3_self_containment.md b/research/host/d2_d3_self_containment.mdindex 06fac8d9..9fd86de5 100644--- a/research/host/d2_d3_self_containment.md+++ b/research/host/d2_d3_self_containment.md@@ -28,8 +28,8 @@ Every script declares its tier on **line 2**:# vphone-tier: dist```-`scripts/dist_manifest.sh` reads those declarations and prints the dist-payload. `scripts/build.sh` and `make bundle` both stage from it, so the+`Scripts/dist_manifest.sh` reads those declarations and prints the dist+payload. `Scripts/build.sh` and `make bundle` both stage from it, so thebundler is an **allowlist**. It used to be a list of exclusions, which is howthe `.app` came to carry `build.sh`, `check_aux.sh` and `setup_tools.sh` — thelast of which runs `brew install`. An undeclared script now ships nowhere anddiff --git a/research/host/host_binary_split.md b/research/host/host_binary_split.mdindex a8b8f745..5a93f415 100644--- a/research/host/host_binary_split.md+++ b/research/host/host_binary_split.md@@ -172,7 +172,7 @@ strings. That process is `vphone-vm`.It launches perfectly. The AMFI probe therefore concludes nothing is wrong, theboot proceeds, and it fails much later trying to create a PV=3 machine — farfrom the cause. A bare `swift build -c release` leaves exactly that state-behind, because only `make build` / `scripts/build.sh` sign. Both now verify+behind, because only `make build` / `Scripts/build.sh` sign. Both now verifythe entitlements actually landed and fail if they did not. This was found bywalking into it.diff --git a/research/host/naming_and_shared_module_review.md b/research/host/naming_and_shared_module_review.mdindex 6f73130f..b281b25a 100644--- a/research/host/naming_and_shared_module_review.md+++ b/research/host/naming_and_shared_module_review.md@@ -73,6 +73,6 @@ dependencies remain owned by the packages that use them.## Verification- `swift test --jobs 4`: 340 tests in 74 suites passed.-- `zsh scripts/build.sh`: host binaries, signed app, and iOS guest built.-- `zsh scripts/check_aux.sh`: all admission gates passed.+- `zsh Scripts/build.sh`: host binaries, signed app, and iOS guest built.+- `zsh Scripts/check_aux.sh`: all admission gates passed.- `vphone-cli --help`: public `vm`, `fw`, and `cfw` command names remain present.diff --git a/research/restore/p2_restore_off_python.md b/research/restore/p2_restore_off_python.mdindex 5971d1c8..324b506c 100644--- a/research/restore/p2_restore_off_python.md+++ b/research/restore/p2_restore_off_python.md@@ -279,7 +279,7 @@ Moving the restore backend into the package is what finally emptied `vendor/`.- **`vendor/` is gone.** Every one of the seven dependencies resolves by URL;`Package.resolved` pins fourteen once transitives are counted.- **Submodules went from 9 to 3**: `scripts/resources`,- `scripts/repos/trustcache`, `scripts/repos/insert_dylib`. The other six were+ `scripts/repos/trustcache`, `Scripts/Repos/InsertDylib`. The other six wereSwiftPM checkouts this repository pinned by commit, which meant a`git submodule update` before any build and a tree that could sit at anunreleased commit — MachOKit was four commits past 0.46.1, Dynamic two pastdiff --git a/siblings/gpu/README.md b/siblings/gpu/README.mdindex 10f75f21..04c6baf0 100644--- a/siblings/gpu/README.md+++ b/siblings/gpu/README.md@@ -20,6 +20,6 @@ Metal compilation, leaving the host VM window black even while vphoned connects.`main.mm` is the compiler-plugin reimplementation from[0xjohnnydev's metal-patch](https://github.com/0xjohnnydev/0xjohnnydev.github.io/blob/main/blog/assets/metal-patch/main.mm).`make -C siblings gpu` builds and ad-hoc signs it for iPhoneOS arm64e.-`scripts/build.sh` stores it as `Resources/gpu/compiler-plugin.tar.zst` in the+`Scripts/build.sh` stores it as `Resources/gpu/compiler-plugin.tar.zst` in theapp. `fw prepare` extracts that archive and puts the dylib alongside thefirmware-sourced GPU driver before exposing the complete restore tree.