mirror of
https://github.com/revanced/Apktool.git
synced 2024-12-13 06:17:46 +01:00
feat: usage output for list-frameworks
This commit is contained in:
parent
734793c4bb
commit
db1fe98524
@ -73,7 +73,7 @@ public class Main {
|
|||||||
|
|
||||||
// check for advance mode
|
// check for advance mode
|
||||||
if (commandLine.hasOption("advance") || commandLine.hasOption("advanced")) {
|
if (commandLine.hasOption("advance") || commandLine.hasOption("advanced")) {
|
||||||
setAdvanceMode(true);
|
setAdvanceMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean cmdFound = false;
|
boolean cmdFound = false;
|
||||||
@ -90,6 +90,9 @@ public class Main {
|
|||||||
} else if (opt.equalsIgnoreCase("empty-framework-dir")) {
|
} else if (opt.equalsIgnoreCase("empty-framework-dir")) {
|
||||||
cmdEmptyFrameworkDirectory(commandLine);
|
cmdEmptyFrameworkDirectory(commandLine);
|
||||||
cmdFound = true;
|
cmdFound = true;
|
||||||
|
} else if (opt.equalsIgnoreCase("list-frameworks")) {
|
||||||
|
cmdListFrameworks(commandLine);
|
||||||
|
cmdFound = true;
|
||||||
} else if (opt.equalsIgnoreCase("publicize-resources")) {
|
} else if (opt.equalsIgnoreCase("publicize-resources")) {
|
||||||
cmdPublicizeResources(commandLine);
|
cmdPublicizeResources(commandLine);
|
||||||
cmdFound = true;
|
cmdFound = true;
|
||||||
@ -274,6 +277,15 @@ public class Main {
|
|||||||
new Androlib(apkOptions).installFramework(new File(apkName));
|
new Androlib(apkOptions).installFramework(new File(apkName));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void cmdListFrameworks(CommandLine cli) throws AndrolibException {
|
||||||
|
ApkOptions apkOptions = new ApkOptions();
|
||||||
|
if (cli.hasOption("p") || cli.hasOption("frame-path")) {
|
||||||
|
apkOptions.frameworkFolderLocation = cli.getOptionValue("p");
|
||||||
|
}
|
||||||
|
|
||||||
|
new Androlib(apkOptions).listFrameworks();
|
||||||
|
}
|
||||||
|
|
||||||
private static void cmdPublicizeResources(CommandLine cli) throws AndrolibException {
|
private static void cmdPublicizeResources(CommandLine cli) throws AndrolibException {
|
||||||
int paraCount = cli.getArgList().size();
|
int paraCount = cli.getArgList().size();
|
||||||
String apkName = cli.getArgList().get(paraCount - 1);
|
String apkName = cli.getArgList().get(paraCount - 1);
|
||||||
@ -497,6 +509,9 @@ public class Main {
|
|||||||
emptyFrameworkOptions.addOption(forceDecOption);
|
emptyFrameworkOptions.addOption(forceDecOption);
|
||||||
emptyFrameworkOptions.addOption(frameIfDirOption);
|
emptyFrameworkOptions.addOption(frameIfDirOption);
|
||||||
|
|
||||||
|
// add list framework options
|
||||||
|
listFrameworkOptions.addOption(frameIfDirOption);
|
||||||
|
|
||||||
// add all, loop existing cats then manually add advance
|
// add all, loop existing cats then manually add advance
|
||||||
for (Object op : normalOptions.getOptions()) {
|
for (Object op : normalOptions.getOptions()) {
|
||||||
allOptions.addOption((Option)op);
|
allOptions.addOption((Option)op);
|
||||||
@ -561,6 +576,7 @@ public class Main {
|
|||||||
if (isAdvanceMode()) {
|
if (isAdvanceMode()) {
|
||||||
formatter.printHelp("apktool " + verbosityHelp() + "publicize-resources <file_path>", emptyOptions);
|
formatter.printHelp("apktool " + verbosityHelp() + "publicize-resources <file_path>", emptyOptions);
|
||||||
formatter.printHelp("apktool " + verbosityHelp() + "empty-framework-dir [options]", emptyFrameworkOptions);
|
formatter.printHelp("apktool " + verbosityHelp() + "empty-framework-dir [options]", emptyFrameworkOptions);
|
||||||
|
formatter.printHelp("apktool " + verbosityHelp() + "list-frameworks [options]", listFrameworkOptions);
|
||||||
System.out.println("");
|
System.out.println("");
|
||||||
} else {
|
} else {
|
||||||
System.out.println("");
|
System.out.println("");
|
||||||
@ -634,8 +650,8 @@ public class Main {
|
|||||||
return advanceMode;
|
return advanceMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void setAdvanceMode(boolean advanceMode) {
|
private static void setAdvanceMode() {
|
||||||
Main.advanceMode = advanceMode;
|
Main.advanceMode = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum Verbosity {
|
private enum Verbosity {
|
||||||
@ -651,6 +667,7 @@ public class Main {
|
|||||||
private final static Options allOptions;
|
private final static Options allOptions;
|
||||||
private final static Options emptyOptions;
|
private final static Options emptyOptions;
|
||||||
private final static Options emptyFrameworkOptions;
|
private final static Options emptyFrameworkOptions;
|
||||||
|
private final static Options listFrameworkOptions;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
//normal and advance usage output
|
//normal and advance usage output
|
||||||
@ -661,5 +678,6 @@ public class Main {
|
|||||||
allOptions = new Options();
|
allOptions = new Options();
|
||||||
emptyOptions = new Options();
|
emptyOptions = new Options();
|
||||||
emptyFrameworkOptions = new Options();
|
emptyFrameworkOptions = new Options();
|
||||||
|
listFrameworkOptions = new Options();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user