207 Commits
Author SHA1 Message Date
Majd Alfhailyandhorskin ab79e429d5 fix: fall back to legacy Store authentication (#514)
* fix: fall back to legacy Store authentication

* style: satisfy lint checks

---------

Co-authored-by: horskin <pkh_horskin@photons.com.tw>
v2.3.2
2026-08-03 09:58:15 +02:00
dependabot[bot] 9032d4c192 Bump golang.org/x/crypto from 0.51.0 to 0.52.0 (#509)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.51.0 to 0.52.0.
- [Commits](https://github.com/golang/crypto/compare/v0.51.0...v0.52.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.52.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-10 23:08:22 +02:00
dependabot[bot]andMajd Alfhaily 779a2e66cb Bump golang.org/x/net from 0.51.0 to 0.55.0 (#508)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.51.0 to 0.55.0.
- [Commits](https://github.com/golang/net/compare/v0.51.0...v0.55.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-version: 0.55.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Majd Alfhaily <majd@alfhaily.me>
v2.3.1
2026-07-05 12:46:54 +02:00
Vadim-B52 fd630343bc fix(auth): append trailing slash to native/fast authenticate endpoint (#507)
Apple's account bag now returns the authentication endpoint as
https://auth.itunes.apple.com/auth/v1/native/fast. That endpoint only
responds correctly when the path has a trailing slash; posting to it
without the slash makes Apple's edge return a 301/204 with an empty or
HTML body, so 'ipatool auth login' fails to parse the response and
silently dies (observed as the 'plist: unexpected hex digit' error or a
-5000 with no usable message).

Also improve http client diagnostics: when an XML response body is not a
property list, return 'unexpected response from Apple (HTTP <code>):
<snippet>' instead of the opaque plist parse error.
2026-07-05 12:41:37 +02:00
Rudra Sarkar dcddce4650 Fix 429 rate limit handling and context key type mismatch in login #480 (#481)
fix: handle 429 rate limit and context key type mismatch in login issue #480
2026-05-26 06:21:29 +02:00
Lakr a3fa2f09b3 feat: add tvOS app search and download support (#478) 2026-05-25 13:19:30 +02:00
Majd Alfhaily 85ae82d9c4 chore(repo): delete .github/FUNDING.yml (#475) 2026-05-05 21:23:37 +00:00
Majd Alfhaily 1bee8bc568 chore(repo): remove Patreon funding option (#474) 2026-05-02 16:21:27 +02:00
Majd Alfhaily abaeccefec feat: perform partial zip reads for extracting version and release date (#472) 2026-05-02 12:11:12 +02:00
Majd Alfhailyandliqiang 8c4e037aa3 fix: close ZIP entry readers during replication (#469)
Co-authored-by: liqiang <1573335865@qq.com>
2026-04-16 18:42:55 +00:00
4142ab48ad feat: use auth endpoint from Bag on retries (#468)
* Fix purchase retry to resolve auth endpoint via Bag() before re-login

The retry logic in purchase, download, get-version-metadata, and
list-versions called Login() without an Endpoint when re-authenticating
after a password token expiry. This caused silent failures because the
auth endpoint was empty.

- Add Bag() call before Login() in all retry blocks to resolve the auth
  endpoint dynamically
- Fall back to hardcoded auth endpoint when bag.xml omits
  authenticateAccount
- Detect "Your password has changed." customer message as a token expiry
  trigger alongside failure type 2034
- Increase download retry attempts to 3 to handle license-required then
  token-expired chain

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Address PR review: make auth path constant consistent, add password-changed test

- Rename PrivateAppStoreAPIPathAuthenticate to store only the path
  (consistent with other *APIPath* constants), constructing the full
  URL in the Bag() fallback
- Add test for CustomerMessagePasswordChanged triggering
  ErrPasswordTokenExpired in purchaseWithParams

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix purchase "already purchased" detection for Apple API changes

Apple now returns HTTP 200 with FailureType "5002" for already-purchased
apps instead of HTTP 500. Also treat FailureType "1008" (device
verification failed) as a stale token that triggers re-authentication.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix download retry to handle new Apple failure types (5002, 1008)

Map FailureType "5002" (license already exists) and "1008" (device
verification failed) to ErrPasswordTokenExpired in the download flow,
triggering re-auth retry consistent with the purchase fix in 438e8e8.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix zip corruption on re-download when .ipa already exists

applyPatches opened the destination file with O_CREATE|O_WRONLY but no
O_TRUNC. On re-download, the existing .ipa (which includes sinf data
from ReplicateSinf) is larger than what applyPatches writes (zip entries
+ metadata, no sinf yet). The leftover bytes at the end corrupt the ZIP
end-of-central-directory record, causing ReplicateSinf's zip.OpenReader
to fail with "failed to open zip reader".

Fix: add O_TRUNC to truncate the file before writing, and add a missing
defer dstFile.Close() to prevent file descriptor leaks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Treat "license already exists" as success in purchase and download

When the user already owns an app, purchase should report success
(with alreadyOwned=true) instead of failing with an error. Applied
to both the standalone purchase command and the --purchase flag in
the download command.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Remove Bag() fallback in retry paths, use DefaultAuthEndpoint directly

The bag response from init.itunes.apple.com/bag.xml does not contain
an authenticateAccount key, so the fallback was firing 100% of the time.
Replace the Bag()+Login() pattern in retry paths with Login() using a
DefaultAuthEndpoint constant directly, avoiding an unnecessary network
round-trip. The cmd/auth.go login flow still uses Bag() as before.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Use bag auth endpoint for retry login

---------

Co-authored-by: Barnabas Birmacher <birmacher@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 18:23:09 +00:00
Majd AlfhailyandBasil 1858ad7a72 chore(deps): update keyring module to maintained fork (#466)
Co-authored-by: Basil <basil@basil.cafe>
2026-04-14 20:39:55 +02:00
gitevedev 2140a26bdf Treating 'iTunes Store Sign-in required' the same way as expired pass (#432) 2026-04-10 18:53:16 +02:00
Majd Alfhaily e914156036 Add repository AGENTS.md guidance 2026-02-16 23:30:01 +01:00
Majd Alfhaily 19ffd1bf6b Use custom pod when applicable in purchase API v2.3.0 v2.3.0-rc.1 2026-02-16 20:12:00 +01:00
Majd Alfhaily 7ffd4bf050 Use custom pod when applicable in download, get-version-metadata and list-versions APIs 2026-02-16 20:12:00 +01:00
Majd Alfhaily 496595a039 Update auth command to retrieve bag and pass custom endpoint to auth API 2026-02-16 20:12:00 +01:00
Majd Alfhaily 7765fd5445 Update auth to use custom endpoint and store pod 2026-02-16 20:12:00 +01:00
Majd Alfhaily 6f63cd4776 Implement AppStore bag retrieval 2026-02-16 20:12:00 +01:00
Majd Alfhaily 65242569b3 Fix decoding Apple Plist envolope 2026-02-16 20:12:00 +01:00
dependabot[bot] 14883b4631 Bump github.com/dvsekhvalnov/jose2go from 1.6.0 to 1.7.0 (#416)
Bumps [github.com/dvsekhvalnov/jose2go](https://github.com/dvsekhvalnov/jose2go) from 1.6.0 to 1.7.0.
- [Commits](https://github.com/dvsekhvalnov/jose2go/compare/v1.6.0...v1.7.0)

---
updated-dependencies:
- dependency-name: github.com/dvsekhvalnov/jose2go
  dependency-version: 1.7.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-23 09:45:46 +01:00
Jens Christian Hillerup 91ae69cc58 Grant binaries exec permissions before packaging with tarball (#389) 2025-09-06 15:14:32 +02:00
GSG 80dbbef6c8 Resume incompleted downloads (#322) 2025-07-13 11:43:24 +02:00
sevenpastzeero e3e604925f Add Iraq storefront code (#383) 2025-07-08 20:38:42 +00:00
Majd Alfhaily cffa279e31 Fix README formatting v2.2.0 2025-06-09 20:44:16 +02:00
Majd Alfhaily 034a0978ab Remove GitHub sponsors from FUNDING.yml 2025-06-09 20:40:45 +02:00
Majd Alfhaily 9657750fc1 Create FUNDING.yml 2025-06-09 20:39:51 +02:00
Majd Alfhaily 9969c18cef Strip 2FA code from whitespaces 2025-06-09 17:23:08 +02:00
Majd Alfhaily f09439ecde Handle disabled account errors on auth 2025-06-09 17:23:08 +02:00
Majd Alfhaily 55ef41fc20 Update README.md 2025-06-09 17:18:53 +02:00
Majd Alfhaily b4bd8d6580 Rename field to external-version-id 2025-06-09 17:18:53 +02:00
Majd Alfhaily 79250ae2a3 Implement GetVersionMetadata command 2025-06-09 17:18:53 +02:00
Majd Alfhaily a3212e0fd2 Use display version in filename 2025-06-09 12:13:32 +02:00
Majd Alfhaily 805678138e Fix running golangci-lint on GitHub Actions 2025-06-09 12:13:32 +02:00
Majd Alfhaily 3a537e7571 Update GitHub Actions to use Go v1.23.0 2025-06-09 12:13:32 +02:00
Majd Alfhaily e686248270 Update README.md 2025-06-09 12:13:32 +02:00
Majd Alfhaily ac081fa19d Use internal version ID in filename of app 2025-06-09 12:13:32 +02:00
Majd Alfhaily 7136f81fd1 Refactor VersionHistory subcommand to ListVersions 2025-06-09 12:13:32 +02:00
SoCuul 34866f5833 Update macOS package manager install instructions (#350) 2025-06-08 13:59:35 +00:00
Chris Lui 46f3369de0 Fix typo on "failed to reoslve the country code" (#367) 2025-06-08 13:48:53 +00:00
koraytutuncu 0bb134e9d7 Add version history and old app version download support (#370) 2025-06-08 15:44:15 +02:00
dependabot[bot] bbf3717456 Bump golang.org/x/net from 0.36.0 to 0.38.0 (#364)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.36.0 to 0.38.0.
- [Commits](https://github.com/golang/net/compare/v0.36.0...v0.38.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-17 23:50:00 +02:00
dependabot[bot] e1eda9f776 Bump golang.org/x/net from 0.33.0 to 0.36.0 (#355)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.33.0 to 0.36.0.
- [Commits](https://github.com/golang/net/compare/v0.33.0...v0.36.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-11 21:33:30 +02:00
Majd Alfhaily c406c36819 Replace Changelog with Releases link 2025-03-01 12:15:22 +01:00
Max e5291ba16b Log if app purchase was required and executed (#339) v2.1.6 2025-02-10 23:33:02 +01:00
AhmedBafkir 37af8f8468 Fix purchase issue (#338)
Fix purchase issue by updating endpoint
2025-02-10 23:25:58 +01:00
MaxandMajd Alfhaily 21cbd596bc Fix initial authentication attempt with 2FA (#331)
I though that the first attempt would not contain the 2fa code,
but I was wrong. This fixes the authentication when using 2fa enabled
accounts.

closes majd/ipatool#326

Co-authored-by: Majd Alfhaily <majd@alfhaily.me>
v2.1.5
2025-01-20 00:13:19 +01:00
dependabot[bot]andMajd Alfhaily f3c9076ff0 Bump golang.org/x/net from 0.23.0 to 0.33.0 (#334)
* Bump golang.org/x/net from 0.23.0 to 0.33.0

Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.33.0.
- [Commits](https://github.com/golang/net/compare/v0.23.0...v0.33.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix linting errors

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Majd Alfhaily <majd@alfhaily.me>
2025-01-20 00:00:00 +01:00
Majd Alfhaily d147788501 Bump deprecated actions versions 2025-01-19 23:39:03 +01:00
Max 8a23d6fadd Fix authentication (#316)
login: increment 'attempt' while following redirects

Apple has introduced some dynamic GET parameters into their
redirects, forcing us to use the main domain ( no `p71-`
and such prefixes ) to obtain those parameters.

However, when following such redirects, we shall also increment
the `attempt` parameter (something that was hard-coded before).
2024-12-07 23:56:04 +01:00