VerificationController 突然停止为所有应用程序工作

VerificationController abruptly stopped working for all apps

我在我的几个应用程序中使用了 Raywenderlich 提供的 VerificationController,它非常棒。完全可靠、易于实施且有效。它已经在我的三个应用程序中分别运行了几个月。

然而,两天前,这三个应用程序突然都无法正常运行。现在,对于我的真实用户和我自己的测试帐户,每次购买都无一例外地被标记为无效。我没有对应用程序或其后端进行任何更改,事实上我一直在搬家,所以我已经一周或更长时间没有碰过它们了。所有三个应用程序的更改都是即时的,我开始收到投诉是可以理解的。

问题似乎出在 checkReceiptSecurity() 函数中(它总是 returning NO 当它需要 return YES 以进行有效交易时),但该函数中的代码是超出我的理解能力。我希望有人遇到过这样的事情,或者现在正在经历,并且知道解决方案?

据我所知,这似乎发生在第二行(VerificationController.m 第 158 行)。

require(signature_length > offsetof(struct signature_blob, certificate), outLabel);
require(signature_blob_ptr->version == 2, outLabel);
certificate_len = ntohl(signature_blob_ptr->cert_len);

注释为 "Make sure the signature blob is long enough to safely extract the version and cert_len fields, then perform a sanity check on the fields." 当它到达 signature_blob_ptr 行时,它突然跳到函数的末尾,我认为这意味着它未能通过与Apple 某些回复的版本号?

任何人都可以阐明正在发生的事情吗?这显然对我的应用程序组合造成了破坏,我需要立即修复它。我会暂时禁用验证并在必要时发布更新,但我想找到任何更改的修复程序...

https://forums.developer.apple.com

搜索 "receipt validation"

显然,证书更新刚刚使 VerificationController 停止工作。

最明显但一点也不快速的解决方法是使用更新的收据验证处理。参见:https://developer.apple.com/library/ios/releasenotes/General/ValidateAppStoreReceipt/Introduction.html#//apple_ref/doc/uid/TP40010573-CH105-SW1

至于上面的代码,signature_blob_ptr->version == 3 现在。但是在代码中用 3 而不是 2 并不能解决问题,因为签名不再是 128 字节长了。