守望者--AIR技术交流

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
热搜: ANE FlasCC 炼金术
查看: 1812|回复: 0
打印 上一主题 下一主题

应用程序许可证检查ANE

[复制链接]
  • TA的每日心情
    擦汗
    2018-4-10 15:18
  • 签到天数: 447 天

    [LV.9]以坛为家II

    1742

    主题

    2094

    帖子

    13万

    积分

    超级版主

    Rank: 18Rank: 18Rank: 18Rank: 18Rank: 18

    威望
    562
    贡献
    29
    金币
    52903
    钢镚
    1422

    开源英雄守望者

    跳转到指定楼层
    楼主
    发表于 2015-1-29 18:02:02 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    应用下载
    应用名称: ANELicenseChecker
    支持64位:
    当前版本: 未知
    运行平台: Android 
    开发语言: ActionScript 3 JAVA 
    应用类别: ANE-JAVA
    应用简介: ANE for App License Check
    # AboutApplication Licensing is an Adobe AIR native extension (ANE) for Android that works with Google Play and Samsung Apps (Zirconia).It provides preventive measures against illegal distribution of your app.# Docshttp://help.adobe.com/en_US/air/extensions/index.htmlhttp://developer.android.com/google/play/licensing/index.htmlhttp://developer.samsung.com/android/technical-docs/How-to-protect-your-app-from-illegal-copy-using-Samsung-Application-License-Management-Zirconia# InstallationExtension ID: com.pozirk.LicenseCheckerFor Google Play: add "LicenseChecker.ane" and "air\LicenseChecker\bin\LicenseChecker.swc" to your AIR projectFor Samsung Apps: add "SAMLicenseChecker.ane" and "air\LicenseChecker\bin\LicenseChecker.swc" to your AIR projectAdd the following lines to your AIR Aplication-app.xml file inside <manifestAdditions> section:For Google Play:
    1. <uses-permission android:name="com.android.vending.CHECK_LICENSE" />
    复制代码
    For Samsung Apps:
    1. <uses-permission android:name="android.permission.INTERNET"/>
    2. <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    复制代码
    # Example for Google Play
    1. import com.pozirk.license.android.LicenseChecker;
    2. import com.pozirk.license.android.LicenseCheckerEvent;


    3. //> initialization
    4. try
    5. {
    6.         _checker = new LicenseChecker();
    7.         _checker.addEventListener(LicenseCheckerEvent.LICENSED, onLicensed);
    8.         _checker.addEventListener(LicenseCheckerEvent.NOT_LICENSED, onNotLicensed);
    9.         _checker.addEventListener(LicenseCheckerEvent.APPLICATION_ERROR, onAppError);
    10. }
    11. catch(err:Error)
    12. {
    13.         ...
    14. }
    15. //<

    16. //checking license
    17. _checker.check("YOUR_LICENSE_KEY_FOR_THE_APPLICATION"); //you can find it in your app's "Services and APIs" at developer's dahsboard


    18. protected function onLicensed(event:LicenseCheckerEvent):void
    19. {
    20.         if(int(event.data) == LicenseCheckerEvent.OK)
    21.                 ... //everything is ok
    22. }

    23. protected function onNotLicensed(event:LicenseCheckerEvent):void
    24. {
    25.         if(int(event.data) == LicenseCheckerEvent.RETRY)
    26.                 ... //probably there is no internet connection, read more info in docs
    27.         else
    28.                 ... //not licensed
    29. }
    30. //<
    复制代码
    # Example for Samsung Apps
    1. import com.pozirk.license.android.LicenseChecker;
    2. import com.pozirk.license.android.LicenseCheckerEvent;

    3. //> initialization
    4. try
    5. {
    6.         _checker = new LicenseChecker();
    7.         _checker.addEventListener(LicenseCheckerEvent.LICENSED, onLicensed);
    8.         _checker.addEventListener(LicenseCheckerEvent.NOT_LICENSED, onNotLicensed);
    9. }
    10. catch(err:Error)
    11. {
    12.         ...
    13. }
    14. //<

    15. //checking license, pass empty string, there is no key for samsung
    16. _checker.check("");

    17. protected function onLicensed(event:LicenseCheckerEvent):void
    18. {
    19.         ... //everything's ok
    20. }

    21. protected function onNotLicensed(event:LicenseCheckerEvent):void
    22. {
    23.         ... //not licensed
    24. }
    复制代码
    # MiscANE is build with AIR3.7, in order to rebuild for another version do the following:- edit "air\extension.xml" and change 3.7 in very first line to any 3.X you need;- edit "build_andy.bat" (for Google Play) or "build_sam.bat" (for Samsung Apps) and in the very last line change path from AIR3.7 SDK to any AIR3.X SDK you need;- execute "build.bat" to repack the ANE.



    相关链接:
    https://github.com/pozirk/ANELicenseChecker

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有帐号?立即注册

    x
    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
    收藏收藏 分享分享 支持支持 反对反对 微信
    守望者AIR技术交流社区(www.airmyth.com)
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    
    关闭

    站长推荐上一条 /4 下一条

    QQ|手机版|Archiver|网站地图|小黑屋|守望者 ( 京ICP备14061876号

    GMT+8, 2026-1-23 23:46 , Processed in 0.050704 second(s), 37 queries .

    守望者AIR

    守望者AIR技术交流社区

    本站成立于 2014年12月31日

    快速回复 返回顶部 返回列表