Class DexFileReader

  • All Implemented Interfaces:
    BaseDexFileReader

    public class DexFileReader
    extends java.lang.Object
    implements BaseDexFileReader
    Open and read a dex file.this is the entrance of dex-reader. to read a dex/odex, use the following code:
     DexFileVisitor visitor = new xxxFileVisitor();
     DexFileReader reader = new DexFileReader(dexFile);
     reader.accept(visitor);
     
    • Field Detail

      • SKIP_DEBUG

        public static final int SKIP_DEBUG
        skip debug infos in dex file.
        See Also:
        Constant Field Values
      • SKIP_ANNOTATION

        public static final int SKIP_ANNOTATION
        skip annotation info in dex file.
        See Also:
        Constant Field Values
      • SKIP_FIELD_CONSTANT

        public static final int SKIP_FIELD_CONSTANT
        skip field constant in dex file.
        See Also:
        Constant Field Values
      • IGNORE_READ_EXCEPTION

        public static final int IGNORE_READ_EXCEPTION
        ingore read exception
        See Also:
        Constant Field Values
      • KEEP_ALL_METHODS

        public static final int KEEP_ALL_METHODS
        read all methods, even if they are glitch
        See Also:
        Constant Field Values
      • SKIP_BROKEN_DEBUG_INFO

        public static final int SKIP_BROKEN_DEBUG_INFO
        Do not throw an exception if debug info is not valid
        See Also:
        Constant Field Values
    • Constructor Detail

      • DexFileReader

        public DexFileReader​(java.nio.ByteBuffer in)
        read dex from a ByteBuffer.
        Parameters:
        in -
      • DexFileReader

        public DexFileReader​(java.nio.ByteBuffer in,
                             int position)
        read dex from a ByteBuffer.
        Parameters:
        in -
        position - start of the dexfile in the buffer
      • DexFileReader

        public DexFileReader​(byte[] data)
        Parameters:
        data - the byte array of dex