主要是针对D:\Atlassian\confluence312\confluence\WEB-INF\lib\atlassian-extras-2.1.3.jar进行破解。
Jad用得有点不爽,所以采用了DJ Java Decompiler 3.10 windows版,听说可以直接对jar文件进行破解。
图形化的操作比较简单。File->Open 打开atlassian-extras-2.1.3.jar,弹出来一个新窗口。 全选里面的class文件,然后按“Decompile” ,选择输出目录,再点“YES”即可。 如果点“NO”的话,就不会保持目录结构,所有破解出来的java文件都扔在同一目录了。
然后就很顺利地破解出了.java文件,而且保持了目录结构。
把这些文件打个包放到linux里面,因为我的winxp么有安装java. M哥的linux在跑resin,正好有java之类的东西,我对此不是很熟悉。恩,怀念一下以前和Davic搭档的日子。
然后要修改二个文件。
com/atlassian/license/decoder/LicenseAdaptor.java
public Date getExpiryDate() {
return null; // 永不过期
}
…
public LicenseType getLicenseType() {
return com.atlassian.license.applications.confluence.ConfluenceLicenseTypeStore.FULL_LICENSE; // 改为最强License
}
…
public int getUsers() {
return 100000; // 允许十万用户
}
…
public boolean isExpired() {
return false; // 永不过期
}
com/atlassian/license/LicenseUtils.java
public static final long POST_LICENSE_EVAL_PERIOD = 0x75cd788000L; // 均改为16年
public static final long UPDATE_ALLOWED_PERIOD = 0x75cd788000L; //改为16年。原来的值是0x75cd78800L, 少了一个0,看仔细了。
…
public static long getSupportPeriodEnd(License license) {
return license.getDateCreated().getTime() + 0x75cd788000L; // 16 years
}
…
public static boolean isLicenseTooOldForBuild(License license, Date date) {
return false;
}
…
public static boolean confirmExtendLicenseExpired(Date date) {
return false;
}
…
public static boolean confirmExtendLicenseExpired(String s) throws NumberFormatException {
return false;
}
…
private static long getNewBuildWithOldLicenseExpiryDate(Date date) {
return date.getTime() + 0x75cd788000L;
}
然后再进行编译:
[root@www de]# ls
com META-INF
[root@www de]# Javac -cp . com/atlassian/license/decoder/LicenseAdaptor.java
[root@www de]# javac -cp . com/atlassian/license/LicenseUtils.java
[root@www de]# find ./ -name “*.java” | xargs -rm
[root@www de]# jar -cvf atlassian-extras-2.1.3.jar *
然后把atlassian-extras-2.1.3.jar覆盖掉D:\Atlassian\confluence312\confluence\WEB-INF\lib\中的同名文件,重启confluence服务即可。
