recursive apk fire search

This commit is contained in:
REAndroid 2023-04-18 20:21:51 +02:00
parent 67ee76ded9
commit 59d5279b7b

View File

@ -127,10 +127,18 @@ public class ApkBundle {
return new ArrayList<>(mModulesMap.values());
}
public void loadApkDirectory(File dir) throws IOException{
loadApkDirectory(dir, false);
}
public void loadApkDirectory(File dir, boolean recursive) throws IOException {
if(!dir.isDirectory()){
throw new FileNotFoundException("No such directory: "+dir);
}
List<File> apkList=ApkUtil.listFiles(dir, ".apk");
List<File> apkList;
if(recursive){
apkList = ApkUtil.recursiveFiles(dir, ".apk");
}else {
apkList = ApkUtil.listFiles(dir, ".apk");
}
if(apkList.size()==0){
throw new FileNotFoundException("No '*.apk' files in directory: "+dir);
}