home *** CD-ROM | disk | FTP | other *** search
Wrap
import com.ibm.bobby.aa; import com.ibm.bobby.au; import com.ibm.bobby.bs; import com.ibm.bobby.r; import com.ibm.jax.e; import com.ibm.jax.l; import com.ibm.jax.m; import com.ibm.jax.o; import com.ibm.jax.q; import java.io.DataInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Date; import java.util.StringTokenizer; public class jax { // $FF: renamed from: m com.ibm.jax.o public static o field_0; // $FF: renamed from: l java.lang.String public static String field_1; static { boolean var10000 = false; var10000 = false; } // $FF: renamed from: e (java.lang.String) void public static void method_0(String var0) { field_0.e(var0); } // $FF: renamed from: f (java.lang.String) void public static void method_1(String var0) { field_0.f(var0); } // $FF: renamed from: d (java.lang.String) void public static void method_2(String var0) { field_0.d(var0); } // $FF: renamed from: t (java.lang.String, boolean) void public static void method_3(String var0, boolean var1) { if (var1 || !var0.startsWith("java.") && !var0.startsWith("sun.") && (!var0.startsWith("sunw.") || !var0.startsWith("com.ms."))) { try { aa.e1(var0); } catch (NoClassDefFoundError var3) { field_0.h("cannot find class " + ((Throwable)var3).getMessage()); } } } // $FF: renamed from: u () void public static void method_4() { try { FileInputStream var0 = new FileInputStream(new File(field_1 + ".daf")); DataInputStream var1 = new DataInputStream(var0); int var2 = 1; while(true) { String var3 = var1.readLine(); if (var3 == null) { return; } var3 = var3.trim(); if (var3.length() != 0 && Character.isJavaIdentifierStart(var3.charAt(0))) { StringTokenizer var4 = new StringTokenizer(var3, " "); String var5 = (String)var4.nextElement(); String var6 = (String)var4.nextElement(); String var7 = (String)var4.nextElement(); m var8; try { var8 = (m)aa.eq(var5, var6, var7); } catch (Exception var10) { var8 = null; } if (var8 == null) { field_0.h("file \"" + field_1 + ".daf\" at line " + var2 + " no such field found: " + var5 + "." + var6 + " " + var7); } else { method_1("readDynamicallyAccessedFieldNames: read \"" + var5 + "." + var6 + " " + var7 + "\""); var8.dj(); } ++var2; } } } catch (FileNotFoundException var11) { field_0.h("no \"" + field_1 + ".daf\" file with names of dynamically accessed fields\n"); } catch (IOException var12) { field_0.h("error reading \"" + field_1 + ".daf\" file.\n"); } } // $FF: renamed from: v () void public static void method_5() { try { FileInputStream var0 = new FileInputStream(new File(field_1 + ".dim")); DataInputStream var1 = new DataInputStream(var0); int var2 = 1; while(true) { String var3 = var1.readLine(); if (var3 == null) { return; } var3 = var3.trim(); if (var3.length() != 0 && Character.isJavaIdentifierStart(var3.charAt(0))) { StringTokenizer var4 = new StringTokenizer(var3, " "); String var5 = (String)var4.nextElement(); String var6 = (String)var4.nextElement(); String var7 = (String)var4.nextElement(); l var8; try { var8 = (l)aa.es(var5, var6, var7); } catch (Exception var10) { var8 = null; } if (var8 == null) { field_0.h("file \"" + field_1 + ".dim\" at line " + var2 + " no such method found: " + var5 + "." + var6 + " " + var7); } else { method_1("readDynamicallyCalledMethodNames: read \"" + var5 + "." + var6 + var7 + "\""); var8.dj(); } ++var2; } } } catch (FileNotFoundException var11) { field_0.h("no \"" + field_1 + ".dim\" file with names of dynamically invoked methods"); } catch (IOException var12) { field_0.h("error reading \"" + field_1 + ".dim\" file.\n"); } } // $FF: renamed from: w () void public static void method_6() { try { FileInputStream var0 = new FileInputStream(new File(field_1 + ".dlc")); DataInputStream var1 = new DataInputStream(var0); int var2 = 1; while(true) { String var3 = var1.readLine(); if (var3 == null) { return; } method_3(var3, true); q var4 = null; try { var4 = (q)aa.e1(var3); } catch (NoClassDefFoundError var6) { field_0.h("at line " + var2 + " in file " + field_1 + ".dlc, cannot find class \"" + ((Throwable)var6).getMessage() + "\""); } if (var4 == null) { ++var2; } else { o var10000 = field_0; boolean var10001 = true; method_1("Found dynamically loaded class \"" + ((au)var4).gg() + "\""); var4.dj(); ++var2; } } } catch (FileNotFoundException var7) { field_0.h("no \"" + field_1 + ".dlc\" file with dynamically loaded class names"); } catch (IOException var8) { field_0.h("error reading \"" + field_1 + ".dlc\" file.\n"); } } // $FF: renamed from: x () com.ibm.bobby.r public static r method_7() { r var0 = new r(); try { FileInputStream var1 = new FileInputStream(new File(field_1 + ".inc")); DataInputStream var2 = new DataInputStream(var1); int var4 = 1; while(true) { String var5 = var2.readLine(); if (var5 == null) { break; } String var3; if (var5.startsWith("include ")) { var3 = "I"; } else { if (!var5.startsWith("exclude ")) { field_0.h("at line " + var4 + " in file " + field_1 + ".inc, line does not start with \"include\" or \"exclude\""); ++var4; continue; } var3 = "E"; } var3 = var3 + var5.substring(8); if (var3.endsWith("*")) { var3 = var3.substring(0, var3.length() - 1); } else { field_0.h("at line " + var4 + " in file " + field_1 + ".inc, line does not end with \"*\""); } var0.cx(var3); ++var4; } } catch (FileNotFoundException var6) { field_0.h("no \"" + field_1 + ".inc\" file with include/exclude package prefixes"); } catch (IOException var7) { field_0.h("error reading \"" + field_1 + ".inc\" file.\n"); } return var0.ct() ? null : var0; } // $FF: renamed from: y () void private static void method_8() { method_2("\n" + "\n" + "" + "jax" + " generates two files:\n\n" + " \"<class name>." + "jax" + ".zip\" containing the compressed program.\n" + " \"<class name>." + "jax" + ".log\" containing the log.\n" + "\n" + "" + "jax" + " looks for 4 optional input files:\n\n" + " (1) Create a file \"<class name>_jax.inc\" in the current \n" + " directory containing a list of the class name prefixes \n" + " for classes that are to be included in or excluded from \n" + " the generated zip file.\n" + " Classes that do not match any in the list will be \n" + " included in the generated zip file.\n" + " Later entries in the list override earlier entries.\n" + " Each line must begin with the word \"include\" or \n" + " \"exclude\" and end with a \"*\".\n" + " Example:\n" + " \n" + " exclude java.* \n" + " exclude sun.* \n" + " exclude com.ms.* \n" + " exclude sunw.hot* \n" + " include myStuff.* \n" + " exclude myStuff.keepout.* \n" + " If this file is omitted, classes with a package prefix of \n" + " java, sun, com.ms are excluded. \n" + " Example:\n" + " \n" + " (2) Create a file \"<class name>_jax.dlc\" in the current \n" + " directory containing the names of all the \n" + " classes that are loaded dynamically.\n" + " Example:\n" + " \n" + " com.acme.ClassOne\n" + " com.acme.ClassTwo\n" + " com.acme.ClassThree\n" + " \n" + " (3) Create a file \"<class name>_jax.dim\" in the current \n" + " directory containing the names of all the \n" + " methods that are called using reflection\n" + " Pattern: <classname> <methodname> " + " <descriptor> using JVM types.\n" + " Example:\n" + " \n" + " com.acme.ClassFour specialMethod1 (I)V\n" + " com.acme.ClassFour specialMethod2 (III)I\n" + " com.acme.ClassFour <init> " + "(Ljava/lang/Object;)V\n" + " \n" + " (4) Create a file \"<class name>_jax.daf\" in the current \n" + " directory containing the names of all the \n" + " fields that are accessed using reflection\n" + " Pattern: <classname> <fieldname> " + " <descriptor> using JVM types.\n" + " Example:\n" + " \n" + " com.acme.ClassFive specialField1 (I)V\n" + " com.acme.ClassSix specialField2 (III)I\n" + " com.acme.ClassSeven specialField3 " + "Ljava/lang/Object;\n" + " \n" + "\n" + "Use the enclosed \"reflect\" program to \n" + "find all classes, methods, and fields that are.\n" + "accessed using reflection.\n" + "Example:\n" + " \n" + " java reflect MyApplet.zip\n" + " \n" + "\n" + "Use the enclosed \"methods\" and \"fields\" programs to \n" + "get a listing of available methods and fields.\n" + "Example:\n" + " \n" + " java methods java.lang.String\n" + " java fields java.lang.String\n" + " \n" + "See http://www.alphaWorks.ibm.com/formula/jax and the\n" + "documentation distributed with JAX for more information.\n" + ""); } // $FF: renamed from: s () void private static void method_9() { method_2("\n" + "Usage: " + "jax" + " [<-options>] <class name>\n" + " Where:\n" + " <class name>: the starting class name\n" + " <-options> are:\n" + " -version: show version number\n" + " -help: show help information\n" + "" + " -notransform: don't merge/eliminate classes\n" + " -noinline: don't inline methods\n" + " -nodevirtualize: don't make virtual method calls nonvirtual\n" + " -noobfuscate: don't shorten internal names\n" + " -keeppackagenames: keep the package structure when obfuscating\n" + " -noverify: don't verify the compressed application\n" + " -nocompatibleserialization: don't preserve (de)serialization " + "compatibility \n" + " between original/JAXed versions of the " + "application\n" + "" + "\n"); method_2(" debug options:\n" + " -ta: trace type analysis\n" + " -to: trace optimization\n" + " -daXXX: debug type analysis of method XXX\n" + " -doXXX: debug optimization of method XXX\n" + "\n"); System.exit(1); } // $FF: renamed from: z () void public static void method_10() { method_1(""); method_1("Java Execution Environment Information:"); method_1("================================================================="); method_1("creation time = " + new Date()); method_1("os.name = " + System.getProperty("os.name")); method_1("os.arch = " + System.getProperty("os.arch")); method_1("os.version = " + System.getProperty("os.version")); method_1("java.version = " + System.getProperty("java.version")); method_1("java.vendor = " + System.getProperty("java.vendor")); method_1("java.vendor.url = " + System.getProperty("java.vendor.url")); method_1("java.class.version = " + System.getProperty("java.class.version")); method_1("java.class.path = " + System.getProperty("java.class.path")); method_1("java.home = " + System.getProperty("java.home")); method_1("java_compiler = " + System.getProperty("java.compiler")); method_1("================================================================="); method_1(""); } // $FF: renamed from: aa () void public static void method_11() { method_0("\nOptions: " + (field_0.bp ? "obfuscate " : "noobfuscate ") + (field_0.bo ? "keeppackagenames " : "nokeeppackagenames ") + (field_0.bn ? "transform " : "notransform ") + (field_0.bl ? "verify " : "") + (field_0.bm ? "devirtualize " : "nodevirtualize ") + "" + (field_0.bj ? "inline " : "noinline ") + (field_0.bi ? "compatibleserialization " : "nocompatibleserialization ") + "\n"); } // $FF: renamed from: ab () void public static void method_12() { Date var0 = new Date(); Date var1 = new Date("Jul 28 1999"); if (var0.getTime() > var1.getTime()) { method_0(""); method_0("---------------------------------------------------"); method_0("The license for this free software from IBM has"); method_0("expired. A new version with major improvements "); method_0("and bug fixes may have been released. See: "); method_0("http://www.alphaWorks.ibm.com/formula/jax "); method_0("---------------------------------------------------"); method_0(""); } else { method_0(""); method_0("Your free license expires on " + "Jul 28 1999" + ". After this date,"); method_0("download a new version with " + "major improvements and bug fixes."); } } // $FF: renamed from: ac (java.lang.String) void private static void method_13(String var0) { if (var0.equals("version")) { System.out.println("jax V5.3-Wednesday-Apr-28-1999 Copyright IBM 1997-1999. All rights reserved."); System.exit(1); } if (var0.equals("obfuscate")) { field_0.bp = true; } else if (var0.equals("noobfuscate")) { field_0.bp = false; } else if (var0.equals("keeppackagenames")) { field_0.bo = true; } else if (var0.equals("nokeeppackagenames")) { field_0.bo = false; } else { if (var0.equals("help")) { method_8(); System.exit(5); } if (var0.equals("noverify")) { field_0.bl = false; } else if (var0.equals("devirtualize")) { field_0.bm = true; } else if (var0.equals("nodevirtualize")) { field_0.bm = false; } else if (var0.equals("inline")) { field_0.bj = true; } else if (var0.equals("noinline")) { field_0.bj = false; } else if (var0.equals("transform")) { field_0.bn = true; } else if (var0.equals("notransform")) { field_0.bn = false; } else if (var0.equals("compatibleserialization")) { field_0.bi = true; } else if (var0.equals("nocompatibleserialization")) { field_0.bi = false; } else { method_2("*** unknown option \"-" + var0 + "\""); method_9(); } } } // $FF: renamed from: ad (java.lang.String[]) void private static void method_14(String[] var0) { for(int var1 = 0; var1 < var0.length; ++var1) { if (var0[var1].startsWith("-")) { method_13(var0[var1].substring(1)); } else if (field_0.bu == null) { field_0.d4(var0[var1]); } else { method_2("\n*** too many arguments that are not options\n"); method_9(); } } if (field_0.bu == null) { method_2("\n*** Must specify class name\n"); method_9(); } if (field_0.bu.indexOf(File.separator) != -1) { method_2("\nPlease specify class with \".\" separators\n"); method_9(); } if (!field_0.bp && field_0.bo) { method_2("\nSpecified option -keeppackagenames only makes " + "sense when \nused in combination with obfuscation."); method_2("\nPlease do not specify -noobfuscate."); method_9(); } method_2("ProgramName is \"" + field_0.bu + "\""); method_2("JDK used is " + System.getProperty("java.vendor") + " version " + System.getProperty("java.version")); } // $FF: renamed from: ae (java.lang.String[]) void private static void method_15(String[] var0) { field_0 = new o(0); method_14(var0); method_2(""); method_2("jax V5.3-Wednesday-Apr-28-1999 Copyright IBM 1997-1999. All rights reserved."); method_2("More information at: " + "http://www.research.ibm.com/jax"); method_2(""); method_12(); method_1(""); method_1("jax V5.3-Wednesday-Apr-28-1999 Copyright IBM 1997-1999. All rights reserved."); method_1("Info inside IBM: " + "http://w3.watson.ibm.com/~laffra/jax"); method_1("Info outside IBM: " + "http://www.alphaWorks.ibm.com/formula/jax"); method_1(""); method_11(); method_10(); long var1 = System.currentTimeMillis(); field_1 = field_0.bt + "_" + "jax"; method_2("loading, this may take a while"); method_2(" "); bs.eh = true; e.bl(field_0, method_7()); method_6(); method_3(field_0.bu, false); method_5(); method_4(); if (aa.b7.ct()) { method_0("\n" + "========================================================\n" + "Jax: could not find class " + field_0.bu + "\n" + "please check your spelling and/or classpath\n" + "========================================================\n" + ""); System.exit(7); } bs.eh = false; System.out.print("\r \r"); method_1(" "); method_0("finished loading, total " + aa.b7.cr() + " classes"); int var3 = 0; int var4 = 0; int var5 = 0; int var6 = 0; for(int var7 = 0; var7 < aa.b7.cr(); ++var7) { bs var8 = aa.b7.cw(var7); if (var8.d3) { ++var4; } else if (var8.ea) { ++var5; } else if (var8.d2) { ++var6; } else { ++var3; } } method_0(" " + var4 + "\tapplication classes"); method_0(" " + var6 + "\tbasic types"); method_0(" " + var5 + "\tarray types"); method_0(" " + var3 + "\texternal classes"); e.ae(var0); field_0.n(field_0.bq); field_0.d2(); long var9 = System.currentTimeMillis(); method_0("\nTime used for analysis: " + (var9 - var1) / 1000L + " seconds.\n"); method_0("\nThanks for using JAX, a technology preview from IBM."); method_0("Please email your feedback to: jax@watson.ibm.com"); method_0(""); System.exit(0); } public static void main(String[] var0) { try { method_15(var0); } catch (Exception var2) { method_1(((Throwable)var2).toString()); ((Throwable)var2).printStackTrace(field_0.bh); System.out.println(((Throwable)var2).toString()); ((Throwable)var2).printStackTrace(System.out); } } }