联系许可服务器 [英] Contacting licensing server

查看:118
本文介绍了联系许可服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在要发布3个小时的应用,但是我无法使许可证检查正常工作。

I'm trying to publish my app for 3 hours now, but I can't get the license check to work.

在我的 onCreate 方法,我得到了这段代码:

In my onCreate method I got this code:

// Try to use more data here. ANDROID_ID is a single point of attack.
String deviceId = Secure.getString(getContentResolver(), Secure.ANDROID_ID);
String pckName = getPackageName();

// Library calls this when it's done.
mLicenseCheckerCallback = new MyLicenseCheckerCallback();
// Construct the LicenseChecker with a policy.
mChecker = new LicenseChecker(this, new ServerManagedPolicy(this, new AESObfuscator(
    SALT, pckName, deviceId)), BASE64_PUBLIC_KEY);

mChecker.checkAccess(mLicenseCheckerCallback);

回调看起来像这样

private class MyLicenseCheckerCallback implements LicenseCheckerCallback {
    public void allow(int policyReason) {
        if (isFinishing()) 
            return; // Don't update UI if Activity is finishing.
        // Should allow user access.
        Main.isLicensed = true;
    }

    public void dontAllow(int policyReason) {
        if (isFinishing())
            return; // Don't update UI if Activity is finishing.
        Main.isLicensed = false;
    }

    public void applicationError(int errorCode) {
        if (isFinishing())
            return; // Don't update UI if Activity is finishing.
        Main.isLicensed = false;
    }
}

仅调用dontAllow方法。响应代码为291。

Only the dontAllow method gets called. And the response code is 291.

在logcat中,我收到联系许可服务器时出错。

In logcat I get "Error contacting licensing server."


  • 应用已升级到开发人员控制台。

  • The app is uplodaded to the developer console.

公钥已正确复制(没有空格)。

The public key is correct copied (without any spaces).

电话(装有Android 4.0.4的三星Galaxy S2)已连接互联网

The phone (Samsung Galaxy S2 with Android 4.0.4 Stock) got internet

有什么想法吗?

推荐答案

代码对我来说不错。但是我现在有一个类似的问题。您是否...

Code looks good to me. But I have a similar problem at the moment. Did you ...


  • 重新启动网络连接

  • 重新启动电话

  • 清除Google Play商店的数据(设置->应用程序-> Google Play商店)

  • 清除Google Play服务的数据

  • 使用您的发布者/测试帐户登录设备的Google Play商店

  • restarted network connection
  • restarted your phone
  • clear the data of google play store (settings -> apps -> google play store)
  • clear the data of google play services
  • logged in your device google play store with your publisher/testing account

如果解决了问题,请告诉我。

Let me know, if solved the problem.

感谢
最好的祝福

Thanks Best wishes

这篇关于联系许可服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆