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 Details

    • getData

      byte[] getData()
      Retrieve the bytes of the underlying dex file. Multiple entries may share the share byte buffer.
      Returns:
    • getOffset

      int getOffset()
      Offset within data 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 means classes.dex, 1 to classes2.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.
      use getExpectedSize() instead
      Get 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: