Skip to content

Fix Patchless for cloudOS 26.4#336

Open
mpass99 wants to merge 2 commits into
Lakr233:mainfrom
mpass99:fix/dynamic-apfs-sealvolume
Open

Fix Patchless for cloudOS 26.4#336
mpass99 wants to merge 2 commits into
Lakr233:mainfrom
mpass99:fix/dynamic-apfs-sealvolume

Conversation

@mpass99
Copy link
Copy Markdown
Contributor

@mpass99 mpass99 commented May 21, 2026

by dynamically matching and downloading the required apfs_sealvolume version.

We find that apfs_sealvolume is more version dependent than expected.
A 26.3 apfs_sealvolume does not work with a 26.4 filesystem and vice versa.

@zqxwce
Copy link
Copy Markdown
Collaborator

zqxwce commented May 21, 2026

cool, testing it now, 26.4 has a problem with the ramdisk in 26.4 with the other variants, that I am trying to solve, but it seems that this is not a limiting factor to the patchless variant.

@mpass99
Copy link
Copy Markdown
Contributor Author

mpass99 commented May 21, 2026

Wow thank you for this lightning fast review. I just noticed that I forgot to push one part. Give me one second 😅

@zqxwce
Copy link
Copy Markdown
Collaborator

zqxwce commented May 21, 2026

there seem to be an issue in the restore stage:

@ make setup_machine NONE_INTERACTIVE=1 IPHONE_SOURCE=ipsws/iPhone17,3_26.5_23F77_Restore.ips
w CLOUDOS_SOURCE=ipsws/c0ecdb4b310cf5239ab2b248dd3098eec297dc5aa3bbe6ada27273262b0b8b64.ipsw LESS=1
SUDO_PASSWORD="" \
	NONE_INTERACTIVE="1" \
	NO_BINPACK="" \
	NO_VPHONED="" \
	SPOOF_BUILD="" \
	zsh scripts/setup_machine.sh \
		 \
		 \
		 \
		--less \

[*] setup_machine mode: less, project_setup=run, non_interactive=1, no_binpack=0, no_vphoned=0
=== Installing Homebrew dependencies ===
  wget: already installed
  gnu-tar: already installed
  openssl@3: already installed
  ldid-procursus: already installed
  sshpass: already installed
  keystone: already installed
  git-lfs: already installed
  python@3.13: already installed
  libusb: already installed
  ipsw: already installed


=== Project setup ===
VARIANT= zsh scripts/setup_tools.sh
[1/4] Checking brew packages...
  All brew packages installed
[2/4] trustcache
  Already built: /Users/user/dev/vphone-cli/.tools/bin/trustcache
[3/4] insert_dylib
  Already built: /Users/user/dev/vphone-cli/.tools/bin/insert_dylib
[4/4] Python venv
=== Creating venv ===
  Python:  /Users/user/.local/share/uv/python/cpython-3.14.3-macos-aarch64-none/bin/python3.14 (Python 3.14.3)
  venv:    /Users/user/dev/vphone-cli/.venv
  deps:    /Users/user/dev/vphone-cli/requirements.txt

Requirement already satisfied: typer in ./.venv/lib/python3.14/site-packages (from -r /Users/user/dev/vphone-cli/requirements.txt (line 1)) (0.25.1)
Requirement already satisfied: capstone in ./.venv/lib/python3.14/site-packages (from -r /Users/user/dev/vphone-cli/requirements.txt (line 2)) (5.0.7)
Requirement already satisfied: keystone-engine in ./.venv/lib/python3.14/site-packages (from -r /Users/user/dev/vphone-cli/requirements.txt (line 3)) (0.9.2)
Requirement already satisfied: pyimg4 in ./.venv/lib/python3.14/site-packages (from -r /Users/user/dev/vphone-cli/requirements.txt (line 4)) (0.8.8)
Requirement already satisfied: pymobiledevice3>=9.5.0 in ./.venv/lib/python3.14/site-packages (from -r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (9.12.3)
Requirement already satisfied: ipsw-parser in ./.venv/lib/python3.14/site-packages (from -r /Users/user/dev/vphone-cli/requirements.txt (line 6)) (1.7.0)
Requirement already satisfied: click>=8.2.1 in ./.venv/lib/python3.14/site-packages (from typer->-r /Users/user/dev/vphone-cli/requirements.txt (line 1)) (8.4.0)
Requirement already satisfied: shellingham>=1.3.0 in ./.venv/lib/python3.14/site-packages (from typer->-r /Users/user/dev/vphone-cli/requirements.txt (line 1)) (1.5.4)
Requirement already satisfied: rich>=13.8.0 in ./.venv/lib/python3.14/site-packages (from typer->-r /Users/user/dev/vphone-cli/requirements.txt (line 1)) (15.0.0)
Requirement already satisfied: annotated-doc>=0.0.2 in ./.venv/lib/python3.14/site-packages (from typer->-r /Users/user/dev/vphone-cli/requirements.txt (line 1)) (0.0.4)
Requirement already satisfied: apple-compress>=0.2.3 in ./.venv/lib/python3.14/site-packages (from pyimg4->-r /Users/user/dev/vphone-cli/requirements.txt (line 4)) (0.2.3)
Requirement already satisfied: asn1<3.0.0 in ./.venv/lib/python3.14/site-packages (from pyimg4->-r /Users/user/dev/vphone-cli/requirements.txt (line 4)) (2.8.0)
Requirement already satisfied: pycryptodome>=3.18.0 in ./.venv/lib/python3.14/site-packages (from pyimg4->-r /Users/user/dev/vphone-cli/requirements.txt (line 4)) (3.23.0)
Requirement already satisfied: pylzss==0.3.4 in ./.venv/lib/python3.14/site-packages (from pyimg4->-r /Users/user/dev/vphone-cli/requirements.txt (line 4)) (0.3.4)
Requirement already satisfied: enum-compat in ./.venv/lib/python3.14/site-packages (from asn1<3.0.0->pyimg4->-r /Users/user/dev/vphone-cli/requirements.txt (line 4)) (0.0.3)
Requirement already satisfied: construct>=2.9.29 in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (2.10.70)
Requirement already satisfied: construct-typing>=0.7.0 in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (0.7.0)
Requirement already satisfied: coloredlogs in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (15.0.1)
Requirement already satisfied: IPython in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (9.13.0)
Requirement already satisfied: bpylist2>=4.0.1 in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (4.1.1)
Requirement already satisfied: pygments in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (2.20.0)
Requirement already satisfied: hexdump in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (3.3)
Requirement already satisfied: daemonize in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (2.5.0)
Requirement already satisfied: gpxpy!=1.6.0,<1.7.0 in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (1.6.2)
Requirement already satisfied: pykdebugparser>=1.2.7 in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (1.2.7)
Requirement already satisfied: pyusb>=1.2.1 in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (1.3.1)
Requirement already satisfied: tqdm in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (4.67.3)
Requirement already satisfied: requests in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (2.34.2)
Requirement already satisfied: xonsh in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (0.23.7)
Requirement already satisfied: parameter_decorators in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (0.0.2)
Requirement already satisfied: packaging in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (26.2)
Requirement already satisfied: pygnuutils>=0.0.7 in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (0.1.1)
Requirement already satisfied: cryptography>=41.0.1 in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (48.0.0)
Requirement already satisfied: pycrashreport>=2.0.0 in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (2.0.0)
Requirement already satisfied: fastapi>=0.93.0 in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (0.136.1)
Requirement already satisfied: uvicorn>=0.15.0 in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (0.47.0)
Requirement already satisfied: wsproto in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (1.3.2)
Requirement already satisfied: Pillow in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (12.2.0)
Requirement already satisfied: inquirer3>=0.6.0 in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (0.6.1)
Requirement already satisfied: ifaddr in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (0.2.0)
Requirement already satisfied: hyperframe in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (6.1.0)
Requirement already satisfied: srptools in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (1.0.1)
Requirement already satisfied: qh3<2,>=1.0.0 in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (1.8.1)
Requirement already satisfied: developer_disk_image>=0.0.2 in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (0.2.0)
Requirement already satisfied: opack2 in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (0.0.1)
Requirement already satisfied: psutil in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (7.2.2)
Requirement already satisfied: pytun-pmd3>=3.0.3 in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (3.0.3)
Requirement already satisfied: prompt_toolkit in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (3.0.52)
Requirement already satisfied: python-pcapng>=2.1.1 in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (2.1.1)
Requirement already satisfied: plumbum in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (1.10.0)
Requirement already satisfied: typer-injector>=0.2.0 in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (0.3.0)
Requirement already satisfied: defusedxml in ./.venv/lib/python3.14/site-packages (from pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (0.7.1)
Requirement already satisfied: remotezip2 in ./.venv/lib/python3.14/site-packages (from ipsw-parser->-r /Users/user/dev/vphone-cli/requirements.txt (line 6)) (0.0.2)
Requirement already satisfied: loguru<0.8.0,>=0.7.2 in ./.venv/lib/python3.14/site-packages (from apple-compress>=0.2.3->pyimg4->-r /Users/user/dev/vphone-cli/requirements.txt (line 4)) (0.7.3)
Requirement already satisfied: typing_extensions>=4.6.0 in ./.venv/lib/python3.14/site-packages (from construct-typing>=0.7.0->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (4.15.0)
Requirement already satisfied: cffi>=2.0.0 in ./.venv/lib/python3.14/site-packages (from cryptography>=41.0.1->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (2.0.0)
Requirement already satisfied: pycparser in ./.venv/lib/python3.14/site-packages (from cffi>=2.0.0->cryptography>=41.0.1->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (3.0)
Requirement already satisfied: starlette>=0.46.0 in ./.venv/lib/python3.14/site-packages (from fastapi>=0.93.0->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (1.0.0)
Requirement already satisfied: pydantic>=2.9.0 in ./.venv/lib/python3.14/site-packages (from fastapi>=0.93.0->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (2.13.4)
Requirement already satisfied: typing-inspection>=0.4.2 in ./.venv/lib/python3.14/site-packages (from fastapi>=0.93.0->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (0.4.2)
Requirement already satisfied: blessed<2.0.0,>=1.20.0 in ./.venv/lib/python3.14/site-packages (from inquirer3>=0.6.0->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (1.41.0)
Requirement already satisfied: editor<2.0.0,>=1.6.6 in ./.venv/lib/python3.14/site-packages (from inquirer3>=0.6.0->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (1.8.0)
Requirement already satisfied: readchar<5.0.0,>=4.0.6 in ./.venv/lib/python3.14/site-packages (from inquirer3>=0.6.0->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (4.2.2)
Requirement already satisfied: wcwidth>=0.7 in ./.venv/lib/python3.14/site-packages (from blessed<2.0.0,>=1.20.0->inquirer3>=0.6.0->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (0.7.0)
Requirement already satisfied: jinxed<3,>=2.0 in ./.venv/lib/python3.14/site-packages (from blessed<2.0.0,>=1.20.0->inquirer3>=0.6.0->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (2.0.0)
Requirement already satisfied: runs in ./.venv/lib/python3.14/site-packages (from editor<2.0.0,>=1.6.6->inquirer3>=0.6.0->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (1.3.0)
Requirement already satisfied: xmod in ./.venv/lib/python3.14/site-packages (from editor<2.0.0,>=1.6.6->inquirer3>=0.6.0->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (1.10.0)
Requirement already satisfied: annotated-types>=0.6.0 in ./.venv/lib/python3.14/site-packages (from pydantic>=2.9.0->fastapi>=0.93.0->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (0.7.0)
Requirement already satisfied: pydantic-core==2.46.4 in ./.venv/lib/python3.14/site-packages (from pydantic>=2.9.0->fastapi>=0.93.0->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (2.46.4)
Requirement already satisfied: termcolor in ./.venv/lib/python3.14/site-packages (from pykdebugparser>=1.2.7->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (3.3.0)
Requirement already satisfied: markdown-it-py>=2.2.0 in ./.venv/lib/python3.14/site-packages (from rich>=13.8.0->typer->-r /Users/user/dev/vphone-cli/requirements.txt (line 1)) (4.2.0)
Requirement already satisfied: mdurl~=0.1 in ./.venv/lib/python3.14/site-packages (from markdown-it-py>=2.2.0->rich>=13.8.0->typer->-r /Users/user/dev/vphone-cli/requirements.txt (line 1)) (0.1.2)
Requirement already satisfied: anyio<5,>=3.6.2 in ./.venv/lib/python3.14/site-packages (from starlette>=0.46.0->fastapi>=0.93.0->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (4.13.0)
Requirement already satisfied: idna>=2.8 in ./.venv/lib/python3.14/site-packages (from anyio<5,>=3.6.2->starlette>=0.46.0->fastapi>=0.93.0->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (3.15)
Requirement already satisfied: h11>=0.8 in ./.venv/lib/python3.14/site-packages (from uvicorn>=0.15.0->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (0.16.0)
Requirement already satisfied: humanfriendly>=9.1 in ./.venv/lib/python3.14/site-packages (from coloredlogs->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (10.0)
Requirement already satisfied: decorator>=5.1.0 in ./.venv/lib/python3.14/site-packages (from IPython->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (5.3.1)
Requirement already satisfied: ipython-pygments-lexers>=1.0.0 in ./.venv/lib/python3.14/site-packages (from IPython->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (1.1.1)
Requirement already satisfied: jedi>=0.18.2 in ./.venv/lib/python3.14/site-packages (from IPython->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (0.20.0)
Requirement already satisfied: matplotlib-inline>=0.1.6 in ./.venv/lib/python3.14/site-packages (from IPython->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (0.2.2)
Requirement already satisfied: pexpect>4.6 in ./.venv/lib/python3.14/site-packages (from IPython->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (4.9.0)
Requirement already satisfied: stack_data>=0.6.0 in ./.venv/lib/python3.14/site-packages (from IPython->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (0.6.3)
Requirement already satisfied: traitlets>=5.13.0 in ./.venv/lib/python3.14/site-packages (from IPython->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (5.15.0)
Requirement already satisfied: parso<0.9.0,>=0.8.6 in ./.venv/lib/python3.14/site-packages (from jedi>=0.18.2->IPython->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (0.8.7)
Requirement already satisfied: ptyprocess>=0.5 in ./.venv/lib/python3.14/site-packages (from pexpect>4.6->IPython->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (0.7.0)
Requirement already satisfied: executing>=1.2.0 in ./.venv/lib/python3.14/site-packages (from stack_data>=0.6.0->IPython->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (2.2.1)
Requirement already satisfied: asttokens>=2.1.0 in ./.venv/lib/python3.14/site-packages (from stack_data>=0.6.0->IPython->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (3.0.1)
Requirement already satisfied: pure-eval in ./.venv/lib/python3.14/site-packages (from stack_data>=0.6.0->IPython->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (0.2.3)
Requirement already satisfied: arrow in ./.venv/lib/python3.14/site-packages (from opack2->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (1.4.0)
Requirement already satisfied: python-dateutil>=2.7.0 in ./.venv/lib/python3.14/site-packages (from arrow->opack2->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (2.9.0.post0)
Requirement already satisfied: tzdata in ./.venv/lib/python3.14/site-packages (from arrow->opack2->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (2026.2)
Requirement already satisfied: six>=1.5 in ./.venv/lib/python3.14/site-packages (from python-dateutil>=2.7.0->arrow->opack2->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (1.17.0)
Requirement already satisfied: charset_normalizer<4,>=2 in ./.venv/lib/python3.14/site-packages (from requests->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (3.4.7)
Requirement already satisfied: urllib3<3,>=1.26 in ./.venv/lib/python3.14/site-packages (from requests->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (2.7.0)
Requirement already satisfied: certifi>=2023.5.7 in ./.venv/lib/python3.14/site-packages (from requests->pymobiledevice3>=9.5.0->-r /Users/user/dev/vphone-cli/requirements.txt (line 5)) (2026.5.20)

=== Building keystone dylib ===
  static lib: /opt/homebrew/Cellar/keystone/0.9.2/lib/libkeystone.a
  dylib dest: /Users/user/dev/vphone-cli/.venv/lib/python3.14/site-packages/keystone/libkeystone.dylib
  dylib built OK

=== Verifying imports ===
  capstone  OK
  keystone  OK
  pyimg4    OK
  pmd3      OK

=== venv ready ===
  Activate:   source /Users/user/dev/vphone-cli/.venv/bin/activate
  Deactivate: deactivate

All tools installed.

=== Project setup ===
make[1]: Nothing to be done for `build'.

=== Firmware prep ===
CPU="8          " MEMORY="8192       " \
	zsh scripts/vm_create.sh --dir vm --disk-size 64
=== vphone create_vm ===
Directory : vm
Disk size : 64 GB
AVPBooter : /System/Library/Frameworks/Virtualization.framework/Versions/A/Resources/AVPBooter.vresearch1.bin
AVPSEPBooter: /System/Library/Frameworks/Virtualization.framework/Versions/A/Resources/AVPSEPBooter.vresearch1.bin

[1/4] Creating vm/
[2/4] Creating sparse disk image (64 GB)
  -> vm/Disk.img (  0B on disk)
[3/4] Creating SEP storage (512 KB)
[4/4] Copying ROMs
  AVPBooter.vresearch1.bin — copied (305928 bytes)
  AVPSEPBooter.vresearch1.bin — copied (167936 bytes)
[5/4] Generating VM manifest (config.plist)
[5/4] Created VM manifest: vm/config.plist

=== VM created at vm/ ===

Contents:
total 1960
-rw-r--r--@ 1 user  staff   299K 21 מאי  16:50 AVPBooter.vresearch1.bin
-rw-r--r--@ 1 user  staff   164K 21 מאי  16:50 AVPSEPBooter.vresearch1.bin
-rw-r--r--@ 1 user  staff   1.0K 21 מאי  16:50 config.plist
-rw-r--r--@ 1 user  staff    64G 21 מאי  16:50 Disk.img
-rw-r--r--@ 1 user  staff   512K 21 מאי  16:50 SEPStorage

Manifest (config.plist) saved with VM configuration.
Future boots will read configuration from this manifest.

Next steps:
  1. Prepare firmware:  make fw_prepare
  2. Patch firmware:    make fw_patch
  3. Boot DFU:          make boot_dfu
  4. Boot normal:       make boot

=== Firmware prep ===
cd vm && bash "/Users/user/dev/vphone-cli/scripts/fw_prepare.sh"
=== prepare_firmware ===
  Device:   iPhone17,3
  iPhone:   ipsws/iPhone17,3_26.5_23F77_Restore.ipsw
  CloudOS:  ipsws/c0ecdb4b310cf5239ab2b248dd3098eec297dc5aa3bbe6ada27273262b0b8b64.ipsw
  IPSWs:    /Users/user/dev/vphone-cli/scripts/../ipsws
  Output:   /Users/user/dev/vphone-cli/vm/iPhone17,3_26.5_23F77_Restore/

==> Skipping: '/Users/user/dev/vphone-cli/scripts/../ipsws/iPhone17,3_26.5_23F77_Restore.ipsw' already exists.
==> Skipping: '/Users/user/dev/vphone-cli/scripts/../ipsws/c0ecdb4b310cf5239ab2b248dd3098eec297dc5aa3bbe6ada27273262b0b8b64.ipsw' already exists.
apfs_sealvolume_26.5 already present
==> Cached: iPhone17,3_26.5_23F77_Restore
==> Cloning iPhone17,3_26.5_23F77_Restore → iPhone17,3_26.5_23F77_Restore ...
==> Cached: c0ecdb4b310cf5239ab2b248dd3098eec297dc5aa3bbe6ada27273262b0b8b64
==> Cloning c0ecdb4b310cf5239ab2b248dd3098eec297dc5aa3bbe6ada27273262b0b8b64 → c0ecdb4b310cf5239ab2b248dd3098eec297dc5aa3bbe6ada27273262b0b8b64 ...
==> Importing cloudOS firmware components ...
==> Generating hybrid plists ...
  cloudOS vresearch101ap: release=#4, research=#6
  cloudOS vphone600ap:    release=#3, research=#5
  iPhone  erase: #0
  wrote BuildManifest.plist
  wrote Restore.plist
==> Cleaning up ...
==> Done. Restore directory ready: iPhone17,3_26.5_23F77_Restore/
    Run 'make fw_patch' to patch boot-chain components.

=== Firmware patch ===
Password:
=== Building vphone-cli patcher (b4e6367) ===
    |             `- warning: initialization of variable 'shouldReveal' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
111 |         reveal.target = nil
112 |         reveal.action = nil
[6/8] Compiling vphone_cli VPhoneBuildInfo.swift
Build complete! (4.49s)
"/Users/user/dev/vphone-cli/.build/debug/vphone-cli" patch-firmware --vm-directory "/Users/user/dev/vphone-cli/vm" \
	--variant less \

[*] VM directory:      /Users/user/dev/vphone-cli/vm
[*] Restore directory: /Users/user/dev/vphone-cli/vm/iPhone17,3_26.5_23F77_Restore
[*] Patching 9 boot-chain components ...

============================================================
  AVPBooter: /Users/user/dev/vphone-cli/vm/AVPBooter.vresearch1.bin
============================================================
  format: 305928 bytes
  [+] saved

============================================================
  iBSS: /Users/user/dev/vphone-cli/vm/iPhone17,3_26.5_23F77_Restore/Firmware/dfu/iBSS.vresearch101.RELEASE.im4p
============================================================
  format: 740704 bytes
  [+] saved

============================================================
  iBEC: /Users/user/dev/vphone-cli/vm/iPhone17,3_26.5_23F77_Restore/Firmware/dfu/iBEC.vresearch101.RELEASE.im4p
============================================================
  format: 740704 bytes
  0x0A417B: → "Loaded iBEC"  [serial label]
  0x0A4226: → "Loaded iBEC"  [serial label]
  0x00975C: b.ne 0x986c → nop   [image4 callback: b.ne → nop]
  0x009760: mov x0, x22 → mov x0, #0  [image4 callback: mov x0,x22 → mov x0,#0]
  0x060330: → "serial=3 -v debug=0x2014e %s"  [boot-args string]
  0x01168C: adrp x2, 0xa5000 → adrp x2, 0x60000  [boot-args: adrp x2 → new string page]
  0x011690: add x2, x2, #0x6c5 → add x2, x2, #0x330  [boot-args: add x2 → new string offset]

  [7 ibec patches applied]
  [+] 7 iBEC patches applied
  [+] saved

============================================================
  LLB: /Users/user/dev/vphone-cli/vm/iPhone17,3_26.5_23F77_Restore/Firmware/all_flash/LLB.vresearch101.RELEASE.im4p
============================================================
  format: 740704 bytes
  0x0A417B: → "Loaded LLB"  [serial label]
  0x0A4226: → "Loaded LLB"  [serial label]
  0x00975C: b.ne 0x986c → nop   [image4 callback: b.ne → nop]
  0x009760: mov x0, x22 → mov x0, #0  [image4 callback: mov x0,x22 → mov x0,#0]
  0x060330: → "serial=3 -v debug=0x2014e %s"  [boot-args string]
  0x01168C: adrp x2, 0xa5000 → adrp x2, 0x60000  [boot-args: adrp x2 → new string page]
  0x011690: add x2, x2, #0x6c5 → add x2, x2, #0x330  [boot-args: add x2 → new string offset]
  0x036A1C: cbz w0, 0x36a3c → b 0x36a3c  [rootfs: skip sig check (0x3B7)]
  [-] rootfs b.hs: expected 1 'cmp x8, #0x400', found 3
  0x036A64: cbz w0, 0x36830 → b 0x36830  [rootfs: skip sig verify (0x3C2)]
  0x03A608: cbz x8, 0x3a654 → nop   [rootfs: NOP cbz x8 null check (#0x78)]
  0x03A7C8: cbz w0, 0x3a7e0 → b 0x3a7e0  [rootfs: skip size verify (0x110)]
  0x01A35C: cbnz w0, 0x1a3e8 → nop   [panic bypass: NOP cbnz w0]

  [12 llb patches applied]
  [+] 12 LLB patches applied
  [+] saved

============================================================
  TXM: /Users/user/dev/vphone-cli/vm/iPhone17,3_26.5_23F77_Restore/Firmware/txm.iphoneos.research.im4p
============================================================
  format: 442400 bytes
  [+] saved

============================================================
  kernelcache: /Users/user/dev/vphone-cli/vm/iPhone17,3_26.5_23F77_Restore/kernelcache.research.vphone600
============================================================
  format: 43368448 bytes
  [+] saved

============================================================
  DeviceTree: /Users/user/dev/vphone-cli/vm/iPhone17,3_26.5_23F77_Restore/Firmware/all_flash/DeviceTree.vphone600ap.im4p
============================================================
  format: 68480 bytes
  0x000128: 7379736366672f53724e6d2f → 7670686f6e652d3133333700  [devicetree.serial_number]
  0x00052C: 73797363 → 02000000  [devicetree.home_button_type]
  0x00D20C: 73797363 → fc090000  [devicetree.artwork_device_subtype]
  0x00D354: 73797363 → 90000000  [devicetree.island_notch_location]

  [4 DeviceTree patch(es) applied]
  [+] 4 DeviceTree patches applied
  [+] saved

============================================================
  Filesystem: /Users/user/dev/vphone-cli/vm/iPhone17,3_26.5_23F77_Restore/BuildManifest.plist
============================================================
  format: 55324 bytes
Merging Filesystems
- Converting OS image
- Merging App OS Cryptex
- Merging System OS Cryptex
- Fix Dyld Cache
- Fix GPU Driver
- Patch Mobile Activation
- Add vphoned
- Add binpack
- Finalizing merged image
Creating Trustcache
Creating mtree
Creating DigestDB and Root Hash
Used time: 1779371551833560123
  [+] 1 Filesystem patches applied
  [+] saved

============================================================
  Manifest: /Users/user/dev/vphone-cli/vm/iPhone17,3_26.5_23F77_Restore/BuildManifest.plist
============================================================
  format: 55281 bytes
  [+] 1 Manifest patches applied
  [+] saved

============================================================
  All 9 components patched successfully! (25 total patches)
============================================================
[patch-firmware] applied 25 patches for less

=== Restore phase ===
[*] Starting DFU boot in background...
[+] boot_dfu running (pid=61171, log=/Users/user/dev/vphone-cli/setup_logs/boot_dfu.log)
[+] Device identity loaded: UDID=0000FE01-A8EB59CAD6780044 ECID=0xA8EB59CAD6780044
[*] Waiting for recovery/DFU endpoint...
[+] Device endpoint is reachable

=== Restore ===
[+] SHSH saved: A8EB59CAD6780044.shsh

=== Restore ===
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 365/365 [00:00<00:00, 8623.11it/s]
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 23/23 [00:00<00:00, 2690.01it/s]
WARNING:root:build_identity has no RestoreLogo
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 772.04it/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5/5 [00:00<00:00, 5059.47it/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 3086.32it/s]
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7105/7105 [00:00<00:00, 10551.64it/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 3253.92it/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 101/101 [00:00<00:00, 5749.13it/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 432/432 [00:00<00:00, 8050.99it/s]
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 15/15 [00:00<00:00, 8152.72it/s]
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6192/6192 [00:00<00:00, 10274.53it/s]
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 55/55 [00:00<00:00, 10505.82it/s]
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 17403.75it/s]
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 21/21 [00:00<00:00, 11706.59it/s]
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15650.39it/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 76800/76800 [01:07<00:00, 1137.07it/s]
verify-restore: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████| 100/100 [00:00<00:00, 27478.41it/s]
ERROR:Task-1-pymobiledevice3.restore.restore:disk failure

@mpass99 mpass99 force-pushed the fix/dynamic-apfs-sealvolume branch from b4e6367 to 1ca38d5 Compare May 21, 2026 13:57
@mpass99
Copy link
Copy Markdown
Contributor Author

mpass99 commented May 21, 2026

Ok, now the filesystem patcher is also using the right apfs_sealvolume 😃

by dynamically matching and downloading the required apfs_sealvolume version.
@mpass99 mpass99 force-pushed the fix/dynamic-apfs-sealvolume branch from 1ca38d5 to c354720 Compare May 22, 2026 13:26
@Lakr233 Lakr233 requested a review from Copilot May 24, 2026 05:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the patchless (“less”) firmware workflow to use a version-specific apfs_sealvolume binary, addressing incompatibilities between cloudOS 26.3 vs 26.4 APFS sealing behavior.

Changes:

  • Select apfs_sealvolume dynamically based on ProductVersion from BuildManifest.plist during filesystem patching.
  • Move apfs_sealvolume acquisition into fw_prepare.sh, downloading and resigning a version-matched binary for the patchless variant.
  • Simplify setup flow by removing the old setup_tools.sh sealvolume step and adjusting setup_machine.sh to pass the patchless variant through fw_prepare.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 10 comments.

File Description
sources/FirmwarePatcher/Filesystem/CryptexFilesystemPatcher.swift Switches filesystem sealing to a versioned apfs_sealvolume path derived from ProductVersion.
scripts/setup_tools.sh Removes the previous patchless-only sealvolume download step and updates step counters.
scripts/setup_machine.sh Ensures patchless runs fw_prepare with VARIANT=less so required tooling can be fetched there.
scripts/fw_prepare.sh Adds logic to download a version-matched apfs_sealvolume from a macOS restore and place it in .tools/.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +397 to +400
func identify_apfs_sealvolume() throws -> URL {
let iosVersion = try getProductVersion()
return self.vphoneCliDirectory.appending(path: ".tools/apfs_sealvolume_\(iosVersion)")
}
Comment on lines +397 to +401
func identify_apfs_sealvolume() throws -> URL {
let iosVersion = try getProductVersion()
return self.vphoneCliDirectory.appending(path: ".tools/apfs_sealvolume_\(iosVersion)")
}

}

func getProductVersion() throws -> String {
var root = try parsePlist(data: buildManiest)
Comment thread scripts/fw_prepare.sh
Comment on lines +414 to +417
local src="$1"
IOS_VERSION="$(basename "$src" | awk -F_ '{print $2}')"
filename="apfs_sealvolume_$IOS_VERSION"

Comment thread scripts/fw_prepare.sh
Comment on lines +446 to +450
ipsw download appledb \
--os macOS \
--build $BUILD \
--pattern "^BuildManifest.plist\$" \
--output "$TMP_DIR"
Comment thread scripts/fw_prepare.sh
Comment on lines +415 to +420
IOS_VERSION="$(basename "$src" | awk -F_ '{print $2}')"
filename="apfs_sealvolume_$IOS_VERSION"

PROJECT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
TOOLS_PREFIX="$PROJECT_DIR/.tools"

Comment thread scripts/fw_prepare.sh

[[ "$ver" == "$IOS_VERSION" ]] || continue

selected_src="$url"
Comment thread scripts/fw_prepare.sh
Comment on lines +425 to +487
TMP_DIR="$(mktemp -d)"

# List matching macOS version to the iOS version
while IFS= read -r url; do
bn="$(basename "$url")"
ver="${bn#*_}"
ver="${ver%%_*}"

[[ "$ver" == "$IOS_VERSION" ]] || continue

selected_src="$url"
BUILD="$(awk -F_ '{print $3}' <<<"$bn")"
break
done < <(
ipsw download appledb \
--os macOS \
--version $IOS_VERSION \
--urls
)

# Download BuildManifest first
ipsw download appledb \
--os macOS \
--build $BUILD \
--pattern "^BuildManifest.plist\$" \
--output "$TMP_DIR"

BUILD_MANIFEST="$(find "$TMP_DIR" -name BuildManifest.plist -print -quit)"
if [ -z "$BUILD_MANIFEST" ]; then
echo "Failed to locate BuildManifest.plist"
rm -rf "$TMP_DIR"
exit 1
fi

RAMDISK_PATH="$(/usr/bin/plutil -extract 'BuildIdentities.0.Manifest.RestoreRamDisk.Info.Path' raw -o - "$BUILD_MANIFEST")"
if [ -z "$RAMDISK_PATH" ]; then
echo "Failed to read RestoreRamDisk path from BuildManifest"
rm -rf "$TMP_DIR"
exit 1
fi

# Download the ramdisk referenced by BuildManifest
ipsw download appledb \
--os macOS \
--build $BUILD \
--pattern "$RAMDISK_PATH" \
--output "$TMP_DIR"

RAMDISK_IM4P="$(find "$TMP_DIR" -path "*${RAMDISK_PATH}" -print -quit)"
if [ -z "$RAMDISK_IM4P" ]; then
echo "Failed to locate downloaded ramdisk: $RAMDISK_PATH"
rm -rf "$TMP_DIR"
exit 1
fi

RAMDISK="$TMP_DIR/ramdisk.dmg"
ipsw img4 im4p extract --output "$RAMDISK" "$RAMDISK_IM4P"

MOUNT=$(hdiutil attach -readonly -nobrowse "$RAMDISK" | awk 'END{ print$NF}')
cp "$MOUNT/System/Library/Filesystems/apfs.fs/Contents/Resources/apfs_sealvolume" \
"$TOOLS_PREFIX/$filename"
hdiutil detach "$MOUNT" >/dev/null 2>&1 || true
rm -rf "$TMP_DIR"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true, I experienced this in my testing

Comment thread scripts/fw_prepare.sh
Comment on lines +480 to +487
RAMDISK="$TMP_DIR/ramdisk.dmg"
ipsw img4 im4p extract --output "$RAMDISK" "$RAMDISK_IM4P"

MOUNT=$(hdiutil attach -readonly -nobrowse "$RAMDISK" | awk 'END{ print$NF}')
cp "$MOUNT/System/Library/Filesystems/apfs.fs/Contents/Resources/apfs_sealvolume" \
"$TOOLS_PREFIX/$filename"
hdiutil detach "$MOUNT" >/dev/null 2>&1 || true
rm -rf "$TMP_DIR"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true, I experienced this in my testing

Comment thread scripts/fw_prepare.sh
Comment on lines +621 to +625
VARIANT="${VARIANT:-}"
if [[ "$VARIANT" == "less" ]]; then
download_apfs_sealvolume "$IPHONE_SOURCE"
else
echo "==> Downloading apfs sealvolume (skipped — patchless variant only)"
@zqxwce
Copy link
Copy Markdown
Collaborator

zqxwce commented May 24, 2026

I encountered some weird behavior with the patchless variant when you originally added it.
I thought it was a problem with my setup so didn't commit this until now, but it still happens even on a different setup.
for some reason, the apfs_sealvolume command never returns unless you give the runProcess an output file to write to.
it is probably a bug in the runProcess function, but I didn't have time to debug it, so I added a temporary fix for now (which I also use for debugging), which we should fix in the future.

@zqxwce
Copy link
Copy Markdown
Collaborator

zqxwce commented May 24, 2026

at any case, I tested the branch and it works, look over the CR comments left by Copilot and after you resolve/dismiss them we can merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants