download the ane : AndroidLVLv1.2.1  

This ane helps you enforce licensing policies for paid Android applications that you publish through Google Play. Your application can query Google Play at runtime to obtain the licensing status for the current user and then permit or prohibit further use.

in your app
import com.adobe.air.nativeExtensions.android.licensing.*;
private var lc:LicenseChecker;
public function Main() {
  addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
}
private function onAddedToStage():void
{
  removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
  var BASE64_PUBLIC_KEY:String = "your_BASE64_PUBLIC_KEY";
  lc = new LicenseChecker();
  lc.addEventListener(LicenseStatusEvent.STATUS, licenseResult);
  lc.addEventListener(ErrorEvent.ERROR, errorHandler);
  lc.checkLicense(BASE64_PUBLIC_KEY);
}
private function licenseResult(event:LicenseStatusEvent):void {
  if (event.status == LicenseStatus.LICENSED) {
    //Application is licensed, allow the user to proceed.
  } else if (event.status == LicenseStatus.NOT_LICENSED) {
    //Application is not licensed, don't allow to user to proceed.
    switch (event.statusReason) {
          case LicenseStatusReason.CHECK_IN_PROGRESS:
          // "There is already a license check in progress"
          break ;
          case LicenseStatusReason.INVALID_PACKAGE_NAME:
          // "Package Name of the application is not valid"
          break ;
          case LicenseStatusReason.INVALID_PUBLIC_KEY:
          // "Public key specified is incorrect"
          break ;
          case LicenseStatusReason.MISSING_PERMISSION:
          // "License Check permission in App descriptor is missing"
          break ;
          case LicenseStatusReason.NON_MATCHING_UID:
          // "UID of the application is not matching"
          break ;
          case LicenseStatusReason.NOT_MARKET_MANAGED:
          // "The application is not market managed"
          break ;
          default:
          if(lc.isNetworkAvailable) // "The application is not licensed"
            else // "Network not available"
    }
  }
}
private function errorHandler(e:ErrorEvent):void {
  trace("AIR Application - error Handler " + e.toString());
}
- BASE64_PUBLIC_KEY : available on the Google Play Developer Console, select your app, see Services and APIs, it's recommended to encrypt the public key with an actionscript obfuscator.


and in the app-desciptor.xml
<android>
  <colorDepth>16bit</colorDepth>
  <manifestAdditions>
    <![CDATA[
    <manifest>
          <uses-permission android:name="android.permission.INTERNET" />
          <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
          <uses-permission android:name="com.android.vending.CHECK_LICENSE" />
    </manifest>
    ]]>
  </manifestAdditions>
</android>
<extensions>
  <extensionID>com.adobe.air.nativeExtensions.android.licensing</extensionID>
</extensions>





3 comments

it works !
thanks !

Test Movie Launched Failed

What to do?

AndroidLVLv1.2.1 : bug fixes

Name :


Email (not published) :


Comment :