gliffy-confluence-plugin-9.1.2安装

本文档详细介绍了如何下载gliffy-confluence-plugin的特定版本,然后解压并找到GliffyLicenseManager.class文件进行反编译。接着,它说明了如何替换原有实现,重新编译并注入到系统中,以规避许可验证。这个过程涉及到对代码的修改,包括isValid()、isSupported()等关键方法,以使插件始终显示为有效和受支持。
摘要由CSDN通过智能技术生成

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

2、解压后找到GliffyLicenseManager.class

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();*/

        return false;
    }

    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;
    }
}

 

评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值