最新公司換了新項目,項目比較大,每次更改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());
破解完成。
之後可以安裝中文插件,漢化一下。
以上修改隻用于學習研究之用,請不要用于任何商業用途,任何由此産生的法律糾紛,均與本人無關,本人概不負責。