diff --git a/src/main/java/pdd/vm/VmMain.java b/src/main/java/pdd/vm/VmMain.java index 030d465..0b7fa77 100644 --- a/src/main/java/pdd/vm/VmMain.java +++ b/src/main/java/pdd/vm/VmMain.java @@ -8,9 +8,15 @@ public class VmMain { public static void main(String[] args) throws IOException { - if (args.length < 2) { + if (args.length < 1) { System.err.println("mw.bin dest.jar"); } - MwBin.toClassesJar(new File(args[0]), new File(args[1])); + File dest; + if(args.length<2){ + dest=new File("out.jar"); + }else { + dest=new File(args[1]); + } + MwBin.toClassesJar(new File(args[0]), dest); } } diff --git a/src/test/java/VmTest.java b/src/test/java/VmTest.java index f5cb7d5..06f320a 100644 --- a/src/test/java/VmTest.java +++ b/src/test/java/VmTest.java @@ -1,18 +1,15 @@ import org.junit.jupiter.api.Test; -import pdd.vm.mw.MwBin; -import java.io.File; import java.io.IOException; -import java.io.InputStream; public class VmTest { @Test public void testParse() throws IOException { // final FieldRefTypeSet fieldSet = new FieldRefTypeSet(); // fieldSet.loadFromAndroidSdk(); - final InputStream input = getClass().getResourceAsStream("/mw1.bin"); - final File file = new File("/home/mao/mytest/alive.jar"); - if (!file.getParentFile().exists()) file.getParentFile().mkdirs(); - MwBin.toClassesJar(input, file); +// final InputStream input = getClass().getResourceAsStream("/mw1.bin"); +// final File file = new File("/home/mao/mytest/alive.jar"); +// if (!file.getParentFile().exists()) file.getParentFile().mkdirs(); +// MwBin.toClassesJar(input, file); } } diff --git a/src/test/resources/mw1.bin b/src/test/resources/mw1.bin deleted file mode 100644 index bcea332..0000000 Binary files a/src/test/resources/mw1.bin and /dev/null differ