Skip to content

feat(core): support native Store authentication and ADI device provisioning - #25

Merged
Kosthi merged 4 commits into
masterfrom
fix/native-auth-endpoint
Nov 30, 2026
Merged

Kosthi merged 4 commits into
masterfrom
fix/native-auth-endpoint

Conversation

@Kosthi

@Kosthi Kosthi commented Nov 30, 2026 •

Copy link
Copy Markdown
Owner

Closes #17
Closes #24

Summary

Since November 2026 Apple's edge drops most requests to the legacy MZFinance.woa/wa/authenticate action, while Configurator/2.21 is routed by the bag to https://auth.itunes.apple.com/auth/v1/native, which requires both a SAP X-Apple-ActionSignature and a Store-scoped (dsid = -1) ADI device proof (X-Apple-AMD / X-Apple-AMD-M).

Changes

  • Native authentication routing: update User-Agent to Configurator/2.21 and allow auth.itunes.apple.com/auth/v1/native (/fast) in the bag validator and manual redirect handler; handle 2FA challenges and DSID cookie/header fallbacks on native responses.
  • Portable Store ADI runtime (crates/ipatool-core/src/adi): range-read Apple's self-contained x86-64 libCoreADI.so and libstoreservicescore.so (~2 MB compressed, verified against pinned SHA-256 digests) from the official Android Apple Music APK and run them inside the existing Unicorn emulator with a lightweight ELF loader and Bionic/VFS shims.
  • Automatic SP / RP device provisioning: complete auth/v1/otp/1.5/finish handshakes and persist device_id + adi.pb locally across runs.
  • Commerce integration: attach Store AMD proofs across buyProduct, volumeStoreDownloadProduct, and version queries; share download product dictionary resolution in versions.rs.
  • Docs & CI: document the Store ADI flow and first-run ~2 MB CoreADI cache in README.md / README_zh.md, and include the Android CoreADI digests in weekly live.yml failure reports.

Verification

  • cargo fmt --all --check & cargo clippy --all-targets --all-features -- -D warnings
  • cargo test --workspace (121 unit tests passing)
  • cargo test -p ipatool-core -- --ignored live_store_adi (fresh asset range-fetch, SHA-256 verification, SAP + Store ADI SP provisioning handshake, and state reload)
  • End-to-end live verification against Apple production servers: auth re-authentication, free license purchase, version list, version meta, and full IPA download + iTunesMetadata.plist/.sinf patching.

…ioning

Since November 2026 Apple's edge drops most requests to the legacy
MZFinance authenticate action. Updating the client User-Agent to
Configurator/2.21 routes sign-in through auth.itunes.apple.com/auth/v1/native,
which requires a Store-scoped (dsid = -1) X-Apple-AMD / X-Apple-AMD-M
device proof alongside the existing SAP X-Apple-ActionSignature.

Add crates/ipatool-core/src/adi to range-read Apple's x86-64
libCoreADI.so and libstoreservicescore.so (~2 MB compressed, pinned by
SHA-256) from the official Android Apple Music APK and run them inside
the existing Unicorn engine with a lightweight ELF loader and Bionic/VFS
shims. Automatically service X-Apple-AMD-Action (SP/RP) challenges via
auth/v1/otp/1.5/finish, persist adi.pb locally, and attach Store AMD
headers across native sign-in, purchase, download, and version queries.
Update both English and Chinese READMEs to describe the auth/v1/native
endpoint, Store ADI (X-Apple-AMD) device provisioning, the ~2 MB
CoreADI range download cached under ~/.ipatool/cache/, and the new sap/
and adi/ modules in the project layout.
live_store_adi_provisions_and_produces_accepted_headers runs as part of
the scheduled `live_` suite, so list the Android Apple Music APK digests
and auth/v1/native provisioning endpoint alongside the SAP and Unicorn
artifacts in the failure issue body.
Workflow-level RUSTFLAGS=-Dwarnings leaked into `cargo install cross`,
turning future-incompat warnings from cross's locked eyre 0.6.12
dependency (`semicolon_in_expressions_from_non_local_macros`) into hard
errors on newer stable Rust toolchains.
@Kosthi
Kosthi merged commit f9de2a9 into master Nov 30, 2026
17 checks passed
@Kosthi
Kosthi deleted the fix/native-auth-endpoint branch November 30, 2026 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant