I am licensing an Android application for a paid application. In this application, I gave a basic 64 public key and a salt of 20 random numbers according to the details of my application. My code is as follows:
initialized variables:
private static final String BASE64_PUBLIC_KEY = "xxxxxx"; private static final byte[] SALT = new byte[] {xxxxxxxxxxxxxxxx}; private LicenseChecker mChecker; private LicenseCheckerCallback mLicenseCheckerCallback;
in oncreate () does the following:
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 callback check function:
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 the apk file and saved as a draft on google play and tested with test accounts that are specified in Google play as test accounts and the same account as on my device. I tested this application many times every time it shows only a non-license for dialogue. what is the problem? Plz help me ..
source share