温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

如何正确的使用gliffy-confluence-plugin-9.1.2插件

发布时间:2021-02-19 14:58:22 来源:亿速云 阅读:593 作者:Leah 栏目:开发技术

这篇文章给大家介绍如何正确的使用gliffy-confluence-plugin-9.1.2插件,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。

1、下载gliffy-confluence-plugin-9.1.2.obr

2、解压后找到GliffyLicenseManager.class

如何正确的使用gliffy-confluence-plugin-9.1.2插件

3、反编译GliffyLicenseManager.class,替换原来的实现,重新编译成class后替换进去

package com.gliffy.plugin.confluence.license;
 
import com.atlassian.confluence.setup.BootstrapManager;
import com.atlassian.confluence.setup.settings.CoreFeaturesManager;
import com.atlassian.upm.api.license.PluginLicenseManager;
import com.atlassian.upm.api.license.entity.LicenseError;
import com.atlassian.upm.api.license.entity.LicenseType;
import com.atlassian.upm.api.license.entity.PluginLicense;
import com.atlassian.upm.api.util.Option;
import org.joda.time.DateTime;
import org.joda.time.Days;
import org.joda.time.ReadableInstant;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
 
public class GliffyLicenseManager {
 private static final Logger logger = LoggerFactory.getLogger(GliffyLicenseManager.class);
 private PluginLicenseManager licenseManager;
 private CoreFeaturesManager coreFeaturesManager;
 private BootstrapManager bootstrapManager;
 
 public GliffyLicenseManager(PluginLicenseManager licenseManager, CoreFeaturesManager coreFeaturesManager, BootstrapManager bootstrapManager) {
 this.licenseManager = licenseManager;
 this.coreFeaturesManager = coreFeaturesManager;
 this.bootstrapManager = bootstrapManager;
 }
 
 /*private PluginLicense fetchLicense() {
 PluginLicense license = null;
 Option<PluginLicense> licenseOption = this.licenseManager.getLicense();
 if (licenseOption.isDefined()) {
 license = (PluginLicense)licenseOption.get();
 } else {
 logger.debug("no Gliffy license found");
 }
 return license;
 }*/
 
 public boolean isValid() {
 /*PluginLicense license = this.fetchLicense();
 return license != null ? license.isValid() : false;*/
 
 return true;
 }
 
 public boolean isSupported() {
 /*PluginLicense license = this.fetchLicense();
 if (license != null) {
 return !license.isMaintenanceExpired();
 } else {
 return false;
 }*/
 
 return true;
 }
 
 public boolean isEvaluation() {
 /*PluginLicense license = this.fetchLicense();
 return license != null ? license.isEvaluation() : false;*/
 
 return false;
 }
 
 public String getLicenseError() {
 /*PluginLicense license = this.fetchLicense();
 if (license != null) {
 Option<LicenseError> errorOption = license.getError();
 if (errorOption.isDefined()) {
 return ((LicenseError)errorOption.get()).toString();
 }
 }
 return null;*/
 
 return null;
 }
 
 public String getSEN() {
 /*PluginLicense license = this.fetchLicense();
 if (license != null) {
 Option<String> customerIdOption = license.getSupportEntitlementNumber();
 if (customerIdOption.isDefined()) {
 return (String)customerIdOption.get();
 }
 }
 return null;*/
 
 return null;
 }
 
 public boolean isCloud() {
 return this.coreFeaturesManager.isOnDemand();
 }
 
 public LicenseType getLicenseType() {
 /*PluginLicense license = this.fetchLicense();
 return license != null ? license.getLicenseType() : null;*/
 
 return LicenseType.COMMERCIAL;
 }
 
 public int getDaysToExpiration() {
 /*PluginLicense license = this.fetchLicense();
 if (license != null) {
 Option<DateTime> expiryDateOption = license.getExpiryDate();
 if (expiryDateOption.isDefined()) {
 return Days.daysBetween(new DateTime(), (ReadableInstant)expiryDateOption.get()).getDays();
 }
 }
 return 0;*/
 
 return Integer.MAX_VALUE;
 }
 
 public Integer getUserCount() {
 /*PluginLicense license = this.fetchLicense();
 if (license != null) {
 Option<Integer> qtyUsersOption = license.getEdition();
 if (qtyUsersOption.isDefined()) {
 return (Integer)qtyUsersOption.get();
 }
 }
 return null;*/
 
 return Integer.MAX_VALUE;
 }
 
 public boolean isFree() {
 /*if (this.fetchLicense() == null) {
 return false;
 } else {
 LicenseType type = this.getLicenseType();
 return type.equals(LicenseType.COMMUNITY) || type.equals(LicenseType.NON_PROFIT) || type.equals(LicenseType.OPEN_SOURCE);
 }*/
 
 return false;
 }
 
 public boolean isCommercial() {
 return this.isValid() && this.isSupported() && !this.isEvaluation() && !this.isFree();
 }
 
 public long getLicenseInstallUnixTimestamp() {
 /*PluginLicense license = this.fetchLicense();
 return license != null ? license.getCreationDate().getMillis() / 1000L : 0L;*/
 
 return 0L;
 }
 
 public String getLicenseManagementURL() {
 /*return this.bootstrapManager.getWebAppContextPath() + "/plugins/servlet/upm#manage/com.gliffy.integration.confluence";*/
 
 return "";
 }
 
 public boolean isNonAnalyticsLicenseType() {
 /*LicenseType licenseType = this.getLicenseType();
 boolean isEvalCloudInstance = this.isCloud() && (this.isEvaluation() || licenseType == null);
 return isEvalCloudInstance || LicenseType.DEVELOPER.equals(licenseType) || LicenseType.TESTING.equals(licenseType) || LicenseType.DEMONSTRATION.equals(licenseType);*/
 
 return false;
 }
}

知识点扩展:Gliffy confluence插件的破解

Gliffy是一个在线画流程图的工具,或者简单的说Gliffy就是web版的Visio。Gliffy的用户体验非常的好,加打开浏览器就可以使用,使用起来非常的方便。Gliffy同时推出了confluence的插件版本。在安装插件后可在confluence中方便的编辑和插入流程图。

同事对Gliffy甚为垂涎,只是Gliffy还有些小贵。confluence插件版,500用户的许可要卖到2000$。

虽然同事的利诱有些不靠谱,但偶尔干干着方面的事也还算有趣,那就动手吧。

注:下面只是简单的讲解一些关键点,如果你对java一窍不通,那还是罢手吧。

java应用破解的通常做法是:将文件反编译,找到认证部分的处理,直接将认证结果返回true。java的反编译工具推荐Java Decompiler。

Gliffy的jar包比较大,但其中java代码并不是很多。而且Gliffy采用的是仿君子不防小人的做法,里面的java代码并未混淆过。在代码中有个目录非常的扎眼\src\com\gliffy\core\license\。再做些简单的分析我们即可找到真正的关键点SimpleLicenseManager.java

不得不说Gliffy的命名还是非常规范的。以函数名为线索,很容易就可以找到我们要的函数validLicenseValues。简单粗暴的将函数返回值改为true。打包并重新安装插件。

如果问题就这么解决了,那也未免顺利的有些不太寻常。虽然可以成功安装,但运行的时候抛出一堆的异常。试着进入Gliffy的管理界面,依旧是一堆的异常。虽然我们强制的将认证结果设置为了true,但某些地方还需要获取license的到期日期等信息。由于读不到相关数据,直接出异常了。

关于如何正确的使用gliffy-confluence-plugin-9.1.2插件就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI