|
|
@ -20,6 +20,7 @@ |
|
|
|
package jode; |
|
|
|
package jode; |
|
|
|
import java.io.*; |
|
|
|
import java.io.*; |
|
|
|
import jode.bytecode.ClassInfo; |
|
|
|
import jode.bytecode.ClassInfo; |
|
|
|
|
|
|
|
import jode.bytecode.InnerClassInfo; |
|
|
|
import jode.decompiler.*; |
|
|
|
import jode.decompiler.*; |
|
|
|
import java.util.zip.ZipOutputStream; |
|
|
|
import java.util.zip.ZipOutputStream; |
|
|
|
import java.util.zip.ZipEntry; |
|
|
|
import java.util.zip.ZipEntry; |
|
|
@ -92,6 +93,18 @@ public class Decompiler { |
|
|
|
"use --debug=help for more information."); |
|
|
|
"use --debug=help for more information."); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static boolean skipClass(ClassInfo clazz) { |
|
|
|
|
|
|
|
InnerClassInfo[] outers = clazz.getOuterClasses(); |
|
|
|
|
|
|
|
if (outers != null) { |
|
|
|
|
|
|
|
if (outers[0].outer == null) { |
|
|
|
|
|
|
|
return ((Decompiler.options & Decompiler.OPTION_ANON) != 0); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return ((Decompiler.options & Decompiler.OPTION_INNER) != 0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] params) { |
|
|
|
public static void main(String[] params) { |
|
|
|
int i; |
|
|
|
int i; |
|
|
|
String classPath = System.getProperty("java.class.path"); |
|
|
|
String classPath = System.getProperty("java.class.path"); |
|
|
@ -204,6 +217,8 @@ public class Decompiler { |
|
|
|
("`"+params[i]+"' is not a class name"); |
|
|
|
("`"+params[i]+"' is not a class name"); |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (skipClass(clazz)) |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
|
|
String filename = |
|
|
|
String filename = |
|
|
|
params[i].replace('.', File.separatorChar)+".java"; |
|
|
|
params[i].replace('.', File.separatorChar)+".java"; |
|
|
@ -222,14 +237,10 @@ public class Decompiler { |
|
|
|
imports); |
|
|
|
imports); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
imports.init(params[i]); |
|
|
|
|
|
|
|
GlobalOptions.err.println(params[i]); |
|
|
|
GlobalOptions.err.println(params[i]); |
|
|
|
|
|
|
|
|
|
|
|
ClassAnalyzer clazzAna = new ClassAnalyzer(clazz, imports); |
|
|
|
ClassAnalyzer clazzAna = new ClassAnalyzer(clazz, imports); |
|
|
|
clazzAna.analyze(); |
|
|
|
clazzAna.dumpJavaFile(writer); |
|
|
|
|
|
|
|
|
|
|
|
imports.dumpHeader(writer); |
|
|
|
|
|
|
|
clazzAna.dumpSource(writer); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (destZip != null) { |
|
|
|
if (destZip != null) { |
|
|
|
writer.flush(); |
|
|
|
writer.flush(); |
|
|
|