Flex4 IBM ILOG OrgChart破解

来源:互联网 发布:淘宝怎样交电费 编辑:程序博客网 时间:2024/06/03 17:47

网上有破解好的包,可是这个包是2.5版本的,不能用在Flex4上,或者这个包很难下载下来,另外破解信息也写的不是很详细, 故写此文章。

首先你手里得有 ilog 3.0 或以上版本,试用版即可,可到IBM处下载;还需要一个反编译工具, 本人用的硕思。

1、把试用版安装好以后,到 IBM\ILOG\Elixir Enterprise 3.0 Trial\samples\elixir\orgchart 下把orgChart包复制出来,里面就是 orgChart 的Demo项目了。

2、在Flash Builder中新建Flex项目,把 orgChart 下的内容都复制到项目里, 会报 range-en.xml 文件找不到。

          解决办法:右键项目,打开属性,编译器,编译参数位置修改 range-en.xml 文件路径。

      修改后会报 ilog-elixir-enterprise.swc 找不到。

         解决办法:到 IBM\ILOG\Elixir Enterprise 3.0 Trial\frameworks\libs 路径下复制 ilog-elixir-enterprise.swc 文件,到 IBM\ILOG\Elixir Enterprise 3.0 Trial\frameworks\locale\en_US 路径下复制 ilog-elixir-enterprise_rb.swc 文件,将两个文件放置在项目 lib 文件夹下(如果没有就创建一个)。然后右键项目,打开属性,构建路径,删除两个 swc 文件,引入 lib 文件夹下的两个 swc 文件即可。

      至此项目可正常运行。

3、项目运行起来会有水印,如果你是早期的安装包,也会有超过试用期,组件位置为黑色的情况。

      将 ilog-elixir-enterprise.swc 复制一份,更改文件类型为 .zip 解压,解压后会有一个 library.swf 的文件,用反编译工具打开 library.swf 在 com.ibm.ilog.elixir.utils 路径下找到 LicenseHandler 文件,导出,打开。

      1)去除水印

            找到 enterFrameHandler 方法,在 return; 的上一行添加 this._textField.visible = false;

      2)去除黑色覆盖

           @ 找到 displayWatermark 方法,将

new LicenseHandler(where, darkBackground, new Date().getTime()); 

               修改为

new LicenseHandler(where, darkBackground, new Date(2007, 1, 1).getTime());

           @ 找到 enterFrameHandler 方法,删除下面几行代码

                _loc_2.clear();                _loc_2.beginFill(1118481, (this._time - dBuild - TRIAL_PERIOD_DAYS) / (1 * DAY));                _loc_2.drawRect(0, 0, this._p.width, this._p.height);                _loc_2.endFill();
          上述两个@步骤,任选其一进行修改即可。

4、将修改后的 LicenseHandler 文件注入到项目中。

      1)在项目中新建 com.ibm.ilog.elixir.utils 包,把修改后的 LicenseHandler 文件复制到 com.ibm.ilog.elixir.utils 包内

      2)在项目 application 文件中添加如下代码,用来替换 library.swf 中 LicenseHandler 文件

  [Frame(extraClass="com.ibm.ilog.elixir.utils.LicenseHandler")]
此时破解完成~

别忘了运行之前clean一下项目!!!


附:为防止有些人破解不成功,特将 LicenseHandler 修改后的代码贴上

package com.ibm.ilog.elixir.utils{import flash.display.*;import flash.events.*;import flash.filters.*;import flash.geom.*;import flash.net.*;import flash.system.*;import flash.text.*;import flash.ui.*;import mx.core.*;import mx.resources.*;public class LicenseHandler extends Object{private var _p:DisplayObjectContainer;private var _textField:TextField;private var _foreground:Sprite;private var _time:Number;private var _darkBackground:Boolean = false;private static const wmarkAfter:Number = 0;private static const dBuild:Number = 1.28173e+012;private static const wText:String = "Trial Version";private static const MENU_CAPTIONS:Array = [ResourceManager.getInstance().getString("ilogsparkutilities", "about.elixir"), ResourceManager.getInstance().getString("ilogsparkutilities", "about.elixirenterprise")];private static const DAY:Number = 86400000;private static const TRIAL_PERIOD_DAYS:Number = 5.3568e+009;public function LicenseHandler(p:DisplayObjectContainer, darkBackground:Boolean, time:Number){this._p = p;this._time = time;this._darkBackground = darkBackground;this._p.addEventListener("enterFrame", this.enterFrameHandler);return;}// end functionprotected function checkVisible(p:DisplayObjectContainer) : Boolean{return true;}// end functionprivate function enterFrameHandler(event:Event) : void{//var _loc_2:Graphics = null;var _loc_3:UIComponent = null;var _loc_4:TextFormat = null;var _loc_5:String = null;var _loc_6:Array = null;var _loc_7:UIComponent = null;if (this._textField != null){}if (!this.checkVisible(this._p)){this._textField.visible = false;return;}var _loc_8:* = new Point();var _loc_9:* = new Point(this._p.width, this._p.height);_loc_8 = this._p.localToGlobal(_loc_8);_loc_9 = this._p.localToGlobal(_loc_9);var _loc_10:* = Math.abs(_loc_9.x - _loc_8.x);var _loc_11:* = Math.abs(_loc_9.y - _loc_8.y);if (this._time > dBuild + TRIAL_PERIOD_DAYS){if (!this._foreground){this._foreground = new Sprite();this._foreground.mouseEnabled = false;}if (!this._foreground.parent){if (this._p is Container){_loc_3 = new UIComponent();this._p.addChild(_loc_3);_loc_3.addChild(this._foreground);}else{this._p.addChild(this._foreground);}}this._foreground.width = this._p.width;this._foreground.height = this._p.height;//_loc_2 = this._foreground.graphics;//_loc_2.clear();//_loc_2.beginFill(1118481, (this._time - dBuild - TRIAL_PERIOD_DAYS) / (1 * DAY));//_loc_2.drawRect(0, 0, this._p.width, this._p.height);//_loc_2.endFill();}if (_loc_10 < 20){}if (_loc_11 >= 20){}if (!this._p.visible){if (this._textField != null){this._textField.visible = false;}return;}if (!this._textField){this._textField = new TextField();this._textField.selectable = false;this._textField.autoSize = TextFieldAutoSize.CENTER;this._textField.textColor = 16777215;//this._textField.backgroundColor = 0;_loc_4 = new TextFormat();_loc_4.font = "Verdana";_loc_4.size = 32;_loc_4.bold = true;this._textField.defaultTextFormat = _loc_4;_loc_5 = wText;if (_loc_5 != null){}if (_loc_5.length < 1){_loc_5 = "IBM ILOG Elixir Trial";}if (this._time < dBuild + TRIAL_PERIOD_DAYS){//_loc_5 = _loc_5 + (" " + Math.round((dBuild + TRIAL_PERIOD_DAYS - this._time) / DAY) + " Days Left过期吗");_loc_5 = "无期限";}else{_loc_5 = _loc_5 + " Ended";}this._textField.text = _loc_5;this._textField.alpha = 0.35;this._textField.mouseEnabled = false;_loc_6 = [];_loc_6.push(new GlowFilter(this._darkBackground ? (16777215) : (0), 1, 6, 6, 2, 1, false, true));this._textField.filters = _loc_6;this._textField.x = Math.round(-10 * Math.random());this._textField.y = Math.round(-40 * Math.random());}if (!this._textField.parent){if (this._p is Container){_loc_7 = new UIComponent();this._p.addChild(_loc_7);_loc_7.addChild(this._textField);}else{this._p.addChild(this._textField);}}if (!this._textField.visible){this._textField.visible = false;}this._textField.x = this._p.width / 2 - this._textField.width / 2;this._textField.y = this._p.height / 2 - this._textField.height / 2;this._textField.visible = false;return;}// end functionpublic static function displayWatermark(where:DisplayObjectContainer, darkBackground:Boolean = false) : void{new LicenseHandler(where, darkBackground, new Date(2007, 1, 1).getTime());return;}// end functionpublic static function addElixirToMenu() : void{addToMenu(MENU_CAPTIONS[0], "http://www-01.ibm.com/software/integration/visualization/elixir/");return;}// end functionpublic static function addElixirEnterpriseToMenu() : void{addToMenu(MENU_CAPTIONS[1], "http://www-01.ibm.com/software/integration/visualization/elixir-enterprise/");return;}// end functionprivate static function addToMenu(menuText:String, url:String) : void{var item:ContextMenuItem;var menuText:* = menuText;var url:* = url;menuText = menuText;url = url;if (Security.sandboxType == Security.LOCAL_WITH_FILE){return;}var menu:* = FlexGlobals.topLevelApplication.contextMenu;if (menu == null){menu = new ContextMenu();FlexGlobals.topLevelApplication.contextMenu = menu;}var _loc_4:int;var _loc_5:* = menu.customItems;while (_loc_5 in _loc_4){item = _loc_5[_loc_4];if (item.caption != MENU_CAPTIONS[0]){}if (item.caption == MENU_CAPTIONS[1]){return;}}item = new ContextMenuItem(menuText, true);item.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, function (event:ContextMenuEvent) : void{navigateToURL(new URLRequest(url));return;}// end function);menu.customItems.push(item);menu.customItems = menu.customItems;return;}// end function}}

      运行效果如图:



0 0
原创粉丝点击