Package proguard.io

Class DexClassReader

  • All Implemented Interfaces:
    DataEntryReader

    public class DexClassReader
    extends java.lang.Object
    implements DataEntryReader
    This data entry reader reads dex files, converts their classes, and passes them to a given class visitor.
    • Constructor Summary

      Constructors 
      Constructor Description
      DexClassReader​(boolean readCode, boolean usePrimitiveArrayConstants, ClassVisitor classVisitor)
      Creates a new DexClassReader.
      DexClassReader​(boolean readCode, ClassVisitor classVisitor)
      Creates a new DexClassReader.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void main​(java.lang.String[] args)
      This main method illustrates and tests the class.
      void read​(DataEntry dataEntry)
      Reads the given data entry.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DexClassReader

        public DexClassReader​(boolean readCode,
                              ClassVisitor classVisitor)
        Creates a new DexClassReader.

        Does not generate PrimitiveArrayConstants by default, which is a custom ProGuardCORE extension.

        Parameters:
        readCode - specifies whether to read the actual code or just skip it.
        classVisitor - the class visitor to which decoded classes will be passed.
      • DexClassReader

        public DexClassReader​(boolean readCode,
                              boolean usePrimitiveArrayConstants,
                              ClassVisitor classVisitor)
        Creates a new DexClassReader.

        If PrimitiveArrayConstants are generated then they should be converted back to standard Java arrays before converting to Java class files using PrimitiveArrayConstantReplacer.

        Parameters:
        readCode - specifies whether to read the actual code or just skip it.
        usePrimitiveArrayConstants - specifies whether PrimitiveArrayConstant can be generated when applicable.
        classVisitor - the class visitor to which decoded classes will be passed.
    • Method Detail

      • read

        public void read​(DataEntry dataEntry)
                  throws java.io.IOException
        Description copied from interface: DataEntryReader
        Reads the given data entry.
        Specified by:
        read in interface DataEntryReader
        Throws:
        java.io.IOException
      • main

        public static void main​(java.lang.String[] args)
                         throws java.lang.Exception
        This main method illustrates and tests the class. It reads an input dex file (or jar file with a dex file) and prints out its classes.
        Throws:
        java.lang.Exception