Introduction to flex licence Technology

Source: Internet
Author: User

 

Some friends often encounter problems when developing flex, that is, the SWF of a product cannot be authorized for management. Illegal downloading of projects for use, resulting in some adverse effects. Some friends have been asking me how to make the most flexible authorization for the flex SWF. At that time, I could not disclose my authorization secrets because it was also for my SWF Authorization not to crack. Now I also use the new-generation authorization encryption framework. Now I will introduce to you my previous flex encryption framework.

First, my Flex authorization adopts the SWF + SWC mode. The main force of the project is the SWF file, and the authorization file is in SWC. Each time the customer illegally changes the project name, the project path must be loaded with a new SWC authorization file to run properly. Authorization Constraints for SWC files include: Project name, project path, and project validity period.

I posted the entire authorization source code and shared it with you. The detailed description will not be detailed.

Package COM. shine. framework. licence {import COM. shine. framework. browser. browserutils; import COM. shine. framework. SWC. swcmanager; import COM. shine. framework. core. util. referenceutil; import MX. controls. alert; public class licencemanager {Private Static Var _ instance: licencemanager; // licence data public var licence: String = ""; // licence mode public var licenceconfig: String = ""; // licence status public var licencestatus: Bo Olean = false; // Return Value Method public var returnmethod: function; Public Function licencemanager (Enforcer: singletonenforcer) {} public static function getinstance (): licencemanager {If (licencemanager. _ instance = NULL) {licencemanager. _ instance = new licencemanager (New singletonenforcer ();} return licencemanager. _ instance;} // load swcpublic function loadlicence (swcurl: String, returnmethod: function = NULL): void {var swcmanage: Swcmanager = new swcmanager; swcmanage. loadswc (swcurl, loadcomplete); If (returnmethod! = NULL) {This. returnmethod = returnmethod ;}// load the private function loadcomplete (): void {If (checklicencename () = true & checklicenceurl () = true) {licencestatus = true;} else {licencestatus = false;} If (returnmethod! = NULL) {This. returnmethod. call (this) ;}}// check the licence namepublic function checklicencename (): Boolean {var O: Object = referenceutil. referenceclass ("com. shine. framework. licence. file: licencefile "); If (licence. length! = 0) {If (O. Licence! = NULL & string (O. Licence). length! = 0) {If (licence = string (O. licence) return true;} else {return false;} // check the licence namepublic function checklicenceurl (): Boolean {var O: Object = referenceutil. referenceclass ("com. shine. framework. licence. file: licencefile "); If (O. licenceurl! = NULL & string (O. licenceurl). length! = 0) {If (browserutils. getbrowserbaseurl () = string (O. licenceurl) return true;} else {return true;} return false; }}} class singletonenforcer {}

package com.shine.framework.Licence.file{public class LicenceFile{public var licence:String="nms4";public var licenceUrl:String="http://127.0.0.1";public var licenceDate:String="2011-03-07";public function LicenceFile(){}}}

<? XML version = "1.0" encoding = "UTF-8"?> <View: basesimplecontainer xmlns: FX = "http://ns.adobe.com/mxml/2009" xmlns: S = "Library: // ns.adobe.com/flex/spark" xmlns: MX = "Library: // ns.adobe.com/flex/mx" xmlns: view = "com. shine. framework. core. view. * "width =" 200 "Height =" 30 "visible =" false "creationcomplete =" {complete ()} "> <view: layout> <s: basiclayout/> </View: layout> <FX: SCRIPT> <! [CDATA [import COM. shine. framework. licence. licencemanager; Private function complete (): void {This. completeloading (); licencemanager. getinstance (). loadlicence ("data. SWC ", returnmethod);} private function returnmethod (): void {This. visible = true ;}]]> </FX: SCRIPT> <s: Label text = "dear customer, your system authorization protocol has expired or has been illegally stolen, to protect your interests, please contact our engineers !! "Fontweight =" bold "fontstyle =" italic "fontsize =" 12 "/> </View: basesimplecontainer>

These codes cannot run independently. The main code should refer to my Flex framework:

Http://code.google.com/p/ken-javaframeword/source/browse/#svn%2Ftrunk%2Fframework2.0%2Fsrc%2Fcom%2Fshine%2Fframework%2FLicence

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.