// 1.通过反编译工具提取 /atlassian/jira/atlassian-jira/WEB-INF/atlassian-bundled-plugins/atlassian-universal-plugin-manager-plugin-x.x.x.jar 的源码
// 2.修改 com.atlassian.extras.decoder.v2.Version2LicenseDecoder 类
..
public boolean canDecode(String licenseString)
{
return true;
}
private Properties loadLicenseConfiguration(Reader text)
{
Properties props = new Properties();
try
{
new DefaultPropertiesPersister().load(props, text);
if (props.containsKey("Description"))
{
String desc = props.getProperty("Description");
props.put("Description", desc.replace("Evaluation", "Commercial"));
if (desc.contains("Confluence")) {
props.put("conf.LicenseTypeName", "COMMERCIAL");
} else if (desc.contains("JIRA")) {
props.put("jira.LicenseTypeName", "COMMERCIAL");
} else if (desc.contains("FishEye")) {
props.put("fisheye.LicenseTypeName", "COMMERCIAL");
} else if (desc.contains("Bitbucket")) {
props.put("stash.LicenseTypeName", "COMMERCIAL");
}
props.put("Evaluation", "false");
props.put("MaintenanceExpiryDate", "2099-02-09");
props.put("LicenseExpiryDate", "2099-02-09");
}
return props;
}
catch (IOException e)
{
throw new LicenseException("Could NOT load properties from reader", e);
}
}
..
// 3.修改 com.atlassian.license.LicenseManager 类
..
public boolean hasValidLicense(String licenseKey)
{
return true;
}
..
// 4.以上两个类,编译成class文件,替换 atlassian-universal-plugin-manager-plugin-x.x.x.jar 中
的class文件即可。