內部邀請碼: C8E245J (不寫邀請碼,沒有現金送)
國內私募機構九鼎控股打造,九鼎投資是在全國股份轉讓系統掛牌的公眾公司,股票代碼為430719,為“中國PE第一股”,市值超1000億元。
原文地址: http://blog.csdn.net/joinandjoin/article/details/9052785
最新公司換了新項目,項目比較大,每次更改bug,修改source都很費勁,特別是提交測試后再次回退修改,每次都很麻煩,突然想到使用JIRA本地管理一下自己的任務,於是去官網下載。發現官方網站已經更新到6.0.1版本。
JIRA是有License的,很不爽,於是百度破解,發現最新的破解也只是適用5.2.4版本。對比了一下網上的破解方法,基本上都是更改atlassian-extras-2.2.2.jar這個jar包,6.0.1版本也是用的這個jar包,於是認為改動應該不大,於是着手自己破解。過程如下:
1、任意建立一個eclipse的java項目,將atlassian-extras-2.2.2.jar包以外的atlassian-jira\WEB-INF\lib下jar導入到工程的類路徑。
2、反編譯atlassian-extras-2.2.2.jar包,得到source,將該souce作為1中建立的項目的源碼。編譯工程,一般反編譯的source在異常處理處會出錯,throw語句會放在catch語句之后,稍微修改即可。
3、JIRA5版本的破解主要更改兩個文件JiraLicenseStoreImpl.java,Version2LicenseDecoder.java;通過實驗JIRA6可以不用修改JiraLicenseStoreImpl.class文件。但是JIRA6破解需要修改另一個文件LicenseManager.java如果不修改該文件,破解后管理插件時候會提示沒有可用的有效License。本文最后會貼出修改后的代碼。
4、開始啟動JIRA6,按照提示配置安裝(安裝教程和JIRA5版本類似,此處略)時候到填寫License的時候會提示你去JIRA的網站申請一個帳號和試用License。去申請一個得到一個試用License,如下圖
記住Service ID,SEN和license Key,后面會用到。
填寫申請到的license Key使安裝繼續到創建完管理員賬戶。關閉JIRA。
5、用Version2LicenseDecoder.class和LicenseManager.class替換atlassian-extras-2.2.2.jar對應文件,注意LicenseManager.class文件在atlassian-extras-2.2.2.jar有兩個同名的文件,要替換非抽象的那個,不要替換錯了。
6、替換之后重新啟動JIRA,並用管理員登錄。進入到授權管理頁面,如下圖
這是我破解后的樣子,破解簽是JIRA:EVALUATION,時間是安裝時間一個月后到期。
進去后,在新的License輸入框中輸入明碼
Description=JIRA: Commercial,
CreationDate=你的安裝日期,格式(yyyy-mm-dd),
jira.LicenseEdition=ENTERPRISE,
Evaluation=false,
jira.LicenseTypeName=COMMERCIAL,
jira.active=true,
licenseVersion=2,
MaintenanceExpiryDate=你想設置的失效日期如:2099-12-31,
Organisation=你的JIRA網站的注冊名,
SEN=你申請到的SEN注意沒有前綴LID,
ServerID=你申請到的ServerID,
jira.NumberOfUsers=-1,
LicenseID=LID你申請到的SEN,注意LID前綴不要丟掉,
LicenseExpiryDate=你想設置的失效日期如:2099-12-31,
PurchaseDate=你的安裝日期,格式(yyyy-mm-dd)
注意要用“,”分割。
點擊ADD添加先的License。如果沒有錯誤,可以看到License已經更新了。
7、上述破解后,如果你去安裝中文插件會看到無效的License提示,但是中文插件也是可以成功安裝的,但是插件管理部分無法正常使用。原因是JIRA6在一些功能中使用的是插件式的驗證機制。還要更新一個jar包,這個jar包是atlassian-bundled-plugins.zip中的atlassian-universal-plugin-manager-plugin-2.10.1.jar;該jar中也有Version2LicenseDecoder.class和LicenseManager.class文件,同樣用修改過的文件替換,然后重啟JIRA,插件管理功能可以正常使用了。
附上修改的代碼:
Version2LicenseDecoder類
將canDecode方法改名為canDecode2,再新建一個canDecode方法,方法直接返回true;
- public boolean canDecode2(String licenseString)
- {
- licenseString = removeWhiteSpaces(licenseString);
- int pos = licenseString.lastIndexOf('X');
- if ((pos == -1) || (pos + 3 >= licenseString.length()))
- {
- return false;
- }
- try
- {
- int version = Integer.parseInt(licenseString.substring(pos + 1, pos + 3));
- if ((version != 1) && (version != 2))
- {
- return false;
- }
- String lengthStr = licenseString.substring(pos + 3);
- int encodedLicenseLength = Integer.valueOf(lengthStr, 31).intValue();
- return pos == encodedLicenseLength;
- }
- catch (NumberFormatException e)
- {
- }
- return false;
- }
- public boolean canDecode(String licenseString)
- {
- return true;
- }
修改doDecode方法
- public Properties doDecode(String licenseString)
- {
- Properties result = null;
- String encodedLicenseTextAndHash = null;
- if (canDecode2(licenseString)){
- encodedLicenseTextAndHash = getLicenseContent(removeWhiteSpaces(licenseString));
- byte[] zippedLicenseBytes = checkAndGetLicenseText(encodedLicenseTextAndHash);
- Reader licenseText = unzipText(zippedLicenseBytes);
- result = loadLicenseConfiguration(licenseText);
- } else {
- encodedLicenseTextAndHash = removeWhiteSpaces(licenseString);
- result = new Properties();
- if (encodedLicenseTextAndHash != null && encodedLicenseTextAndHash.length()>0){
- String[] proStrs = encodedLicenseTextAndHash.split(",");
- if (proStrs!= null && proStrs.length>0){
- for (String property : proStrs){
- String[] proStr = property.split("=");
- result.put(proStr[0], proStr[1]);
- }
- }
- }
- }
- return result;
- }
其他方法不做任何更改。
LicenseManager類
修改hasValidLicense方法,直接返回true;
- public boolean hasValidLicense(String licenseKey)
- {
- return true;
- //return (getLicense(licenseKey) != null) && (!getLicense(licenseKey).isExpired());
- }
破解完成。
之后可以安裝中文插件,漢化一下。
大家也可以去CSDN 下載破解包, 里面是直接打包好的補丁。
以上修改只用於學習研究之用,請不要用於任何商業用途,任何由此產生的法律糾紛,均與本人無關,本人概不負責。