Repository navigation
Send the anisette server's user agent with GrandSlam requests - fixes HTTP 503 on sign-in with remote anisette - #1851
Open
IgoSzaFIIT wants to merge 1 commit into
Conversation
AltStore never set ALTAppleAPI.authenticationUserAgent, so AltSign used its fallback "akd/1.0 CFNetwork/808.1.4" next to the anisette server's client info, and gsa.apple.com refused about half of those requests with HTTP 503. AltServer already sets it from its anisette server.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AltStore never sets
ALTAppleAPI.authenticationUserAgent, so since 2.3.1 every GrandSlam request is done with AltSign's fallbackUser-Agent: akd/1.0 CFNetwork/808.1.4next to the anisette server's client info. gsa.apple.com refuses about half of those with an HTML 503 page. A sign-in takes three GrandSlam requests (init,complete,apptokens), so most refreshes fail. AltServer already sets the user agent from its anisette server (AnisetteDataManager.swift).I'm pretty sure this is what people are also describing in #1842.
I started encountering this right after updating my iPhone and iPad to 2.3.1, both on Remote AltServer with a self-hosted anisette v3 server that reports a Mac client info. On 2.3 both refreshed fine. On 2.3.1, one refresh worked after the re-auth and every attempt after that failed with
AppleDeveloperError 3000/ HTTP 503.To narrow it down, I sent GrandSlam
initrequests with a fake Apple ID from a throwaway anisette machine on the same server, with a fresh OTP each time, and swapped one part of the request at a time between AltSign's 2.3 and 2.3.1 versions.-20970(wrong account details) means Apple accepted the request, anything else was the 503 page:cpd+ 2.3 headerscpd+ 2.3 headerscpd+ 2.3.1 headers (UAakd/1.0 CFNetwork/808.1.4)cpd+ 2.3.1 headers (UAakd/1.0 CFNetwork/808.1.4)cpd+ 2.3.1 headers, UA = the server'suser_agentThe other
cpdand header changes from rileytestut/AltSign#61 don't matter. The user agent does - with the server'suser_agent, the exact 2.3.1 request never got a 503. Sending through Python's urllib or URLSession made no difference.The fix sets
authenticationUserAgentto theuser_agentfrom the server's/v3/client_inforesponse inFetchAnisetteDataOperation, like AltServer does.Not tested on a device yet, only with the request-level test above. I didn't wanna spam these requests with my real account.