Update GrandSlam authentication user agent (notarized line) - #51
Update GrandSlam authentication user agent (notarized line)#51Calvin-Zikakis wants to merge 1 commit into
Conversation
The akd/1.0 CFNetwork/978.0.7 Darwin/18.7.0 string dates from macOS 10.14. Apple's GSA edge now allows only two requests per connection with it, and sign in sends three, so the third always fails with an HTML 503 that surfaces as NSCocoaErrorDomain 3840. A current AuthKit string raises that to four. Port of rileytestut#47 by @BreezeDelegate onto the notarized branch, which AltStore's classic branches pin.
77785c3 to
ec2968c
Compare
AltServer HTTP 503 / “Incorrect data format” workaroundThanks Chatgpt 6 this worked for me !!: The main file is:
The working approach updates the AuthKit User-Agent, uses fresh connections, and retries temporary server errors. Credit: AltSign PR #51 and PR #50. 1. Download the source and dependencies Requires Xcode and an Apple Silicon Mac. git clone https://github.com/altstoreio/AltStore.git
cd AltStore
git checkout 5a0f2de77e0723bf782447edbc0ab2bc11688234
git submodule update --init --recursive2. Apply the proposed authentication patches set -o pipefail
curl -fsSL https://github.com/rileytestut/AltSign/pull/51.patch \
| git -C Dependencies/AltSign apply -
curl -fsSL https://github.com/rileytestut/AltSign/pull/50.patch \
| git -C Dependencies/AltSign apply -Stop if either command fails. These upstream patches apply to this revision; the successful local test used an adapted retry implementation, not these patches unchanged. 3. Adjust two build settings for current Xcode In .headerSearchPath("AltSign/**"),with: .headerSearchPath("AltSign/include/AltSign"),
.headerSearchPath("AltSign/Apple API"),
.headerSearchPath("AltSign/Model"),
.headerSearchPath("AltSign/Model/Apple API"),
.headerSearchPath("AltSign/Categories"),
.headerSearchPath("AltSign/Signing"),In 4. Build and sign locally xcodebuild -workspace AltStore.xcworkspace \
-scheme AltServer -configuration Release \
-derivedDataPath build \
-destination 'platform=macOS,arch=arm64' \
ARCHS=arm64 ONLY_ACTIVE_ARCH=YES \
CODE_SIGNING_ALLOWED=NO \
ENABLE_USER_SCRIPT_SANDBOXING=NO buildOnly continue after codesign --force --deep --sign - \
build/Build/Products/Release/AltServer.app
codesign --verify --deep --strict \
build/Build/Products/Release/AltServer.app5. Test Quit the existing AltServer, then launch the new build: open build/Build/Products/Release/AltServer.app |
Since early September 2026 GrandSlam intermittently answers the sign-in requests with an HTML 503 page instead of a plist, which AltSign fed straight to PropertyListSerialization and surfaced as the opaque "Encountered unknown tag html on line 1" (NSCocoaError 3840). Two changes fix it: - Send the modern AuthKit User-Agent. Apple now rejects the obsolete akd/1.0 CFNetwork/978.0.7 Darwin/18.7.0 string a large fraction of the time; the AuthKit string current akd sends is accepted (measured on an affected Mac: old string 503'd 12/100, AuthKit 0/100). - Use a fresh ephemeral URLSession per request and retry. GrandSlam's edge assigns a keep-alive connection to one backend node; once that node starts failing, every later request on the same connection 503s and does not recover. Sign-in sends init, complete and apptokens over one shared session, so the third request always failed. A new connection per attempt, plus a bounded 5xx retry (up to 5 attempts, 1/2/4/8s backoff, within the ~30s anisette window), resolves it. Root cause and approach from altstoreio/AltStore#1776 (Calvin-Zikakis) and the upstream fixes in rileytestut#47/rileytestut#50/rileytestut#51.
Since early September 2026 GrandSlam intermittently answers the sign-in requests with an HTML 503 page instead of a plist, which AltSign fed straight to PropertyListSerialization and surfaced as the opaque "Encountered unknown tag html on line 1" (NSCocoaError 3840). Two changes fix it: - Send the modern AuthKit User-Agent. Apple now rejects the obsolete akd/1.0 CFNetwork/978.0.7 Darwin/18.7.0 string a large fraction of the time; the AuthKit string current akd sends is accepted (measured on an affected Mac: old string 503'd 12/100, AuthKit 0/100). - Use a fresh ephemeral URLSession per request and retry. GrandSlam's edge assigns a keep-alive connection to one backend node; once that node starts failing, every later request on the same connection 503s and does not recover. Sign-in sends init, complete and apptokens over one shared session, so the third request always failed. A new connection per attempt, plus a bounded 5xx retry (up to 5 attempts, 1/2/4/8s backoff, within the ~30s anisette window), resolves it. Root cause and approach from altstoreio/AltStore#1776 (Calvin-Zikakis) and the upstream fixes in rileytestut#47/rileytestut#50/rileytestut#51.
Port of #47 by @BreezeDelegate onto
notarized. The change is theirs, this just applies it to the other branch, and the commit keeps them as author.marketplaceandnotarizedhave diverged and neither contains the other. #47 targetsmarketplace, but AltStore'sclassicandclassic_v2.3b1pinnotarized, so AltServer and non EU AltStore builds do not get it. Without this they stay on the 2018 User-Agent.Why it matters
Apple's GSA edge allows a fixed number of requests per connection before it starts returning 503, and the User-Agent changes that number. Six requests down one reused connection, five trials each, identical every time:
Two requests on the old string, four on the new one.
authenticate()sends three down a single connection, so the third one always fails, which is exactly the reported symptom: init and complete succeed, apptokens returns an HTML 503, and the plist parser reports it asNSCocoaErrorDomain 3840 "Encountered unknown tag html on line 1".Interleaved over 100 requests each, one at a time on fresh connections:
Scope
This is the whole fix for the deterministic part. There is a separate baseline failure of roughly 20 to 25 percent even on a fresh connection's first request, which the User-Agent does not affect (old 15/20, new 16/20). #50 handles that by retrying 5xx on a fresh connection. The two together got a machine that had never completed sign in to 25/25.
Reported in altstoreio/AltStore#1776, #1699, #1747.