我已经尝试了几天来解决这个问题,使用SDK附带的Dungeons演示代码.我试过谷歌寻求答案,但找不到答案.
android.test.purchased在控制台上创建的产品列表和已发布的订阅(我想要的应用程序的主要功能).但我仍然得到错误,Signature verification failed然后签名与数据不匹配.我怎么解决这个问题?
public static ArrayList<VerifiedPurchase> verifyPurchase(String signedData, String signature)
{
if (signedData == null) {
Log.e(TAG, "data is null");
return null;
}
if (Consts.DEBUG) {
Log.i(TAG, "signedData: " + signedData);
}
boolean verified = false;
if (!TextUtils.isEmpty(signature)) {
String base64EncodedPublicKey = "MIIBIjA....AQAB";
PublicKey key = Security.generatePublicKey(base64EncodedPublicKey);
verified = Security.verify(key, signedData, signature);
if (!verified) {
Log.w(TAG, "signature does not match data.");
return null;
}
}
}
public static boolean verify(PublicKey publicKey, String …Run Code Online (Sandbox Code Playgroud) 我已在我的应用中实施了应用内结算 - 最近谷歌已对其进行了更新,之前我正在测试应用内结算"android.test.purchased"并且工作正常(购买完整版和恢复完整版).
现在我从这里接受了更改的课程 https://code.google.com/p/marketbilling/source/detail?r=7bc191a004483a1034b758e1df0bda062088d840
之后,我无法测试应用程序,它在Logcat中给出以下错误 "IabHelper: In-app billing error: Purchase signature verification FAILED for sku android.test.purchased
".
我已经检查了我的密钥,包名和app版本都是正确的,有没有人遇到过这个问题?
请帮我解决一下这个.
android billing in-app-purchase in-app-billing android-billing