Android 许可应用程序显示未许可?

标签 android google-play android-lvl

我正在为付费应用程序制作应用程序 android 许可证。在这个应用程序中,我根据我的应用程序详细信息给出了 base 64 公钥和 salt 20 随机数。我的代码如下:

像这样初始化变量:

  private static final String BASE64_PUBLIC_KEY = "xxxxxx";
  private static final byte[] SALT = new byte[] {xxxxxxxxxxxxxxxx};
  private LicenseChecker mChecker;
  private LicenseCheckerCallback mLicenseCheckerCallback;

在 oncreate() 中这样做:

   String deviceId = Secure.getString(getContentResolver(),Secure.ANDROID_ID);
   mLicenseCheckerCallback = new MyLicenseCheckerCallback();
   mChecker = new LicenseChecker(this, (Policy) new ServerManagedPolicy(this,
                   new AESObfuscator(SALT, getPackageName(), deviceId)),
                   BASE64_PUBLIC_KEY);
   mChecker.checkAccess(mLicenseCheckerCallback);

我的许可证检查器回调函数是这样的:

      private class MyLicenseCheckerCallback implements LicenseCheckerCallback {
           @Override
           public void allow(int result) {
                   if (isFinishing()) {
                           return;
                   }
           }

           @Override
           public void applicationError(int errorCode) {
                   if (isFinishing()) {
                           return;
                   }
           }
           @SuppressWarnings("deprecation")
           @Override
           public void dontAllow(int result) {
                   if (isFinishing()) {
                           return;
                   }
                   showDialog(0);
           }
    }

由此我导出了 apk 文件并在 google play 中存储为草稿,并使用 google play 中作为测试帐户提供的测试帐户以及我的设备中使用的相同帐户进行了测试。我多次测试这个应用程序,每次它只显示未获得对话许可。问题是什么? 请帮助我..

最佳答案

这个错误是因为你的公钥,在 google play 中为从你的 google 帐户发布的每个新应用程序生成不同的 Base64 编码的 RSA 公钥。在为您的应用程序创建 apk 之前检查该 key 。

关于Android 许可应用程序显示未许可?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15584197/

相关文章:

java - Android 市场未在平板电脑中显示我的应用程序

android - Android LicenseChecker 上“无法绑定(bind)到服务”

android - 可组合 fillMaxSize 和旋转不起作用

android - 如何解决 Android 应用中的 Google 身份验证问题?

java - 泰卢固语字体(泰卢固语连词)在 Android 2.2 中无法正常工作

android - 包 com.google.android.gms.samples.wallet.databinding 不存在

android - Google Play LVL 许可证检查 "package"或 "public key"是特定的吗?

Android Licensing (LVL) 在发布应用程序后不断返回重试(代码 291)

android - 如果我的 ListView 是由 JSON 对象在单击时创建的,如何将 id 传递给其他 Activity

android - 如何在 Android 中动态更改 ListView 高度?