Skip to content

Commit

Permalink
Merge pull request #2105 from MarcMil/buildfix
Browse files Browse the repository at this point in the history
Make castPrimitive overridable by subclasses
  • Loading branch information
StevenArzt authored Sep 28, 2024
2 parents f4ff4c8 + 05f342b commit 862edf0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/main/java/soot/dexpler/DexFileProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ private Map<String, DexContainer<? extends DexFile>> mappingForFile(File dexSour
while (entryNameIterator.hasPrevious()) {
String entryName = entryNameIterator.previous();
DexEntry<? extends DexFile> entry = dexContainer.getEntry(entryName);
if (!acceptFile(entry)) {
continue;
}

entryName = deriveDexName(entryName);
logger.debug("" + String.format("Found dex file '%s' with %d classes in '%s'", entryName,
entry.getDexFile().getClasses().size(), dexSourceFile.getCanonicalPath()));
Expand All @@ -249,6 +253,10 @@ private Map<String, DexContainer<? extends DexFile>> mappingForFile(File dexSour
return Collections.unmodifiableMap(dexMap);
}

protected boolean acceptFile(DexEntry<? extends DexFile> entry) {
return true;
}

private String deriveDexName(String entryName) {
return new File(entryName).getName();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/soot/toDex/ExprVisitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ protected void castObject(Register sourceReg, Type castType) {
}
}

private void castPrimitive(Register sourceReg, Value source, Type castSootType) {
protected void castPrimitive(Register sourceReg, Value source, Type castSootType) {
PrimitiveType castType = PrimitiveType.getByName(castSootType.toString());

// Fix null_types on the fly. This should not be necessary, but better
Expand Down

0 comments on commit 862edf0

Please sign in to comment.