Package proguard.io

Class D8BasedDexDataEntryWriter

  • All Implemented Interfaces:
    java.lang.AutoCloseable, DataEntryWriter

    public class D8BasedDexDataEntryWriter
    extends DexDataEntryWriter
    An dex writer that uses the d8 tool from the Android SDK.
    • Constructor Detail

      • D8BasedDexDataEntryWriter

        public D8BasedDexDataEntryWriter​(ClassPool classPool,
                                         StringMatcher classNameFilter,
                                         ClassPath libraryJars,
                                         java.lang.String dexFileName,
                                         boolean forceDex,
                                         int minSdkVersion,
                                         boolean debuggable,
                                         DataEntryReader extraDexDataEntryVisitor,
                                         DataEntryWriter dexDataEntryWriter,
                                         DataEntryWriter otherDataEntryWriter)
        Creates a new D8BasedDexDataEntryWriter.
        Parameters:
        classPool - the class pool from which classes are collected.
        classNameFilter - an optional filter for classes to be written.
        dexFileName - the dex file name.
        forceDex - specifies whether the dex files should always be written, even if they don't contain any code.
        minSdkVersion - the minimum supported API level.
        debuggable - whether the dex file shall be debuggable or not.
        extraDexDataEntryVisitor - an optional extra visitor for all dex data entries that written. The visitor can use the data entry names, but must not read their contents.
        dexDataEntryWriter - the writer to which the converted dex file is written.
        otherDataEntryWriter - the writer to which other data entries are written.
    • Method Detail

      • createClassConverter

        protected ClassVisitor createClassConverter()
      • writeDex

        protected void writeDex​(java.io.OutputStream outputStream)
                         throws java.io.IOException
        Description copied from class: DexDataEntryWriter
        Creates a new Dex instance from the collected classes.
        Specified by:
        writeDex in class DexDataEntryWriter
        Throws:
        java.io.IOException
      • println

        public void println​(java.io.PrintWriter pw,
                            java.lang.String prefix)
        Description copied from interface: DataEntryWriter
        Prints out the structure of the data entry writer.
        Specified by:
        println in interface DataEntryWriter
        Overrides:
        println in class DexDataEntryWriter
        Parameters:
        pw - the print stream to which the structure should be printed.
        prefix - a prefix for every printed line.