Ứng dụng Giấy phép Android hiển thị Không được cấp phép? (Android License App showing Not-licensed?)


問題描述

Ứng dụng Giấy phép Android hiển thị Không được cấp phép? (Android License App showing Not‑licensed?)

I'am doing an app android license for paid application. In this app i gave base 64 public key & salt 20 random numbers according to my app details. My code is as follows:

initialized variables like this:  

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

in oncreate() doing like this:

   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);

and My license checker callback function like this:

      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);
           }
    }

from this I exported apk file and Stored as a draft in google play and tested with test accounts which are given in google play as test accounts and same account used in my device also. I tested many times this app everytime it shows only Not Licensed with dialogue. what is the problem? plz help me..


參考解法

方法 1:

This error because of your public key, in the google play produces the different Base64‑encoded RSA public key for every new application published from your google account. Check that key before creating your apk for your application.

(by NagarjunaReddyRajaReddy PolamReddy)

參考文件

  1. Android License App showing Not‑licensed? (CC BY‑SA 3.0/4.0)

#android-lvl #Android #google-play






相關問題

這種 Google LVL 政策實施是否合理安全? (Would this Google LVL policy implementation be reasonably secure?)

在 SDK 管理器中找不到 Google 市場許可包 (Cant find Google Market Licensing package in SDK Manager)

在 Google Play 上查詢應用程序當前版本的更快方法? (Faster Way to Query Application's Current Version on Google Play?)

Android 應用許可檢查 (Android app licensing check)

Ứng dụng Giấy phép Android hiển thị Không được cấp phép? (Android License App showing Not-licensed?)

導入 com.google.android.vending 無法在導入的 android 項目中解析 (The import com.google.android.vending cannot be resolved in an imported android project)

Android“Not_Market_Managed”錯誤 (Android “Not_Market_Managed” error)

是否可以向服務添加許可證檢查(使用許可證驗證庫)? (Is it possible to add a license check (using License Verification Library) to a Service?)

應用程序許可和 android 唯一 ID (Application Licensing and android unique id)

Android 許可 - 每個 Android 開發者帳戶只有一個公鑰? (Android Licensing - Only one public key per Android Developer account?)

測試 Android LVL,許可證檢查總是失敗,沒有網絡 (Testing Android LVL, license check always fails with no network)

什麼時候從服務器返回 LICENSED_OLD_KEY? (When is LICENSED_OLD_KEY returned from server?)







留言討論