Skip to content
Permalink
Browse files

Set the oat version based on the api level in AnalysisArguments

This ensures the oat version is set to NOT_ART for api 19 and lower, and
fixes deodexing for those api levels.
  • Loading branch information
JesusFreke committed Feb 3, 2020
1 parent 210e36d commit 8eb2595f873c59288543bf19c707c241dc989cd5
Showing with 3 additions and 0 deletions.
  1. +3 −0 baksmali/src/main/java/org/jf/baksmali/AnalysisArguments.java
@@ -34,6 +34,7 @@
import com.beust.jcommander.Parameter;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import org.jf.dexlib2.VersionMap;
import org.jf.dexlib2.analysis.ClassPath;
import org.jf.dexlib2.analysis.ClassPathResolver;
import org.jf.dexlib2.dexbacked.DexBackedDexFile;
@@ -101,6 +102,8 @@ public ClassPath loadClassPathForDexFile(@Nonnull File dexFileDir,
if (container instanceof OatFile) {
checkPackagePrivateAccess = true;
oatVersion = ((OatFile) container).getOatVersion();
} else {
oatVersion = VersionMap.mapApiToArtVersion(dexEntry.getDexFile().getOpcodes().api);
}
} else {
// this should always be true for ART

0 comments on commit 8eb2595

Please sign in to comment.
You can’t perform that action at this time.