com.android.dx.dex.file.MixedItemSection.SortType Java Examples

The following examples show how to use com.android.dx.dex.file.MixedItemSection.SortType. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DexFile.java    From J2ME-Loader with Apache License 2.0 5 votes vote down vote up
/**
 * Constructs an instance. It is initially empty.
 */
public DexFile(DexOptions dexOptions) {
    this.dexOptions = dexOptions;

    header = new HeaderSection(this);
    typeLists = new MixedItemSection(null, this, 4, SortType.NONE);
    wordData = new MixedItemSection("word_data", this, 4, SortType.TYPE);
    stringData =
        new MixedItemSection("string_data", this, 1, SortType.INSTANCE);
    classData = new MixedItemSection(null, this, 1, SortType.NONE);
    byteData = new MixedItemSection("byte_data", this, 1, SortType.TYPE);
    stringIds = new StringIdsSection(this);
    typeIds = new TypeIdsSection(this);
    protoIds = new ProtoIdsSection(this);
    fieldIds = new FieldIdsSection(this);
    methodIds = new MethodIdsSection(this);
    classDefs = new ClassDefsSection(this);
    map = new MixedItemSection("map", this, 4, SortType.NONE);

    /*
     * This is the list of sections in the order they appear in
     * the final output.
     */
    sections = new Section[] {
        header, stringIds, typeIds, protoIds, fieldIds, methodIds,
        classDefs, wordData, typeLists, stringData, byteData,
        classData, map };

    fileSize = -1;
    dumpWidth = 79;
}
 
Example #2
Source File: DexFile.java    From buck with Apache License 2.0 5 votes vote down vote up
/**
 * Constructs an instance. It is initially empty.
 */
public DexFile(DexOptions dexOptions) {
    this.dexOptions = dexOptions;

    header = new HeaderSection(this);
    typeLists = new MixedItemSection(null, this, 4, SortType.NONE);
    wordData = new MixedItemSection("word_data", this, 4, SortType.TYPE);
    stringData =
        new MixedItemSection("string_data", this, 1, SortType.INSTANCE);
    classData = new MixedItemSection(null, this, 1, SortType.NONE);
    byteData = new MixedItemSection("byte_data", this, 1, SortType.TYPE);
    stringIds = new StringIdsSection(this);
    typeIds = new TypeIdsSection(this);
    protoIds = new ProtoIdsSection(this);
    fieldIds = new FieldIdsSection(this);
    methodIds = new MethodIdsSection(this);
    classDefs = new ClassDefsSection(this);
    map = new MixedItemSection("map", this, 4, SortType.NONE);

    /*
     * This is the list of sections in the order they appear in
     * the final output.
     */
    sections = new Section[] {
        header, stringIds, typeIds, protoIds, fieldIds, methodIds,
        classDefs, wordData, typeLists, stringData, byteData,
        classData, map };

    fileSize = -1;
    dumpWidth = 79;
}
 
Example #3
Source File: DexFile.java    From Box with Apache License 2.0 4 votes vote down vote up
/**
 * Constructs an instance. It is initially empty.
 *
 * @param dexOptions {@code non-null;} DEX file generations options to apply
 */
public DexFile(final DexOptions dexOptions) {
    this.dexOptions = dexOptions;

    header = new HeaderSection(this);
    typeLists = new MixedItemSection(null, this, 4, SortType.NONE);
    wordData = new MixedItemSection("word_data", this, 4, SortType.TYPE);
    stringData =
        new MixedItemSection("string_data", this, 1, SortType.INSTANCE);
    classData = new MixedItemSection(null, this, 1, SortType.NONE);
    byteData = new MixedItemSection("byte_data", this, 1, SortType.TYPE);
    stringIds = new StringIdsSection(this);
    typeIds = new TypeIdsSection(this);
    protoIds = new ProtoIdsSection(this);
    fieldIds = new FieldIdsSection(this);
    methodIds = new MethodIdsSection(this);
    classDefs = new ClassDefsSection(this);
    map = new MixedItemSection("map", this, 4, SortType.NONE);

    /*
     * Prepare the list of sections in the order they appear in
     * the final output.
     */
    if (dexOptions.apiIsSupported(DexFormat.API_METHOD_HANDLES)) {
        /*
         * Method handles and call sites only visible in DEX files
         * from SDK version 26 onwards. Do not create or add sections unless
         * version true. This is conditional to avoid churn in the dx tests
         * that look at annotated output.
         */
        callSiteIds = new CallSiteIdsSection(this);
        methodHandles = new MethodHandlesSection(this);

        sections = new Section[] {
            header, stringIds, typeIds, protoIds, fieldIds, methodIds, classDefs,
            callSiteIds, methodHandles,
            wordData, typeLists, stringData, byteData, classData, map };
    } else {
        callSiteIds = null;
        methodHandles = null;

        sections = new Section[] {
            header, stringIds, typeIds, protoIds, fieldIds, methodIds, classDefs,
            wordData, typeLists, stringData, byteData, classData, map };
    }

    fileSize = -1;
    dumpWidth = 79;
}
 
Example #4
Source File: DexFile.java    From Box with Apache License 2.0 4 votes vote down vote up
/**
 * Constructs an instance. It is initially empty.
 *
 * @param dexOptions {@code non-null;} DEX file generations options to apply
 */
public DexFile(final DexOptions dexOptions) {
    this.dexOptions = dexOptions;

    header = new HeaderSection(this);
    typeLists = new MixedItemSection(null, this, 4, SortType.NONE);
    wordData = new MixedItemSection("word_data", this, 4, SortType.TYPE);
    stringData =
        new MixedItemSection("string_data", this, 1, SortType.INSTANCE);
    classData = new MixedItemSection(null, this, 1, SortType.NONE);
    byteData = new MixedItemSection("byte_data", this, 1, SortType.TYPE);
    stringIds = new StringIdsSection(this);
    typeIds = new TypeIdsSection(this);
    protoIds = new ProtoIdsSection(this);
    fieldIds = new FieldIdsSection(this);
    methodIds = new MethodIdsSection(this);
    classDefs = new ClassDefsSection(this);
    map = new MixedItemSection("map", this, 4, SortType.NONE);

    /*
     * Prepare the list of sections in the order they appear in
     * the final output.
     */
    if (dexOptions.apiIsSupported(DexFormat.API_METHOD_HANDLES)) {
        /*
         * Method handles and call sites only visible in DEX files
         * from SDK version 26 onwards. Do not create or add sections unless
         * version true. This is conditional to avoid churn in the dx tests
         * that look at annotated output.
         */
        callSiteIds = new CallSiteIdsSection(this);
        methodHandles = new MethodHandlesSection(this);

        sections = new Section[] {
            header, stringIds, typeIds, protoIds, fieldIds, methodIds, classDefs,
            callSiteIds, methodHandles,
            wordData, typeLists, stringData, byteData, classData, map };
    } else {
        callSiteIds = null;
        methodHandles = null;

        sections = new Section[] {
            header, stringIds, typeIds, protoIds, fieldIds, methodIds, classDefs,
            wordData, typeLists, stringData, byteData, classData, map };
    }

    fileSize = -1;
    dumpWidth = 79;
}