public static Opcodes getOpcodes(Oat oat) { return DexUtil.getOpcodes(VersionMap.mapArtVersionToApi(oat.getArtVersion())); }
public static void writeSmaliContent(@Nonnull String type, @Nonnull ClassPath classPath, @Nonnull java.io.Writer outWriter) { final org.jf.baksmali.BaksmaliOptions options = new org.jf.baksmali.BaksmaliOptions(); final org.jf.dexlib2.iface.ClassDef classDef = classPath.getClassDef(type); options.apiLevel = VersionMap.mapArtVersionToApi(classPath.oatVersion); options.allowOdex = true; options.classPath = classPath; final ClassDefinition cd = new ClassDefinition(options, classDef); try { org.jf.util.IndentingWriter writer = new org.jf.util.IndentingWriter(outWriter); cd.writeTo(writer); } catch (IOException ex) { LLog.ex(ex); } }
this.artVersion = mapApiToArtVersion(api); } else if (artVersion >= 0 && artVersion < 39) { this.api = mapArtVersionToApi(artVersion); this.artVersion = artVersion; } else {
this.artVersion = mapApiToArtVersion(api); } else if (artVersion >= 0 && artVersion < 39) { this.api = mapArtVersionToApi(artVersion); this.artVersion = artVersion; } else {
public ClassPathEx(@Nonnull Iterable<? extends DexFile> classPath, int oatVersion) { super(false, oatVersion); for (DexFile dexFile : classPath) { addDex(dexFile, false); } if (availableClasses.get("Ljava/lang/Class;") == null) { final DexFile basicClasses = new ImmutableDexFile( DexUtil.getOpcodes(VersionMap.mapArtVersionToApi(oatVersion)), ImmutableSet.of( new ReflectionClassDef(Class.class), new ReflectionClassDef(Cloneable.class), new ReflectionClassDef(Object.class), new ReflectionClassDef(Serializable.class), new ReflectionClassDef(String.class), new ReflectionClassDef(Throwable.class))); addDex(basicClasses, false); } }
if (VersionMap.mapArtVersionToApi(classProto.classPath.oatVersion) < API_M) { return getForApiLevelBelow23(fields, fieldOffset, instanceFields);