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 TypeMethodDescriptionint
Get the computed checksum.byte[]
Get the computed signature.int
Convenience method.int
Convenience method.int
int
byte[]
getData()
Retrieve the bytes of the underlyingdex
file.int
int
Get the endianness of this file.int
Get the header provided file checksum.default int
Deprecated.byte[]
Get the header provided SHA-1 file signature.int
Get the header provided expected DEX size.int
int
int
The underlying dex file index.int
Get the size of header.int
The index of this entry in their dex container, if the corresponding physical dex file is a v41 container.int
int
getMap()
Get a map object for this file.int
int
Convenience method.int
Convenience method.int
int
int
Offset withindata
of the start of this dex.Retrieve the owner DEX unit.int
int
int
int
int
int
int
Get the DEX version number.
-
Method Details
-
getData
byte[] getData()Retrieve the bytes of the underlyingdex
file. Multiple entries may share the share byte buffer.- Returns:
-
getOffset
int getOffset()Offset withindata
of the start of this dex.- Returns:
- an offset, generally 0
-
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:
-
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:
-
getOwnerUnit
IDexUnit getOwnerUnit()Retrieve the owner DEX unit.- Returns:
-
getVersion
int getVersion()Get the DEX version number.- Returns:
-
getHeaderSize
int getHeaderSize()Get the size of header.- Returns:
-
getEndianness
Endianness getEndianness()Get the endianness of this file. Currently, all DEX files use a little-endian byte ordering.- Returns:
-
getExpectedSize
int getExpectedSize()Get the header provided expected DEX size.- Returns:
-
getExpectedFileSize
default int getExpectedFileSize()Deprecated.usegetExpectedSize()
insteadGet the header provided expected DEX size. -
getExpectedChecksum
int getExpectedChecksum()Get the header provided file checksum.- Returns:
-
getActualChecksum
int getActualChecksum()Get the computed checksum. It may differ from the expected one.- Returns:
-
getExpectedSignature
byte[] getExpectedSignature()Get the header provided SHA-1 file signature.- Returns:
-
getActualSignature
byte[] getActualSignature()Get the computed signature. It may differ from the expected one.- Returns:
-
getLinkSectionSize
int getLinkSectionSize() -
getLinkSectionOffset
int getLinkSectionOffset() -
getMapOffset
int getMapOffset() -
getMap
IDexMap getMap()Get a map object for this file.- Returns:
-
getStringsPoolSize
int getStringsPoolSize() -
getStringsPoolOffset
int getStringsPoolOffset() -
getTypesPoolSize
int getTypesPoolSize() -
getTypesPoolOffset
int getTypesPoolOffset() -
getPrototypesPoolSize
int getPrototypesPoolSize() -
getPrototypesPoolOffset
int getPrototypesPoolOffset() -
getFieldsPoolSize
int getFieldsPoolSize() -
getFieldsPoolOffset
int getFieldsPoolOffset() -
getMethodsPoolSize
int getMethodsPoolSize() -
getMethodsPoolOffset
int getMethodsPoolOffset() -
getClassesPoolSize
int getClassesPoolSize() -
getClassesPoolOffset
int getClassesPoolOffset() -
getDataSectionSize
int getDataSectionSize() -
getDataSectionOffset
int getDataSectionOffset() -
getCallSitesPoolSize
int getCallSitesPoolSize()Convenience method. Always return 0 for DEX files version 37-.- Returns:
-
getCallSitesPoolOffset
int getCallSitesPoolOffset()Convenience method. Always return 0 for DEX files version 37-.- Returns:
-
getMethodHandlesPoolSize
int getMethodHandlesPoolSize()Convenience method. Always return 0 for DEX files version 37-.- Returns:
-
getMethodHandlesPoolOffset
int getMethodHandlesPoolOffset()Convenience method. Always return 0 for DEX files version 37-.- Returns:
-
getExpectedSize()
instead