mirror of
https://github.com/revanced/smali.git
synced 2025-05-06 09:24:33 +02:00
- removed the ability to dump to stdout (issues with the CLI recognizing '-' as a value instead of an option)
- tweaked the version and usage info git-svn-id: https://smali.googlecode.com/svn/trunk@218 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
parent
60188336df
commit
c894b9658c
@ -38,11 +38,6 @@ public class dump {
|
||||
public static void dump(DexFile dexFile, String dumpFileName, String outputDexFileName, boolean sort)
|
||||
throws IOException {
|
||||
|
||||
boolean dumpToStdOut = false;
|
||||
if (dumpFileName != null && dumpFileName.equals("-")) {
|
||||
dumpToStdOut = true;
|
||||
}
|
||||
|
||||
if (sort) {
|
||||
//sort all items, to guarantee a unique ordering
|
||||
dexFile.setSortAllItems(true);
|
||||
@ -65,9 +60,7 @@ public class dump {
|
||||
out.finishAnnotating();
|
||||
FileWriter writer = null;
|
||||
|
||||
if (dumpToStdOut) {
|
||||
out.writeAnnotationsTo(new OutputStreamWriter(System.out));
|
||||
} else {
|
||||
|
||||
try {
|
||||
writer = new FileWriter(dumpFileName);
|
||||
out.writeAnnotationsTo(writer);
|
||||
@ -85,7 +78,6 @@ public class dump {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//rewrite the dex file
|
||||
if (outputDexFileName != null) {
|
||||
|
@ -30,9 +30,10 @@ public class main {
|
||||
|
||||
public static final String VERSION = "0.91";
|
||||
|
||||
private static Options options;
|
||||
private static final Options options;
|
||||
|
||||
static {
|
||||
options = new Options();
|
||||
buildOptions();
|
||||
}
|
||||
|
||||
@ -161,16 +162,13 @@ public class main {
|
||||
* Prints the version message.
|
||||
*/
|
||||
private static void version() {
|
||||
System.out.println("baksmali " + VERSION);
|
||||
System.out.println("baksmali " + VERSION + " (http://smali.googlecode.com)");
|
||||
System.out.println("Copyright (C) 2009 Ben Gruver");
|
||||
System.out.println("License: \"new\" BSD license");
|
||||
System.out.println("http://smali.googlecode.com");
|
||||
System.out.println("BSD license (http://www.opensource.org/licenses/bsd-license.php)");
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
private static void buildOptions() {
|
||||
options = new Options();
|
||||
|
||||
Option versionOption = OptionBuilder.withLongOpt("version")
|
||||
.withDescription("prints the version then exits")
|
||||
.create("v");
|
||||
@ -182,13 +180,13 @@ public class main {
|
||||
Option dumpOption = OptionBuilder.withLongOpt("dump-to")
|
||||
.withDescription("dumps the given dex file into a single annotated dump file named FILE (<dexfile>.dump by default), along with the normal disassembly.")
|
||||
.hasOptionalArg()
|
||||
.withArgName("FILE|-")
|
||||
.withArgName("FILE")
|
||||
.create("d");
|
||||
|
||||
Option dumpOnlyOption = OptionBuilder.withLongOpt("dump-only")
|
||||
.withDescription("dumps the given dex file into a single annotated dump file named FILE (<dexfile>.dump by default), and does not generate the disassembly")
|
||||
.hasOptionalArg()
|
||||
.withArgName("FILE|-")
|
||||
.withArgName("FILE")
|
||||
.create("D");
|
||||
|
||||
Option writeDexOption = OptionBuilder.withLongOpt("write-dex")
|
||||
@ -204,7 +202,7 @@ public class main {
|
||||
.create("o");
|
||||
|
||||
Option sortOption = OptionBuilder.withLongOpt("sort")
|
||||
.withDescription("when dumping or rewriting, sort the items in the dex file before dumping/writing.")
|
||||
.withDescription("sort the items in the dex file into a canonical order before dumping/writing")
|
||||
.create("s");
|
||||
|
||||
Option fixSignedRegisterOption = OptionBuilder.withLongOpt("fix-signed-registers")
|
||||
|
Loading…
x
Reference in New Issue
Block a user