Skip to content

Commit

Permalink
fix: skip dex files with parsing errors (#1495)
Browse files Browse the repository at this point in the history
  • Loading branch information
skylot committed May 28, 2022
1 parent 5f60c0f commit 2aa6c99
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions jadx-core/src/main/java/jadx/core/dex/nodes/RootNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,21 +115,25 @@ public void loadClasses(List<ILoadResult> loadedInputs) {
}

private void addDummyClass(IClassData classData, Exception exc) {
String typeStr = classData.getType();
String name = null;
try {
ClassInfo clsInfo = ClassInfo.fromName(this, typeStr);
if (clsInfo != null) {
name = clsInfo.getShortName();
String typeStr = classData.getType();
String name = null;
try {
ClassInfo clsInfo = ClassInfo.fromName(this, typeStr);
if (clsInfo != null) {
name = clsInfo.getShortName();
}
} catch (Exception e) {
LOG.error("Failed to get name for class with type {}", typeStr, e);
}
} catch (Exception e) {
LOG.error("Failed to get name for class with type {}", typeStr, e);
}
if (name == null || name.isEmpty()) {
name = "CLASS_" + typeStr;
if (name == null || name.isEmpty()) {
name = "CLASS_" + typeStr;
}
ClassNode clsNode = ClassNode.addSyntheticClass(this, name, classData.getAccessFlags());
ErrorsCounter.error(clsNode, "Load error", exc);
} catch (Exception innerExc) {
LOG.error("Failed to load class from file: {}", classData.getInputFileName(), exc);
}
ClassNode clsNode = ClassNode.addSyntheticClass(this, name, classData.getAccessFlags());
ErrorsCounter.error(clsNode, "Load error", exc);
}

private static void markDuplicatedClasses(List<ClassNode> classes) {
Expand Down

0 comments on commit 2aa6c99

Please sign in to comment.