save table in properties

readTable implemented


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@286 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent cc2d7294c0
commit ca4f3f9cae
  1. 17
      jode/jode/obfuscator/ClassBundle.java

@ -72,12 +72,24 @@ public class ClassBundle {
} }
public void readTable(String filename) { public void readTable(String filename) {
Properties prop = new Properties();
try {
InputStream input = new FileInputStream(filename);
prop.load(input);
input.close();
} catch (java.io.IOException ex) {
Obfuscator.err.println("Can't read rename table "+filename);
ex.printStackTrace();
}
basePackage.readTable(prop);
} }
public void writeTable(String filename) { public void writeTable(String filename) {
Properties prop = new Properties();
basePackage.writeTable(prop);
try { try {
PrintWriter out = new PrintWriter(new FileOutputStream(filename)); OutputStream out = new FileOutputStream(filename);
basePackage.writeTable(out); prop.save(out, "Reverse renaming table");
out.close(); out.close();
} catch (java.io.IOException ex) { } catch (java.io.IOException ex) {
Obfuscator.err.println("Can't write rename table "+filename); Obfuscator.err.println("Can't write rename table "+filename);
@ -90,6 +102,7 @@ public class ClassBundle {
if (!directory.exists()) { if (!directory.exists()) {
Obfuscator.err.println("Destination directory " Obfuscator.err.println("Destination directory "
+directory.getPath()+" doesn't exists."); +directory.getPath()+" doesn't exists.");
return;
} }
basePackage.storeClasses(new File(destination)); basePackage.storeClasses(new File(destination));
} }

Loading…
Cancel
Save