AltStore icon indicating copy to clipboard operation
AltStore copied to clipboard

Error 412 With SMS

Open Thought-1915 opened this issue 3 weeks ago • 4 comments

This is different from the recent fix to Error 415. This error pops up whenever I attempt to install AltStore onto my phone via AltServer on a Mac. If it helps, both devices are set to the en_US locale, but also set to use the metric system.

AltStore.AppleDeveloperError: 3000, Error Description: Could not request an SMS verification code from Apple. Apple's authentication servers returned an error (HTTP 412)., Failure: Could not request an SMS verification code from Apple., Failure Reason: Apple's authentication servers returned an error (HTTP 412)., Recovery Suggestion: This is most likely a problem on Apple's end, not with your Apple ID or password., Title: AltStore could not be installed onto iPhone. Source File: AltSign/ALTAppleAPI+Authentication.swift, Source Line: 438, HTTPStatusCode: 412

For accessibility reasons, the text of the screenshot is also included below:

AltStore.AppleDeveloperError 3000

Error Description Could not request an SMS verification code from Apple. Apple's authentication servers returned an error (HTTP 412).

Failure Could not request an SMS verification code from Apple.

Failure Reason Apple's authentication servers returned an error (HTTP 412).

Recovery Suggestion This is most likely a problem on Apple's end, not with your Apple ID or password.

Title AltStore could not be installed onto iPhone.

Source File AltSign/ALTAppleAPI+Authentication.swift

Source Line 438

HTTPStatusCode 412

Thought-1915 avatar Nov 10 '26 04:11 Thought-1915

this is a different error from the 415, and it comes after it: the 415 was apple rejecting the format of the sms request (an xml plist), which rileytestut/AltSign#62 changed to json. with the new format apple accepts the request but answers 412 ("precondition failed"), so something about the account or its state is being rejected, not the format. the source line in your screenshot (438) is the sms request in the code that includes #62, so you're on a build with that change.

one thing that might explain it: isideload, whose request format #62 copies, does not treat a 412 on this request as a failure. it reads the body, and if it describes an active sms challenge (mode sms, type verification, authentication type hsa2, a trusted phone number, a 6-digit code) it concludes apple already sent a code (for example from an earlier attempt) and goes on to ask for it. altsign only accepts 2xx, so it would show this error instead. i haven't confirmed that's what happens in your case: altserver doesn't show the response body.

two questions that would help:

  1. did a text message with a code arrive on your phone right before (or on an earlier attempt of) this error?
  2. which altserver are you running: the official 1.8.3, one built from source, or the experimental build linked in #1844?

don't share your apple id or any code here.

kisnner26 avatar Nov 12 '26 22:11 kisnner26

in case it is the "code already sent" case i described above, here is a proposed fix, not a pull request: https://github.com/kisnner26/AltSign/commit/e775d4ae2dbbb17d427ad83f516a488104288e5f (on top of rileytestut/AltSign#62).

what it does: when the sms request answers 412, it reads the body and, only if it describes an active sms challenge for the requested phone number (mode sms, type verification, authentication type hsa2, a 6-digit code, and none of the too-many-codes, locked or cooldown flags), it goes on and asks for the code instead of failing. any other 412 still fails as before. it is a new SMSChallenge.swift plus about 8 changed lines in requestSMSTwoFactorCode.

what i have and haven't checked:

  • the check itself passes 19 cases in a standalone test (the conditions failing one by one, other status codes, empty or malformed bodies).
  • i have not seen a real 412 body from apple; the shape follows isideload's parser. if apple's body differs, nothing changes compared to today.
  • i have not tested it against apple, and i couldn't finish a full altserver build with it. it is only a proposal until someone who gets this 412 confirms it.

if you can build altsign/altserver from source and want to try it, tell me what happens: does it ask for the code, does the code from the text verify, does the sign-in finish. please don't paste your apple id or any code. if it doesn't help, or the 412 is something else, the answer to my two questions above would tell us more.

kisnner26 avatar Nov 12 '26 23:11 kisnner26

Hello. For question 1, I have never received an SMS code as a direct result of using AltStore, let alone around whenever this error occurred. For question 2, I am using the official latest build, not the unofficial one. I'll check out your proposed fix if I have the time.

Thought-1915 avatar Nov 13 '26 00:11 Thought-1915

thanks for answering. since no sms ever arrived, my guess that apple answers 412 because a code was already sent doesn't fit your case, so the fix i proposed above is probably not the answer for you; please ignore it unless more evidence points that way.

what fits better is what is being discussed in #1844: altsign takes the sms path when apple's sign-in reply says secondaryAuth, even for accounts that use trusted devices, and then apple refuses the sms request (415 before rileytestut/AltSign#62, and 403 or 412 in different reports). the real fix would probably be choosing the 2fa method from the account's actual state. nobody has verified that against apple yet, me included.

thanks for the details and for offering to test.

kisnner26 avatar Nov 18 '26 23:11 kisnner26