Class DexFormat


  • public final class DexFormat
    extends Object
    Constants that show up in and are otherwise related to .dex files, and helper methods for same.
    • Field Detail

      • API_CURRENT

        public static final int API_CURRENT
        API level to target in order to produce the most modern file format
        See Also:
        Constant Field Values
      • API_NO_EXTENDED_OPCODES

        public static final int API_NO_EXTENDED_OPCODES
        API level to target in order to suppress extended opcode usage
        See Also:
        Constant Field Values
      • DEX_IN_JAR_NAME

        public static final String DEX_IN_JAR_NAME
        file name of the primary .dex file inside an application or library .jar file
        See Also:
        Constant Field Values
      • VERSION_CURRENT

        public static final String VERSION_CURRENT
        dex file version number for the current format variant
        See Also:
        Constant Field Values
      • VERSION_FOR_API_13

        public static final String VERSION_FOR_API_13
        dex file version number for API level 13 and earlier
        See Also:
        Constant Field Values
      • ENDIAN_TAG

        public static final int ENDIAN_TAG
        value used to indicate endianness of file contents
        See Also:
        Constant Field Values
      • MAX_MEMBER_IDX

        public static final int MAX_MEMBER_IDX
        Maximum addressable field or method index. The largest addressable member is 0xffff, in the "instruction formats" spec as field@CCCC or meth@CCCC.
        See Also:
        Constant Field Values
      • MAX_TYPE_IDX

        public static final int MAX_TYPE_IDX
        Maximum addressable type index. The largest addressable type is 0xffff, in the "instruction formats" spec as type@CCCC.
        See Also:
        Constant Field Values
    • Method Detail

      • magicToApi

        public static int magicToApi​(byte[] magic)
        Returns the API level corresponding to the given magic number, or -1 if the given array is not a well-formed dex file magic number.
      • apiToMagic

        public static String apiToMagic​(int targetApiLevel)
        Returns the magic number corresponding to the given target API level.