1、先下载一个原版插件,地址如下:
https://marketplace.atlassian.com/apps/1210933/draw-io-diagrams-for-confluence/version-history
2、反编译代码,得到 DrawioLicenseManager .class文件:
package com.mxgraph.confluence.plugins.util;
import com.atlassian.confluence.license.LicenseService;
import com.atlassian.extras.api.LicenseType;
import com.atlassian.upm.api.license.PluginLicenseManager;
import com.atlassian.upm.api.license.entity.LicenseError;
import com.atlassian.upm.api.license.entity.PluginLicense;
import com.atlassian.upm.api.util.Option;
import org.joda.time.DateTime;
public class DrawioLicenseManager {
private PluginLicenseManager pluginLicenseManager;
private LicenseService licenseService;
public DrawioLicenseManager(PluginLicenseManager pluginLicenseManager, LicenseService licenseService) {
this.pluginLicenseManager = pluginLicenseManager;
this.licenseService = licenseService;
}
public boolean isDevLicense() {
/*try {
LicenseType lt = this.licenseService.retrieve().getLicenseType();
return lt.compareTo(LicenseType.DEVELOPER) == 0 || lt.compareTo(LicenseType.TESTING) == 0;
} catch (Throwable var2) {
return false;
}*/
return false;
}
public DrawioLicenseManager.LicenseStatus getLicenseStatus() {
/*Option<PluginLicense> licOpt = this.pluginLicenseManager.getLicense();
if (this.isDevLicense()) {
return DrawioLicenseManager.LicenseStatus.OK;
} else if (!licOpt.isDefined()) {
return DrawioLicenseManager.LicenseStatus.NO_LICENSE;
} else {
PluginLicense license = (PluginLicense)licOpt.get();
if (license.isEvaluation()) {
DateTime evalExpDate = (DateTime)license.getExpiryDate().get();
return evalExpDate.isBefore(DateTime.now().minusWeeks(1)) ? DrawioLicenseManager.LicenseStatus.EVAL_EXPIRED : DrawioLicenseManager.LicenseStatus.EVAL_LICENSE;
} else {
if (license.getError().isDefined()) {
if (((LicenseError)license.getError().get()).equals(LicenseError.USER_MISMATCH)) {
return DrawioLicenseManager.LicenseStatus.USER_MISMATCH;
}
if (((LicenseError)license.getError().get()).equals(LicenseError.VERSION_MISMATCH)) {
return DrawioLicenseManager.LicenseStatus.VERSION_MISMATCH;
}
}
return DrawioLicenseManager.LicenseStatus.OK;
}
}*/
return DrawioLicenseManager.LicenseStatus.OK;
}
public static enum LicenseStatus {
NO_LICENSE,
EVAL_LICENSE,
EVAL_EXPIRED,
USER_MISMATCH,
VERSION_MISMATCH,
OK;
private LicenseStatus() {
}
}
}
说明:以上属于DrawioLicenseManager.java文件,需要通过一个集成开发软件,建立一个工程,build之后生成DrawioLicenseManager.class文件。我这里是通过IDEA软件中,新建一个工程实现的。截图如下:
新建idea工程,src中建立这个包:com.mxgraph.confluence.plugins.util;新建Java类DrawioLicenseManager.java,把网上破解教程中的内容拷贝过来,点击build编译后,得到DrawioLicenseManager.class文件,即为破解文件。
备注:DrawioLicenseManager.java中用到的其他类文件,新建对应包和空的java文件做辅助即可。重点是能得到DrawioLicenseManager.class类文件
3、重新打包。基本方法是拖拽和替换。并不需要java -jar那么复杂,重新打包。只需要压缩工具,选中拖拽替换并重新打包即可。
前面已经下载了drawio-confluence-plugin-9.5.8.obr原版
现在解压缩它,得到里面的了drawio-confluence-plugin-9.5.8.jar,用winrar打开它,在里面找到
DrawioLicenseManager.class文件,鼠标选中它。然后把上面你得到的破解文件,拖住拽进来,替换这个文件,winrar会提示你,重新打包并覆盖吗?如下:
拖拽进来覆盖并重新覆盖得到破解后的drawio-confluence-plugin-9.5.8.jar。
4、得到最终插件:
类似于方法3,用压缩工具,打开drawio-confluence-plugin-9.5.8.obr文件,拖拽drawio-confluence-plugin-9.5.8.jar替换原drawio-confluence-plugin-9.5.8.jar。压缩文件提示是否重新压缩覆盖原drawio-confluence-plugin-9.5.8.obr文件。
5、提供破解插件包链接如下:【不想重复上述过程,你可以直接使用这个】
链接:百度网盘 请输入提取码
提取码:xyp0