Interface IDexFile
public interface IDexFile
Representation of a DEX entry. For dex version 40 and below, each entry is mapped to a single
file (hence the name of this class, at the time it was introduced). For dex version 41 and above
with containers, a single dex file may generate multiple dex entries.
IMPORTANT! This interface will be renamed to IDexEntry in a future release.
-
Method Summary
Modifier and TypeMethodDescriptionintGet the computed checksum.byte[]Get the computed signature.intConvenience method.intConvenience method.intGet the class pool offset.intGet the class pool size.byte[]getData()Retrieve the bytes of the underlyingdexfile.intGet the data section offset.intGet the data section size.Get the endianness of this file.intGet the header provided file checksum.default intDeprecated.byte[]Get the header provided SHA-1 file signature.intGet the header provided expected DEX size.intGet the field pool offset.intGet the field pool size.intThe underlying dex file index.intGet the size of header.intThe index of this entry in their dex container, if the corresponding physical dex file is a v41 container.intGet the link section offset.intGet the link section size.getMap()Get a map object for this file.intGet the map offset.intConvenience method.intConvenience method.intGet the method pool offset.intGet the method pool size.Get the optional name tag associated with this dex entry.intOffset withindataof the start of this dex.Retrieve the owner DEX unit.intGet the prototype pool offset.intGet the prototype pool size.intGet the string pool offset.intGet the string pool size.intGet the type pool offset.intGet the type pool size.intGet the DEX version number.
-
Method Details
-
getData
byte[] getData()Retrieve the bytes of the underlyingdexfile. Multiple entries may share the share byte buffer.- Returns:
- the backing dex bytes
-
getOffset
int getOffset()Offset withindataof the start of this dex.- Returns:
- an offset, generally 0
-
getNameTag
String getNameTag()Get the optional name tag associated with this dex entry.- Returns:
- an optional name tag associated with the object (usually, the file name that contained the dex file or dex container used to create this object)
-
getFileIndex
int getFileIndex()The underlying dex file index. When children of an APK unit, 0 would be attributed to meansclasses.dex, 1 toclasses2.dex, etc.- Returns:
- the physical dex file index
-
getIndexInContainer
int getIndexInContainer()The index of this entry in their dex container, if the corresponding physical dex file is a v41 container. The primary entry at offset 0 would have index 0, subsequent entries indices 1, 2, etc.- Returns:
- the entry index in the dex container
-
getOwnerUnit
IDexUnit getOwnerUnit()Retrieve the owner DEX unit.- Returns:
- the owner dex unit
-
getVersion
int getVersion()Get the DEX version number.- Returns:
- the dex version number
-
getHeaderSize
int getHeaderSize()Get the size of header.- Returns:
- the header size
-
getEndianness
Endianness getEndianness()Get the endianness of this file. Currently, all DEX files use a little-endian byte ordering.- Returns:
- the file endianness
-
getExpectedSize
int getExpectedSize()Get the header provided expected DEX size.- Returns:
- the expected dex size
-
getExpectedFileSize
default int getExpectedFileSize()Deprecated.usegetExpectedSize()insteadGet the header provided expected DEX size.- Returns:
- the expected dex size
-
getExpectedChecksum
int getExpectedChecksum()Get the header provided file checksum.- Returns:
- the expected checksum
-
getActualChecksum
int getActualChecksum()Get the computed checksum. It may differ from the expected one.- Returns:
- the actual checksum
-
getExpectedSignature
byte[] getExpectedSignature()Get the header provided SHA-1 file signature.- Returns:
- the expected SHA-1 signature
-
getActualSignature
byte[] getActualSignature()Get the computed signature. It may differ from the expected one.- Returns:
- the actual SHA-1 signature
-
getLinkSectionSize
int getLinkSectionSize()Get the link section size.- Returns:
- the link section size
-
getLinkSectionOffset
int getLinkSectionOffset()Get the link section offset.- Returns:
- the link section offset
-
getMapOffset
int getMapOffset()Get the map offset.- Returns:
- the map offset
-
getMap
IDexMap getMap()Get a map object for this file.- Returns:
- the dex map
-
getStringsPoolSize
int getStringsPoolSize()Get the string pool size.- Returns:
- the string pool size
-
getStringsPoolOffset
int getStringsPoolOffset()Get the string pool offset.- Returns:
- the string pool offset
-
getTypesPoolSize
int getTypesPoolSize()Get the type pool size.- Returns:
- the type pool size
-
getTypesPoolOffset
int getTypesPoolOffset()Get the type pool offset.- Returns:
- the type pool offset
-
getPrototypesPoolSize
int getPrototypesPoolSize()Get the prototype pool size.- Returns:
- the prototype pool size
-
getPrototypesPoolOffset
int getPrototypesPoolOffset()Get the prototype pool offset.- Returns:
- the prototype pool offset
-
getFieldsPoolSize
int getFieldsPoolSize()Get the field pool size.- Returns:
- the field pool size
-
getFieldsPoolOffset
int getFieldsPoolOffset()Get the field pool offset.- Returns:
- the field pool offset
-
getMethodsPoolSize
int getMethodsPoolSize()Get the method pool size.- Returns:
- the method pool size
-
getMethodsPoolOffset
int getMethodsPoolOffset()Get the method pool offset.- Returns:
- the method pool offset
-
getClassesPoolSize
int getClassesPoolSize()Get the class pool size.- Returns:
- the class pool size
-
getClassesPoolOffset
int getClassesPoolOffset()Get the class pool offset.- Returns:
- the class pool offset
-
getDataSectionSize
int getDataSectionSize()Get the data section size.- Returns:
- the data section size
-
getDataSectionOffset
int getDataSectionOffset()Get the data section offset.- Returns:
- the data section offset
-
getCallSitesPoolSize
int getCallSitesPoolSize()Convenience method. Always return 0 for DEX files version 37-.- Returns:
- the call site pool size
-
getCallSitesPoolOffset
int getCallSitesPoolOffset()Convenience method. Always return 0 for DEX files version 37-.- Returns:
- the call site pool offset
-
getMethodHandlesPoolSize
int getMethodHandlesPoolSize()Convenience method. Always return 0 for DEX files version 37-.- Returns:
- the method handle pool size
-
getMethodHandlesPoolOffset
int getMethodHandlesPoolOffset()Convenience method. Always return 0 for DEX files version 37-.- Returns:
- the method handle pool offset
-
getExpectedSize()instead