link start!

This commit is contained in:
cherubin
2026-03-17 13:31:18 -07:00
commit 08abe87cfb
5910 changed files with 386288 additions and 0 deletions
@@ -0,0 +1,199 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.tridium.sys.license.LicenseUtil
* com.tridium.sys.license.dom.VendorCertificate
* javax.baja.file.BIFile
* javax.baja.sys.BStruct
* javax.baja.sys.Property
* javax.baja.sys.Sys
* javax.baja.sys.Type
* javax.baja.xml.XContent
* javax.baja.xml.XElem
*/
package com.tridium.platform.license;
import com.tridium.platform.license.CertificateInfo;
import com.tridium.sys.license.LicenseUtil;
import com.tridium.sys.license.dom.VendorCertificate;
import javax.baja.file.BIFile;
import javax.baja.sys.BStruct;
import javax.baja.sys.Property;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
import javax.baja.xml.XContent;
import javax.baja.xml.XElem;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BCertificateSummary
extends BStruct {
public static final Property vendor = BCertificateSummary.newProperty((int)1, (String)"", null);
public static final Property certificateGenerated = BCertificateSummary.newProperty((int)1, (long)Long.MIN_VALUE, null);
public static final Property certificateExpires = BCertificateSummary.newProperty((int)1, (long)Long.MIN_VALUE, null);
public static final Property certificateSignatureString = BCertificateSummary.newProperty((int)1, (String)"", null);
public static final Type TYPE;
static /* synthetic */ Class class$com$tridium$platform$license$BCertificateSummary;
public String getVendor() {
return this.getString(vendor);
}
public void setVendor(String string) {
this.setString(vendor, string, null);
}
public long getCertificateGenerated() {
return this.getLong(certificateGenerated);
}
public void setCertificateGenerated(long l) {
this.setLong(certificateGenerated, l, null);
}
public long getCertificateExpires() {
return this.getLong(certificateExpires);
}
public void setCertificateExpires(long l) {
this.setLong(certificateExpires, l, null);
}
public String getCertificateSignatureString() {
return this.getString(certificateSignatureString);
}
public void setCertificateSignatureString(String string) {
this.setString(certificateSignatureString, string, null);
}
public Type getType() {
return TYPE;
}
public static BCertificateSummary make(XElem xElem) {
String string = xElem.get("certGenerated", null);
long l = string == null ? Long.MIN_VALUE : LicenseUtil.parseDate((String)string);
String string2 = xElem.get("certExpires", null);
long l2 = string2 == null ? Long.MIN_VALUE : LicenseUtil.parseDate((String)string2);
XElem xElem2 = xElem.elem("certSignature");
String string3 = xElem2 == null ? null : xElem2.string();
return new BCertificateSummary(xElem.get("vendor"), l, l2, string3);
}
public static BCertificateSummary makeEmpty(String string) {
return new BCertificateSummary(string, Long.MIN_VALUE, Long.MIN_VALUE, null);
}
public boolean isEmpty() {
boolean bl = false;
if (this.getCertificateGenerated() == Long.MIN_VALUE) {
bl = true;
}
return bl;
}
public static BCertificateSummary make(BIFile bIFile) throws Exception {
return BCertificateSummary.make(VendorCertificate.make((BIFile)bIFile));
}
public static BCertificateSummary make(VendorCertificate vendorCertificate) {
return new BCertificateSummary(vendorCertificate.getVendor(), vendorCertificate.getGenerated(), vendorCertificate.getExpiration(), vendorCertificate.getSignature());
}
public static BCertificateSummary[] make(CertificateInfo[] certificateInfoArray) {
BCertificateSummary[] bCertificateSummaryArray = new BCertificateSummary[certificateInfoArray.length];
int n = 0;
while (n < certificateInfoArray.length) {
bCertificateSummaryArray[n] = BCertificateSummary.make(certificateInfoArray[n].vendorCertificate);
++n;
}
return bCertificateSummaryArray;
}
public static BCertificateSummary[] make(VendorCertificate[] vendorCertificateArray) {
BCertificateSummary[] bCertificateSummaryArray = new BCertificateSummary[vendorCertificateArray.length];
int n = 0;
while (n < vendorCertificateArray.length) {
bCertificateSummaryArray[n] = BCertificateSummary.make(vendorCertificateArray[n]);
++n;
}
return bCertificateSummaryArray;
}
public String getCertificateSignature() {
String string = this.getCertificateSignatureString();
return string.length() == 0 ? null : string;
}
public void setCertificateSignature(String string) {
this.setCertificateSignatureString(string == null ? "" : string);
}
public void update(VendorCertificate vendorCertificate) {
if (vendorCertificate.getGenerated() > this.getCertificateGenerated()) {
this.setCertificateGenerated(vendorCertificate.getGenerated());
this.setCertificateExpires(vendorCertificate.getExpiration());
this.setCertificateSignatureString(vendorCertificate.getSignature());
}
}
public void update(BCertificateSummary bCertificateSummary) {
if (bCertificateSummary.getCertificateGenerated() > this.getCertificateGenerated()) {
this.setCertificateGenerated(bCertificateSummary.getCertificateGenerated());
this.setCertificateExpires(bCertificateSummary.getCertificateExpires());
this.setCertificateSignatureString(bCertificateSummary.getCertificateSignatureString());
}
}
public XElem asXml() {
XElem xElem = new XElem("certSummary");
xElem.setAttr("vendor", this.getVendor());
if (this.getCertificateGenerated() > Long.MIN_VALUE) {
xElem.setAttr("certGenerated", LicenseUtil.formatDate((long)this.getCertificateGenerated()));
}
if (this.getCertificateExpires() > Long.MIN_VALUE) {
xElem.setAttr("certExpires", LicenseUtil.formatDate((long)this.getCertificateExpires()));
}
if (this.getCertificateSignature() != null) {
XElem xElem2 = new XElem("certSignature");
xElem2.addText(this.getCertificateSignature());
xElem.addContent((XContent)xElem2);
}
return xElem;
}
static /* synthetic */ Class class(String string, boolean bl) {
try {
Class<?> clazz = Class.forName(string);
if (!bl) {
clazz = clazz.getComponentType();
}
return clazz;
}
catch (ClassNotFoundException classNotFoundException) {
throw new NoClassDefFoundError(classNotFoundException.getMessage());
}
}
public BCertificateSummary() {
}
public BCertificateSummary(String string, long l, long l2, String string2) {
this.setVendor(string);
this.setCertificateGenerated(l);
this.setCertificateExpires(l2);
this.setCertificateSignature(string2);
}
static {
Class clazz = class$com$tridium$platform$license$BCertificateSummary;
if (clazz == null) {
clazz = class$com$tridium$platform$license$BCertificateSummary = BCertificateSummary.class("[Lcom.tridium.platform.license.BCertificateSummary;", false);
}
TYPE = Sys.loadType((Class)clazz);
}
}
@@ -0,0 +1,317 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.tridium.sys.license.dom.VendorLicense
* javax.baja.naming.SlotPath
* javax.baja.nre.util.Array
* javax.baja.sys.BComponent
* javax.baja.sys.BValue
* javax.baja.sys.BVector
* javax.baja.sys.Property
* javax.baja.sys.SlotCursor
* javax.baja.sys.Sys
* javax.baja.sys.Type
* javax.baja.util.Version
* javax.baja.xml.XContent
* javax.baja.xml.XElem
*/
package com.tridium.platform.license;
import com.tridium.platform.license.BVendorLicenseSummary;
import com.tridium.platform.license.LicenseInfo;
import com.tridium.sys.license.dom.VendorLicense;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import javax.baja.naming.SlotPath;
import javax.baja.nre.util.Array;
import javax.baja.sys.BComponent;
import javax.baja.sys.BValue;
import javax.baja.sys.BVector;
import javax.baja.sys.Property;
import javax.baja.sys.SlotCursor;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
import javax.baja.util.Version;
import javax.baja.xml.XContent;
import javax.baja.xml.XElem;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BEnvLicenseSummary
extends BComponent {
public static final Property hostId = BEnvLicenseSummary.newProperty((int)1, (String)"", null);
public static final Property brandIdString = BEnvLicenseSummary.newProperty((int)1, (String)"", null);
public static final Property vendorInfo = BEnvLicenseSummary.newProperty((int)1, (BValue)new BVector(), null);
public static final Type TYPE;
static /* synthetic */ Class class$com$tridium$platform$license$BEnvLicenseSummary;
static /* synthetic */ Class class$com$tridium$sys$license$dom$VendorLicense;
static /* synthetic */ Class class$java$lang$String;
static /* synthetic */ Class class$com$tridium$platform$license$BVendorLicenseSummary;
public String getHostId() {
return this.getString(hostId);
}
public void setHostId(String string) {
this.setString(hostId, string, null);
}
public String getBrandIdString() {
return this.getString(brandIdString);
}
public void setBrandIdString(String string) {
this.setString(brandIdString, string, null);
}
public BVector getVendorInfo() {
return (BVector)this.get(vendorInfo);
}
public void setVendorInfo(BVector bVector) {
this.set(vendorInfo, (BValue)bVector, null);
}
public Type getType() {
return TYPE;
}
public static BEnvLicenseSummary make(XElem xElem) {
BEnvLicenseSummary bEnvLicenseSummary = new BEnvLicenseSummary(xElem.get("hostId"), xElem.get("brandId", null));
XElem[] xElemArray = xElem.elems("vendorInfo");
int n = 0;
while (n < xElemArray.length) {
bEnvLicenseSummary.updateVendorInfo(xElemArray[n].get("vendor"), BVendorLicenseSummary.make(xElemArray[n]));
++n;
}
return bEnvLicenseSummary;
}
public static BEnvLicenseSummary make(LicenseInfo licenseInfo) {
return BEnvLicenseSummary.make(licenseInfo.vendorLicense);
}
public static BEnvLicenseSummary[] make(LicenseInfo[] licenseInfoArray) {
VendorLicense[] vendorLicenseArray = new VendorLicense[licenseInfoArray.length];
int n = 0;
while (n < licenseInfoArray.length) {
vendorLicenseArray[n] = licenseInfoArray[n].vendorLicense;
++n;
}
return BEnvLicenseSummary.make(vendorLicenseArray);
}
public static BEnvLicenseSummary[] make(VendorLicense[] vendorLicenseArray) {
Object object;
Object object2;
HashSet<String> hashSet = new HashSet<String>();
HashMap<Object, Array> hashMap = new HashMap<Object, Array>();
HashMap<Object, Array> hashMap2 = new HashMap<Object, Array>();
int n = 0;
while (n < vendorLicenseArray.length) {
object2 = vendorLicenseArray[n].getHostId();
hashSet.add((String)object2);
if (vendorLicenseArray[n].getVendor().equalsIgnoreCase("tridium")) {
object = (Map)hashMap.get(object2);
if (object == null) {
object = new HashMap();
hashMap.put(object2, (Array)object);
}
object.put(vendorLicenseArray[n].getBrandId(), vendorLicenseArray[n]);
} else {
object = (Array)hashMap2.get(object2);
if (object == null) {
Class clazz = class$com$tridium$sys$license$dom$VendorLicense;
if (clazz == null) {
clazz = BEnvLicenseSummary.class("[Lcom.tridium.sys.license.dom.VendorLicense;", false);
}
object = new Array(clazz);
hashMap2.put(object2, (Array)object);
}
object.add((Object)vendorLicenseArray[n]);
}
++n;
}
Class clazz = class$com$tridium$platform$license$BEnvLicenseSummary;
if (clazz == null) {
clazz = class$com$tridium$platform$license$BEnvLicenseSummary = BEnvLicenseSummary.class("[Lcom.tridium.platform.license.BEnvLicenseSummary;", false);
}
Array array = new Array(clazz);
object2 = hashSet.iterator();
while (object2.hasNext()) {
BEnvLicenseSummary bEnvLicenseSummary;
Object object3;
object = (String)object2.next();
Map map = (Map)hashMap.get(object);
Array array2 = (Array)hashMap2.get(object);
if (map == null) {
object3 = new BEnvLicenseSummary((String)object);
if (array2 != null) {
int n2 = 0;
while (n2 < array2.size()) {
bEnvLicenseSummary = (VendorLicense)array2.get(n2);
((BEnvLicenseSummary)((Object)object3)).updateVendorInfo((VendorLicense)bEnvLicenseSummary);
++n2;
}
}
array.add(object3);
continue;
}
object3 = map.keySet().iterator();
while (object3.hasNext()) {
String string = (String)object3.next();
bEnvLicenseSummary = new BEnvLicenseSummary((String)object, string);
VendorLicense vendorLicense = (VendorLicense)map.get(string);
bEnvLicenseSummary.updateVendorInfo(vendorLicense);
if (array2 != null) {
int n3 = 0;
while (n3 < array2.size()) {
vendorLicense = (VendorLicense)array2.get(n3);
bEnvLicenseSummary.updateVendorInfo(vendorLicense);
++n3;
}
}
array.add((Object)bEnvLicenseSummary);
}
}
return (BEnvLicenseSummary[])array.trim();
}
public static BEnvLicenseSummary make(VendorLicense vendorLicense) {
BEnvLicenseSummary bEnvLicenseSummary = new BEnvLicenseSummary(vendorLicense.getHostId(), vendorLicense.getBrandId());
bEnvLicenseSummary.updateVendorInfo(vendorLicense);
return bEnvLicenseSummary;
}
public String getBrandId() {
String string = this.getBrandIdString();
return string.length() == 0 ? null : string;
}
public void setBrandId(String string) {
this.setBrandIdString(string == null ? "" : string);
}
/*
* Unable to fully structure code
*/
public String[] getVendors() {
v0 = BEnvLicenseSummary.class$java$lang$String;
if (v0 == null) {
v0 = BEnvLicenseSummary.class$java$lang$String = BEnvLicenseSummary.class("[Ljava.lang.String;", false);
}
var1_1 = new Array(v0);
var2_2 = this.getVendorInfo().getProperties();
if (true) ** GOTO lbl10
do {
var1_1.add((Object)SlotPath.unescape((String)var2_2.slot().getName()));
lbl10:
// 2 sources
if ((v1 = BEnvLicenseSummary.class$com$tridium$platform$license$BVendorLicenseSummary) != null) continue;
v1 = BEnvLicenseSummary.class("[Lcom.tridium.platform.license.BVendorLicenseSummary;", false);
} while (var2_2.next(v1));
return (String[])var1_1.trim();
}
public String getLicenseSignature(String string) {
BVendorLicenseSummary bVendorLicenseSummary = this.getVendorInfo(string);
return bVendorLicenseSummary == null ? null : bVendorLicenseSummary.getLicenseSignature();
}
public long getLicenseGenerated(String string) {
BVendorLicenseSummary bVendorLicenseSummary = this.getVendorInfo(string);
return bVendorLicenseSummary == null ? Long.MIN_VALUE : bVendorLicenseSummary.getLicenseGenerated();
}
public Version getTridiumVersion() {
BVendorLicenseSummary bVendorLicenseSummary = this.getVendorInfo("tridium");
return bVendorLicenseSummary == null ? null : bVendorLicenseSummary.getLicenseVersion();
}
public BVendorLicenseSummary getVendorInfo(String string) {
SlotCursor slotCursor = this.getVendorInfo().getProperties();
while (slotCursor.next()) {
if (!SlotPath.unescape((String)slotCursor.property().getName()).toLowerCase().equals(string.toLowerCase())) continue;
return (BVendorLicenseSummary)slotCursor.get();
}
return null;
}
public void updateVendorInfo(String string, BVendorLicenseSummary bVendorLicenseSummary) {
BVendorLicenseSummary bVendorLicenseSummary2 = this.getVendorInfo(string);
if (bVendorLicenseSummary2 == null) {
this.getVendorInfo().add(SlotPath.escape((String)string), (BValue)bVendorLicenseSummary);
} else {
bVendorLicenseSummary2.update(bVendorLicenseSummary);
}
}
public void updateVendorInfo(VendorLicense vendorLicense) {
BVendorLicenseSummary bVendorLicenseSummary = this.getVendorInfo(vendorLicense.getVendor());
if (bVendorLicenseSummary == null) {
this.updateVendorInfo(vendorLicense.getVendor(), BVendorLicenseSummary.make(vendorLicense));
} else {
bVendorLicenseSummary.update(vendorLicense);
}
}
/*
* Unable to fully structure code
*/
public XElem asXml() {
var1_1 = new XElem("licenseSummary");
var1_1.setAttr("hostId", this.getHostId());
if (this.getBrandId() != null) {
var1_1.setAttr("brandId", this.getBrandId());
}
var2_2 = this.getVendorInfo().getProperties();
if (true) ** GOTO lbl10
do {
var1_1.addContent((XContent)((BVendorLicenseSummary)var2_2.get()).asXml());
lbl10:
// 2 sources
if ((v0 = BEnvLicenseSummary.class$com$tridium$platform$license$BVendorLicenseSummary) != null) continue;
v0 = BEnvLicenseSummary.class("[Lcom.tridium.platform.license.BVendorLicenseSummary;", false);
} while (var2_2.next(v0));
return var1_1;
}
static /* synthetic */ Class class(String string, boolean bl) {
try {
Class<?> clazz = Class.forName(string);
if (!bl) {
clazz = clazz.getComponentType();
}
return clazz;
}
catch (ClassNotFoundException classNotFoundException) {
throw new NoClassDefFoundError(classNotFoundException.getMessage());
}
}
public BEnvLicenseSummary() {
}
public BEnvLicenseSummary(String string) {
this(string, null);
}
public BEnvLicenseSummary(String string, String string2) {
this.setHostId(string);
this.setBrandId(string2);
}
static {
Class clazz = class$com$tridium$platform$license$BEnvLicenseSummary;
if (clazz == null) {
clazz = class$com$tridium$platform$license$BEnvLicenseSummary = BEnvLicenseSummary.class("[Lcom.tridium.platform.license.BEnvLicenseSummary;", false);
}
TYPE = Sys.loadType((Class)clazz);
}
}
@@ -0,0 +1,181 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.tridium.sys.license.dom.VendorLicense
* javax.baja.file.BDataFile
* javax.baja.file.BIFileStore
* javax.baja.nre.util.Array
* javax.baja.nre.util.IFilter
* javax.baja.sys.BIcon
* javax.baja.sys.Sys
* javax.baja.sys.Type
*/
package com.tridium.platform.license;
import com.tridium.sys.license.dom.VendorLicense;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import java.util.zip.ZipOutputStream;
import javax.baja.file.BDataFile;
import javax.baja.file.BIFileStore;
import javax.baja.nre.util.Array;
import javax.baja.nre.util.IFilter;
import javax.baja.sys.BIcon;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BLicenseArchiveFile
extends BDataFile {
private static final BIcon icon = BIcon.std((String)"file.png");
public static final Type TYPE;
static /* synthetic */ Class class$com$tridium$platform$license$BLicenseArchiveFile;
static /* synthetic */ Class class$com$tridium$sys$license$dom$VendorLicense;
public VendorLicense[] getLicenses() throws Exception {
return this.getLicenses(new IFilter(){
public final boolean accept(Object object) {
return true;
}
});
}
public VendorLicense[] getLicenses(final String string) throws Exception {
return this.getLicenses(new IFilter(){
public final boolean accept(Object object) {
String string2 = (String)object;
return string2.startsWith("licenses/" + string + '/');
}
});
}
/*
* WARNING - Removed back jump from a try to a catch block - possible behaviour change.
* Enabled aggressive block sorting
* Enabled unnecessary exception pruning
* Enabled aggressive exception aggregation
*/
public void writeLicenses(VendorLicense[] vendorLicenseArray) throws Exception {
OutputStream outputStream = this.getOutputStream();
ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream);
try {
int n = 0;
while (n < vendorLicenseArray.length) {
VendorLicense vendorLicense = vendorLicenseArray[n];
zipOutputStream.putNextEntry(new ZipEntry("licenses/" + vendorLicense.getHostId() + '/' + vendorLicense.getLicenseName() + ".license"));
vendorLicense.save((OutputStream)zipOutputStream, false);
zipOutputStream.closeEntry();
++n;
}
}
catch (Throwable throwable) {
Object var5_7 = null;
try {
zipOutputStream.close();
throw throwable;
}
catch (Exception exception) {}
throw throwable;
}
{
Object var5_8 = null;
}
try {}
catch (Exception exception) {
return;
}
zipOutputStream.close();
}
/*
* WARNING - Removed back jump from a try to a catch block - possible behaviour change.
* Enabled aggressive block sorting
* Enabled unnecessary exception pruning
* Enabled aggressive exception aggregation
*/
private final VendorLicense[] getLicenses(IFilter iFilter) throws Exception {
Class clazz = class$com$tridium$sys$license$dom$VendorLicense;
if (clazz == null) {
clazz = class$com$tridium$sys$license$dom$VendorLicense = BLicenseArchiveFile.class("[Lcom.tridium.sys.license.dom.VendorLicense;", false);
}
Array array = new Array(clazz);
ZipInputStream zipInputStream = new ZipInputStream(this.getInputStream());
try {
ZipEntry zipEntry = zipInputStream.getNextEntry();
while (zipEntry != null) {
if (iFilter.accept((Object)zipEntry.getName())) {
VendorLicense vendorLicense = VendorLicense.make((String)this.getFileName(), (InputStream)zipInputStream, (boolean)false);
array.add((Object)vendorLicense);
}
zipInputStream.closeEntry();
zipEntry = zipInputStream.getNextEntry();
}
}
catch (Throwable throwable) {
Object var5_7 = null;
try {
zipInputStream.close();
throw throwable;
}
catch (Exception exception) {}
throw throwable;
}
{
Object var5_8 = null;
}
try {}
catch (Exception exception) {
return (VendorLicense[])array.trim();
}
zipInputStream.close();
return (VendorLicense[])array.trim();
}
public String getMimeType() {
return "application/x-baja-license-archive";
}
public BIcon getIcon() {
return icon;
}
public Type getType() {
return TYPE;
}
static /* synthetic */ Class class(String string, boolean bl) {
try {
Class<?> clazz = Class.forName(string);
if (!bl) {
clazz = clazz.getComponentType();
}
return clazz;
}
catch (ClassNotFoundException classNotFoundException) {
throw new NoClassDefFoundError(classNotFoundException.getMessage());
}
}
public BLicenseArchiveFile(BIFileStore bIFileStore) {
super(bIFileStore);
}
public BLicenseArchiveFile() {
}
static {
Class clazz = class$com$tridium$platform$license$BLicenseArchiveFile;
if (clazz == null) {
clazz = class$com$tridium$platform$license$BLicenseArchiveFile = BLicenseArchiveFile.class("[Lcom.tridium.platform.license.BLicenseArchiveFile;", false);
}
TYPE = Sys.loadType((Class)clazz);
}
}
@@ -0,0 +1,112 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.tridium.fox.sys.BFoxChannelRegistry
* com.tridium.sys.license.Brand
* javax.baja.license.LicenseException
* javax.baja.sys.BIcon
* javax.baja.sys.BValue
* javax.baja.sys.Property
* javax.baja.sys.Sys
* javax.baja.sys.Type
*/
package com.tridium.platform.license;
import com.tridium.fox.sys.BFoxChannelRegistry;
import com.tridium.platform.BPlatformService;
import com.tridium.platform.fox.BLicenseChannel;
import com.tridium.sys.license.Brand;
import javax.baja.license.LicenseException;
import javax.baja.sys.BIcon;
import javax.baja.sys.BValue;
import javax.baja.sys.Property;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BLicensePlatformService
extends BPlatformService {
public static final Property brand = BLicensePlatformService.newProperty((int)3, (String)"unknown", null);
public static final Type TYPE;
private static final BIcon icon;
static /* synthetic */ Class class$com$tridium$platform$license$BLicensePlatformService;
public String getBrand() {
return this.getString(brand);
}
public void setBrand(String string) {
this.setString(brand, string, null);
}
public Type getType() {
return TYPE;
}
public Type[] getServiceTypes() {
return new Type[]{TYPE};
}
public boolean isValidPlatform() {
return true;
}
public int getSlotFlags() {
return 0;
}
public void serviceStarted() throws Exception {
super.serviceStarted();
try {
this.setBrand(Brand.getBrandId());
}
catch (LicenseException licenseException) {
this.setBrand("");
}
BFoxChannelRegistry bFoxChannelRegistry = BFoxChannelRegistry.getPrototype();
if (bFoxChannelRegistry.get("license") == null) {
bFoxChannelRegistry.add("license", (BValue)new BLicenseChannel());
}
}
public void serviceStopped() {
BFoxChannelRegistry bFoxChannelRegistry = BFoxChannelRegistry.getPrototype();
if (bFoxChannelRegistry.get("license") != null) {
bFoxChannelRegistry.remove("license");
}
}
public BIcon getIcon() {
return icon;
}
static /* synthetic */ Class class(String string, boolean bl) {
try {
Class<?> clazz = Class.forName(string);
if (!bl) {
clazz = clazz.getComponentType();
}
return clazz;
}
catch (ClassNotFoundException classNotFoundException) {
throw new NoClassDefFoundError(classNotFoundException.getMessage());
}
}
public BLicensePlatformService() {
this.setPlatformServiceDescription(this.getLexicon().getText("LicensePlatformService.description"));
}
static {
Class clazz = class$com$tridium$platform$license$BLicensePlatformService;
if (clazz == null) {
clazz = class$com$tridium$platform$license$BLicensePlatformService = BLicensePlatformService.class("[Lcom.tridium.platform.license.BLicensePlatformService;", false);
}
TYPE = Sys.loadType((Class)clazz);
icon = BIcon.std((String)"license.png");
}
}
@@ -0,0 +1,181 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.tridium.sys.license.LicenseUtil
* com.tridium.sys.license.dom.VendorLicense
* javax.baja.naming.SlotPath
* javax.baja.sys.BStruct
* javax.baja.sys.Property
* javax.baja.sys.Sys
* javax.baja.sys.Type
* javax.baja.util.Version
* javax.baja.xml.XContent
* javax.baja.xml.XElem
*/
package com.tridium.platform.license;
import com.tridium.sys.license.LicenseUtil;
import com.tridium.sys.license.dom.VendorLicense;
import javax.baja.naming.SlotPath;
import javax.baja.sys.BStruct;
import javax.baja.sys.Property;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
import javax.baja.util.Version;
import javax.baja.xml.XContent;
import javax.baja.xml.XElem;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BVendorLicenseSummary
extends BStruct {
public static final Property licenseGenerated = BVendorLicenseSummary.newProperty((int)1, (long)Long.MIN_VALUE, null);
public static final Property licenseExpires = BVendorLicenseSummary.newProperty((int)1, (long)Long.MIN_VALUE, null);
public static final Property licenseSignatureString = BVendorLicenseSummary.newProperty((int)1, (String)"", null);
public static final Property licenseVersionString = BVendorLicenseSummary.newProperty((int)1, (String)"", null);
public static final Type TYPE;
static /* synthetic */ Class class$com$tridium$platform$license$BVendorLicenseSummary;
public long getLicenseGenerated() {
return this.getLong(licenseGenerated);
}
public void setLicenseGenerated(long l) {
this.setLong(licenseGenerated, l, null);
}
public long getLicenseExpires() {
return this.getLong(licenseExpires);
}
public void setLicenseExpires(long l) {
this.setLong(licenseExpires, l, null);
}
public String getLicenseSignatureString() {
return this.getString(licenseSignatureString);
}
public void setLicenseSignatureString(String string) {
this.setString(licenseSignatureString, string, null);
}
public String getLicenseVersionString() {
return this.getString(licenseVersionString);
}
public void setLicenseVersionString(String string) {
this.setString(licenseVersionString, string, null);
}
public Type getType() {
return TYPE;
}
public static BVendorLicenseSummary make(XElem xElem) {
String string = xElem.get("licenseGenerated", null);
long l = string == null ? Long.MIN_VALUE : LicenseUtil.parseDate((String)string);
String string2 = xElem.get("licenseExpires", null);
long l2 = string2 == null ? Long.MIN_VALUE : LicenseUtil.parseDate((String)string2);
XElem xElem2 = xElem.elem("licenseSignature");
String string3 = xElem2 == null ? null : xElem2.string();
return new BVendorLicenseSummary(l, l2, string3, xElem.get("version", ""));
}
public static BVendorLicenseSummary make(VendorLicense vendorLicense) {
return new BVendorLicenseSummary(vendorLicense == null ? Long.MIN_VALUE : vendorLicense.getGenerated(), vendorLicense == null ? Long.MIN_VALUE : vendorLicense.getExpiration(), vendorLicense == null ? "" : vendorLicense.getSignature(), vendorLicense == null ? "" : vendorLicense.getVersion().toString());
}
public String getLicenseSignature() {
String string = this.getLicenseSignatureString();
return string.length() == 0 ? null : string;
}
public void setLicenseSignature(String string) {
this.setLicenseSignatureString(string == null ? "" : string);
}
public String getVendor() {
return SlotPath.unescape((String)this.getPropertyInParent().getName());
}
public Version getLicenseVersion() {
return this.getLicenseVersionString().length() == 0 ? null : new Version(this.getLicenseVersionString());
}
public void update(VendorLicense vendorLicense) {
if (vendorLicense.getGenerated() > this.getLicenseGenerated()) {
this.setLicenseGenerated(vendorLicense.getGenerated());
this.setLicenseExpires(vendorLicense.getExpiration());
this.setLicenseSignatureString(vendorLicense.getSignature());
this.setLicenseVersionString(vendorLicense.getVersion().toString());
}
}
public void update(BVendorLicenseSummary bVendorLicenseSummary) {
if (bVendorLicenseSummary.getLicenseGenerated() > this.getLicenseGenerated()) {
this.setLicenseGenerated(bVendorLicenseSummary.getLicenseGenerated());
this.setLicenseExpires(bVendorLicenseSummary.getLicenseExpires());
this.setLicenseSignatureString(bVendorLicenseSummary.getLicenseSignatureString());
this.setLicenseVersionString(bVendorLicenseSummary.getLicenseVersionString());
}
}
public XElem asXml() {
XElem xElem = new XElem("vendorInfo");
xElem.setAttr("vendor", this.getVendor());
xElem.setAttr("version", this.getLicenseVersionString());
if (this.getLicenseGenerated() > Long.MIN_VALUE) {
xElem.setAttr("licenseGenerated", LicenseUtil.formatDate((long)this.getLicenseGenerated()));
}
if (this.getLicenseExpires() > Long.MIN_VALUE) {
xElem.setAttr("licenseExpires", LicenseUtil.formatDate((long)this.getLicenseExpires()));
}
if (this.getLicenseSignature() != null) {
XElem xElem2 = new XElem("licenseSignature");
xElem2.addText(this.getLicenseSignature());
xElem.addContent((XContent)xElem2);
}
return xElem;
}
static /* synthetic */ Class class(String string, boolean bl) {
try {
Class<?> clazz = Class.forName(string);
if (!bl) {
clazz = clazz.getComponentType();
}
return clazz;
}
catch (ClassNotFoundException classNotFoundException) {
throw new NoClassDefFoundError(classNotFoundException.getMessage());
}
}
public BVendorLicenseSummary() {
}
public BVendorLicenseSummary(long l, long l2, String string) {
this.setLicenseGenerated(l);
this.setLicenseExpires(l2);
this.setLicenseSignature(string);
}
public BVendorLicenseSummary(long l, long l2, String string, String string2) {
this.setLicenseGenerated(l);
this.setLicenseExpires(l2);
this.setLicenseSignature(string);
this.setLicenseVersionString(string2);
}
static {
Class clazz = class$com$tridium$platform$license$BVendorLicenseSummary;
if (clazz == null) {
clazz = class$com$tridium$platform$license$BVendorLicenseSummary = BVendorLicenseSummary.class("[Lcom.tridium.platform.license.BVendorLicenseSummary;", false);
}
TYPE = Sys.loadType((Class)clazz);
}
}
@@ -0,0 +1,95 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.file.BFileSpace
* javax.baja.file.BFileSystem
* javax.baja.file.BIFile
* javax.baja.file.FilePath
*/
package com.tridium.platform.license;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Properties;
import javax.baja.file.BFileSpace;
import javax.baja.file.BFileSystem;
import javax.baja.file.BIFile;
import javax.baja.file.FilePath;
public class BrandProps {
private static BrandProps LOCAL_INSTANCE = null;
private Properties props;
public String get(String string, String string2) {
return this.props == null ? string2 : this.props.getProperty(string, string2);
}
public boolean get(String string, boolean bl) {
return this.props == null ? bl : this.props.getProperty(string, bl ? "true" : "false").equals("true");
}
public int get(String string, int n) {
return this.props == null ? n : Integer.parseInt(this.props.getProperty(string, Integer.toString(n)));
}
public String[] getKeys() {
if (this.props == null) {
return new String[0];
}
Enumeration<?> enumeration = this.props.propertyNames();
ArrayList<String> arrayList = new ArrayList<String>(16);
while (enumeration.hasMoreElements()) {
String string = (String)enumeration.nextElement();
arrayList.add(string);
}
return arrayList.toArray(new String[arrayList.size()]);
}
public static BrandProps getLocalInstance() {
if (LOCAL_INSTANCE == null) {
LOCAL_INSTANCE = new BrandProps((BFileSpace)BFileSystem.INSTANCE);
}
return LOCAL_INSTANCE;
}
/*
* WARNING - Removed back jump from a try to a catch block - possible behaviour change.
* Enabled aggressive block sorting
* Enabled unnecessary exception pruning
* Enabled aggressive exception aggregation
*/
public BrandProps(BFileSpace bFileSpace) {
try {
BIFile bIFile = bFileSpace.findFile(new FilePath("!lib/brand.properties"));
if (bIFile == null) return;
InputStream inputStream = bIFile.getInputStream();
try {
this.props = new Properties();
this.props.load(inputStream);
}
catch (Throwable throwable) {
Object var5_5 = null;
try {
inputStream.close();
throw throwable;
}
catch (Exception exception) {}
throw throwable;
}
{
Object var5_6 = null;
try {}
catch (Exception exception) {
return;
}
inputStream.close();
return;
}
}
catch (IOException iOException) {}
}
}
@@ -0,0 +1,211 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.tridium.file.types.text.BCertificateFile
* com.tridium.sys.license.LicenseUtil
* com.tridium.sys.license.dom.VendorCertificate
* javax.baja.file.BDirectory
* javax.baja.file.BFileSystem
* javax.baja.file.BIFile
* javax.baja.file.FilePath
* javax.baja.nre.util.Array
* javax.baja.nre.util.TextUtil
* javax.baja.sys.BajaRuntimeException
* javax.baja.sys.Context
* javax.baja.util.LexiconText
* javax.baja.xml.XElem
* javax.baja.xml.XParser
*/
package com.tridium.platform.license;
import com.tridium.file.types.text.BCertificateFile;
import com.tridium.platform.license.IFileInfo;
import com.tridium.sys.license.LicenseUtil;
import com.tridium.sys.license.dom.VendorCertificate;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import javax.baja.file.BDirectory;
import javax.baja.file.BFileSystem;
import javax.baja.file.BIFile;
import javax.baja.file.FilePath;
import javax.baja.nre.util.Array;
import javax.baja.nre.util.TextUtil;
import javax.baja.sys.BajaRuntimeException;
import javax.baja.sys.Context;
import javax.baja.util.LexiconText;
import javax.baja.xml.XElem;
import javax.baja.xml.XParser;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class CertificateInfo
implements IFileInfo {
private static LexiconText neverExpiresFmt = LexiconText.make((String)"platform", (String)"CertificateInfo.neverExpiresFormat");
private static LexiconText defaultFmt = LexiconText.make((String)"platform", (String)"CertificateInfo.format");
public static final FilePath CERTS_PATH = new FilePath("!certificates");
public VendorCertificate vendorCertificate;
public BIFile file;
static /* synthetic */ Class class$com$tridium$platform$license$CertificateInfo;
public static CertificateInfo[] make(BIFile[] bIFileArray) throws Exception {
CertificateInfo[] certificateInfoArray = new CertificateInfo[bIFileArray.length];
int n = 0;
while (n < bIFileArray.length) {
certificateInfoArray[n] = new CertificateInfo(bIFileArray[n]);
++n;
}
return certificateInfoArray;
}
public static CertificateInfo[] make(XElem[] xElemArray) throws Exception {
CertificateInfo[] certificateInfoArray = new CertificateInfo[xElemArray.length];
int n = 0;
while (n < xElemArray.length) {
certificateInfoArray[n] = new CertificateInfo(xElemArray[n]);
++n;
}
return certificateInfoArray;
}
public static CertificateInfo[] make(VendorCertificate[] vendorCertificateArray) throws Exception {
CertificateInfo[] certificateInfoArray = new CertificateInfo[vendorCertificateArray.length];
int n = 0;
while (n < vendorCertificateArray.length) {
certificateInfoArray[n] = new CertificateInfo(vendorCertificateArray[n], null);
++n;
}
return certificateInfoArray;
}
public static CertificateInfo[] listLocal() {
Class clazz = class$com$tridium$platform$license$CertificateInfo;
if (clazz == null) {
clazz = class$com$tridium$platform$license$CertificateInfo = CertificateInfo.class("[Lcom.tridium.platform.license.CertificateInfo;", false);
}
Array array = new Array(clazz);
BDirectory bDirectory = (BDirectory)BFileSystem.INSTANCE.findFile(CERTS_PATH);
BIFile[] bIFileArray = bDirectory.listFiles();
int n = 0;
while (n < bIFileArray.length) {
if (bIFileArray[n] instanceof BCertificateFile) {
try {
array.add((Object)new CertificateInfo(bIFileArray[n]));
}
catch (Exception exception) {
exception.printStackTrace();
}
}
++n;
}
return (CertificateInfo[])array.trim();
}
public String getInstalledFileName() {
return TextUtil.capitalize((String)this.vendorCertificate.getVendor()) + ".certificate";
}
public String getXmlContent() {
try {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
this.vendorCertificate.save((OutputStream)byteArrayOutputStream);
return byteArrayOutputStream.toString();
}
catch (RuntimeException runtimeException) {
throw runtimeException;
}
catch (Exception exception) {
throw new BajaRuntimeException((Throwable)exception);
}
}
public String getXmlSummary() {
return CertificateInfo.getXmlSummary(this.vendorCertificate);
}
public static String getXmlSummary(VendorCertificate vendorCertificate) {
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("<certificateSummary ");
stringBuffer.append("vendor=\"" + vendorCertificate.getVendor() + "\" ");
stringBuffer.append("expiration=\"" + vendorCertificate.getExpiration() + "\" ");
stringBuffer.append("signature=\"" + vendorCertificate.getSignature() + "\"/>");
return stringBuffer.toString();
}
public FilePath getInstalledFilePath() {
return CERTS_PATH.merge(this.getInstalledFileName());
}
public void write(OutputStream outputStream) throws Exception {
this.write(outputStream, true);
}
public void write(OutputStream outputStream, boolean bl) throws Exception {
this.vendorCertificate.save(outputStream, bl);
}
public String toString() {
return this.toString(null);
}
public static String getSummaryText(VendorCertificate vendorCertificate, Context context) {
return CertificateInfo.getSummaryText(vendorCertificate.getVendor() + ".certificate", vendorCertificate, context);
}
public String toString(Context context) {
String string = this.file != null && this.file instanceof BCertificateFile ? this.file.getFileName() : this.getInstalledFileName();
return CertificateInfo.getSummaryText(string, this.vendorCertificate, context);
}
public static String getSummaryText(String string, VendorCertificate vendorCertificate, Context context) {
if (vendorCertificate.getExpiration() == Long.MAX_VALUE) {
return neverExpiresFmt.getText(context, new Object[]{string, vendorCertificate.getVendor()});
}
return defaultFmt.getText(context, new Object[]{string, vendorCertificate.getVendor(), LicenseUtil.formatDate((long)vendorCertificate.getExpiration())});
}
public BIFile getFile() {
return this.file;
}
static /* synthetic */ Class class(String string, boolean bl) {
try {
Class<?> clazz = Class.forName(string);
if (!bl) {
clazz = clazz.getComponentType();
}
return clazz;
}
catch (ClassNotFoundException classNotFoundException) {
throw new NoClassDefFoundError(classNotFoundException.getMessage());
}
}
public CertificateInfo(XElem xElem) throws Exception {
this(xElem, null);
}
public CertificateInfo(BIFile bIFile) throws Exception {
this(VendorCertificate.make((BIFile)bIFile), bIFile);
}
public CertificateInfo(XElem xElem, BIFile bIFile) throws Exception {
this(VendorCertificate.make((String)(bIFile == null ? "CertificateInfo" : bIFile.getFileName()), (XElem)xElem), bIFile);
}
public CertificateInfo(VendorCertificate vendorCertificate, BIFile bIFile) {
this.vendorCertificate = vendorCertificate;
this.file = bIFile;
}
public CertificateInfo(InputStream inputStream) throws Exception {
this(inputStream, true);
}
public CertificateInfo(InputStream inputStream, boolean bl) throws Exception {
this(XParser.make((InputStream)inputStream).parse(bl), null);
}
}
@@ -0,0 +1,33 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.file.BIFile
* javax.baja.file.FilePath
* javax.baja.sys.Context
*/
package com.tridium.platform.license;
import java.io.OutputStream;
import javax.baja.file.BIFile;
import javax.baja.file.FilePath;
import javax.baja.sys.Context;
public interface IFileInfo {
public BIFile getFile();
public String toString(Context var1);
public String getInstalledFileName();
public FilePath getInstalledFilePath();
public String getXmlContent();
public String getXmlSummary();
public void write(OutputStream var1) throws Exception;
public void write(OutputStream var1, boolean var2) throws Exception;
}
@@ -0,0 +1,344 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.tridium.file.types.text.BLicenseFile
* com.tridium.sys.Nre
* com.tridium.sys.license.Brand
* com.tridium.sys.license.Brand$AcceptList
* com.tridium.sys.license.LicenseUtil
* com.tridium.sys.license.dom.Feature$Brand
* com.tridium.sys.license.dom.VendorLicense
* javax.baja.file.BDirectory
* javax.baja.file.BFileSystem
* javax.baja.file.BIFile
* javax.baja.file.FilePath
* javax.baja.nre.util.Array
* javax.baja.nre.util.TextUtil
* javax.baja.sys.BAbsTime
* javax.baja.sys.BajaRuntimeException
* javax.baja.sys.Context
* javax.baja.sys.Sys
* javax.baja.util.LexiconText
* javax.baja.xml.XElem
* javax.baja.xml.XParser
*/
package com.tridium.platform.license;
import com.tridium.file.types.text.BLicenseFile;
import com.tridium.platform.license.IFileInfo;
import com.tridium.sys.Nre;
import com.tridium.sys.license.Brand;
import com.tridium.sys.license.LicenseUtil;
import com.tridium.sys.license.dom.Feature;
import com.tridium.sys.license.dom.VendorLicense;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import javax.baja.file.BDirectory;
import javax.baja.file.BFileSystem;
import javax.baja.file.BIFile;
import javax.baja.file.FilePath;
import javax.baja.nre.util.Array;
import javax.baja.nre.util.TextUtil;
import javax.baja.sys.BAbsTime;
import javax.baja.sys.BajaRuntimeException;
import javax.baja.sys.Context;
import javax.baja.sys.Sys;
import javax.baja.util.LexiconText;
import javax.baja.xml.XElem;
import javax.baja.xml.XParser;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class LicenseInfo
implements IFileInfo {
private static LexiconText neverExpiresFmt = LexiconText.make((String)"platform", (String)"LicenseInfo.neverExpiresFormat");
private static LexiconText defaultFmt = LexiconText.make((String)"platform", (String)"LicenseInfo.format");
public static final FilePath LICENSES_PATH = new FilePath("!licenses");
public VendorLicense vendorLicense;
public BIFile file;
static /* synthetic */ Class class$com$tridium$platform$license$LicenseInfo;
public static LicenseInfo[] make(BIFile[] bIFileArray) throws Exception {
if (bIFileArray == null) {
return new LicenseInfo[0];
}
LicenseInfo[] licenseInfoArray = new LicenseInfo[bIFileArray.length];
int n = 0;
while (n < bIFileArray.length) {
licenseInfoArray[n] = new LicenseInfo(bIFileArray[n]);
++n;
}
return licenseInfoArray;
}
public static LicenseInfo[] make(XElem[] xElemArray) throws Exception {
if (xElemArray == null) {
return new LicenseInfo[0];
}
LicenseInfo[] licenseInfoArray = new LicenseInfo[xElemArray.length];
int n = 0;
while (n < xElemArray.length) {
licenseInfoArray[n] = new LicenseInfo(xElemArray[n]);
++n;
}
return licenseInfoArray;
}
public static LicenseInfo[] make(VendorLicense[] vendorLicenseArray) throws Exception {
LicenseInfo[] licenseInfoArray = new LicenseInfo[vendorLicenseArray.length];
int n = 0;
while (n < vendorLicenseArray.length) {
licenseInfoArray[n] = new LicenseInfo(vendorLicenseArray[n], null);
++n;
}
return licenseInfoArray;
}
public static LicenseInfo[] listLocal() {
Class clazz = class$com$tridium$platform$license$LicenseInfo;
if (clazz == null) {
clazz = class$com$tridium$platform$license$LicenseInfo = LicenseInfo.class("[Lcom.tridium.platform.license.LicenseInfo;", false);
}
Array array = new Array(clazz);
BDirectory bDirectory = (BDirectory)BFileSystem.INSTANCE.findFile(LICENSES_PATH);
BIFile[] bIFileArray = bDirectory.listFiles();
int n = 0;
while (n < bIFileArray.length) {
if (bIFileArray[n] instanceof BLicenseFile) {
try {
array.add((Object)new LicenseInfo(bIFileArray[n]));
}
catch (Exception exception) {
exception.printStackTrace();
}
}
++n;
}
return (LicenseInfo[])array.trim();
}
public static Feature.Brand getLocalBrandFeature() {
if (Nre.bootEnv.isRemote()) {
return null;
}
String string = Brand.getBrandId();
if (string == null) {
return null;
}
LicenseInfo[] licenseInfoArray = LicenseInfo.listLocal();
int n = 0;
while (n < licenseInfoArray.length) {
if (licenseInfoArray[n].vendorLicense.getHostId().equals(Sys.getHostId()) && string.equals(licenseInfoArray[n].getBrand())) {
return licenseInfoArray[n].vendorLicense.getBrandFeature();
}
++n;
}
return null;
}
public static int countActiveLicenses(LicenseInfo[] licenseInfoArray, BAbsTime bAbsTime) {
if (licenseInfoArray == null) {
return 0;
}
int n = 0;
int n2 = 0;
while (n2 < licenseInfoArray.length) {
if (!licenseInfoArray[n2].isExpired(bAbsTime)) {
++n;
}
++n2;
}
return n;
}
public boolean isExpired() {
return this.isExpired(BAbsTime.now());
}
public boolean isExpired(BAbsTime bAbsTime) {
if (this.vendorLicense.getExpiration() == 0L) {
return false;
}
boolean bl = false;
if (this.vendorLicense.getExpiration() < bAbsTime.getMillis()) {
bl = true;
}
return bl;
}
public String getBrand() {
return this.vendorLicense.getBrandId();
}
public boolean allowsLocalWbAccess() {
return this.allowsWbAccess(LicenseInfo.getLocalBrandFeature());
}
public boolean allowsLocalStationAccess() {
return this.allowsStationAccess(LicenseInfo.getLocalBrandFeature());
}
public boolean allowsWbAccess(Feature.Brand brand) {
Feature.Brand brand2 = this.vendorLicense.getBrandFeature();
if (brand == null || brand2 == null) {
return true;
}
boolean bl = true;
Brand.AcceptList acceptList = new Brand.AcceptList("accept.wb.in", brand2.getWbIn());
boolean bl2 = false;
if (bl && acceptList.accept(brand.getBrandId())) {
bl2 = true;
}
bl = bl2;
Brand.AcceptList acceptList2 = new Brand.AcceptList("accept.wb.out", brand.getWbOut());
boolean bl3 = false;
if (bl && acceptList2.accept(brand2.getBrandId())) {
bl3 = true;
}
bl = bl3;
return bl;
}
public boolean allowsStationAccess(Feature.Brand brand) {
Feature.Brand brand2 = this.vendorLicense.getBrandFeature();
if (brand == null || brand2 == null) {
return true;
}
boolean bl = true;
Brand.AcceptList acceptList = new Brand.AcceptList("accept.station.in", brand2.getStationIn());
boolean bl2 = false;
if (bl && acceptList.accept(brand.getBrandId())) {
bl2 = true;
}
bl = bl2;
Brand.AcceptList acceptList2 = new Brand.AcceptList("accept.station.out", brand.getStationOut());
boolean bl3 = false;
if (bl && acceptList2.accept(brand2.getBrandId())) {
bl3 = true;
}
bl = bl3;
return bl;
}
public String getInstalledFileName() {
return this.getBaseName() + ".license";
}
public String getBaseName() {
String string = this.vendorLicense.getBrandId();
if (string != null) {
return TextUtil.capitalize((String)string);
}
return TextUtil.capitalize((String)this.vendorLicense.getVendor());
}
public String getXmlContent() {
try {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
this.vendorLicense.save((OutputStream)byteArrayOutputStream);
return byteArrayOutputStream.toString();
}
catch (RuntimeException runtimeException) {
throw runtimeException;
}
catch (Exception exception) {
throw new BajaRuntimeException((Throwable)exception);
}
}
public String getXmlSummary() {
return LicenseInfo.getXmlSummary(this.vendorLicense);
}
public static String getXmlSummary(VendorLicense vendorLicense) {
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("<licenseSummary ");
stringBuffer.append("hostid=\"" + vendorLicense.getHostId() + "\" ");
stringBuffer.append("vendor=\"" + vendorLicense.getVendor() + "\" ");
String string = vendorLicense.getBrandId();
if (string != null) {
stringBuffer.append("brand=\"" + string + "\" ");
}
stringBuffer.append("expiration=\"" + vendorLicense.getExpiration() + "\" ");
stringBuffer.append("signature=\"" + vendorLicense.getSignature() + "\"/>");
return stringBuffer.toString();
}
public FilePath getInstalledFilePath() {
return LICENSES_PATH.merge(this.getInstalledFileName());
}
public void write(OutputStream outputStream) throws Exception {
this.write(outputStream, true);
}
public void write(OutputStream outputStream, boolean bl) throws Exception {
this.vendorLicense.save(outputStream, bl);
}
public String toString() {
return this.toString(null);
}
public static String getSummaryText(VendorLicense vendorLicense, Context context) {
return LicenseInfo.getSummaryText(vendorLicense.getLicenseName() + ".license", vendorLicense, context);
}
public String toString(Context context) {
String string = this.file != null && this.file instanceof BLicenseFile ? this.file.getFileName() : this.getInstalledFileName();
return LicenseInfo.getSummaryText(string, this.vendorLicense, context);
}
public static String getSummaryText(String string, VendorLicense vendorLicense, Context context) {
if (vendorLicense.getExpiration() == Long.MAX_VALUE) {
return neverExpiresFmt.getText(context, new Object[]{string, vendorLicense.getVendor(), vendorLicense.getVersion()});
}
return defaultFmt.getText(context, new Object[]{string, vendorLicense.getVendor(), vendorLicense.getVersion(), LicenseUtil.formatDate((long)vendorLicense.getExpiration())});
}
public BIFile getFile() {
return this.file;
}
static /* synthetic */ Class class(String string, boolean bl) {
try {
Class<?> clazz = Class.forName(string);
if (!bl) {
clazz = clazz.getComponentType();
}
return clazz;
}
catch (ClassNotFoundException classNotFoundException) {
throw new NoClassDefFoundError(classNotFoundException.getMessage());
}
}
public LicenseInfo(XElem xElem) throws Exception {
this(xElem, null);
}
public LicenseInfo(BIFile bIFile) throws Exception {
this(VendorLicense.make((BIFile)bIFile), bIFile);
}
public LicenseInfo(XElem xElem, BIFile bIFile) throws Exception {
this(VendorLicense.make((String)(bIFile == null ? "LicenseInfo" : bIFile.getFileName()), (XElem)xElem), bIFile);
}
public LicenseInfo(VendorLicense vendorLicense, BIFile bIFile) {
this.vendorLicense = vendorLicense;
this.file = bIFile;
}
public LicenseInfo(InputStream inputStream) throws Exception {
this(inputStream, true);
}
public LicenseInfo(InputStream inputStream, boolean bl) throws Exception {
this(XParser.make((InputStream)inputStream).parse(bl), null);
}
}
@@ -0,0 +1,30 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.nre.util.Array
*/
package com.tridium.platform.license;
import javax.baja.nre.util.Array;
public class LicenseSync {
public Array toAdd;
public Array toUpdate;
public Array toRemove;
public boolean unchanged() {
boolean bl = false;
if (this.toAdd.size() == 0 && this.toUpdate.size() == 0 && this.toRemove.size() == 0) {
bl = true;
}
return bl;
}
public LicenseSync(Array array, Array array2, Array array3) {
this.toAdd = array;
this.toUpdate = array2;
this.toRemove = array3;
}
}
@@ -0,0 +1,618 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.tridium.file.types.text.BCertificateFile
* com.tridium.file.types.text.BLicenseFile
* com.tridium.fox.sys.BFoxSession
* com.tridium.fox.sys.file.BFoxFileStore
* com.tridium.sys.license.dom.CertificateDatabase
* com.tridium.sys.license.dom.Feature$Brand
* com.tridium.sys.license.dom.LicenseDatabase
* com.tridium.sys.license.dom.VendorCertificate
* com.tridium.sys.license.dom.VendorLicense
* javax.baja.file.BIFile
* javax.baja.nre.util.Array
* javax.baja.sys.BModule
* javax.baja.sys.ModuleNotFoundException
* javax.baja.sys.Sys
* javax.baja.util.Version
* javax.baja.xml.XElem
* javax.baja.xml.XParser
*/
package com.tridium.platform.license;
import com.tridium.file.types.text.BCertificateFile;
import com.tridium.file.types.text.BLicenseFile;
import com.tridium.fox.sys.BFoxSession;
import com.tridium.fox.sys.file.BFoxFileStore;
import com.tridium.platform.daemon.message.ByteArrayFileTransferElement;
import com.tridium.platform.daemon.message.FileTransferMessage;
import com.tridium.platform.fox.BLicenseChannel;
import com.tridium.platform.license.BCertificateSummary;
import com.tridium.platform.license.BEnvLicenseSummary;
import com.tridium.platform.license.BLicenseArchiveFile;
import com.tridium.platform.license.BrandProps;
import com.tridium.platform.license.CertificateInfo;
import com.tridium.platform.license.IFileInfo;
import com.tridium.platform.license.LicenseInfo;
import com.tridium.platform.license.LicenseSync;
import com.tridium.sys.license.dom.CertificateDatabase;
import com.tridium.sys.license.dom.Feature;
import com.tridium.sys.license.dom.LicenseDatabase;
import com.tridium.sys.license.dom.VendorCertificate;
import com.tridium.sys.license.dom.VendorLicense;
import java.io.InputStream;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import javax.baja.file.BIFile;
import javax.baja.nre.util.Array;
import javax.baja.sys.BModule;
import javax.baja.sys.ModuleNotFoundException;
import javax.baja.sys.Sys;
import javax.baja.util.Version;
import javax.baja.xml.XElem;
import javax.baja.xml.XParser;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class PortalLicenseUtil {
private static boolean initialized = false;
private static Class portalApiClass = null;
static /* synthetic */ Class class$com$tridium$sys$license$dom$VendorLicense;
static /* synthetic */ Class class$com$tridium$sys$license$dom$VendorCertificate;
static /* synthetic */ Class array$Ljavax$baja$xml$XElem;
static /* synthetic */ Class class$java$lang$String;
static /* synthetic */ Class class$com$tridium$platform$license$LicenseInfo;
static /* synthetic */ Class class$com$tridium$platform$license$CertificateInfo;
public static IFileInfo makeFileInfo(BIFile bIFile) throws Exception {
Object object;
BLicenseChannel bLicenseChannel = null;
if (bIFile.getSession() instanceof BFoxSession) {
object = (BFoxSession)bIFile.getSession();
try {
Version version = (Version)object.fw(404, (Object)"platform", null, null, null);
if (version != null && version.compareTo((Object)new Version("3.7.201")) != -1) {
bLicenseChannel = (BLicenseChannel)object.getConnection().getChannels().get("license", BLicenseChannel.TYPE);
}
}
catch (Exception exception) {}
}
if (bIFile instanceof BLicenseFile) {
if (bLicenseChannel != null) {
try {
object = bLicenseChannel.read((BFoxFileStore)bIFile.getStore());
return new LicenseInfo(XParser.make((InputStream)object).parse(true), bIFile);
}
catch (Exception exception) {}
}
return new LicenseInfo(bIFile);
}
if (bIFile instanceof BCertificateFile) {
if (bLicenseChannel != null) {
try {
object = bLicenseChannel.read((BFoxFileStore)bIFile.getStore());
return new CertificateInfo(XParser.make((InputStream)object).parse(true), bIFile);
}
catch (Exception exception) {}
}
return new CertificateInfo(bIFile);
}
return null;
}
public static synchronized boolean isApiAvailable() {
if (!initialized) {
try {
BModule bModule = Sys.loadModule((String)"portalApi");
portalApiClass = bModule.loadClass("com.tridium.portal.api.PortalApi");
}
catch (ClassNotFoundException classNotFoundException) {
}
catch (ModuleNotFoundException moduleNotFoundException) {}
initialized = true;
}
boolean bl = false;
if (portalApiClass != null) {
bl = true;
}
return bl;
}
public static boolean autoFetchLicenses() {
return BrandProps.getLocalInstance().get("license.autoFetch", true);
}
public static boolean requestLicensesOnline() {
return BrandProps.getLocalInstance().get("license.onlineRequest", true);
}
public static VendorLicense[] getUpdatedLicenses(BEnvLicenseSummary[] bEnvLicenseSummaryArray, LicenseDatabase licenseDatabase) throws Exception {
Class clazz = class$com$tridium$sys$license$dom$VendorLicense;
if (clazz == null) {
clazz = class$com$tridium$sys$license$dom$VendorLicense = PortalLicenseUtil.class("[Lcom.tridium.sys.license.dom.VendorLicense;", false);
}
Array array = new Array(clazz);
int n = 0;
while (n < bEnvLicenseSummaryArray.length) {
HashSet<String> hashSet = new HashSet<String>();
VendorLicense[] vendorLicenseArray = licenseDatabase.getLicenses(bEnvLicenseSummaryArray[n].getHostId(), bEnvLicenseSummaryArray[n].getBrandId());
int n2 = 0;
while (n2 < vendorLicenseArray.length) {
String string = vendorLicenseArray[n2].getVendor();
if (string.equalsIgnoreCase("tridium") || !hashSet.contains(string)) {
long l = bEnvLicenseSummaryArray[n].getLicenseGenerated(string);
long l2 = vendorLicenseArray[n2].getGenerated();
if (bEnvLicenseSummaryArray[n].getLicenseSignature(string) == null || l < l2 || l == l2 && !vendorLicenseArray[n2].getSignature().equals(bEnvLicenseSummaryArray[n].getLicenseSignature(string))) {
array.add((Object)vendorLicenseArray[n2]);
if (!string.equalsIgnoreCase("tridium")) {
hashSet.add(string);
}
}
}
++n2;
}
++n;
}
return (VendorLicense[])array.trim();
}
public static VendorCertificate[] getUpdatedCertificates(BCertificateSummary[] bCertificateSummaryArray, CertificateDatabase certificateDatabase) throws Exception {
Class clazz = class$com$tridium$sys$license$dom$VendorCertificate;
if (clazz == null) {
clazz = class$com$tridium$sys$license$dom$VendorCertificate = PortalLicenseUtil.class("[Lcom.tridium.sys.license.dom.VendorCertificate;", false);
}
Array array = new Array(clazz);
int n = 0;
while (n < bCertificateSummaryArray.length) {
VendorCertificate vendorCertificate = certificateDatabase.getCertificate(bCertificateSummaryArray[n].getVendor());
if (vendorCertificate != null) {
long l = bCertificateSummaryArray[n].getCertificateGenerated();
long l2 = vendorCertificate.getGenerated();
if (bCertificateSummaryArray[n].getCertificateSignature() == null || l < l2 || l == l2 && !vendorCertificate.getSignature().equals(bCertificateSummaryArray[n].getCertificateSignature())) {
array.add((Object)vendorCertificate);
}
}
++n;
}
return (VendorCertificate[])array.trim();
}
public static VendorLicense[] getPortalUpdates(VendorLicense[] vendorLicenseArray) throws Exception {
return PortalLicenseUtil.getPortalUpdates(BEnvLicenseSummary.make(vendorLicenseArray));
}
public static VendorLicense[] getPortalUpdates(BEnvLicenseSummary[] bEnvLicenseSummaryArray) throws Exception {
if (!PortalLicenseUtil.isApiAvailable()) {
throw new UnsupportedOperationException();
}
try {
Class[] classArray = new Class[1];
Class clazz = array$Ljavax$baja$xml$XElem;
if (clazz == null) {
clazz = array$Ljavax$baja$xml$XElem = PortalLicenseUtil.class("[Ljavax.baja.xml.XElem;", true);
}
classArray[0] = clazz;
Method method = portalApiClass.getMethod("getLicenseUpdates", classArray);
XElem[] xElemArray = new XElem[bEnvLicenseSummaryArray.length];
int n = 0;
while (n < bEnvLicenseSummaryArray.length) {
xElemArray[n] = bEnvLicenseSummaryArray[n].asXml();
++n;
}
XElem[] xElemArray2 = (XElem[])method.invoke(null, new Object[]{xElemArray});
VendorLicense[] vendorLicenseArray = new VendorLicense[xElemArray2.length];
int n2 = 0;
while (n2 < xElemArray2.length) {
vendorLicenseArray[n2] = VendorLicense.make((String)"portal", (XElem)xElemArray2[n2]);
++n2;
}
return vendorLicenseArray;
}
catch (NoSuchMethodException noSuchMethodException) {
throw new UnsupportedOperationException();
}
}
public static VendorCertificate[] getPortalUpdates(VendorCertificate[] vendorCertificateArray) throws Exception {
return PortalLicenseUtil.getPortalUpdates(BCertificateSummary.make(vendorCertificateArray));
}
public static VendorCertificate[] getPortalUpdates(BCertificateSummary[] bCertificateSummaryArray) throws Exception {
if (!PortalLicenseUtil.isApiAvailable()) {
throw new UnsupportedOperationException();
}
try {
Class[] classArray = new Class[1];
Class clazz = array$Ljavax$baja$xml$XElem;
if (clazz == null) {
clazz = array$Ljavax$baja$xml$XElem = PortalLicenseUtil.class("[Ljavax.baja.xml.XElem;", true);
}
classArray[0] = clazz;
Method method = portalApiClass.getMethod("getCertificateUpdates", classArray);
XElem[] xElemArray = new XElem[bCertificateSummaryArray.length];
int n = 0;
while (n < bCertificateSummaryArray.length) {
xElemArray[n] = bCertificateSummaryArray[n].asXml();
++n;
}
XElem[] xElemArray2 = (XElem[])method.invoke(null, new Object[]{xElemArray});
VendorCertificate[] vendorCertificateArray = new VendorCertificate[xElemArray2.length];
int n2 = 0;
while (n2 < xElemArray2.length) {
vendorCertificateArray[n2] = VendorCertificate.make((String)"portal", (XElem)xElemArray2[n2]);
++n2;
}
return vendorCertificateArray;
}
catch (NoSuchMethodException noSuchMethodException) {
throw new UnsupportedOperationException();
}
}
public static LicenseInfo[] getLicenseInfo(BIFile bIFile, String string, String string2) throws Exception {
return PortalLicenseUtil.getLicenseInfo(new BIFile[]{bIFile}, string, string2);
}
public static LicenseInfo[] getLicenseInfo(BIFile[] bIFileArray, String string, String string2) throws Exception {
HashMap hashMap = new HashMap();
VendorLicense[] vendorLicenseArray = PortalLicenseUtil.getLicenses(bIFileArray, string, string2, hashMap);
LicenseInfo[] licenseInfoArray = new LicenseInfo[vendorLicenseArray.length];
int n = 0;
while (n < vendorLicenseArray.length) {
licenseInfoArray[n] = new LicenseInfo(vendorLicenseArray[n], (BIFile)hashMap.get(vendorLicenseArray[n]));
++n;
}
return licenseInfoArray;
}
public static VendorLicense[] getLicenses(BIFile bIFile, String string, String string2) throws Exception {
return PortalLicenseUtil.getLicenses(new BIFile[]{bIFile}, string, string2, null);
}
public static VendorLicense[] getLicenses(BIFile[] bIFileArray, String string, String string2) throws Exception {
return PortalLicenseUtil.getLicenses(bIFileArray, string, string2, null);
}
protected static VendorLicense[] getLicenses(BIFile[] bIFileArray, String string, String string2, Map map) throws Exception {
HashMap hashMap = new HashMap();
String string3 = string2;
int n = 0;
while (n < bIFileArray.length) {
VendorLicense[] vendorLicenseArray;
if (bIFileArray[n] instanceof BLicenseFile) {
vendorLicenseArray = VendorLicense.make((BIFile)bIFileArray[n]);
if (vendorLicenseArray.getBrandId() == null || string2 == null || string2.equals(vendorLicenseArray.getBrandId())) {
string3 = PortalLicenseUtil.accumLicenses(string3, hashMap, map, (VendorLicense)vendorLicenseArray, bIFileArray[n]);
}
} else if (bIFileArray[n] instanceof BLicenseArchiveFile) {
vendorLicenseArray = ((BLicenseArchiveFile)bIFileArray[n]).getLicenses(string);
int n2 = 0;
while (n2 < vendorLicenseArray.length) {
string3 = PortalLicenseUtil.accumLicenses(string3, hashMap, map, vendorLicenseArray[n2], bIFileArray[n]);
++n2;
}
}
++n;
}
VendorLicense[] vendorLicenseArray = new VendorLicense[hashMap.size()];
hashMap.values().toArray(vendorLicenseArray);
return vendorLicenseArray;
}
protected static String accumLicenses(String string, Map map, Map map2, VendorLicense vendorLicense, BIFile bIFile) throws Exception {
VendorLicense vendorLicense2;
if (!(vendorLicense.getBrandId() != null && string != null && !string.equals(vendorLicense.getBrandId()) || (vendorLicense2 = (VendorLicense)map.get(vendorLicense.getLicenseName())) != null && vendorLicense2.getGenerated() >= vendorLicense.getGenerated())) {
map.put(vendorLicense.getLicenseName(), vendorLicense);
if (map2 != null) {
map2.put(vendorLicense, bIFile);
}
}
return string == null ? vendorLicense.getBrandId() : string;
}
public static synchronized boolean checkConnectivity() {
if (!PortalLicenseUtil.isApiAvailable()) {
throw new UnsupportedOperationException();
}
try {
Method method = portalApiClass.getMethod("checkConnectivity", new Class[0]);
Boolean bl = (Boolean)method.invoke(null, null);
return bl;
}
catch (Exception exception) {
return false;
}
}
public static XElem[] getExistingLicenses(String string, String string2) throws Exception {
Method method;
Class clazz;
if (!PortalLicenseUtil.isApiAvailable()) {
throw new UnsupportedOperationException();
}
XElem[] xElemArray = null;
Class[] classArray = new Class[2];
Class clazz2 = class$java$lang$String;
if (clazz2 == null) {
clazz2 = classArray[0] = (class$java$lang$String = PortalLicenseUtil.class("[Ljava.lang.String;", false));
}
if ((clazz = class$java$lang$String) == null) {
clazz = classArray[1] = (class$java$lang$String = PortalLicenseUtil.class("[Ljava.lang.String;", false));
}
if ((xElemArray = (XElem[])(method = portalApiClass.getMethod("getLicenses", classArray)).invoke(null, string, string2)) == null || xElemArray.length == 0) {
return null;
}
return xElemArray;
}
public static XElem[] getCertificates(String string) throws Exception {
Method method;
if (!PortalLicenseUtil.isApiAvailable()) {
throw new UnsupportedOperationException();
}
XElem[] xElemArray = null;
Class[] classArray = new Class[1];
Class clazz = class$java$lang$String;
if (clazz == null) {
clazz = classArray[0] = (class$java$lang$String = PortalLicenseUtil.class("[Ljava.lang.String;", false));
}
if ((xElemArray = (XElem[])(method = portalApiClass.getMethod("getCertificates", classArray)).invoke(null, string)) == null || xElemArray.length == 0) {
return null;
}
return xElemArray;
}
public static XElem getCertificate(String string) throws Exception {
if (!PortalLicenseUtil.isApiAvailable()) {
throw new UnsupportedOperationException();
}
Class[] classArray = new Class[1];
Class clazz = class$java$lang$String;
if (clazz == null) {
clazz = class$java$lang$String = PortalLicenseUtil.class("[Ljava.lang.String;", false);
}
classArray[0] = clazz;
Method method = portalApiClass.getMethod("getCertificate", classArray);
return (XElem)method.invoke(null, string);
}
public static XElem[] getCertificates(String[] stringArray) throws Exception {
if (!PortalLicenseUtil.isApiAvailable()) {
throw new UnsupportedOperationException();
}
Method method = portalApiClass.getMethod("getCertificates", stringArray.getClass());
return (XElem[])method.invoke(null, new Object[]{stringArray});
}
public static LicenseSync syncLicenses(String string, LicenseInfo[] licenseInfoArray, LicenseInfo[] licenseInfoArray2) {
return PortalLicenseUtil.syncLicenses(string, LicenseInfo.getLocalBrandFeature(), licenseInfoArray, licenseInfoArray2);
}
public static LicenseSync syncLicenses(String string, Feature.Brand brand, LicenseInfo[] licenseInfoArray, LicenseInfo[] licenseInfoArray2) {
Object object;
Object object2;
LicenseInfo licenseInfo;
Class clazz = class$com$tridium$platform$license$LicenseInfo;
if (clazz == null) {
clazz = class$com$tridium$platform$license$LicenseInfo = PortalLicenseUtil.class("[Lcom.tridium.platform.license.LicenseInfo;", false);
}
Array array = new Array(clazz);
Class clazz2 = class$com$tridium$platform$license$LicenseInfo;
if (clazz2 == null) {
clazz2 = class$com$tridium$platform$license$LicenseInfo = PortalLicenseUtil.class("[Lcom.tridium.platform.license.LicenseInfo;", false);
}
Array array2 = new Array(clazz2);
Class clazz3 = class$com$tridium$platform$license$LicenseInfo;
if (clazz3 == null) {
clazz3 = class$com$tridium$platform$license$LicenseInfo = PortalLicenseUtil.class("[Lcom.tridium.platform.license.LicenseInfo;", false);
}
Array array3 = new Array(clazz3);
HashMap<String, LicenseInfo> hashMap = new HashMap<String, LicenseInfo>();
int n = 0;
while (n < licenseInfoArray.length) {
licenseInfo = licenseInfoArray[n];
object2 = licenseInfo.vendorLicense;
if (object2.getHostId().equals(string)) {
LicenseInfo licenseInfo2 = (LicenseInfo)hashMap.get(object2.getVendor());
if (licenseInfo2 != null) {
object = licenseInfo2.vendorLicense;
if (object2.getGenerated() > object.getGenerated()) {
array3.add((Object)licenseInfo2);
hashMap.put(object2.getVendor(), licenseInfo);
} else if (object.getGenerated() > object2.getGenerated()) {
array3.add((Object)licenseInfo);
} else if (licenseInfo.file.getFileName().equals(licenseInfo.getInstalledFileName())) {
array3.add((Object)licenseInfo2);
hashMap.put(object2.getVendor(), licenseInfo);
} else {
array3.add((Object)licenseInfo);
}
} else {
hashMap.put(object2.getVendor(), licenseInfo);
}
}
++n;
}
n = 0;
while (n < licenseInfoArray2.length) {
licenseInfo = licenseInfoArray2[n];
object2 = (LicenseInfo)hashMap.get(licenseInfo.vendorLicense.getVendor());
if (PortalLicenseUtil.shouldInstall(licenseInfo, (LicenseInfo)object2, brand)) {
boolean bl;
boolean bl2 = false;
if (object2 != null) {
bl2 = true;
}
if (bl = bl2) {
object = licenseInfo.getInstalledFileName();
if (((String)object).equals(object2.file.getFileName())) {
array2.add((Object)licenseInfo);
} else {
array3.add(object2);
array.add((Object)licenseInfo);
}
} else {
array.add((Object)licenseInfo);
}
}
++n;
}
return new LicenseSync(array, array2, array3);
}
public static void sync(FileTransferMessage fileTransferMessage, LicenseSync licenseSync) {
if (licenseSync == null || fileTransferMessage == null) {
return;
}
int n = 0;
while (n < licenseSync.toAdd.size()) {
PortalLicenseUtil.addFile(fileTransferMessage, (IFileInfo)licenseSync.toAdd.get(n));
++n;
}
n = 0;
while (n < licenseSync.toUpdate.size()) {
PortalLicenseUtil.addFile(fileTransferMessage, (IFileInfo)licenseSync.toUpdate.get(n));
++n;
}
n = 0;
while (n < licenseSync.toRemove.size()) {
fileTransferMessage.addDelete(((IFileInfo)licenseSync.toRemove.get(n)).getInstalledFilePath());
++n;
}
}
public static void addLicense(FileTransferMessage fileTransferMessage, LicenseInfo licenseInfo) {
PortalLicenseUtil.addFile(fileTransferMessage, licenseInfo);
}
public static void addCertificate(FileTransferMessage fileTransferMessage, CertificateInfo certificateInfo) {
PortalLicenseUtil.addFile(fileTransferMessage, certificateInfo);
}
public static void addFile(FileTransferMessage fileTransferMessage, IFileInfo iFileInfo) {
ByteArrayFileTransferElement byteArrayFileTransferElement = new ByteArrayFileTransferElement(iFileInfo.getInstalledFilePath(), iFileInfo.getXmlContent().getBytes(), fileTransferMessage.getTargetFileSpace());
fileTransferMessage.addElement(byteArrayFileTransferElement);
}
public static LicenseSync syncCertificates(CertificateInfo[] certificateInfoArray, CertificateInfo[] certificateInfoArray2) {
CertificateInfo certificateInfo;
CertificateInfo certificateInfo2;
Class clazz = class$com$tridium$platform$license$CertificateInfo;
if (clazz == null) {
clazz = class$com$tridium$platform$license$CertificateInfo = PortalLicenseUtil.class("[Lcom.tridium.platform.license.CertificateInfo;", false);
}
Array array = new Array(clazz);
Class clazz2 = class$com$tridium$platform$license$CertificateInfo;
if (clazz2 == null) {
clazz2 = class$com$tridium$platform$license$CertificateInfo = PortalLicenseUtil.class("[Lcom.tridium.platform.license.CertificateInfo;", false);
}
Array array2 = new Array(clazz2);
Class clazz3 = class$com$tridium$platform$license$CertificateInfo;
if (clazz3 == null) {
clazz3 = class$com$tridium$platform$license$CertificateInfo = PortalLicenseUtil.class("[Lcom.tridium.platform.license.CertificateInfo;", false);
}
Array array3 = new Array(clazz3);
HashMap<String, CertificateInfo> hashMap = new HashMap<String, CertificateInfo>();
int n = 0;
while (n < certificateInfoArray.length) {
certificateInfo2 = certificateInfoArray[n];
certificateInfo = (CertificateInfo)hashMap.get(certificateInfo2.vendorCertificate.getVendor());
if (certificateInfo != null) {
if (certificateInfo2.vendorCertificate.getExpiration() > certificateInfo.vendorCertificate.getExpiration()) {
array3.add((Object)certificateInfo);
hashMap.put(certificateInfo2.vendorCertificate.getVendor(), certificateInfo2);
} else if (certificateInfo.vendorCertificate.getExpiration() > certificateInfo2.vendorCertificate.getExpiration()) {
array3.add((Object)certificateInfo2);
} else if (certificateInfo2.file.getFileName().equals(certificateInfo2.getInstalledFileName())) {
array3.add((Object)certificateInfo);
hashMap.put(certificateInfo2.vendorCertificate.getVendor(), certificateInfo2);
} else {
array3.add((Object)certificateInfo2);
}
} else {
hashMap.put(certificateInfo2.vendorCertificate.getVendor(), certificateInfo2);
}
++n;
}
n = 0;
while (n < certificateInfoArray2.length) {
certificateInfo2 = certificateInfoArray2[n];
certificateInfo = (CertificateInfo)hashMap.get(certificateInfo2.vendorCertificate.getVendor());
if (PortalLicenseUtil.shouldInstall(certificateInfo2, certificateInfo)) {
boolean bl;
boolean bl2 = false;
if (certificateInfo != null) {
bl2 = true;
}
if (bl = bl2) {
String string = certificateInfo2.getInstalledFileName();
if (string.equals(certificateInfo.file.getFileName())) {
array2.add((Object)certificateInfo2);
} else {
array3.add((Object)certificateInfo);
array.add((Object)certificateInfo2);
}
} else {
array.add((Object)certificateInfo2);
}
}
++n;
}
return new LicenseSync(array, array2, array3);
}
public static boolean shouldInstall(LicenseInfo licenseInfo, LicenseInfo licenseInfo2) {
return PortalLicenseUtil.shouldInstall(licenseInfo, licenseInfo2, LicenseInfo.getLocalBrandFeature());
}
public static boolean shouldInstall(LicenseInfo licenseInfo, LicenseInfo licenseInfo2, Feature.Brand brand) {
if (licenseInfo2 == null) {
return true;
}
if (!licenseInfo.allowsWbAccess(brand)) {
return false;
}
String string = licenseInfo.vendorLicense.getSignature();
String string2 = licenseInfo2.vendorLicense.getSignature();
return string.equals(string2) ^ true;
}
public static boolean shouldInstall(CertificateInfo certificateInfo, CertificateInfo certificateInfo2) {
if (certificateInfo2 == null) {
return true;
}
String string = certificateInfo.vendorCertificate.getSignature();
String string2 = certificateInfo2.vendorCertificate.getSignature();
return string.equals(string2) ^ true;
}
public static void main(String[] stringArray) throws Exception {
System.out.println("connectivity: " + PortalLicenseUtil.checkConnectivity());
XElem[] xElemArray = PortalLicenseUtil.getCertificates(stringArray);
int n = 0;
while (n < xElemArray.length) {
System.out.println("----- " + n + " -----");
xElemArray[n].dump();
++n;
}
}
static /* synthetic */ Class class(String string, boolean bl) {
try {
Class<?> clazz = Class.forName(string);
if (!bl) {
clazz = clazz.getComponentType();
}
return clazz;
}
catch (ClassNotFoundException classNotFoundException) {
throw new NoClassDefFoundError(classNotFoundException.getMessage());
}
}
}