欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

gliffy-confluence-plugin-9.1.2插件教程详解

程序员文章站 2023-01-13 16:07:09
1、下载2、解压后找到gliffylicensemanager.class3、反编译gliffylicensemanager.class,替换原来的实现,重新编译成class后替换进去package...

1、下载

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的到期日期等信息。由于读不到相关数据,直接出异常了。

既然如此,那我们需要先将license信息写入系统。

validlicensevalues还原,然后找到设置license的函数installlicense。在函数中注释掉license认证相关的代码,让系统在忽略认证结果的情况下强行写入注册信息。修改后的java文件在执行时还会报gethostedstatus的虚函数错误。按理说这个函数应当会在子类中被重写。不过我们先不管这么多,把它修改为普通函数并直接返回0。

重新打包安装,然后进入gliffy的管理界面,license信息随便填写,然后保存。保存是成功的,但认证还是失败。修改validlicensevalues函数,重新打包安装。这次由于我们有写入注册信息,因此就不会再出现先前的空指针异常了。

享受gliffy吧。

注:gliffy确实是个好东西,如果喜欢,还是尽量说服公司出钱买吧。

到此这篇关于gliffy-confluence-plugin-9.1.2破解教程详解的文章就介绍到这了,更多相关gliffy-confluence-plugin-9.1.2内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持!