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.
This commit is contained in:
Ben Gruver 2020-02-02 19:26:14 -08:00
parent 210e36dc19
commit 8eb2595f87

View File

@ -34,6 +34,7 @@ package org.jf.baksmali;
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 class AnalysisArguments {
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