Googleで提供されているアプリ内課金のサンプルを続けています。セキュリティクラスをサーバー上の実装に置き換えることをお勧めします。だから私は上記を交換したいと私は私のサーバーからの応答を得るとき、私は(confirmNotificationsを実行したいアプリ内課金 - 通知()を確認するまでマーケットプレイスは引き続きPingしていますか?
/**
* Verifies that the data was signed with the given signature, and calls
* {@link ResponseHandler#purchaseResponse(Context, PurchaseState, String, String, long)}
* for each verified purchase.
* @param startId an identifier for the invocation instance of this service
* @param signedData the signed JSON string (signed, not encrypted)
* @param signature the signature for the data, signed with the private key
*/
private void purchaseStateChanged(int startId, String signedData, String signature) {
// Instead of using the local version included on the client,
// this should be an http call to our server which has the
// implementation.
ArrayList<Security.VerifiedPurchase> purchases;
purchases = Security.verifyPurchase(signedData, signature);
if (purchases == null) {
return;
}
// Then the rest gets executed after the http response comes back.
...
confirmNotifications(startId, notifyIds);
):私は私のサーバー上の実装を呼び出して、次を置き換えるために持っているように見えますビットなど。しかし、ここで間違っていることがたくさんあります。ネットワークが途切れる可能性があるので、私は正常にconfirmNotifications()ビットを実行するまで市場が私にメッセージを送信し続けると思いますか?
私のサーバーで検証を開始すると何かがうまくいかず、クレジットカードの請求があったユーザーがたくさんいますが、デバイスに表示されているコンテンツは表示されません。
また、私のアプリでは著作権侵害のスレッドはかなり低いと思うが、私はマーケットプレイスの公開鍵をクライアントに埋め込んでおくことに心配している。私がいつか人気のタイトルを持っていれば、攻撃者は私の古いアプリを見て、それを手に入れてしまう可能性があります(公開鍵を入手すればどれくらいの危険性があるかわかりません)。
おかげ
を見て?そしてどれくらい?私が決して確認しなければ、非常に死ぬまで迷惑メールを受け取りますか? –
まあ、言いにくいです。あなたが市場サービスに接続するたびに、市場はCONFIRM_NOTIFICATIONSを送信することを覚えています。 – Blackbelt