Search in sources :

Example 6 with DexPool

use of org.jf.dexlib2.writer.pool.DexPool in project smali by JesusFreke.

the class DexPool method writeTo.

public static void writeTo(@Nonnull String path, @Nonnull org.jf.dexlib2.iface.DexFile input) throws IOException {
    DexPool dexPool = new DexPool(input.getOpcodes());
    for (ClassDef classDef : input.getClasses()) {
        dexPool.internClass(classDef);
    }
    dexPool.writeTo(new FileDataStore(new File(path)));
}
Also used : ClassDef(org.jf.dexlib2.iface.ClassDef) FileDataStore(org.jf.dexlib2.writer.io.FileDataStore) File(java.io.File)

Aggregations

ClassDef (org.jf.dexlib2.iface.ClassDef)4 DexPool (org.jf.dexlib2.writer.pool.DexPool)4 File (java.io.File)3 FileDataStore (org.jf.dexlib2.writer.io.FileDataStore)3 ArrayList (java.util.ArrayList)1 Nonnull (javax.annotation.Nonnull)1 Opcodes (org.jf.dexlib2.Opcodes)1 DexBackedDexFile (org.jf.dexlib2.dexbacked.DexBackedDexFile)1 MapItem (org.jf.dexlib2.dexbacked.raw.MapItem)1 DexFile (org.jf.dexlib2.iface.DexFile)1 MemoryDataStore (org.jf.dexlib2.writer.io.MemoryDataStore)1 BasePool (org.jf.dexlib2.writer.pool.BasePool)1 Test (org.junit.Test)1