Posted on 2010-06-15 17:34
高老莊 閱讀(3411)
評論(14) 編輯 收藏 所屬分類:
架構與模式
Architexa的前身是relo,這個工具在分析開源項目的源碼時很好用,relo已經不再維護,變成了新的插件Architexa,其網址是http://www.architexa.com/,雖然說architexa東西不錯,可惜需要付費.另外他的注冊網站好像有問題,因此連評估也做不了,無奈之下,動了暴力破解的念頭.下面即是暴力破解的過程,需要的人可以參考下.
1.architexa 通過eclipse的update manager 下載后,在eclipse_HOME/plugins會存在幾個jar和目錄,如下:

1.architexa 沒有對編譯后的代碼混淆,先用java decompiler 反編譯出如下的類:
- com.architexa.diagrams.RSECore 位于com.architexa.diagrams_1.2.2.201006051418.jar中.
- com.architexa.rse.ConnectAccountDialog 位于com.architexa.intro_1.2.2.201006051418/ReloIntro.jar中
2.修改RSECore類的方法:
1 public static boolean validInstall()
2 {
3 if (!AccountStatusUtils.testAccountValid()) {
4 String email = AccountSettings.getStoredAccountEmail();
5 AccountSettings.getStoredAccountPassword();
6 if ((email != null) && (email.length() > 0))
7 AccountErrorMsgs.displayErr("Account Has Expired ");
8 return false;
9 }
10 return true;
11 }
12
中間的判斷可以完全拿掉,修改為如下即可:
1 public static boolean validInstall()
2 {
3 return true;
4 }
3.修改ConnectAccountDialog類的代碼(反編譯后的代碼有點長,這里不列出了),最終改成如下即可:
1 protected void okPressed_Internal() {
2 this.emailEntered = this.emailField.getText();
3 this.passwordEntered = this.passwordField.getText();
4
5 AccountConnection ac = new AccountConnection();
6 if (this.enableOnOK) ac.setMenuToDisable(!this.disableOnCancel);
7 super.okPressed();
8 }
編譯后將上述兩個類放到對應的jar中,重啟eclipse.
4.在architexa的認證對話框,輸入任意email和password,architexa 將重建索引.
5.在某個java類的上下文菜單中,可以看到Open in Diagram 就可以生成類的布局圖,類圖和序列圖了.可以通過工具欄上的button來輸出圖形.
下面貼幾個通過這個插件構成的圖,欣賞下