アプリ内課金を実装しようとしています。マーケットに登録されたテスト アカウントにサインインし、コード内の公開キーを更新しました。テスト製品 ID の 1 つを購入できます。
ただし、空の署名が 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