Repository navigation
Sign in as an emulated Mac: Apple's macOS CoreADI under Unicorn, on the phone - #274
Conversation
parawanderer
left a comment
There was a problem hiding this comment.
Requesting changes. Item 1 blocks the merge; 2–4 are required alongside it.
-
Existing sessions are moved onto a new machine on upgrade.
AppDependencies.java:63makesEmulatedMacAnisettethe source for every caller, so on restore_preferLocalAnisette(main.py:896) calls itsensureReady(), which downloads CoreADI and provisions a new Mac at app start, then swaps it into the restored account. That session's token was issued to the Android machine, and per #248 a token works only with Anisette from the machine that obtained it, so it should start answering 401.identityForRestore(main.py:863) also carries the old Android device id across, so Apple receives the new Mac'sX-Apple-I-MD-Malongside the AndroidX-Mme-Device-Id. Sessions established before 2026-10-12 still fetch reports today; @parawanderer's does. Fix: keepLocalAnisettefor any session it established and give the emulated Mac only to fresh sign-ins. A restored session must not provision anything. -
libmacadi.soloads in the app process with no crash guard.MacCoreAdi.java:67callsSystem.loadLibrarydirectly, and thecatch (Exception | LinkageError)atEmulatedMacAnisette.java:114cannot catch a SIGSEGV from Unicorn or from Apple's code. That is the #232 failure mode (AGENTS.md rule 4): a native crash on the sign-in screen makes the app unopenable. Run it behind the:adiprobeprocess /TryItElsewhereFirstandNativeLoadGuard, or host the emulator in its own process and call it over binder. The second option also keeps the GPL code in a separate program from the Apache-2.0 libraries and the proprietary map SDKs (item 4). -
Session provenance is lost on upgrade.
EmulatedMacAnisettestoressessionEstablishedLocallyin a new preferences file,anisette-emulated-mac(line 41), so for every existing sessionwasSessionEstablishedLocally()reads false and the machine-change warning in_preferLocalAnisettenever fires. Read the flagLocalAnisettealready wrote. This mostly goes away with item 1. -
Unicorn is accepted as GPL-2.0. Add a licence notice for it to the app or the release, and see item 2 for keeping it out of the app process. Decision and reasoning:
docs/emulated-mac-emulator-choice.md(#275). -
Tests. The pure logic here is untested:
EmulatedMacAnisette's state machine (first provisioning, the lost-store branch that registers a new machine, failure falling back to remote,adi.pbnever saved),MacIdentitygeneration and save/load round trip, and the request shapesMacProvisioningsends. Put them on the JVM with the native layer behind an interface and aFakeApkServer-style local socket for provisioning (rule 13). Add one for item 1 as well: a restored session established withLocalAnisettekeepsLocalAnisetteand never provisions. -
The C++ port has no byte-for-byte comparison against os-findmy-e's Rust
adi-core, as the PR says.scripts/adi-emulator-diff/(#275) drivesadi-corewith a frozen clock and a fixed host UUID; run the same sequence throughlibmacadi.soand diff. A mismatch on these offline calls is a port bug that a single successful sign-in will not show. -
Move the
hsc409 handling into parawanderer/FindMy.py's_gsa_authenticateinstead of wrapping_gsa_requestat runtime (main.py:343,main.py:898). malmeloo/FindMy.py#279 makes the same change upstream.
Non-blocking: MacBookPro13,2 never shipped macOS 13.1, which is what rule 11 forbids. Keeping the values os-findmy-e was observed to get searchPartyToken with is defensible; note it in MacIdentity alongside the Darwin mismatch already noted there.
Interactively co-authored by Claude Code and @parawanderer
…icle diff parawanderer#274 runs Apple's macOS CoreADI under Unicorn, which is GPL-2.0. The decision is to ship it, with a licence notice and the library in its own process, and to swap it only if somebody has a reason to. A swap is invisible to users only if the replacement produces the same bytes, so scripts/adi-emulator-diff/ puts icicle (MIT OR Apache-2.0) under os-findmy-e's adi-core and diffs it against Unicorn. Every offline call matched byte for byte; the OTP path, which needs a provisioned machine, has not been compared. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A C++ port of sacca97/os-findmy-e's adi-core (MIT, see macadi/NOTICE.md): a Mach-O loader, a Unicorn x86_64 VM with the few pieces of macOS userland the library calls, and the CoreADI dispatcher framing. Unicorn 2.1.4 (GPL-2.0) is fetched at build time, pinned by SHA-256, and linked only into libmacadi.so. The library itself is never in the repository or the build. In iTunes 12.8.3 for Mac the package holding it is stored uncompressed and contiguous, so it is one HTTP range request of 3.5 MB; scripts/locate_mac_coreadi.py re-derives the offsets and checks both pinned hashes, and macadi-host.yml builds the core for the host and loads the library into it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012JDrrt9ff7WwPepHs6B2Gx
Since 2026-10-12 Apple issues searchPartyToken only to Mac- or iPhone-minted Anisette, and the edge now refuses any client claiming Android, so the Android ADI path cannot reach Find My. EmulatedMacAnisette fetches the macOS library from Apple, provisions one emulated Mac with akd's headers, keeps its identity and store for the life of the install, and is what AppDependencies hands out. Also: read Grand Slam's hsc 409 without au as a second factor; send the routing number Apple assigned at provisioning; give CloudKit a UUID, since a Mac's device id is not one; drop the legacy adi.pb before every session, which otherwise made a freshly provisioned machine report unprovisioned (ec -80009). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012JDrrt9ff7WwPepHs6B2Gx
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012JDrrt9ff7WwPepHs6B2Gx
…its own process A session LocalAnisette signed in keeps LocalAnisette, and nothing is provisioned to restore it. AppDependencies made EmulatedMacAnisette the source for every caller, so a restore provisioned a new Mac at app start and paired its X-Apple-I-MD-M with the account's Android device id. Per parawanderer#248 that session's token only works with Anisette from the Android machine, so a working session would start answering 401. AnisetteForSession now chooses: the emulated Mac for a fresh sign-in, and for a restore whichever machine signed the session in. SessionProvenance records that in LocalAnisette's own preferences file, reading the sessionEstablishedLocally flag every older install already has and adding sessionMachine=emulatedMac beside it for the Mac's sessions. The separate anisette-emulated-mac file is gone, so the machine-change warning works again for upgraders. A Mac session is restored as Purpose.RESTORE, which never creates or provisions a machine: a lost store falls back to remote with the warning. libmacadi.so now loads only in a :macadi process. MacAdiService hosts the emulator and RemoteMacAdi calls it over binder, so a SIGSEGV from Unicorn or Apple's code kills that process rather than the sign-in screen (rule 4, parawanderer#232), and the GPL-2.0 emulator is a separate program from the rest of the APK. A death during a call is recorded per app version and library build, and the Mac is not tried again until one of them changes. OpenAirTagApplication skips its start-up in that process. The native layer is behind MacAdi, so the logic is tested on the JVM: EmulatedMacAnisette's state machine, MacIdentity's shapes and round trip, MacProvisioning's requests against a local FakeGrandSlam socket, and the restore choice for an install with only LocalAnisette's flag. TheEmulatedMacInItsOwnProcessTest checks the process boundary on a device, including that the app process never maps libmacadi.so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015MJtmGkNZpfzFGSN1BZ82a
…ease libmacadi.so links Unicorn 2.1.4, which is GPL-2.0. The APK now carries Unicorn's own licence files (COPYING, its QEMU licence, LGPL2, GLIB) under assets/licences/unicorn/, with a NOTICE.txt naming the exact source tarball and hash and saying the code runs in its own process. UnicornNoticeTest fails if that notice stops matching MacAdi.cmake. The source is fetched by FetchContent rather than being in the tag, so build-release.yml now downloads the same tarball, checks it against the pinned hash, and attaches it to the release beside the APK. The root NOTICE gains Unicorn and os-findmy-e entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015MJtmGkNZpfzFGSN1BZ82a
compare-libmacadi.sh builds adi-core's adi-diff (the driver run.sh uses for Unicorn against icicle) and the port's new macadi_diff, runs both over the same offline CoreADI calls with a frozen clock and a fixed host UUID, and diffs the output. macadi-host.yml runs it on every change to the port. To make that possible CoreAdi exposes the raw calls adi-core has (begin_session, IsMachineProvisioned, RequestOTP, GetIDMSRouting, ProvisioningStart) and the VM's files. headers() and provisioningBegin() are now built from those same calls, so the comparison covers the code the app runs. Result on x86_64 Linux: all 20 lines identical, with the port on Unicorn 2.1.4 and adi-core on unicorn-engine 2.1.5. Checked for teeth by breaking vm.cpp on purpose: a stray byte in created files turns six lines red, while changing arc4random_buf or truncating write changes nothing, because the offline calls never reach them. Both drivers take an optional provisioned store for the OTP path, which has not been run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015MJtmGkNZpfzFGSN1BZ82a
The fix belongs in FindMy.py's _gsa_authenticate, where malmeloo/FindMy.py#279 adds _normalize_2fa_status; the same change is prepared for parawanderer/FindMy.py. Until the pin moves, _treatHsc409AsSecondFactor keeps wrapping _gsa_request, but returns without touching the account when the pinned FindMy.py has the function. test_the_pinned_findmy_does_not_yet fails on the pin move, which is the cue to delete the wrapper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015MJtmGkNZpfzFGSN1BZ82a
The 2016 13-inch MacBook Pro stops at macOS 12, so the pair is not a real release, which rule 11 asks for. These are the values os-findmy-e was observed to get searchPartyToken with, and changing either is a new machine to Apple, so they stay until a consistent pair is shown to work. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015MJtmGkNZpfzFGSN1BZ82a
Records what the review taught: never move an existing session onto the emulated Mac, where provenance lives, why libmacadi.so loads only in :macadi, the GPL obligations and where each is met, the byte-for-byte check, and that the hsc 409 wrapper goes when the FindMy.py pin moves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015MJtmGkNZpfzFGSN1BZ82a
d9e695c to
6100a00
Compare
|
Thanks for the thorough review. I've rebased onto main (after #275 and #278) and pushed the fixes as separate commits. Item by item: 1. Restored sessions keep 2. Native-crash guard. I took the separate-process option. 3. Provenance. The 4. GPL-2.0 notice. The APK now carries Unicorn's own licence files from the 2.1.4 tag under 5. JVM tests. The native layer is behind a
I made sure they can fail. Reverting the restore choice, the restore-never-provisions guard, the 6. Byte-for-byte comparison. 7. hsc 409 in FindMy.py. I've prepared the change for parawanderer/FindMy.py, and will open it there as a PR if you're happy with this shape: Non-blocking. I've added a note to AGENTS.md rule 21 is updated with the above. Upstream's numbering only goes to 20, so it stays 21. On my fork's CI, the JVM suite, the bridge tests, the debug APK build (including the NDK build of What I haven't verified: I haven't done a sign-in on a phone since these changes. The emulator suite swaps Anisette for a fake, so a real sign-in through |
|
I've opened the FindMy.py change for item 7 as parawanderer/FindMy.py#9. Once that's merged I'll move the pin in this PR and delete |
parawanderer/FindMy.py#9 is merged as 37d5ca0b, so the pinned library reads Grand Slam's hsc 409 with no au as a second factor itself, in _gsa_authenticate. _treatHsc409AsSecondFactor already stepped aside once _normalize_2fa_status existed; it and its tests go. One test keeps the pin honest: it fails if a later pin move loses _normalize_2fa_status. Pin moved in all four places (AGENTS.md rule 14); uv.lock via `uv lock`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… through Since 2026-11-20 Apple's edge refuses any Grand Slam sign-in whose client info says <macOS;...> (parawanderer#289). MacIdentity copied os-findmy-e's macOS, so every sign-in as the emulated Mac would be refused before the password is looked at. "Mac OS X" is what macOS's own akd sends and gets through. Not yet seen: that Apple issues searchPartyToken to this spelling as it did to the old one. That needs a real sign-in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dit its author libmacadi's macho, vm and core_adi are a C++ port of sacca97/os-findmy-e's native/adi-core, and MacProvisioning and MacIdentity follow its tools/machoadi. The notices quoted its MIT licence without a commit, and the repository has been GPL-2.0-only since 7896dc3 (2026-10-27), so a reader checking today's repository would find a different licence than the one quoted. They now name 374d838 (2026-10-19), the last MIT commit, which carries the three files ported. This is also the commit that credits sacca97 here: their work is in this PR as a port, which carries none of their commits. Co-Authored-By: sacca97 <tommaso.sacchetti@gmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # python/pyproject.toml # python/uv.lock
…reADI Since 2026-10-12 Apple serves the Android ADI machine that `anisette` provisions differently from a Mac (parawanderer#248), and the exporter's iCloud route signs in as exactly that machine (parawanderer#288). This makes the default an emulated Mac instead: Apple's x86_64 CoreADI under Unicorn, through sacca97's machoadi engine from os-findmy-e. - The engine is GPL-2.0 and runs as `python -m machoadi.mac_anisette` in its own process, never imported. It comes from parawanderer/os-findmy-e, which spells the OS "Mac OS X" (parawanderer#289), verifies TLS against FindMy.py's pinned Apple root rather than CERT_NONE, takes a serial, and installs with pip. - Apple's library is fetched from Apple: 3.5 MB of the iTunes 12.8.3 installer in one range request, checked against two pinned hashes. A port of the app's MacCoreAdiFetcher; nothing for the user to supply, on any OS. - The machine is provisioned once, under this install's 0PENTAGX serial, and kept beside device-identity.json. The account signs in with the ids it was provisioned with. An install that was the Android machine gains one device-list entry, once, and is told so. - CloudKit is given the machine's host UUID, since it parses the device id as a UUID and a Mac's is not one (as parawanderer#274's _forCloudKit). - --anisette-url is unchanged; --anisette-libs now explicitly selects the Android ADI. A PyInstaller build refuses with a message for now: it has no interpreter to run the engine with. Not yet verified: a real sign-in through it. Co-Authored-By: sacca97 <tommaso.sacchetti@gmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One engine in :macadi serves every header set for the life of the process, so anything it accumulates per call accumulates for hours. - Cap Unicorn's translation cache at 8 MiB. Its default is 1 GiB, flushed only when full; measured on the host, resident memory grew ~20 KB a call without end (150 MB after 3000 calls). With the cap it levels off at ~87 MB, and a call takes no longer (~12 ms). - Give each guest call a 30 s timeout. Without one, a call that loops under emulation holds a core, and the app's binder call waits on it, until Android kills the process. Unicorn reports a timeout as success, so a stop short of the return address is turned into an error. - macadi_selftest: the timeout (a `jmp $` in guest memory, stopped and reported, engine usable after), and N header sets from one engine against a provisioned store, failing if memory grows past the first 50 calls. Fails with the cap removed. macadi-host.yml runs the timeout check. The ~60 MB jump over the first dozen calls is QEMU's TLB doubling to its ceiling, then stopping. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both drivers set a fixed host UUID, and CoreADI derives the machine id from it, so no real provisioned store ever read as provisioned: the "provisioned" lines were "not provisioned" on both sides, identical, and the OTP path was never compared. ADI_DIFF_HOST_UUID sets the store's own host UUID for the provisioned section, the script leaves adi.pb out of the store it passes (while it exists the library reports not provisioned), and it fails if the store still does not read as provisioned. Run against a store the exporter's Python engine provisioned with Apple: libmacadi and adi-core agree on machine id, OTP and routing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A restore reads the stored Mac before fetching CoreADI, so an install with none downloads nothing, and serial()/deviceIdsJson() on a restore no longer create and save an identity. - A sign-in that gets HTTP 433 for a never-provisioned identity draws a new one and provisions once more. That is a process that died between midFinishProvisioning and saving the store; retrying the same device id is refused forever. ProvisioningException carries the status. - CloudKit's device id is derived from the account's device id in every case. It was the host UUID when restored onto the Mac and a derived one on a remote server: two devices for one session. cloudKitDeviceUuid() is gone. - :macadi is let go after five idle minutes and reopened from the store on the next request. Its engine holds ~85 MB, and a bound service otherwise lives as long as the app's process. - AnisetteForSession.create() dispatches through a seam, and tests assert that an upgrader's session builds LocalAnisette and never the Mac. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
parawanderer
left a comment
There was a problem hiding this comment.
Merged main (conflicts in python/pyproject.toml and uv.lock resolved to main's) and pushed four commits on top. Please check them against what you know of the port.
1d0e5fc3, emulator bounds:
vm.cpp: Unicorn's translation cache defaults to 1 GiB and only flushes when full. One engine in:macadigrew ~20 KB perheaders()call without end on the host (150 MB after 3000 calls). Capped at 8 MiB: levels off at ~87 MB, same ~12 ms per call. The ~60 MB jump over the first dozen calls is QEMU's TLB reaching its ceiling.uc_emu_starthad no timeout, andRemoteMacAdi.callblocks ontransactwith no deadline. A guest loop would hold a core and the caller indefinitely. Now 30 s; a stop short ofRETURN_ADDRESSwithUC_ERR_OKis an error.app/src/test/macadi-host/macadi_selftest.cppchecks both;macadi-host.ymlruns the timeout part.
e72ab06f, OTP path in the byte comparison: both drivers hardcode host UUID 10325476…, and the machine id is derived from it, so a real store never read as provisioned and the "provisioned" lines compared two "not provisioned" answers. ADI_DIFF_HOST_UUID fixes that, the script drops adi.pb from the store copy and fails if the store still reads unprovisioned. Run against a store provisioned with Apple by machoadi: machine id, OTP and routing identical to adi-core.
5ab9bd99, session handling:
EmulatedMacAnisette.ensureReadyinRESTOREcalledlibrary.ensure()beforestoredIdentity(), so an install with no Mac downloaded CoreADI before failing.serial(),deviceIdsJson()andcloudKitDeviceUuid()went throughloadOrCreateIdentity()and created an identity during a restore. Both now read the stored identity only.- A process death between
midFinishProvisioningandsaveStoreleft an unprovisioned identity whose device id Apple answers 433 for on every later sign-in. A 433 on a never-provisioned identity inSIGN_INnow draws a new identity and provisions once more.ProvisioningException.httpStatus()carries the status. _forCloudKitsent the host UUID when restored onto the Mac anduuid5(deviceId)after falling back to a server: two CloudKit device ids for one session. Nowuuid5(deviceId)always;cloudKitDeviceUuid()removed.:macadistayed bound for the life of the app process, ~85 MB once used, held for hours under the nearby scan's foreground service. Now unbound after 5 idle minutes and reopened from the store on the next request.AnisetteForSession.create()goes through aMachinesseam; tests assert an upgrader's session buildsLocalAnisetteand never the Mac.
8b23e902: AGENTS.md rule 21 and CONTRIBUTING.md for the above.
Local: JVM 540 pass, bridge tests 327 pass, debug APK builds. Not verified: the CloudKit list on a device with the uuid5 id, and a real sign-in on this head. Those are next, along with an upgrade install over a working 1.1.x session.
Not changed: EmulatedMacAnisette logs the device id and MacProvisioning the routing number at Log.i; icloud_bridge prints the CloudKit id.
Drafted by Claude Code
Unicorn's CMake generates config-host.h by running `sh qemu/configure`, which also calls `strings` and `pkg-config`, and it does not check that any of it worked. Android Studio and PowerShell on Windows usually have none of the three, so configure "succeeds" and the compile dies later on a missing header, which reads as a broken checkout. Git for Windows ships `sh` in usr\bin; Strawberry Perl supplies the other two, and is what this was verified with. Also correct the JDK row: recent Android Studio bundles Java 25, which Gradle 8.10 cannot run on, so "the bundled runtime works" was no longer true. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Unicorn runs `sh qemu/configure` with execute_process and ignores the result, so a missing `sh`, `strings` or `pkg-config` let CMake configure succeed and the build fail minutes later on `'config-host.h' file not found`. Check for the three up front and name the missing ones, and check afterwards that config-host.h exists, which catches any other reason the script failed. Skipped under MSVC, where Unicorn uses a checked-in header. Verified by configuring app/src/main/cpp for arm64-v8a on Windows with three PATHs: no sh (fails, names sh), Git's usr\bin only (fails, names strings and pkg-config), and the full machine PATH (configures, writes config-host.h). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Pushed two commits on top of Commits (build setup only, no app code)
Device tests, at
CI on Not tested: killing and relaunching the app on the emulator. The CoreADI download and first provisioning happened before the captured log starts.
|
|
Anyways, wanted to take the time to do a quick non-LLM-forwarded message/response here, @lazzurs, to thank you for looking into this thing and fixing it for the users of the app here! This was a big and complex one, and I honestly thought I would have to get to it myself at whatever point because of how cumbersome it is to ask for this sort of work from somebody else. Really appreciate it - as well as all the other PRs, which I will go through now that this login flow is fixed and properly working again. 🙏 I apologise for not getting to this earlier, as I've been dealing with personal things and some other work unrelated to this. I wanted to give this some proper dedicated time, too, unlike smaller features, since it's an important part to get right. Beyond that, I was wondering if you'd have an interest to be added here as a Collaborator, since I think you clearly have a good hang on the project and that it would unblock you to make changes like this without necessarily waiting on me to validate them. No pressure, obviously - it's fine if not. |
parawanderer
left a comment
There was a problem hiding this comment.
Approving: tested on an emulator and on an upgrade over 1.1.0 (see the comment above), and CI is green on ed6d4a4.
Drafted by Claude Code
…number this one 22 main.py: parawanderer#274 removed nothing near the attach, so it is kept. Both places that create an account (sign-in and restore) still attach. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fixes #248.
Since 2026-10-12 Apple only issues the Find My token (
searchPartyToken) to a sign-in whose Anisette machine was minted by a Mac or an iPhone. An Android-minted machine getsmmeAuthTokenalone and report fetches return 401 (malmeloo/FindMy.py#278). Since about 2026-10-20 the GSA edge also returns 503 for anyX-MMe-Client-Infowhose OS token isAndroid(probe results on #261). So the Android ADI libraries can't reach Find My any more, whatever headers are sent.This runs Apple's macOS CoreADI on the phone instead, under an x86_64 emulator - the "derived library that can be run on android directly" from #248, built off sacca97/os-findmy-e.
How it works
libmacadi.so(app/src/main/cpp/macadi/): a C++ port of os-findmy-e's Rustadi-core- Mach-O loader, Unicorn x86_64 VM with the handful of macOS calls the library makes, and the CoreADI dispatcher framing. Unicorn 2.1.4 is fetched by CMake at build time, pinned by SHA-256, and only linked into this library.CoreADI.pkgpayload is stored uncompressed and contiguous, so a single HTTP range request gets it. The payload and the extracted library are both pinned by SHA-256.scripts/locate_mac_coreadi.pyre-derives the offsets (from Apple, or from a local copy of the DMG) and reads its constants from the Java sources. Nothing of Apple's is in the repo or the APK.AnisetteForSessionpicks the machine inAppDependencies. A fresh sign-in getsEmulatedMacAnisette. A restored session keeps the machine that signed it in:LocalAnisettefor every session it established (and for installs that recorded nothing), and the emulated Mac only for sessions it signed in, restored without ever provisioning. Provenance lives inLocalAnisette's preferences (SessionProvenance).EmulatedMacAnisetteprovisions one emulated Mac withakd's headers (from os-findmy-e'sgsa.py), keeps its identity and ADI store underfiles/anisette/mac/for the life of the install, and serves the OTP, machine id and Apple-assigned routing number to the existing Python sign-in.libmacadi.soloads only in a non-exported:macadiprocess (MacAdiService), and the app calls it over binder (RemoteMacAdi). A native crash there reaches the app asMacAdi.EmulatorDiedExceptionand is recorded per app version and library build, the same scheme asTryItElsewhereFirst, rather than making the app unopenable. It also keeps the GPL code out of the app process.hsc409 with noauon GSAcompleteis treated as a second factor (the pinned FindMy.py otherwise skips 2FA). The proper fix,_normalize_2fa_statusin_gsa_authenticateas in Fix and integrate with anisette mac backend malmeloo/FindMy.py#279, is prepared for parawanderer/FindMy.py; until the pin moves the runtime wrapper stays, and it steps aside once the pinned FindMy.py has the fix; the routing number comes from Java; CloudKit and the keychain session get a view of the account whosedevice_uuidis a UUID, because a Mac's device id (00006000-…) isn't one and FindMy.py's CloudKit client parses it as one.Things to decide
docs/emulated-mac-emulator-choice.md). The APK carries Unicorn 2.1.4's licence files and aNOTICE.txtwith the exact source tarball and SHA-256 underassets/licences/unicorn/, andbuild-release.ymlattaches that verified tarball to each release. The rootNOTICElists Unicorn and os-findmy-e (MIT).0PENTAGV…, as before). Apple could start fingerprinting this; it has changed the rules four times in five weeks.Testing
adi.pbin the store, and while it exists the library reports "not provisioned", so the first sign-in after provisioning sent an empty machine id (ec -80009);badly formed hexadecimal UUID string).macadi-host.yml, which range-fetches the library from Apple exactly as the app does, checks both hashes, builds the native core for the host and loads the library ("not provisioned").MacCoreAdiFetcherTest(cpio walk, universal-binary slice, refusing a server that ignores the range),test_emulated_mac.py(409 shim, routing, CloudKit device id view), and on the JVMEmulatedMacAnisetteTest,MacIdentityTest,MacProvisioningTest(against a localFakeGrandSlamsocket),RestoringASessionOnTheMachineThatSignedItInTestandUnicornNoticeTest. Instrumented:TheEmulatedMacInItsOwnProcessTest(real CoreADI loads in:macadi, the app process never mapslibmacadi.so, a SIGSEGV there arrives as a death).adi-core:scripts/adi-emulator-diff/compare-libmacadi.shruns the same offline calls throughlibmacadi.soand os-findmy-e'sadi-diff; all 20 lines match, in CI as a secondmacadi-host.ymljob.Not verified: a device sign-in since the review changes (the Pixel test above predates moving the emulator into
:macadi); the byte-for-byte comparison of the OTP and provisioning paths, which needs a provisioned store; how long a provisioned emulated Mac and its token stay accepted over days; more than one account.Credit to @sacca97 for os-findmy-e, which this is ported from, and to @hoorayman and @poterpan on #248 for establishing that a Mac-minted machine is what gets
searchPartyToken.🤖 Generated with Claude Code