Accept bounded StoreKit signing clock skew

Allow legitimate App Store transaction timestamps to differ within the existing verification tolerance while preserving rejection beyond that boundary.
This commit is contained in:
Rocky
2026-08-19 18:26:54 +08:00
parent 75c046d91d
commit 2194e69bb8
2 changed files with 32 additions and 3 deletions
@@ -123,7 +123,7 @@ class StoreKitService(
}
val now = clock.instant()
if (
transaction.purchasedAt > transaction.signedAt ||
transaction.purchasedAt > transaction.signedAt.plus(MAX_CLOCK_SKEW) ||
transaction.signedAt > now.plus(MAX_CLOCK_SKEW)
) {
throw StoreKitPurchaseConflict()