【问题标题】:Android License App showing Not-licensed?Android License App 显示未授权?
【发布时间】:2013-03-23 06:53:16
【问题描述】:

我正在为付费应用程序制作应用程序 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上注册了多个gmail账号吗?
  • 我们有一个发布者账号和两个测试账号在google play中。目前我正在使用 google play 的一个测试帐户进行测试。该帐户已添加到我的手机中。
  • 我的意思是,在您的手机中,您设置了多少个帐户?
  • 只添加了一个帐号
  • 在您的手机中,进入设置 -> 应用程序,选择 google play 应用程序并清除其数据。然后再试一次

标签: android google-play android-lvl


【解决方案1】:

由于您的公钥导致此错误,在 google play 中为您的 google 帐户发布的每个新应用程序生成不同的 Base64-encoded RSA public key。在为您的应用程序创建 apk 之前检查该密钥。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-02
    • 1970-01-01
    • 2016-03-08
    • 1970-01-01
    相关资源
    最近更新 更多