Package org.jf.dexlib2.dexbacked
Class DexBackedDexFile
- java.lang.Object
-
- org.jf.dexlib2.dexbacked.DexBackedDexFile
-
- All Implemented Interfaces:
DexFile
- Direct Known Subclasses:
CDexBackedDexFile
,DexBackedOdexFile
,OatFile.OatDexFile
public class DexBackedDexFile extends java.lang.Object implements DexFile
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DexBackedDexFile.IndexedSection<T>
static class
DexBackedDexFile.NotADexFile
static class
DexBackedDexFile.OptionalIndexedSection<T>
-
Constructor Summary
Constructors Modifier Constructor Description DexBackedDexFile(Opcodes opcodes, byte[] buf)
DexBackedDexFile(Opcodes opcodes, byte[] buf, int offset)
protected
DexBackedDexFile(Opcodes opcodes, byte[] buf, int offset, boolean verifyMagic)
DexBackedDexFile(Opcodes opcodes, DexBuffer buf)
protected
DexBackedDexFile(Opcodes opcodes, DexBuffer dexBuffer, DexBuffer dataBuffer, int offset, boolean verifyMagic)
-
Method Summary
-
-
-
Constructor Detail
-
DexBackedDexFile
protected DexBackedDexFile(@Nullable Opcodes opcodes, @Nonnull byte[] buf, int offset, boolean verifyMagic)
-
DexBackedDexFile
protected DexBackedDexFile(@Nullable Opcodes opcodes, @Nonnull DexBuffer dexBuffer, @Nonnull DexBuffer dataBuffer, int offset, boolean verifyMagic)
-
DexBackedDexFile
public DexBackedDexFile(@Nullable Opcodes opcodes, @Nonnull byte[] buf, int offset)
-
DexBackedDexFile
public DexBackedDexFile(@Nullable Opcodes opcodes, @Nonnull byte[] buf)
-
-
Method Detail
-
getBaseDataOffset
public int getBaseDataOffset()
- Returns:
- The offset that various data offsets are relative to. This is always 0 for a dex file, but may be different for other related formats (e.g. cdex).
-
getVersion
protected int getVersion(byte[] buf, int offset, boolean verifyMagic)
-
getDefaultOpcodes
protected Opcodes getDefaultOpcodes(int version)
-
getBuffer
public DexBuffer getBuffer()
-
getDataBuffer
public DexBuffer getDataBuffer()
-
fromInputStream
@Nonnull public static DexBackedDexFile fromInputStream(@Nullable Opcodes opcodes, @Nonnull java.io.InputStream is) throws java.io.IOException
- Throws:
java.io.IOException
-
getOpcodes
@Nonnull public Opcodes getOpcodes()
Description copied from interface:DexFile
Get the Opcodes associated with this dex file- Specified by:
getOpcodes
in interfaceDexFile
- Returns:
- The Opcodes instance representing the possible opcodes that can be encountered in this dex file
-
supportsOptimizedOpcodes
public boolean supportsOptimizedOpcodes()
-
getClasses
@Nonnull public java.util.Set<? extends DexBackedClassDef> getClasses()
Description copied from interface:DexFile
Get a set of the classes defined in this dex file. The classes in the returned set will all have unique types.- Specified by:
getClasses
in interfaceDexFile
- Returns:
- A set of the classes defined in this dex file
-
getStringReferences
public java.util.List<DexBackedStringReference> getStringReferences()
-
getTypeReferences
public java.util.List<DexBackedTypeReference> getTypeReferences()
-
getReferences
public java.util.List<? extends Reference> getReferences(int referenceType)
-
getMapItems
public java.util.List<MapItem> getMapItems()
-
getMapItemForSection
@Nullable public MapItem getMapItemForSection(int itemType)
-
getStringSection
public DexBackedDexFile.OptionalIndexedSection<java.lang.String> getStringSection()
-
getTypeSection
public DexBackedDexFile.OptionalIndexedSection<java.lang.String> getTypeSection()
-
getFieldSection
public DexBackedDexFile.IndexedSection<DexBackedFieldReference> getFieldSection()
-
getMethodSection
public DexBackedDexFile.IndexedSection<DexBackedMethodReference> getMethodSection()
-
getProtoSection
public DexBackedDexFile.IndexedSection<DexBackedMethodProtoReference> getProtoSection()
-
getClassSection
public DexBackedDexFile.IndexedSection<DexBackedClassDef> getClassSection()
-
getCallSiteSection
public DexBackedDexFile.IndexedSection<DexBackedCallSiteReference> getCallSiteSection()
-
getMethodHandleSection
public DexBackedDexFile.IndexedSection<DexBackedMethodHandleReference> getMethodHandleSection()
-
createMethodImplementation
protected DexBackedMethodImplementation createMethodImplementation(@Nonnull DexBackedDexFile dexFile, @Nonnull DexBackedMethod method, int codeOffset)
-
-