Skip to content

1.1.2: sign IPAs >2 GB, recover a broken anisette cache - #2

Merged
pwnapplehat merged 3 commits into
mainfrom
fix/large-ipa-and-anisette
Jul 28, 2026
Merged

1.1.2: sign IPAs >2 GB, recover a broken anisette cache#2
pwnapplehat merged 3 commits into
mainfrom
fix/large-ipa-and-anisette

Conversation

@pwnapplehat

Copy link
Copy Markdown
Owner

What

Two hardware-reported bugs, shipped as 1.1.2.

fix(zsign) — signing IPAs larger than ~2 GB

zsign's vendored minizip uses 32-bit file offsets on Windows (USE_FILE32API), so it
could not seek to the central directory of an archive over 2 GB — a 4 GB game's IPA
failed instantly with "Unzip failed!". Both the read (unzOpen2_64) and write
(zipOpen2_64) now go through iowin32's 64-bit Win32 file API, patched into the upstream
clone during the build (tools/zsign/win-largefile.patch, applied by git apply, fails
loudly if upstream drifts). -DZSIGN_VERSION=iPASide restored. The script and patch are
pinned to LF so a fresh clone with autocrlf=true can't break the build.

fix(anisette) — recovering a broken provisioning cache

A blocked download (a proxy/error page instead of the archive) or a half-written cache
from an interrupted first run made every later launch re-throw a raw tarfile parser
error, unrecoverable without deleting a file by hand. iPASide now discards an unloadable
cache and re-provisions, verifies the download really is an archive (retrying if not), and
reports a clear "provisioning server may be down or the network is blocking it". The
libraries are still downloaded, not bundled — nothing of Apple's is redistributed.

Verified

  • Engine test suite green.
  • Built engine + app + installer as 1.1.2, installed the real installer, and drove the
    installed engine through a full sideload of a real 4.19 GB IPA onto a physical
    iPhone: provision → sign → install, 0→100%, app on device. The step that used to die at
    "Unzip failed!" now completes.

pwnapplehat and others added 3 commits July 29, 2026 04:08
zsign reads and writes IPAs through its vendored minizip, which defines
USE_FILE32API on Windows and so falls back to 32-bit fseek/ftell. It could not
seek past the 2 GB mark to reach the central directory of a larger archive, so
signing a big app - a 4 GB game, say - failed at once with "Unzip failed!".

Route both the read (unzOpen2_64) and the write (zipOpen2_64) through iowin32's
64-bit Win32 file API. The change is applied to the upstream clone during the
build (tools/zsign/win-largefile.patch, git apply in build-zsign.sh), which
fails loudly if upstream drifts rather than silently reverting to the 32-bit
path. Also restores -DZSIGN_VERSION=iPASide, which the build had dropped.

The script and patch are pinned to LF in .gitattributes so a clone with
autocrlf=true cannot break the MSYS2 build or the patch apply.

Proven by signing a real 4.19 GB IPA end to end - unzip, sign every framework,
repack to a valid 4.19 GB output.

Co-authored-by: Cursor <cursoragent@cursor.com>
iPASide sets up Apple sign-in with a small set of device libraries it downloads
once and caches together with the provisioning state. If that download was
intercepted (a proxy or captive-portal page in place of the archive) or the
cache was left half-written by an interrupted first run, every later launch
re-threw a raw "not a gzip/bzip2/xz/tar file" error from deep in the archive
parser, and the only way out was to find and delete the cache by hand.

Discard a cache that will not load and re-provision. Fetch the libraries with a
retry and a check that the response really is an archive, and raise a clear
"provisioning server may be down or the network is blocking it" instead of a
parser stack trace. The libraries are still downloaded, not bundled, so nothing
of Apple's is redistributed.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signing IPAs larger than ~2 GB, and recovery from a broken anisette
provisioning cache. See CHANGELOG.md.

Co-authored-by: Cursor <cursoragent@cursor.com>
@pwnapplehat
pwnapplehat merged commit c058add into main Jul 28, 2026
3 checks passed
@pwnapplehat
pwnapplehat deleted the fix/large-ipa-and-anisette branch July 28, 2026 22:43
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.

1 participant