public void setApiLevel(int apiLevel) { this.opcodes = Opcodes.forApi(apiLevel); this.apiLevel = apiLevel; }
public void setApiLevel(int apiLevel) { this.opcodes = Opcodes.forApi(apiLevel); this.apiLevel = apiLevel; }
public static List<BuilderClassDef> parse(String path) throws Exception { DexBuilder dexBuilder = new DexBuilder(Opcodes.forApi(SmaliParser.DEFAULT_API_LEVEL)); return parseFiles(new File(path), dexBuilder); }
/** * Create a ClassManager with no input Smali classes. It will only contain parse library * classes. */ public ClassManager build(int outputAPILevel) throws IOException { DexBuilder dexBuilder = new DexBuilder(Opcodes.forApi(outputAPILevel)); return build(dexBuilder); }
/** * @param smaliPath Path to Smali file or folder */ public ClassManager build(File smaliPath, int outputAPILevel) throws IOException { return build(smaliPath, new DexBuilder(Opcodes.forApi(outputAPILevel))); }
opcodes = Opcodes.forApi(apiLevel);
final DexBuilder dexBuilder = new DexBuilder(Opcodes.forApi(options.apiLevel));
public static DexBuilder getDexBuilder() { return new DexBuilder(Opcodes.forApi(SmaliParser.DEFAULT_API_LEVEL)); }
/** * Creates the {@link MultiDexBuilder} that shall be used for creating potentially multiple dex files. This method makes * sure that users of Soot can overwrite the {@link MultiDexBuilder} with custom strategies. * * @return The new {@link MultiDexBuilder} */ protected MultiDexBuilder createDexBuilder() { int api = Scene.v().getAndroidAPIVersion(); return new MultiDexBuilder(Opcodes.forApi(api)); }
private void build() throws AndrolibException { try { DexBuilder dexBuilder; if (mApiLevel > 0) { dexBuilder = new DexBuilder(Opcodes.forApi(mApiLevel)); } else { dexBuilder = new DexBuilder(Opcodes.getDefault()); } for (String fileName : mSmaliDir.getDirectory().getFiles(true)) { buildFile(fileName, dexBuilder); } dexBuilder.writeTo(new FileDataStore( new File(mDexFile.getAbsolutePath()))); } catch (IOException | DirectoryException ex) { throw new AndrolibException(ex); } }
= DexFileFactory.loadDexContainer(dexSourceFile, Opcodes.forApi(api));
DexBackedDexFile dexFile = DexFileFactory.loadDexEntry(mApkFile, mDexFile, true, Opcodes.forApi(mApi));
for (Dex dex : owners) { Set<String> descOfChangedClassesInCurrDex = ownerToDescOfChangedClassesMap.get(dex); DexFile dexFile = new DexBackedDexFile(org.jf.dexlib2.Opcodes.forApi(20), dex.getBytes()); boolean isCurrentDexHasChangedClass = false; for (org.jf.dexlib2.iface.ClassDef classDef : dexFile.getClasses()) {
public void setApiLevel(int apiLevel) { this.opcodes = Opcodes.forApi(apiLevel); this.apiLevel = apiLevel; }
public void setApiLevel(int apiLevel) { this.opcodes = Opcodes.forApi(apiLevel); this.apiLevel = apiLevel; }
/** * @return a default Opcodes instance for when the exact Opcodes to use doesn't matter or isn't known */ @Nonnull public static Opcodes getDefault() { // The last pre-art api return forApi(20); }
/** * @return a default Opcodes instance for when the exact Opcodes to use doesn't matter or isn't known */ @Nonnull public static Opcodes getDefault() { // The last pre-art api return forApi(20); }
/** * @param f * the .dex or .apk file */ private DexFileModule(File f, int apiLevel) throws IllegalArgumentException { try { this.f = f; dexfile = DexFileFactory.loadDexFile(f, apiLevel == AUTO_INFER_API_LEVEL? null : Opcodes.forApi(apiLevel)); } catch (IOException e) { throw new IllegalArgumentException(e); } // create ModuleEntries from ClassDefItem entries = new HashSet<>(); for (ClassDef cdefitems : dexfile.getClasses()) { entries.add(new DexModuleEntry(cdefitems, this)); } }
public static Opcodes getOpcodes(int apiLevel) { if (apiLevel <= 0) { return getDefaultOpCodes(); } Opcodes opcodes = MiscUtil.getCache(opCodesCache, apiLevel); if (opcodes == null) { opcodes = Opcodes.forApi(apiLevel); MiscUtil.putCache(opCodesCache, apiLevel, opcodes); } return opcodes; }
@Nonnull protected DexBackedDexFile getInputDexFile(@Nonnull String testName, @Nonnull BaksmaliOptions options) { try { // Load file from resources as a stream byte[] inputBytes = BaksmaliTestUtils.readResourceBytesFully(getInputFilename(testName)); return new DexBackedDexFile(Opcodes.forApi(options.apiLevel), inputBytes); } catch (IOException ex) { Assert.fail(); } return null; } }