feat: method to list frameworks

This commit is contained in:
Connor Tumbleson 2020-11-30 06:35:27 -05:00 committed by Connor Tumbleson
parent db1fe98524
commit d63088db9f
2 changed files with 18 additions and 0 deletions

View File

@ -714,6 +714,10 @@ public class Androlib {
mAndRes.installFramework(frameFile);
}
public void listFrameworks() throws AndrolibException {
mAndRes.listFrameworkDirectory();
}
public void emptyFrameworkDirectory() throws AndrolibException {
mAndRes.emptyFrameworkDirectory();
}

View File

@ -854,6 +854,20 @@ final public class AndrolibResources {
}
}
public void listFrameworkDirectory() throws AndrolibException {
File dir = getFrameworkDir();
if (dir == null) {
LOGGER.severe("No framework directory found. Nothing to list.");
return;
}
for (File file : Objects.requireNonNull(dir.listFiles())) {
if (file.isFile() && file.getName().endsWith(".apk")) {
LOGGER.info(file.getName());
}
}
}
public void installFramework(File frameFile) throws AndrolibException {
installFramework(frameFile, apkOptions.frameworkTag);
}