*** empty log message ***

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@161 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 48875572ac
commit ce88f5d583
  1. 17
      jode/jode/Decompiler.java
  2. 55
      jode/jode/JodeApplet.java
  3. 4
      jode/jode/decompiler/CodeAnalyzer.java
  4. 6
      jode/jode/decompiler/ImportHandler.java

@ -24,7 +24,8 @@ public class Decompiler {
public final static String version = "0.99";
public final static String email = "jochen@gnu.org";
public final static String copyright =
"Jode Copyright 1998,1999 Jochen Hoenicke <"+email+">";
"Jode (c) 1998,1999 Jochen Hoenicke <"+email+">";
public static PrintStream err = System.err;
public static boolean isVerbose = false;
public static boolean isDebugging = false;
public static boolean isTypeDebugging = false;
@ -39,8 +40,8 @@ public class Decompiler {
public static int importClassLimit = 3;
public static void usage() {
System.err.println("Version: " + version);
System.err.println("use: jode [-v][--dest <destdir>]"
err.println("Version: " + version);
err.println("use: jode [-v][--dest <destdir>]"
+"[--imm][--debug][--analyze][--flow]"
+"[--type][--inout][--lvt][--check]"
+"[--import <pkglimit> <clslimit>]"
@ -52,7 +53,7 @@ public class Decompiler {
int i;
String classPath = System.getProperty("java.class.path");
File destDir = null;
System.err.println(copyright);
err.println(copyright);
for (i=0; i<params.length && params[i].startsWith("-"); i++) {
if (params[i].equals("-v"))
isVerbose = true;
@ -86,7 +87,7 @@ public class Decompiler {
break;
} else {
if (!params[i].startsWith("-h"))
System.err.println("Unknown option: "+params[i]);
err.println("Unknown option: "+params[i]);
usage();
return;
}
@ -110,9 +111,9 @@ public class Decompiler {
}
env.doClass(params[i], writer);
} catch (IOException ex) {
System.out.println("Can't write source of "+params[i]+".");
System.out.println("Make sure that all directories exist.");
ex.printStackTrace();
err.println("Can't write source of "+params[i]+".");
err.println("Make sure that all directories exist.");
ex.printStackTrace(err);
}
}
}

@ -4,64 +4,19 @@ import java.awt.*;
import java.awt.event.*;
import java.io.*;
public class JodeApplet extends Applet implements ActionListener, Runnable {
TextField classpathField;
TextField classField;
TextArea sourcecodeField;
Thread decompileThread;
public class JodeApplet extends Applet {
JodeWindow jodeWin;
public JodeApplet() {
setLayout(new BorderLayout());
Panel optionPanel = new Panel();
optionPanel.setLayout(new GridLayout(2,2));
optionPanel.add(new Label("class path: "));
classpathField = new TextField();
optionPanel.add(classpathField);
optionPanel.add(new Label("class name: "));
classField = new TextField();
optionPanel.add(classField);
add(optionPanel, BorderLayout.NORTH);
sourcecodeField = new TextArea();
add(sourcecodeField, BorderLayout.CENTER);
classField.addActionListener(this);
}
public synchronized void actionPerformed(ActionEvent e) {
if (decompileThread == null) {
decompileThread = new Thread(this);
sourcecodeField.setText("Please wait, while decompiling...\n");
decompileThread.start();
} else
sourcecodeField.append("Be a little bit more patient, please.\n");
jodeWin = new JodeWindow(this);
}
public void init() {
String cp = getParameter("classpath");
if (cp != null)
classpathField.setText(cp);
jodeWin.setClasspath(cp);
String cls = getParameter("class");
if (cls != null)
classField.setText(cls);
}
public void run() {
JodeEnvironment env = new JodeEnvironment(classpathField.getText());
ByteArrayOutputStream out = new ByteArrayOutputStream();
try {
TabbedPrintWriter writer = new TabbedPrintWriter(out, " ");
env.doClass(classField.getText(), writer);
sourcecodeField.setText(out.toString());
} catch (Throwable t) {
sourcecodeField.setText("Didn't succeed.\n"
+"Check the java console for more info.");
t.printStackTrace();
} finally {
synchronized(this) {
decompileThread = null;
}
}
jodeWin.setClass(cls);
}
}

@ -130,7 +130,7 @@ public class CodeAnalyzer implements Analyzer {
= Opcodes.readOpcode(cpool, addr, stream, this);
if (jode.Decompiler.isVerbose && addr > mark) {
System.err.print('.');
Decompiler.err.print('.');
mark += 1000;
}
@ -174,7 +174,7 @@ public class CodeAnalyzer implements Analyzer {
}
if (Decompiler.isVerbose)
System.err.print('-');
Decompiler.err.print('-');
excHandlers.analyze();
methodHeader = instr[0];

@ -155,7 +155,7 @@ public class JodeEnvironment {
}
public void error(String message) {
System.err.println(message);
Decompiler.err.println(message);
}
public void doClass(String className, TabbedPrintWriter writer)
@ -165,11 +165,11 @@ public class JodeEnvironment {
try {
clazz = ClassInfo.forName(className);
} catch (IllegalArgumentException ex) {
System.err.println("`"+className+"' is not a class name");
Decompiler.err.println("`"+className+"' is not a class name");
return;
}
System.err.println(className);
Decompiler.err.println(className);
int pkgdelim = className.lastIndexOf('.');
pkg = (pkgdelim == -1)? "" : className.substring(0, pkgdelim);

Loading…
Cancel
Save