3

我收到此错误:无法查询库存:IabResult:刷新库存时出错(查询拥有的项目)。(响应:-1003:购买签名验证失败)。这是由 result.isFailure() 返回 false 引起的:

// Listener that's called when we finish querying the items we own
    IabHelper.QueryInventoryFinishedListener mGotInventoryListener = new IabHelper.QueryInventoryFinishedListener() {
        public void onQueryInventoryFinished(IabResult result, Inventory inventory) {
            Log.d(TAG, "Query inventory finished.");
            if (result.isFailure()) {
                complain("Failed to query inventory: " + result);
                return;
            }

            Log.d(TAG, "Query inventory was successful.");
            MainActivity.this.inventory = inventory;
        }
    };

我正在使用示例代码中的 IabHelper。我正在为我的应用程序使用许可证密钥,并且正在使用新的开发者控制台预览版。我也等了大约4个小时。

02-05 16:16:18.158: D/IabHelper(7243): Billing service connected.
02-05 16:16:18.158: D/IabHelper(7243): Checking for in-app billing 3 support.
02-05 16:16:18.168: D/Finsky(7267): [3600] InAppBillingService.getPreferredAccount: com.onescreen.naturewindow: Account from first account - [NMkNGmwqV_NmltnM8wpDMymSozQ]
02-05 16:16:18.168: D/IabHelper(7243): In-app billing version 3 supported for com.onescreen.naturewindow
02-05 16:16:18.168: D/MainActivity(7243): Setup finished.
02-05 16:16:18.168: D/MainActivity(7243): Setup successful. Querying inventory.
02-05 16:16:18.168: D/IabHelper(7243): Starting async operation: refresh inventory
02-05 16:16:18.168: D/IabHelper(7243): Querying owned items...
02-05 16:16:18.168: D/IabHelper(7243): Package name: com.onescreen.naturewindow
02-05 16:16:18.168: D/IabHelper(7243): Calling getPurchases with continuation token: null
02-05 16:16:18.168: V/Wifi-Receiver(7243): You have wifi
02-05 16:16:18.168: D/Finsky(7267): [3601] InAppBillingService.getPreferredAccount: com.onescreen.naturewindow: Account from first account - [NMkNGmwqV_NmltnM8wpDMymSozQ]
02-05 16:16:18.168: D/Finsky(7267): [3601] InAppBillingService.getPreferredAccount: com.onescreen.naturewindow: Account from first account - [NMkNGmwqV_NmltnM8wpDMymSozQ]
02-05 16:16:18.168: D/IabHelper(7243): Owned items response: 0
02-05 16:16:18.178: E/IABUtil/Security(7243): Signature verification failed.
02-05 16:16:18.178: W/IABUtil/Security(7243): signature does not match data.
02-05 16:16:18.178: W/IabHelper(7243): In-app billing warning: Purchase signature verification **FAILED**. Not adding item.
02-05 16:16:18.178: D/IabHelper(7243):    Purchase data: {"orderId":"968536977714379","packageName":"com.onescreen.naturewindow","productId":"4965353","purchaseTime":1352405691000,"purchaseState":0,"purchaseToken":"hzfiqciitiuwohxygvoiejxx.AO-J1OwDaTeQEtYrTcAX6SmSCNhrriCcBFUHqJHH-X3ILO0nXCBeoAP4NR1TA-4zbYwV5tCM7Apf5XtuVM5tYdD1Qa3v06sFdKlBXfTesZMPmA7v73hGEFdSvVoACzvVtKgbjtFAb_DQ"}
02-05 16:16:18.178: D/IabHelper(7243):    Signature: J7BEM0slF+WjHcYtW4WPm8MQM3QHfloRFXPbkdQOaVaIuWRNcKohY8J46e1lVD/VAlzS/DQjhuVH+oH+YmSqYvTmUvtzoBRMiFejU+zs8zJ74MhPoz+TweZ0GLv5XIBViZi3YyKD3Ht/QJVk6gk4JmsMm88s27EZa/tZmA/09SJ1OiVYh9uXlENpX2U5wSUdd5VmLCdEmBwwGdZE/E3tN0ZTcewvcteukhl82XqIEt//Ag8sGcD/PPC1iNOT39h+ZxxExiMf4ds+G7IhEAHlxChCcAcCWbYbTMQSrrTMC40coxYfBh72wQkvWjMEDJaUc/YYTH0VjJ2qNh5PJuONLg==
02-05 16:16:18.178: E/IABUtil/Security(7243): Signature verification failed.
02-05 16:16:18.178: W/IABUtil/Security(7243): signature does not match data.
02-05 16:16:18.178: W/IabHelper(7243): In-app billing warning: Purchase signature verification **FAILED**. Not adding item.
02-05 16:16:18.178: D/IabHelper(7243):    Purchase data: {"orderId":"12999763169054705758.1340994679114311","packageName":"com.onescreen.naturewindow","productId":"4965354","purchaseTime":1354925460000,"purchaseState":0,"purchaseToken":"jdpbejopfmimosuoijjeqapb.AO-J1OwSnpLWGucDsEpQbO5ippAUS-HEiOJHCANVqH4iOCYv4h2J0xFWaNH2t3BntUKk9QQ7yc8PS8sGhJ19atZeB1_Lhf3BOCLbvUPPhJLQ6bAjexdDYUvk8JYDGhdqfgd8Z6ObKwkM"}
02-05 16:16:18.178: D/IabHelper(7243):    Signature: d5v3Bxxc+e5k85f1PQAAExmwvu77P52o7mrG8Kw+VYmcxGSF/T77FziigKdx4bYQCHjO3nPJfQSjbh4r59mSH+X3G/GHrqRxqumpykFExDyQRl0c21beZBncZVAljMuW3hCs4Y7pcrsIalR8pZjDaZeOF9DdVxQAeQnd9ps5LutGjiSV6fjcetBd922mZErgUxE2AVo/q84wFcqckDjdG0WafsHkq4K/ax7IYENCvKD2yaVYMSagTMc8MzcghCOtBSrDSm0c1V4iZROt+13eYeLlAgJfQEluNMfq0FaqXWKoox0Ms3WV6gG73a883ixArrr8p68mOzhfStnXaxLlIw==
02-05 16:16:18.178: D/IabHelper(7243): Continuation token: null
02-05 16:16:18.178: D/IabHelper(7243): Ending async operation: refresh inventory
02-05 16:16:18.248: V/PhoneStatusBar(544): setLightsOn(true)
02-05 16:16:18.298: D/MainActivity(7243): Query inventory finished.
02-05 16:16:18.298: E/MainActivity(7243): **** TrivialDrive Error: Failed to query inventory: IabResult: Error refreshing inventory (querying owned items). (response: -1003:Purchase signature verification failed)

此外,当我尝试从商店购买托管商品时,我得到用户不允许购买错误。

编辑。所以我正在查看代码,想知道是否String signature = signatureList.get(i)应该看起来像一个数组:{"orderId":"968536977714379","packageName":"com.onescreen.naturewindow","productId":"4965353","purchaseTime":1352405691000,"purchaseState":0,"purchaseToken":"hzfiqciitiuwohxygvoiejxx.AO-J1OwDaTeQEtYrTcAX6SmSCNhrriCcBFUHqJHH-X3ILO0nXCBeoAP4NR1TA-4zbYwV5tCM7Apf5XtuVM5tYdD1Qa3v06sFdKlBXfTesZMPmA7v73hGEFdSvVoACzvVtKgbjtFAb_DQ"}

这是我正在谈论的行。http://code.google.com/p/marketbilling/source/browse/v3/src/com/example/android/trivialdrivesample/util/IabHelper.java#758

4

0 回答 0