未验证 提交 d42bf2d4 编写于 作者: S skylot 提交者: GitHub

Merge pull request #212 from KpChuck/master

Don't throw a DecodeException if dex files aren't found but --no-src used
......@@ -146,7 +146,7 @@ public final class JadxDecompiler {
inputFiles.clear();
for (File file : files) {
try {
InputFile.addFilesFrom(file, inputFiles);
InputFile.addFilesFrom(file, inputFiles, args.isSkipSources());
} catch (IOException e) {
throw new JadxException("Error load file: " + file, e);
}
......
......@@ -32,9 +32,9 @@ public class InputFile {
private final File file;
private final List<DexFile> dexFiles = new ArrayList<DexFile>();
public static void addFilesFrom(File file, List<InputFile> list) throws IOException, DecodeException {
public static void addFilesFrom(File file, List<InputFile> list, boolean... skipSources) throws IOException, DecodeException {
InputFile inputFile = new InputFile(file);
inputFile.searchDexFiles();
inputFile.searchDexFiles(skipSources[0]);
list.add(inputFile);
}
......@@ -45,7 +45,7 @@ public class InputFile {
this.file = file;
}
private void searchDexFiles() throws IOException, DecodeException {
private void searchDexFiles(boolean skipSources) throws IOException, DecodeException {
String fileName = file.getName();
if (fileName.endsWith(".dex")) {
......@@ -75,6 +75,8 @@ public class InputFile {
}
return;
}
if (skipSources) return;
throw new DecodeException("Unsupported input file format: " + file);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册