Skip to content

Offer CoreADI by hand when the emulated Mac cannot download it - #297

Merged
parawanderer merged 2 commits into
mainfrom
feature/supply-coreadi-by-hand
Nov 21, 2026
Merged

parawanderer merged 2 commits into
mainfrom
feature/supply-coreadi-by-hand

Conversation

@parawanderer

Copy link
Copy Markdown
Owner

Summary

Follow-up to #274, and needed before it ships. When the emulated Mac can't download Apple's macOS CoreADI (a blocked network, a firewall, Apple's CDN refusing), sign-in fell back to a remote Anisette server. Since Apple's 2026-10-12 change, a server signs in and then every report fetch answers 401. Worse, when a stored server answered, the sign-in screen skipped the Anisette step entirely, so nothing ever said so.

Changes

  • MacCoreAdiFetcher.importFrom takes either the iTunes 12.8.3 disk image (it seeks to the payload's byte range rather than reading 291 MB) or the CoreADI library, universal or x86_64. Both are checked against the download's own pins.
  • NEEDS_COREADI: EmulatedMacAnisette marks a failed fetch with NO_COREADI_REASON, and AnisetteStatus turns it into the new state.
  • Sign-in screen: in that state it stops on the Anisette step, even when a stored server answers, and offers Apple's link (with a copy button), Choose a file and Retry. The server field stays, under a sentence saying locations won't load through a server. A successful retry goes straight to the account form.
  • Settings → Anisette offers the same file in the same state, through the existing "own file" block.
  • Fixed on the way: the emulated Mac's crash text was never recognised as CRASHES_HERE, so a phone the emulator crashed on got the generic message instead of the report button.
  • Three new strings, in all locales via add_strings.py; "Choose a file", "Retry", the rejection message and "Copied" are reused.
  • AGENTS.md rule 21 has a bullet on it; CONTRIBUTING lists the opt-in test.

Testing

  • JVM: MacCoreAdiFetcherTest, 6 new tests (disk image, universal, thin, wrong build, wrong image, unrelated file); the disk-image test fails when the offset is off by one byte. EmulatedMacAnisetteTest, 2 new tests (the marker is set, and only for a failed fetch).
  • Apple's real disk image through importFrom with the real pins: passes, in 0.3 s (MacCoreAdiRealImageTest, opt-in via COREADI_DMG).
  • Managed device: SuppliedCoreAdiFlowTest (Espresso, 5 tests, with screenshots in light and dark), plus new cases in AnisetteStatusTest and LoginAnisetteFallbackLayoutTest. Alongside AppleLoginFallbackFlowTest and AnisetteApkPickerFlowTest, all 41 pass. The test that a stored server no longer skips the offer fails with the routing change taken out.
  • testDebugUnitTest: everything passes except the 20 existing Windows-only failures in EmulatedMacAnisetteTest/UnicornNoticeTest (File.renameTo over an existing file, and CRLF); CI on Linux is the check for those.
  • Not tested: a phone whose download is really blocked. A file that passes the pins can't be driven through Espresso (only Apple's real image does), so the success path on a device is covered by Retry plus the JVM test on the real image.

🤖 Generated with Claude Code

parawanderer and others added 2 commits November 21, 2026 15:00
A phone that could not download Apple's macOS CoreADI fell back to a
remote Anisette server. Since Apple's 2026-10-12 change a server signs
in and then every report fetch answers 401. When a stored server
answered, the sign-in screen skipped the Anisette step entirely, so
nobody was ever told.

- MacCoreAdiFetcher.importFrom takes the iTunes 12.8.3 disk image
  (reading only the payload's byte range) or the CoreADI library,
  universal or x86_64, checked against the download's own pins.
- EmulatedMacAnisette marks a failed fetch with NO_COREADI_REASON;
  AnisetteStatus makes that NEEDS_COREADI. It also now recognises the
  emulated Mac's crash sentence as CRASHES_HERE, which it never did.
- The sign-in screen stops on the Anisette step in that state, even with
  a working stored server, and offers Apple's link (copyable), "Choose a
  file" and "Retry". The server stays, under a sentence saying
  locations won't load through it. A successful retry goes straight to
  the account form.
- Settings -> Anisette offers the same file in the same state.
- Three new strings in all locales; "Choose a file", "Retry", the
  rejection message and "Copied" are reused.

Tests: MacCoreAdiFetcherTest (disk image, universal, thin, wrong build,
wrong image, unrelated file), EmulatedMacAnisetteTest (the marker),
AnisetteStatusTest, LoginAnisetteFallbackLayoutTest, and
SuppliedCoreAdiFlowTest (Espresso, with screenshots), which fails with
the routing change taken out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MacCoreAdiRealImageTest runs importFrom on the real iTunes 12.8.3 image
with the real pins, when COREADI_DMG names it; skipped otherwise. Passed
on 2026-11-21 in 0.3 s. Listed in CONTRIBUTING's test table (rule 10).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@parawanderer
parawanderer merged commit b4119db into main Nov 21, 2026
6 checks passed

This branch was previously deployed

1 inactive deployment
Android Build — 0f81fced Deployed Nov 21, 2026 by parawanderer via Instrumented tests (emulator) #381
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