AppRestore 0.2.2: fix Apple ID login (ipatool 2.5.0) + reach Apple through the system proxy - #5
Merged
Merged
Conversation
…rough the system proxy Apple ID login broke again after Apple changed its Store auth backend. Upstream ipatool 2.4.0 replaced App Store authentication with SAP-signed requests (majd/ipatool#525) and 2.5.0 added SAP guest timeout handling, retries for transient auth responses and correct macOS keychain access (majd/ipatool#528, #531, #533). Pinned version and the Windows/macOS archive SHA-256 hashes bumped accordingly. The SAP signer runs inside a Unicorn emulator and pulls two things the ipatool release does not ship: the emulator library and private Apple frameworks from swcdn.apple.com. Both land in the user cache on first login, so apprestore doctor now reports each cache separately -- by the library and by file size, because an interrupted download leaves an empty directory behind -- and the login timeout rises from 10 to 30 minutes. ipatool is a Go binary, and Go reads only HTTP_PROXY/HTTPS_PROXY -- it never sees the Windows proxy settings. Where DPI stretches the TLS handshake to Apple past Go's fixed 10 second timeout, the direct path failed with "net/http: TLS handshake timeout" during both login and IPA download while a browser on the same machine worked. AppRestore now passes the Windows system proxy to ipatool, but only when something is actually listening there: the system proxy often points at a VPN client that may be off, and injecting it blindly would break a working direct path. Explicit HTTP_PROXY/HTTPS_PROXY from the environment always win. A failed IPA download no longer blames the licence and the region first: a network failure reaching Apple is now named ahead of them, because a TLS handshake timeout used to read as "app removed from the App Store". install-windows.ps1 no longer dies on Windows PowerShell 5.1, which strips double quotes from native command arguments and delivered the ipatool extraction snippet to python -c already broken; a contract test now keeps double quotes out of inline snippets. Version bumped to 0.2.2 across every file docs/RELEASING.md tracks. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Зачем
Вход в Apple ID снова сломался после изменений на стороне Apple. Апстрим ответил двумя релизами: 2.4.0 заменил авторизацию App Store на SAP-подписанные запросы вместо legacy-эндпоинта (majd/ipatool#525), 2.5.0 добавил обработку таймаутов SAP guest, повтор транзитивных ответов авторизации и корректный доступ к keychain на macOS (#528, #531, #533).
CLI-поверхность
auth login/info/revoke,searchиdownloadне изменилась, так что вызовы ломать не пришлось.Что внутри
Пин ipatool 2.3.2 → 2.5.0. SHA-256 для windows-amd64, macos-amd64 и macos-arm64 взяты из официальных
.sha256sumрелиза и перепроверены загрузкой архивов; структура архива (bin/ipatool-<ver>-<platform>) не изменилась.Новый SAP-подписчик тянет из сети два независимых куска, которых нет в релизе ipatool: библиотеку эмулятора Unicorn и приватные фреймворки Apple со
swcdn.apple.com. Оба кладутся в пользовательский кэш при первом входе, поэтому:apprestore doctorдокладывает про каждый кэш отдельно — они падают по-разному;auth loginподнят с 10 до 30 минут — прежнего запаса не хватало на загрузку рантайма плюс ручной ввод пароля и 2FA;Системный прокси Windows теперь доезжает до ipatool. ipatool на Go, а Go читает только
HTTP_PROXY/HTTPS_PROXYи настроек Windows не видит. На реальной машине TLS-хендшейк доp29-buy.itunes.apple.comнапрямую занимал 15.4 с против 0.66 с через прокси, а у Go таймаут хендшейка фиксированные 10 с — отсюдаnet/http: TLS handshake timeoutи на входе, и на загрузке IPA, при том что браузер на той же машине работал.Подстановка нарочно консервативна:
HTTP_PROXY/HTTPS_PROXYиз окружения всегда важнее;Сообщение о неудачной загрузке больше не сваливает всё на лицензию и регион: сетевой сбой назван первой причиной. Раньше
TLS handshake timeoutчитался как «приложение удалено из App Store».install-windows.ps1больше не падает на Windows PowerShell 5.1. Тот вырезает двойные кавычки из аргументов native-команд, и сниппет распаковки ipatool доезжал доpython -cуже сломанным (mode=r:gz→SyntaxError). Баг latent с давних пор и виден только под 5.1 — pwsh 7 кавычки сохраняет. Контрактный тест теперь не даёт вернуть двойные кавычки в inline-сниппеты.Проверка
pytest -qruff checkcompileallbuild-release.pyAppRestore-0.2.2-source.zip, рассинхрона версий нетpowershell5.1Новых тестов: 5 — четыре на логику прокси (приоритет окружения, недоступный прокси, доступный прокси, доставка env в каждый сетевой вызов
ipatool) и один контрактный на кавычки в inline-сниппетах.Локально не запускался
scripts/rebuild-vendored-wheel.py --check: он требует отдельного окружения CPython 3.12.13, а под рукой был 3.14. Досчитает CI.Версия поднята до 0.2.2 во всех файлах, которые отслеживает
docs/RELEASING.md. Тегv0.2.2— после merge, отдельным шагом.🤖 Generated with Claude Code