阅读 301

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

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

2、解压后找到GliffyLicenseManager.class

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
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内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!


文章分类
前端
版权声明:本站是系统测试站点,无实际运营。本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 XXXXXXo@163.com 举报,一经查实,本站将立刻删除。
相关推荐