I am working on an Android application that is already published on Google Play. For the next update (versionCode = 3), my client wants to enable the LVL licensing scheme.
The first thing I did was set up a static test response from the licensing server. I installed the test answer LICENSED . After reading this in the documentation:
This test answer will be sent to the devices using [my email address] or the control accounts listed above for applications downloaded on Google Play. > In addition, this account (but not test accounts) will receive this answer for> applications that have not yet been downloaded to Google Play.
I thought this was not a problem, since the email of my developer account is the same as the email of my Google Play account on my test devices. Therefore, I should get a test answer when debugging the application.
After that, I read all the other licensed documentation and sample code and integrated it into the application. I used ServerManagedPolicy with the correct base64 public key and 20 random generated bytes as salt.
Once everything looks good, I downloaded it to the device to check it, but instead of receiving the LICENSED response that I expected, I always get NOT_LICENSED . I came back and made sure that:
- I was connected to the internet.
- I was connected to my developer account on Google Play.
- LicenseChecker used the correct public key.
- Clearing the Google Play cache.
At first I thought it might have something to do with caching, so I tried using StrictPolicy . The same answer. Since I did not purchase the application from the store, I had the impression that the licensing server was responding normally instead of sending a static test response . Here are some other things I've tried:
- Waiting 24 hours and retrying.
- I tried to create an application with the debug key android, as well as the current distribution key.
- Set up and use a different test user account on Google Play. I have included this email account in the "Accounts" section of the developer console.
- Downloading the APK on Google Play, but not publishing it.
- The increment of the Code version is from 2 to 3. This is interesting because instead of the NOT_LICENSED response , it returns the application error code ERROR_NOT_MARKET_MANAGED .
This makes me think that the license server always responds normally, instead of sending a static test response configured to my developer account. I feel this may be because the application is already published, but I can’t risk publishing the debug assembly just for verification, or it’s not working.
Has anyone been in this situation before? Any help is appreciated.