to 5.5
stny 2001-09-26 11:59:30 // Decompiler options: fullnames deadcode
// Source File Name: [DashoPro-V2-050200]
// To compile, use "javac -classpath together.jar;openapi.jar zo.java" !!!
// then use "jar ufv together.jar zo*.class" to update.
// save follow two lines as "eval_license.lic". don't stupid to keep the //.
// FEATURE TogetherControlCenterEval together 5.0205 8-oct-2001 // uncounted A674938AE619 HOSTID=DEMO
// put it in [togetherDir]\bin
// now you can use together without worry of expiration.
import com.togethersoft.openapi.ide.message.IdeMessageManagerAccess;
import com.togethersoft.openapi.util.Comparing;
import com.togethersoft.openapi.util.properties.DictionaryProperties;
import com.togethersoft.openapi.util.properties.IProperties;
import com.togethersoft.openapi.util.properties.IPropertiesRO;
import com.togethersoft.together.component.ide.license.IdeLicenseAccess;
import com.togethersoft.together.component.ide.license.IdeLicenseEx;
import com.togethersoft.together.service.application.Application;
import com.togethersoft.together.service.application.ApplicationAccess;
import com.togethersoft.together.service.config.util.PropertyUtil;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.PropertyChangeListener;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.URL;
import java.util.Calendar;
import java.util.Date;
import java.util.Enumeration;
import java.util.GregorianCalendar;
import java.util.Hashtable;
import java.util.StringTokenizer;
public class zo extends zp
implements com.togethersoft.together.component.ide.license.IdeLicenseEx
{
private static class zz
{
public int a(java.lang.Object obj)
{
if(obj == null)
return 1;
if(!(obj instanceof zz))
return 1;
zz zz1 = (zz)obj;
if(zz1.b != b)
return b >= zz1.b ? 1 : -1;
if(a || zz1.a)
{
if(!a)
return 1;
if(!zz1.a)
return -1;
}
if(zz1.c != c)
return c >= zz1.c ? 1 : -1;
else
return 0;
}
public int hashCode()
{
return b ^ (int)c;
}
public boolean equals(java.lang.Object obj)
{
return a(obj) == 0;
}
public boolean a;
public int b;
public long c;
public zz(java.io.File file, zp zp1)
{
c = file.lastModified();
b = -1;
if(zp1 == null)
return;
java.lang.String s1 = zp1.getStringFeature("license.edition");
java.lang.String s2 = zp1.getStringFeature("license.alternative");
a = s2 != null && s2.equals("true");
for(int i1 = 0; i1 < zcya.a.length; i1++)
{
if(!com.togethersoft.openapi.util.Comparing.equal(s1, zcya.a[i1]))
continue;
b = i1;
break;
}
}
}
private class _zaw
implements zx
{
public zp a(zw zw1, zp zp1)
{
zo.a(b, zw1, false);
return zw1.c != 0 ? a : zp1;
}
public zp a;
public final zo b = null; // synthetic field /
public _zaw(zp zp1)
{
a = zp1;
}
}
private static class zy
implements zx
{
public zp a(zw zw1, zp zp1)
{
if(zw1.c == 3 || zw1.c == 4)
return null;
else
return zp1;
}
private zy()
{
}
public zy(zay zay1)
{
this();
}
}
private static interface zx
{
public abstract zp a(zw zw1, zp zp1);
}
private static class za0 extends zp
{
public java.lang.String getStringFeature(java.lang.String s1)
{
return com.togethersoft.together.service.config.util.PropertyUtil.getString(a.getProperty(s1, null), null);
}
public java.lang.Boolean b(java.lang.String s1)
{
return com.togethersoft.openapi.util.properties.PropertyUtil.getLangBoolean(a.getProperty(s1, null), null);
}
public com.togethersoft.openapi.util.properties.IPropertiesRO a;
public za0(com.togethersoft.openapi.util.properties.IPropertiesRO ipropertiesro)
{
a = ipropertiesro;
}
}
private static class zq extends zp
{
public java.lang.String getStringFeature(java.lang.String s1)
{
if(s1.equals("license.edition"))
return "whiteboard";
else
return null;
}
public java.lang.Boolean b(java.lang.String s1)
{
return null;
}
private zq()
{
}
public zq(zay zay1)
{
this();
}
}
static class zw
{
public int a;
public java.lang.String b;
public int c;
public java.lang.String d;
public zw()
{
a = -1;
b = null;
c = 1;
d = null;
}
}
public zo()
{
q = false;
r = false;
s = null;
t = null;
u = new zq(null);
v = new zq(null);
w = null;
x = new zr(this);
try
{
o = new zu();
o.start();
}
catch(java.lang.Throwable throwable) { }
}
public int a(java.lang.String s1)
{
int i1 = 1;
try
{
i1 = o.a(s1);
}
catch(java.lang.Throwable throwable)
{
i1 = 1;
}
return i1;
}
public java.lang.String getStringFeature(java.lang.String s1)
{
d();
java.lang.String s2 = u.getStringFeature(s1);
if(s2 == null)
s2 = v.getStringFeature(s1);
if(s1.equals("license.editionTitle") && s != null)
{
if(s2 == null)
s2 = "Together Whiteboard";
s2 = s2 + " (" + s + ")";
}
return s2;
}
public boolean getBooleanFeature(java.lang.String s1)
{
//java.lang.Boolean boolean1 = b(s1);
//return boolean1 != null ? boolean1.booleanValue() : false;
return true;
}
public void setLicensePath(java.lang.String s1)
{
t = s1;
q = false;
d();
}
public boolean isDiagramAllowed(java.lang.String s1)
{
return true;
}
public boolean isLanguageAllowed(java.lang.String s1)
{
return getBooleanFeature("license.language." + s1);
}
public java.awt.event.ActionListener filterAction(java.lang.String s1, java.awt.event.ActionListener actionlistener)
{
return getBooleanFeature(s1) ? actionlistener : x;
}
public java.lang.Boolean b(java.lang.String s1)
{
d();
java.lang.Boolean boolean1 = u.b(s1);
if(boolean1 == null)
boolean1 = v.b(s1);
return boolean1;
}
public void a()
{
/*if(!r)
{
d();
java.lang.String s1 = getStringFeature("license.launch.expiration");
if(!e(s1))
return;
r = true;
}*/
r = true;
}
private void d()
{
if(!q)
{
if(t == null)
{
java.io.File file = new File(com.togethersoft.together.service.application.ApplicationAccess.getApplication().getHomeDirectory(), "bin");
t = file.getAbsolutePath();
}
java.lang.String s1 = "";
try
{
q = true;
zv.f();
//u = a(f(), new zaw(this, u), false);
s1 = "controlcenter";
}
catch(java.lang.Throwable throwable)
{
s1 = null;
}
if(s1 == null)
s1 = "whiteboard";
zp zp1 = v;
if(v == zp1)
v = a(s1, v);
java.lang.String s4 = u.getStringFeature("license.id");
if(s4 == null)
try
{
o.a();
}
catch(java.lang.Throwable throwable1) { }
}
}
public zp a(java.lang.String s1, java.lang.String s2)
{
w = zo.c();
java.lang.Object obj = w.a(s1);
if(s2 != null)
obj = new zaz(this, ((com.togethersoft.openapi.util.properties.IPropertiesRO) (obj)), s2);
if(obj == null)
return null;
za0 za0_1 = new za0(((com.togethersoft.openapi.util.properties.IPropertiesRO) (obj)));
if(za0_1 != null)
{
u = za0_1;
v = za0_1;
}
return za0_1;
}
public void b()
{
if(!p)
{
zp zp1 = a("whiteboard", "");
u = zp1;
v = zp1;
p = true;
}
}
private zp a(zw zw1, zx zx1, boolean flag)
{
if(zw1.c != 0)
return zx1.a(zw1, null);
if(zw1.a > y.length || y[zw1.a] == null)
{
zw1.c = 2;
return zx1.a(zw1, null);
}
//zp zp1 = y[zw1.a].a(zw1);
zp zp1 = v;
if(zp1 == null)
return zx1.a(zw1, zp1);
if(!flag)
{
java.lang.Boolean boolean1 = zp1.b("license.default");
if(boolean1 != null && boolean1.booleanValue())
{
zw1.c = 2;
return zx1.a(zw1, zp1);
}
java.lang.String s1 = zp1.getStringFeature("license.lastUpdate");
if(s1 == null || !d(s1))
{
zw1.c = 4;
return zx1.a(zw1, zp1);
}
java.lang.String s2 = zp1.getStringFeature("license.expiration");
if(s2 == null || !e(s2))
{
zw1.c = 3;
return zx1.a(zw1, zp1);
}
try
{
int i1 = 3;
int j1 = java.lang.Integer.parseInt("5.5".substring(0, "5.5".indexOf('.')));
java.lang.String s3 = zp1.getStringFeature("license.version.major");
if(s3 != null)
i1 = java.lang.Integer.parseInt(s3);
if(i1 < j1)
{
zw1.c = 6;
return zx1.a(zw1, zp1);
}
}
catch(java.lang.NumberFormatException numberformatexception)
{
zw1.c = 6;
return zx1.a(zw1, zp1);
}
}
return zx1.a(zw1, zp1);
}
private boolean c(java.lang.String s1)
{
java.util.StringTokenizer stringtokenizer = new StringTokenizer("5.5", ".");
for(java.util.StringTokenizer stringtokenizer1 = new StringTokenizer(s1, "."); stringtokenizer.hasMoreElements() && stringtokenizer1.hasMoreElements();)
{
java.lang.String s2 = stringtokenizer.nextToken();
java.lang.String s3 = stringtokenizer1.nextToken();
if(s3.equalsIgnoreCase("x"))
return true;
try
{
int i1 = java.lang.Integer.parseInt(s2);
int j1 = java.lang.Integer.parseInt(s3);
if(j1 > i1)
return true;
if(j1 < i1)
return false;
}
catch(java.lang.NumberFormatException numberformatexception)
{
return false;
}
}
return true;
}
private boolean d(java.lang.String s1)
{
java.util.Date date = f(s1);
if(date == null)
{
return false;
} else
{
java.util.Date date1 = zo.e();
return !date1.after(date);
}
}
private boolean e(java.lang.String s1)
{
java.util.Date date = f(s1);
if(date == null)
{
return false;
} else
{
java.util.Date date1 = new Date();
java.util.GregorianCalendar gregoriancalendar = new GregorianCalendar();
gregoriancalendar.setTime(date1);
gregoriancalendar.set(11, 0);
gregoriancalendar.set(12, 0);
gregoriancalendar.set(13, 0);
gregoriancalendar.set(14, 0);
date1 = gregoriancalendar.getTime();
return !date1.after(date);
}
}
private java.util.Date f(java.lang.String s1)
{
try
{
//if(s1.toLowerCase().equals("forever"))
return (new GregorianCalendar(2200, 1, 1)).getTime();
}
catch(java.lang.Throwable throwable)
{
return null;
}
}
private static java.util.Date e()
{
return (new GregorianCalendar(zcx9.e[2], zcx9.e[1] - 1, zcx9.e[0])).getTime();
}
private static java.lang.String a(java.util.Date date, int i1, int j1)
{
java.util.GregorianCalendar gregoriancalendar = new GregorianCalendar();
gregoriancalendar.setTime(date);
gregoriancalendar.add(i1, j1);
java.lang.StringBuffer stringbuffer = new StringBuffer();
stringbuffer.append(gregoriancalendar.get(2));
stringbuffer.append("/");
stringbuffer.append(gregoriancalendar.get(5));
stringbuffer.append("/");
stringbuffer.append(gregoriancalendar.get(1));
return stringbuffer.toString();
}
private zw f()
{
java.io.File file = new File(t);
zw zw1 = new zw();
zw1.d = file.getAbsolutePath();
if(file.isDirectory())
{
java.lang.String as[] = file.list();
java.lang.String s1 = null;
java.lang.Object obj = null;
if(as != null)
{
for(int i1 = 0; i1 < as.length; i1++)
if(as[i1].toLowerCase().endsWith(".tg"))
{
java.io.File file1 = new File(file, as[i1]);
if(file1.exists() && file1.isFile())
{
java.lang.Object obj1 = a(file1);
if(a(obj1, obj))
{
s1 = as[i1];
obj = obj1;
}
}
}
}
if(s1 != null)
{
file = new File(file, s1);
zw1.d = file.getAbsolutePath();
} else
{
zw1.d += java.io.File.separator + "*." + "tg";
}
}
if(!file.exists() || !file.isFile())
{
zw1.c = 1;
return zw1;
} else
{
return a(zw1, file);
}
}
private java.lang.Object a(java.io.File file)
{
zw zw1 = new zw();
a(zw1, file);
zp zp1 = a(zw1, ((zx) (new zy(null))), false);
zz zz1 = new zz(file, zp1);
java.lang.String s1 = zp1.getStringFeature("license.hostid");
if(!zv.a().c(s1))
{
i = true;
return null;
}
java.lang.String s2 = zp1.getStringFeature("license.id");
java.lang.String s3 = zp1.getStringFeature("license.numofinstances");
int i1 = 2;
try
{
i1 = java.lang.Integer.parseInt(s3);
}
catch(java.lang.Throwable throwable)
{
i1 = 2;
}
java.lang.String s4 = o.b();
int j1 = a(s2);
if(j1 > i1)
{
k = s2;
m = i1;
j = true;
o.b(s4);
return null;
} else
{
return zz1;
}
}
private boolean a(java.lang.Object obj, java.lang.Object obj1)
{
if(obj == null && obj1 == null)
return false;
if(obj != null)
return ((zz)obj).a(obj1) > 0;
else
return ((zz)obj1).a(obj) < 0;
}
private zw g(java.lang.String s1)
{
zw zw1 = new zw();
zw1.d = s1 + "." + "tg";
java.net.URL url = getClass().getResource("/" + zw1.d);
if(url == null && !s1.equals("whiteboard"))
{
zw1.d = "whiteboard.tg";
url = getClass().getResource("/" + zw1.d);
}
if(url == null)
{
zw1.c = 1;
a(zw1, true);
return zw1;
}
zw1.d = url.toString();
java.io.BufferedInputStream bufferedinputstream = null;
try
{
try
{
bufferedinputstream = new BufferedInputStream(url.openStream());
zw zw2 = a(zw1, bufferedinputstream);
return zw2;
}
catch(java.io.IOException ioexception)
{
zw1.c = 1;
}
zw zw3 = zw1;
return zw3;
}
finally
{
if(bufferedinputstream != null)
try
{
bufferedinputstream.close();
}
catch(java.io.IOException ioexception1) { }
}
}
private zw a(zw zw1, java.io.File file)
{
java.io.BufferedInputStream bufferedinputstream = null;
try
{
try
{
bufferedinputstream = new BufferedInputStream(new FileInputStream(file));
zw zw2 = a(zw1, ((java.io.InputStream) (bufferedinputstream)));
return zw2;
}
catch(java.io.IOException ioexception)
{
zw1.c = 1;
}
zw zw3 = zw1;
return zw3;
}
finally
{
if(bufferedinputstream != null)
try
{
bufferedinputstream.close();
}
catch(java.io.IOException ioexception1) { }
}
}
private zw a(zw zw1, java.io.InputStream inputstream)
throws java.io.IOException
{
java.lang.String s1 = null;
java.io.InputStreamReader inputstreamreader = new InputStreamReader(inputstream, "8859_1");
java.lang.StringBuffer stringbuffer = new StringBuffer(inputstream.available());
for(int i1 = inputstreamreader.read(); i1 >= 0; i1 = inputstreamreader.read())
stringbuffer.append((char)i1);
s1 = stringbuffer.toString();
int j1 = s1.indexOf(";");
if(j1 <= 0)
{
zw1.c = 2;
return zw1;
}
try
{
java.lang.String s2 = s1.substring(0, j1);
int k1 = s2.indexOf(".");
if(k1 >= 0)
s2 = s2.substring(0, k1);
zw1.a = java.lang.Integer.parseInt(s2);
zw1.b = s1.substring(j1 + 1);
}
catch(java.lang.NumberFormatException numberformatexception)
{
zw1.c = 2;
return zw1;
}
if(zw1.a < 0)
{
zw1.c = 2;
return zw1;
} else
{
zw1.c = 0;
return zw1;
}
}
private void a(zw zw1, boolean flag)
{
java.lang.String s1 = "License file found: " + zw1.d + " ";
switch(zw1.c)
{
case 0: // '\0'
s1 = null;
break;
case 1: // '\001'
s1 = null;
break;
case 2: // '\002'
s = "License Corrupted";
s1 = s1 + "License is corrupted.";
break;
case 3: // '\003'
s = "Evaluation Expired";
s1 = s1 + "License is expired.";
break;
case 4: // '\004'
s1 = s1 + "License is not valid for this product build.";
break;
case 5: // '\005'
s = "License Corrupted";
s1 = s1 + "License type is unknown.";
break;
}
if(flag)
s1 = null;
if(s1 != null && "Standalone".equals(ze.a().getVersionName()))
com.togethersoft.openapi.ide.message.IdeMessageManagerAccess.printMessage(1, s1);
}
private zp a(java.lang.String s1, zp zp1)
{
if(w == null)
w = zo.c();
com.togethersoft.openapi.util.properties.IPropertiesRO ipropertiesro = w.a(s1);
if(ipropertiesro == null)
return zp1;
else
return new za0(ipropertiesro);
}
public static zax c()
{
java.util.Hashtable hashtable = new Hashtable();
for(int i1 = 0; i1 < zcya.b.length; i1++)
{
for(int j1 = 0; j1 < zcya.b[i1][0].length; j1++)
{
java.lang.String s1 = zcya.b[i1][0][j1];
for(int k1 = 1; k1 < zcya.b[i1].length; k1++)
{
java.lang.String s2 = zcya.b[i1][k1][0];
java.lang.String s3 = zcya.b[i1][k1][1];
java.lang.Object obj = (com.togethersoft.openapi.util.properties.IProperties)hashtable.get(s2);
if(obj == null)
{
obj = new DictionaryProperties();
((com.togethersoft.openapi.util.properties.IProperties) (obj)).putProperty("license.edition", s2);
hashtable.put(s2, obj);
}
((com.togethersoft.openapi.util.properties.IProperties) (obj)).putProperty(s1, s3);
}
}
}
return new zay(hashtable);
}
public static void a(zo zo1, zw zw1, boolean flag)
{
zo1.a(zw1, flag);
}
public static final int a = 0;
public static final int b = 1;
public static final int c = 2;
public static final int d = 3;
public static final int e = 4;
public static final int f = 5;
public static final int g = 6;
public static final boolean h = true;
public static boolean i = false;
public static boolean j = false;
public static java.lang.String k = "";
public static final int l = 2;
public static int m = 2;
public static final java.lang.String n = "tg";
public zu o;
public static boolean p = false;
public boolean q;
public boolean r;
public java.lang.String s;
public java.lang.String t;
public zp u;
public zp v;
public zax w;
public java.awt.event.ActionListener x;
public zt y[] = {null, null, null, new zs()};
}