/* Class491 - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */
import java.applet.Applet;
import java.io.File;
import java.io.FileOutputStream;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;

public class Class491 implements Interface54
{
    Class411 aClass411_6718;
    String aString6719;
    Hashtable aHashtable6720 = new Hashtable();
    Hashtable aHashtable6721 = new Hashtable();
    public static Applet anApplet6722;
    
    public int method6017(String string) throws Exception_Sub4 {
	if (((Class491) this).aHashtable6720.containsKey(string))
	    return 100;
	String string_0_ = Class531.method6525(string, 247790703);
	if (string_0_ == null)
	    throw new Exception_Sub4(1, string);
	String string_1_ = null;
	if (null == string_1_) {
	    string_1_ = new StringBuilder().append
			    (((Class491) this).aString6719).append
			    (string_0_).toString();
	    if (null == ((Class491) this).aClass411_6718
		|| !((Class491) this).aClass411_6718.method5004(string_1_, "",
								1193356782))
		throw new Exception_Sub4(2, string);
	}
	if (!((Class491) this).aClass411_6718.method5008(string_1_,
							 1744562562))
	    return ((Class491) this).aClass411_6718.method5026(string_1_,
							       988345746);
	byte[] is
	    = ((Class491) this).aClass411_6718.method5005(string_1_, "",
							  (short) -10473);
	if (is == null)
	    throw new Exception_Sub4(3, string);
	Object object = null;
	File file;
	try {
	    file = Class44.method868(string_0_, -1950846040);
	} catch (RuntimeException runtimeexception) {
	    throw new Exception_Sub4(4, string, runtimeexception);
	}
	if (null == file)
	    throw new Exception_Sub4(5, string);
	boolean bool = true;
	byte[] is_2_ = Class358.method4456(file, (byte) 1);
	if (is_2_ != null && is.length == is_2_.length) {
	    for (int i = 0; i < is_2_.length; i++) {
		if (is_2_[i] != is[i]) {
		    bool = false;
		    break;
		}
	    }
	} else
	    bool = false;
	if (!bool) {
	    try {
		FileOutputStream fileoutputstream = new FileOutputStream(file);
		fileoutputstream.write(is, 0, is.length);
		fileoutputstream.close();
	    } catch (Throwable throwable) {
		throw new Exception_Sub4(6, string, throwable);
	    }
	}
	method6018(string, file, (byte) 17);
	return 100;
    }
    
    public void method332(String string) throws Exception_Sub5 {
	method6019(string, Class496.class, 1591381180);
    }
    
    void method6018(String string, File file, byte i) {
	((Class491) this).aHashtable6720.put(string, file);
    }
    
    public boolean method331(String string, int i) {
	return ((Class491) this).aHashtable6720.containsKey(string);
    }
    
    void method6019(String string, Class var_class, int i)
	throws Exception_Sub5 {
	Class var_class_3_
	    = (Class) ((Class491) this).aHashtable6721.get(string);
	if (null != var_class_3_
	    && var_class_3_.getClassLoader() != var_class.getClassLoader())
	    throw new Exception_Sub5(1, string);
	File file = null;
	if (null == file)
	    file = (File) ((Class491) this).aHashtable6720.get(string);
	if (file != null) {
	    try {
		file = new File(file.getCanonicalPath());
		Class var_class_4_ = Class.forName("java.lang.Runtime");
		Class var_class_5_
		    = Class.forName("java.lang.reflect.AccessibleObject");
		Method method
		    = var_class_5_.getDeclaredMethod("setAccessible",
						     (new Class[]
						      { Boolean.TYPE }));
		Method method_6_
		    = (var_class_4_.getDeclaredMethod
		       ("load0",
			new Class[] { Class.forName("java.lang.Class"),
				      Class.forName("java.lang.String") }));
		method.invoke(method_6_, new Object[] { Boolean.TRUE });
		method_6_.invoke(Runtime.getRuntime(),
				 new Object[] { var_class, file.getPath() });
		method.invoke(method_6_, new Object[] { Boolean.FALSE });
		((Class491) this).aHashtable6721.put(string, var_class);
	    } catch (NoSuchMethodException nosuchmethodexception) {
		System.load(file.getPath());
		((Class491) this).aHashtable6721.put(string, Class496.class);
	    } catch (Throwable throwable) {
		throw new Exception_Sub5(3, string, throwable);
	    }
	} else
	    throw new Exception_Sub5(4, string);
    }
    
    public boolean method333(short i) {
	Hashtable hashtable = new Hashtable();
	Enumeration enumeration = ((Class491) this).aHashtable6721.keys();
	while (enumeration.hasMoreElements()) {
	    String string = (String) enumeration.nextElement();
	    hashtable.put(string,
			  ((Class491) this).aHashtable6721.get(string));
	}
	try {
	    Class var_class
		= Class.forName("java.lang.reflect.AccessibleObject");
	    Class var_class_7_ = Class.forName("java.lang.ClassLoader");
	    Field field = var_class_7_.getDeclaredField("nativeLibraries");
	    Method method
		= var_class.getDeclaredMethod("setAccessible",
					      new Class[] { Boolean.TYPE });
	    method.invoke(field, new Object[] { Boolean.TRUE });
	    try {
		enumeration = ((Class491) this).aHashtable6721.keys();
		while (enumeration.hasMoreElements()) {
		    String string = (String) enumeration.nextElement();
		    try {
			File file
			    = ((File)
			       ((Class491) this).aHashtable6720.get(string));
			Class var_class_8_
			    = ((Class)
			       ((Class491) this).aHashtable6721.get(string));
			Vector vector
			    = ((Vector)
			       field.get(var_class_8_.getClassLoader()));
			for (int i_9_ = 0; i_9_ < vector.size(); i_9_++) {
			    try {
				Object object = vector.elementAt(i_9_);
				Field field_10_
				    = object.getClass()
					  .getDeclaredField("name");
				method.invoke(field_10_,
					      new Object[] { Boolean.TRUE });
				try {
				    String string_11_
					= (String) field_10_.get(object);
				    if (null != string_11_
					&& (string_11_.equalsIgnoreCase
					    (file.getCanonicalPath()))) {
					Field field_12_
					    = object.getClass()
						  .getDeclaredField("handle");
					Method method_13_
					    = (object.getClass()
						   .getDeclaredMethod
					       ("finalize", new Class[0]));
					method.invoke(field_12_,
						      (new Object[]
						       { Boolean.TRUE }));
					method.invoke(method_13_,
						      (new Object[]
						       { Boolean.TRUE }));
					try {
					    method_13_.invoke(object,
							      new Object[0]);
					    field_12_.set(object,
							  new Integer(0));
					    hashtable.remove(string);
					} catch (Throwable throwable) {
					    /* empty */
					}
					method.invoke(method_13_,
						      (new Object[]
						       { Boolean.FALSE }));
					method.invoke(field_12_,
						      (new Object[]
						       { Boolean.FALSE }));
				    }
				} catch (Throwable throwable) {
				    /* empty */
				}
				method.invoke(field_10_,
					      new Object[] { Boolean.FALSE });
			    } catch (Throwable throwable) {
				/* empty */
			    }
			}
		    } catch (Throwable throwable) {
			/* empty */
		    }
		}
	    } catch (Throwable throwable) {
		/* empty */
	    }
	    method.invoke(field, new Object[] { Boolean.FALSE });
	} catch (Throwable throwable) {
	    /* empty */
	}
	((Class491) this).aHashtable6721 = hashtable;
	return ((Class491) this).aHashtable6721.isEmpty();
    }
    
    public void method334(String string, int i) throws Exception_Sub5 {
	method6019(string, Class496.class, 1295378202);
    }
    
    public int method6020(String string, int i) throws Exception_Sub4 {
	if (((Class491) this).aHashtable6720.containsKey(string))
	    return 100;
	String string_14_ = Class531.method6525(string, -1684735783);
	if (string_14_ == null)
	    throw new Exception_Sub4(1, string);
	String string_15_ = null;
	if (null == string_15_) {
	    string_15_ = new StringBuilder().append
			     (((Class491) this).aString6719).append
			     (string_14_).toString();
	    if (null == ((Class491) this).aClass411_6718
		|| !((Class491) this).aClass411_6718.method5004(string_15_, "",
								1032617554))
		throw new Exception_Sub4(2, string);
	}
	if (!((Class491) this).aClass411_6718.method5008(string_15_,
							 1372545812))
	    return ((Class491) this).aClass411_6718.method5026(string_15_,
							       208510833);
	byte[] is
	    = ((Class491) this).aClass411_6718.method5005(string_15_, "",
							  (short) -26408);
	if (is == null)
	    throw new Exception_Sub4(3, string);
	Object object = null;
	File file;
	try {
	    file = Class44.method868(string_14_, -1860312233);
	} catch (RuntimeException runtimeexception) {
	    throw new Exception_Sub4(4, string, runtimeexception);
	}
	if (null == file)
	    throw new Exception_Sub4(5, string);
	boolean bool = true;
	byte[] is_16_ = Class358.method4456(file, (byte) 1);
	if (is_16_ != null && is.length == is_16_.length) {
	    for (int i_17_ = 0; i_17_ < is_16_.length; i_17_++) {
		if (is_16_[i_17_] != is[i_17_]) {
		    bool = false;
		    break;
		}
	    }
	} else
	    bool = false;
	if (!bool) {
	    try {
		FileOutputStream fileoutputstream = new FileOutputStream(file);
		fileoutputstream.write(is, 0, is.length);
		fileoutputstream.close();
	    } catch (Throwable throwable) {
		throw new Exception_Sub4(6, string, throwable);
	    }
	}
	method6018(string, file, (byte) 16);
	return 100;
    }
    
    public void method336(String string) throws Exception_Sub5 {
	method6019(string, Class496.class, 1493228195);
    }
    
    public Class491(Class411 class411) {
	((Class491) this).aClass411_6718 = class411;
	String string = "";
	if (Class470.aString5331.startsWith("win")
	    || Class470.aString5331.startsWith("windows 7"))
	    string = new StringBuilder().append(string).append("windows/")
			 .toString();
	else if (Class470.aString5331.startsWith("linux"))
	    string = new StringBuilder().append(string).append("linux/")
			 .toString();
	else if (Class470.aString5331.startsWith("mac"))
	    string = new StringBuilder().append(string).append("macos/")
			 .toString();
	if (Class470.aString5332.startsWith("amd64")
	    || Class470.aString5332.startsWith("x86_64"))
	    string = new StringBuilder().append(string).append("x86_64/")
			 .toString();
	else if (Class470.aString5332.startsWith("i386")
		 || Class470.aString5332.startsWith("i486")
		 || Class470.aString5332.startsWith("i586")
		 || Class470.aString5332.startsWith("x86"))
	    string
		= new StringBuilder().append(string).append("x86/").toString();
	else if (Class470.aString5332.startsWith("ppc"))
	    string
		= new StringBuilder().append(string).append("ppc/").toString();
	else
	    string = new StringBuilder().append(string).append
			 ("universal/").toString();
	((Class491) this).aString6719 = string;
    }
    
    public boolean method338() {
	Hashtable hashtable = new Hashtable();
	Enumeration enumeration = ((Class491) this).aHashtable6721.keys();
	while (enumeration.hasMoreElements()) {
	    String string = (String) enumeration.nextElement();
	    hashtable.put(string,
			  ((Class491) this).aHashtable6721.get(string));
	}
	try {
	    Class var_class
		= Class.forName("java.lang.reflect.AccessibleObject");
	    Class var_class_18_ = Class.forName("java.lang.ClassLoader");
	    Field field = var_class_18_.getDeclaredField("nativeLibraries");
	    Method method
		= var_class.getDeclaredMethod("setAccessible",
					      new Class[] { Boolean.TYPE });
	    method.invoke(field, new Object[] { Boolean.TRUE });
	    try {
		enumeration = ((Class491) this).aHashtable6721.keys();
		while (enumeration.hasMoreElements()) {
		    String string = (String) enumeration.nextElement();
		    try {
			File file
			    = ((File)
			       ((Class491) this).aHashtable6720.get(string));
			Class var_class_19_
			    = ((Class)
			       ((Class491) this).aHashtable6721.get(string));
			Vector vector
			    = ((Vector)
			       field.get(var_class_19_.getClassLoader()));
			for (int i = 0; i < vector.size(); i++) {
			    try {
				Object object = vector.elementAt(i);
				Field field_20_
				    = object.getClass()
					  .getDeclaredField("name");
				method.invoke(field_20_,
					      new Object[] { Boolean.TRUE });
				try {
				    String string_21_
					= (String) field_20_.get(object);
				    if (null != string_21_
					&& (string_21_.equalsIgnoreCase
					    (file.getCanonicalPath()))) {
					Field field_22_
					    = object.getClass()
						  .getDeclaredField("handle");
					Method method_23_
					    = (object.getClass()
						   .getDeclaredMethod
					       ("finalize", new Class[0]));
					method.invoke(field_22_,
						      (new Object[]
						       { Boolean.TRUE }));
					method.invoke(method_23_,
						      (new Object[]
						       { Boolean.TRUE }));
					try {
					    method_23_.invoke(object,
							      new Object[0]);
					    field_22_.set(object,
							  new Integer(0));
					    hashtable.remove(string);
					} catch (Throwable throwable) {
					    /* empty */
					}
					method.invoke(method_23_,
						      (new Object[]
						       { Boolean.FALSE }));
					method.invoke(field_22_,
						      (new Object[]
						       { Boolean.FALSE }));
				    }
				} catch (Throwable throwable) {
				    /* empty */
				}
				method.invoke(field_20_,
					      new Object[] { Boolean.FALSE });
			    } catch (Throwable throwable) {
				/* empty */
			    }
			}
		    } catch (Throwable throwable) {
			/* empty */
		    }
		}
	    } catch (Throwable throwable) {
		/* empty */
	    }
	    method.invoke(field, new Object[] { Boolean.FALSE });
	} catch (Throwable throwable) {
	    /* empty */
	}
	((Class491) this).aHashtable6721 = hashtable;
	return ((Class491) this).aHashtable6721.isEmpty();
    }
    
    public boolean method155() {
	Hashtable hashtable = new Hashtable();
	Enumeration enumeration = ((Class491) this).aHashtable6721.keys();
	while (enumeration.hasMoreElements()) {
	    String string = (String) enumeration.nextElement();
	    hashtable.put(string,
			  ((Class491) this).aHashtable6721.get(string));
	}
	try {
	    Class var_class
		= Class.forName("java.lang.reflect.AccessibleObject");
	    Class var_class_24_ = Class.forName("java.lang.ClassLoader");
	    Field field = var_class_24_.getDeclaredField("nativeLibraries");
	    Method method
		= var_class.getDeclaredMethod("setAccessible",
					      new Class[] { Boolean.TYPE });
	    method.invoke(field, new Object[] { Boolean.TRUE });
	    try {
		enumeration = ((Class491) this).aHashtable6721.keys();
		while (enumeration.hasMoreElements()) {
		    String string = (String) enumeration.nextElement();
		    try {
			File file
			    = ((File)
			       ((Class491) this).aHashtable6720.get(string));
			Class var_class_25_
			    = ((Class)
			       ((Class491) this).aHashtable6721.get(string));
			Vector vector
			    = ((Vector)
			       field.get(var_class_25_.getClassLoader()));
			for (int i = 0; i < vector.size(); i++) {
			    try {
				Object object = vector.elementAt(i);
				Field field_26_
				    = object.getClass()
					  .getDeclaredField("name");
				method.invoke(field_26_,
					      new Object[] { Boolean.TRUE });
				try {
				    String string_27_
					= (String) field_26_.get(object);
				    if (null != string_27_
					&& (string_27_.equalsIgnoreCase
					    (file.getCanonicalPath()))) {
					Field field_28_
					    = object.getClass()
						  .getDeclaredField("handle");
					Method method_29_
					    = (object.getClass()
						   .getDeclaredMethod
					       ("finalize", new Class[0]));
					method.invoke(field_28_,
						      (new Object[]
						       { Boolean.TRUE }));
					method.invoke(method_29_,
						      (new Object[]
						       { Boolean.TRUE }));
					try {
					    method_29_.invoke(object,
							      new Object[0]);
					    field_28_.set(object,
							  new Integer(0));
					    hashtable.remove(string);
					} catch (Throwable throwable) {
					    /* empty */
					}
					method.invoke(method_29_,
						      (new Object[]
						       { Boolean.FALSE }));
					method.invoke(field_28_,
						      (new Object[]
						       { Boolean.FALSE }));
				    }
				} catch (Throwable throwable) {
				    /* empty */
				}
				method.invoke(field_26_,
					      new Object[] { Boolean.FALSE });
			    } catch (Throwable throwable) {
				/* empty */
			    }
			}
		    } catch (Throwable throwable) {
			/* empty */
		    }
		}
	    } catch (Throwable throwable) {
		/* empty */
	    }
	    method.invoke(field, new Object[] { Boolean.FALSE });
	} catch (Throwable throwable) {
	    /* empty */
	}
	((Class491) this).aHashtable6721 = hashtable;
	return ((Class491) this).aHashtable6721.isEmpty();
    }
    
    public boolean method337(String string) {
	return ((Class491) this).aHashtable6720.containsKey(string);
    }
    
    public void method335(String string) throws Exception_Sub5 {
	method6019(string, Class496.class, -1632173436);
    }
    
    static final void method6021(Class211 class211, Class203 class203,
				 Class612 class612, byte i) {
	class211.anInt2286 = 1569289793;
	class211.anInt2401 = -1445613331 * client.anInt10839;
	class211.anInt2288 = 0;
	if (741091239 * class211.anInt2245 == -1 && !class203.aBool2136)
	    Class590_Sub1_Sub3_Sub1
		.method10574(class211.anInt2393 * -612115075, 1599010705);
    }
    
    static int method6022(int i) {
	int i_30_ = Class611.aClass276_8015.anInt3213 * 835718707;
	if (i_30_ < Class419.aClass276Array4682.length - 1)
	    Class611.aClass276_8015 = Class419.aClass276Array4682[i_30_ + 1];
	return 100;
    }
}
