From dbce4479b238c6438e84546fbb7fe6e417b4822e Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Wed, 30 Jan 2013 20:22:13 -0600 Subject: [PATCH] added -version to print out raw version number --- CHANGES | 1 + .../src/main/java/brut/apktool/Main.java | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 141be617..87b7e1d1 100644 --- a/CHANGES +++ b/CHANGES @@ -9,6 +9,7 @@ v1.5.2 (TBA) -Fixed (issue #395) - Added check for "aapt" in unit-tests. -Added ability to use "--frame-path" on [if|install-framework] -Fixed renaming of ".r.9.png" images -> ".9.png". +-Added ability to use --version to print out Apktool version v1.5.1 PR3 (Released December 23 - 2012) Codename: Pre Release 3 -Reverted "Prevents removal of on decompile, but then throws warning on rebuild (issue #366)" diff --git a/brut.apktool/apktool-cli/src/main/java/brut/apktool/Main.java b/brut.apktool/apktool-cli/src/main/java/brut/apktool/Main.java index ea2c55e9..c517b661 100644 --- a/brut.apktool/apktool-cli/src/main/java/brut/apktool/Main.java +++ b/brut.apktool/apktool-cli/src/main/java/brut/apktool/Main.java @@ -43,6 +43,11 @@ public class Main { int i; for (i = 0; i < args.length; i++) { String opt = args[i]; + + if (opt.startsWith("--version") || (opt.startsWith("-version"))) { + version_print(); + System.exit(1); + } if (! opt.startsWith("-")) { break; } @@ -258,6 +263,11 @@ public class Main { new Androlib().publicizeResources(new File(args[0])); } + private static void version_print() { + System.out.println( + Androlib.getVersion()); + } + private static void usage() { System.out.println( "Apktool v" + Androlib.getVersion() + " - a tool for reengineering Android apk files\n" + @@ -314,8 +324,6 @@ public class Main { " Build in debug mode. Check project page for more info.\n" + " -a, --aapt\n" + " Loads aapt from specified location.\n" + - // " -o, --original\n" + - // " Build resources into original APK. Retains signature." + "\n" + " if|install-framework [] --frame-path [] \n" + " Install framework file to your system.\n" + @@ -356,6 +364,8 @@ public class Main { private static enum Verbosity { NORMAL, VERBOSE, QUIET; } + + private static boolean Advanced = false; static class InvalidArgsError extends AndrolibException {