From 5cdbca30fd1acc45d3bed09fb7d4a6e0053c60cc Mon Sep 17 00:00:00 2001 From: Andrei Conache Date: Sun, 27 Aug 2017 18:20:20 +0200 Subject: [PATCH] fix #970 and add long api level option --- .../apktool-cli/src/main/java/brut/apktool/Main.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 56171674..713605f9 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 @@ -133,14 +133,13 @@ public class Main { if (cli.hasOption("m") || cli.hasOption("match-original")) { decoder.setAnalysisMode(true, false); } - if (cli.hasOption("api")) { + if (cli.hasOption("api") || cli.hasOption("api-level")) { decoder.setApi(Integer.parseInt(cli.getOptionValue("api"))); } if (cli.hasOption("o") || cli.hasOption("output")) { outDir = new File(cli.getOptionValue("o")); decoder.setOutDir(outDir); } else { - // make out folder manually using name of apk String outName = apkName; outName = outName.endsWith(".apk") ? outName.substring(0, @@ -295,7 +294,7 @@ public class Main { .build(); Option apiLevelOption = Option.builder("api") - .longOpt("api") + .longOpt("api-level") .desc("The numeric api-level of the file to generate, e.g. 14 for ICS.") .hasArg(true) .argName("API") @@ -441,6 +440,7 @@ public class Main { for (Object op : frameOptions.getOptions()) { allOptions.addOption((Option)op); } + allOptions.addOption(apiLevelOption); allOptions.addOption(analysisOption); allOptions.addOption(debugDecOption); allOptions.addOption(noDbgOption);