java - Android 许可证检查失败太多,我做错了什么吗?

标签 java android android-lvl

我有一个使用 Google 许可服务的 Android 应用程序,我经常收到大约 5% 的新用户发来的电子邮件,提示许可检查失败。它开始影响我的销售。我到底做错了什么?

this.licenseCheckerCallback = new MyLicenseCheckerCallback();

String deviceId = Secure.getString(getContentResolver(), Secure.ANDROID_ID);

// Construct the LicenseChecker with a Policy.
this.licenseChecker = new LicenseChecker(
    this, new ServerManagedPolicy(this,
            new AESObfuscator(SALT, getPackageName(), deviceId)), 
            BASE64_PUBLIC_KEY  // Your public licensing key.
    );

this.checkLicense();




private void checkLicense() {
    this.licenseChecker.checkAccess(this.licenseCheckerCallback);
}


private class MyLicenseCheckerCallback implements LicenseCheckerCallback {

    public void allow() {
        // Don't do anything, let the user work in peace.
    }

    public void dontAllow() {
        if (isFinishing()) {
            // Don't update UI if Activity is finishing.
            return;
        }
        // Should not allow access. In most cases, the app should assume
        // the user has access unless it encounters this. If it does,
        // the app should inform the user of their unlicensed ways
        // and then either shut down the app or limit the user to a
        // restricted set of features.
        // In this example, we show a dialog that takes the user to Market.
        showDialog(DIALOG_NO_LICENSE_ID);
        MyActivity.this.dialogIdCurrentlyShown = DIALOG_NO_LICENSE_ID;
    }

    public void applicationError(ApplicationErrorCode errorCode) {
        if (isFinishing()) {
            // Don't update UI if Activity is finishing.
            return;
        }
        // This is a polite way of saying the developer made a mistake
        // while setting up or calling the license checker library.
        // Please examine the error code and fix the error.
        MyActivity.this.applicationErrorMessageForDialog = String.format(getString(R.string.application_error), errorCode);
        showDialog(DIALOG_APPLICATION_ERROR_ID);
        MyActivity.this.dialogIdCurrentlyShown = DIALOG_APPLICATION_ERROR_ID;
    }
}

最佳答案

你没有做错任何事。我有同样的问题,其他人也是。您无能为力,但仍然:

  1. 向 Google 开具支持票,告诉他们 LVL 的性能欠佳并且正在影响合法用户。
  2. 在“未许可”对话框中添加“重试”按钮。有时这只是导致许可失败的暂时性网络故障。
  3. 考虑在我们的对话中留下 Google 的支持电子邮件,或添加其他方式让用户将问题转达给问题的来源。
  4. 唯一有效的选项可能是:手动增加 GT 的值如果响应是针对永久购买的,则在将其存储在缓存中之前从许可服务收到的时间戳。检查 GT 之间的区别时间戳和 VT timestamp - 如果足够大(一周),则向 GT 添加一个月甚至一年.这个想法是,一旦用户过了退款期,您就可以让他/她的许可在他/她的设备上成为半永久性或完全永久性的。

希望这对您有所帮助。

关于java - Android 许可证检查失败太多,我做错了什么吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7448851/

相关文章:

java - 记录未随 ResultSet 更新

java - 如何将视频从 URI 转换为 byte[]

java - 非常基本的变量超出范围问题 - Java Android

android - 如何在我的服务器上验证某个应用程序是否已通过 Android Market 成功购买?

java - 如何在 Windows 命令行中为 Android Studio 生成 keystore 签名的 .jpk 签名文件?

java - ScriptEngineManager 可以给我它刚刚用 Java 编译的 Javascript 函数的名称吗

java - 构造函数标识符不适用于三个对象

Android:振幅值到分贝值?

android - GooglePlay : LVL: License: Validation Errors or Failures: LicenseCheckerCallback: com. google.android.vending.licensing

android - android中的许可应用程序?