Android 应用内结算:购买后收到的空白数据

发布于 2024-10-29 07:38:50 字数 2041 浏览 1 评论 0原文

我正在尝试实施应用内结算。我已登录在 Market 中注册的测试帐户,并且已在代码中更新了我的公钥。我可以购买其中一个测试产品 ID。

但是,似乎在 PURCHASE_STATE_CHANGED 意图中发送了空白签名。日志显示如下:

INFO/BillingReceiver(21437): notifyId: android.test.purchased
WARN/ActivityManager(2513): Duplicate finish request for HistoryRecord{47de4b38 com.android.vending/.billing.InAppBuyPageActivity}
INFO/BillingService(21437): handleCommand() action: com.app.GET_PURCHASE_INFORMATION
DEBUG/BillingService(21437): GetPurchaseInformation
ERROR/BillingService(21437): getPurchaseInformation received RESULT_OK
DEBUG/BillingService(21437): request id: 4241021538346688898
INFO/BillingService(21437): handleCommand() action: com.android.vending.billing.RESPONSE_CODE
DEBUG/BillingService(21437): RequestPurchase: RESULT_OK
INFO/BillingService(21437): handleCommand() action: com.android.vending.billing.PURCHASE_STATE_CHANGED
INFO/Security(21437): signedData: {"nonce":-3927284292945900504,"orders":[{"notificationId":"android.test.purchased","orderId":"transactionId.android.test.purchased","packageName":"com.app","productId":"android.test.purchased","purchaseTime":1301944310410,"purchaseState":0}]}
INFO/Security(21542): signature: 
INFO/Security(21437): Purchase not verified
INFO/Security(21437): Purchase count = 0
INFO/BillingService(21437): handleCommand() action: com.android.vending.billing.RESPONSE_CODE
DEBUG/BillingService(21437): GetPurchaseInformation: RESULT_OK

“购买未验证”是由于代码跳过签名验证(因为它是空白)并丢弃该产品购买。

有什么想法吗?我在文档中没有看到签名可能为空或原因是什么。

FWIW,这只发生在我的 Samsung Vibrant Galaxy S (2.2.1) 上。它在 Droid (2.2.2) 上运行良好。

编辑:当我由于恢复事务操作而获得 PURCHASE_STATE_CHANGED 意图时,我在日志中得到以下内容:

INFO/BillingService(24010): handleCommand() action: com.android.vending.billing.PURCHASE_STATE_CHANGED
ERROR/Security(24010): data is null

这表明根本没有发送签名的有效负载。

编辑:在进一步测试中,当上传的应用程序和安装的应用程序的版本不同时,似乎会发生这种情况。 http://code.google.com/p/marketbilling/issues/detail?id=15< /a>

I'm trying to implement In-App Billing. I'm signed into a test account registered with the Market, and I've updated my public key in the code. I can purchase one of the test product IDs.

However, it appears that a blank signature is sent in the PURCHASE_STATE_CHANGED intent. The log appears as such:

INFO/BillingReceiver(21437): notifyId: android.test.purchased
WARN/ActivityManager(2513): Duplicate finish request for HistoryRecord{47de4b38 com.android.vending/.billing.InAppBuyPageActivity}
INFO/BillingService(21437): handleCommand() action: com.app.GET_PURCHASE_INFORMATION
DEBUG/BillingService(21437): GetPurchaseInformation
ERROR/BillingService(21437): getPurchaseInformation received RESULT_OK
DEBUG/BillingService(21437): request id: 4241021538346688898
INFO/BillingService(21437): handleCommand() action: com.android.vending.billing.RESPONSE_CODE
DEBUG/BillingService(21437): RequestPurchase: RESULT_OK
INFO/BillingService(21437): handleCommand() action: com.android.vending.billing.PURCHASE_STATE_CHANGED
INFO/Security(21437): signedData: {"nonce":-3927284292945900504,"orders":[{"notificationId":"android.test.purchased","orderId":"transactionId.android.test.purchased","packageName":"com.app","productId":"android.test.purchased","purchaseTime":1301944310410,"purchaseState":0}]}
INFO/Security(21542): signature: 
INFO/Security(21437): Purchase not verified
INFO/Security(21437): Purchase count = 0
INFO/BillingService(21437): handleCommand() action: com.android.vending.billing.RESPONSE_CODE
DEBUG/BillingService(21437): GetPurchaseInformation: RESULT_OK

The "Purchase not verified" is due to the code skipping the signature verification (because it is blank) and tossing out that product purchase.

Any idea? I don't see in the docs anywhere that the signature could be blank or what the reason would be.

FWIW, this only happens on my Samsung Vibrant Galaxy S (2.2.1). It works fine on a Droid (2.2.2).

EDIT: When I get the PURCHASE_STATE_CHANGED Intent as the result of a restore transactions operation, I get this instead in the logs:

INFO/BillingService(24010): handleCommand() action: com.android.vending.billing.PURCHASE_STATE_CHANGED
ERROR/Security(24010): data is null

This indicates that no signed payload was sent at all.

EDIT: On further testing it seems that this occurs when the versions of the uploaded app and the installed app differ. http://code.google.com/p/marketbilling/issues/detail?id=15

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

野侃 2024-11-05 07:38:50

我也遇到了这个问题。我增加了 apk 的 versionCode,对其进行了正确签名,但随后只从市场得到了这些空响应。

为了解决这个问题,我将新的 apk 作为草稿上传到市场,然后我得到了有效的回复。

I also ran into this problem. I increased the versionCode of the apk, signed it correctly but then only got these null responses from the market.

To fix it I uploaded the new apk as a draft to the market, then I got valid responses.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文