当前位置: 首页>>代码示例>>Java>>正文


Java Dex.Section方法代码示例

本文整理汇总了Java中com.android.dex.Dex.Section方法的典型用法代码示例。如果您正苦于以下问题:Java Dex.Section方法的具体用法?Java Dex.Section怎么用?Java Dex.Section使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.android.dex.Dex的用法示例。


在下文中一共展示了Dex.Section方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadStaticValues

import com.android.dex.Dex; //导入方法依赖的package包/类
private void loadStaticValues(ClassDef cls, List<FieldNode> staticFields) throws DecodeException {
	for (FieldNode f : staticFields) {
		if (f.getAccessFlags().isFinal()) {
			f.addAttr(FieldInitAttr.NULL_VALUE);
		}
	}
	int offset = cls.getStaticValuesOffset();
	if (offset == 0) {
		return;
	}
	Dex.Section section = dex.openSection(offset);
	StaticValuesParser parser = new StaticValuesParser(dex, section);
	parser.processFields(staticFields);

	// process const fields
	root().getConstValues().processConstFields(this, staticFields);
}
 
开发者ID:skylot,项目名称:jadx,代码行数:18,代码来源:ClassNode.java

示例2: transformTries

import com.android.dex.Dex; //导入方法依赖的package包/类
private void transformTries(Dex.Section out, Code.Try[] tries,
        int[] catchHandlerOffsets) {
    for (Code.Try tryItem : tries) {
        out.writeInt(tryItem.getStartAddress());
        out.writeUnsignedShort(tryItem.getInstructionCount());
        out.writeUnsignedShort(catchHandlerOffsets[tryItem.getCatchHandlerIndex()]);
    }
}
 
开发者ID:johnlee175,项目名称:dex,代码行数:9,代码来源:DexMerger.java

示例3: readUnsortedValues

import com.android.dex.Dex; //导入方法依赖的package包/类
private List<UnsortedValue> readUnsortedValues(Dex source, IndexMap indexMap) {
    TableOfContents.Section section = getSection(source.getTableOfContents());
    if (!section.exists()) {
        return Collections.emptyList();
    }

    List<UnsortedValue> result = new ArrayList<UnsortedValue>();
    Dex.Section in = source.open(section.off);
    for (int i = 0; i < section.size; i++) {
        int offset = in.getPosition();
        T value = read(in, indexMap, 0);
        result.add(new UnsortedValue(source, indexMap, value, i, offset));
    }
    return result;
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:16,代码来源:DexMerger.java

示例4: transformAnnotationSets

import com.android.dex.Dex; //导入方法依赖的package包/类
private void transformAnnotationSets(Dex in, IndexMap indexMap) {
    TableOfContents.Section section = in.getTableOfContents().annotationSets;
    if (section.exists()) {
        Dex.Section setIn = in.open(section.off);
        for (int i = 0; i < section.size; i++) {
            transformAnnotationSet(indexMap, setIn);
        }
    }
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:10,代码来源:DexMerger.java

示例5: transformAnnotationDirectories

import com.android.dex.Dex; //导入方法依赖的package包/类
private void transformAnnotationDirectories(Dex in, IndexMap indexMap) {
    TableOfContents.Section section = in.getTableOfContents().annotationsDirectories;
    if (section.exists()) {
        Dex.Section directoryIn = in.open(section.off);
        for (int i = 0; i < section.size; i++) {
            transformAnnotationDirectory(directoryIn, indexMap);
        }
    }
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:10,代码来源:DexMerger.java

示例6: transformStaticValues

import com.android.dex.Dex; //导入方法依赖的package包/类
private void transformStaticValues(Dex in, IndexMap indexMap) {
    TableOfContents.Section section = in.getTableOfContents().encodedArrays;
    if (section.exists()) {
        Dex.Section staticValuesIn = in.open(section.off);
        for (int i = 0; i < section.size; i++) {
            transformStaticValues(staticValuesIn, indexMap);
        }
    }
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:10,代码来源:DexMerger.java

示例7: transformAnnotationSetRefList

import com.android.dex.Dex; //导入方法依赖的package包/类
/**
 * Transform all annotation set ref lists.
 */
private void transformAnnotationSetRefList(IndexMap indexMap, Dex.Section refListIn) {
    contentsOut.annotationSetRefLists.size++;
    annotationSetRefListOut.assertFourByteAligned();
    indexMap.putAnnotationSetRefListOffset(
            refListIn.getPosition(), annotationSetRefListOut.getPosition());

    int parameterCount = refListIn.readInt();
    annotationSetRefListOut.writeInt(parameterCount);
    for (int p = 0; p < parameterCount; p++) {
        annotationSetRefListOut.writeInt(indexMap.adjustAnnotationSet(refListIn.readInt()));
    }
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:16,代码来源:DexMerger.java

示例8: mergeSorted

import com.android.dex.Dex; //导入方法依赖的package包/类
/**
 * Merges already-sorted sections, reading one value from each dex into memory
 * at a time.
 */
public final void mergeSorted() {
    TableOfContents.Section[] sections = new TableOfContents.Section[dexes.length];
    Dex.Section[] dexSections = new Dex.Section[dexes.length];
    int[] offsets = new int[dexes.length];
    int[] indexes = new int[dexes.length];

    // values contains one value from each dex, sorted for fast retrieval of
    // the smallest value. The list associated with a value has the indexes
    // of the dexes that had that value.
    TreeMap<T, List<Integer>> values = new TreeMap<T, List<Integer>>();

    for (int i = 0; i < dexes.length; i++) {
        sections[i] = getSection(dexes[i].getTableOfContents());
        dexSections[i] = sections[i].exists() ? dexes[i].open(sections[i].off) : null;
        // Fill in values with the first value of each dex.
        offsets[i] = readIntoMap(
                dexSections[i], sections[i], indexMaps[i], indexes[i], values, i);
    }
    getSection(contentsOut).off = out.getPosition();

    int outCount = 0;
    while (!values.isEmpty()) {
        Map.Entry<T, List<Integer>> first = values.pollFirstEntry();
        for (Integer dex : first.getValue()) {
            updateIndex(offsets[dex], indexMaps[dex], indexes[dex]++, outCount);
            // Fetch the next value of the dexes we just polled out
            offsets[dex] = readIntoMap(dexSections[dex], sections[dex],
                    indexMaps[dex], indexes[dex], values, dex);
        }
        write(first.getKey());
        outCount++;
    }

    getSection(contentsOut).size = outCount;
}
 
开发者ID:johnlee175,项目名称:dex,代码行数:40,代码来源:DexMerger.java

示例9: transformAnnotationSetRefLists

import com.android.dex.Dex; //导入方法依赖的package包/类
private void transformAnnotationSetRefLists(Dex in, IndexMap indexMap) {
    TableOfContents.Section section = in.getTableOfContents().annotationSetRefLists;
    if (section.exists()) {
        Dex.Section setIn = in.open(section.off);
        for (int i = 0; i < section.size; i++) {
            transformAnnotationSetRefList(indexMap, setIn);
        }
    }
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:10,代码来源:DexMerger.java

示例10: readUnsortedValues

import com.android.dex.Dex; //导入方法依赖的package包/类
private List<UnsortedValue> readUnsortedValues(Dex source, IndexMap indexMap) {
    TableOfContents.Section section = getSection(source.getTableOfContents());
    if (!section.exists()) {
        return Collections.emptyList();
    }

    List<UnsortedValue> result = new ArrayList<UnsortedValue>();
    Dex.Section in = source.open(section.off);
    for (int i = 0; i < section.size; i++) {
        int offset = in.getPosition();
        T value = read(in, indexMap, 0);
        result.add(new UnsortedValue(indexMap, value, i, offset));
    }
    return result;
}
 
开发者ID:saleehk,项目名称:buck-cutom,代码行数:16,代码来源:DexMerger.java

示例11: readIntoMap

import com.android.dex.Dex; //导入方法依赖的package包/类
private int readIntoMap(Dex.Section in, TableOfContents.Section section, IndexMap indexMap,
                        int index, TreeMap<T, List<Integer>> values, int dex) {
    int offset = in != null ? in.getPosition() : -1;
    if (index < section.size) {
        T v = read(in, indexMap, index);
        List<Integer> l = values.get(v);
        if (l == null) {
            l = new ArrayList<Integer>();
            values.put(v, l);
        }
        l.add(new Integer(dex));
    }
    return offset;
}
 
开发者ID:facebook,项目名称:buck,代码行数:15,代码来源:DexMerger.java

示例12: IdMerger

import com.android.dex.Dex; //导入方法依赖的package包/类
protected IdMerger(Dex.Section out) {
    this.out = out;
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:4,代码来源:DexMerger.java

示例13: transformDebugInfoItem

import com.android.dex.Dex; //导入方法依赖的package包/类
private void transformDebugInfoItem(Dex.Section in, IndexMap indexMap) {
    contentsOut.debugInfos.size++;
    int lineStart = in.readUleb128();
    debugInfoOut.writeUleb128(lineStart);

    int parametersSize = in.readUleb128();
    debugInfoOut.writeUleb128(parametersSize);

    for (int p = 0; p < parametersSize; p++) {
        int parameterName = in.readUleb128p1();
        debugInfoOut.writeUleb128p1(indexMap.adjustString(parameterName));
    }

    int addrDiff;    // uleb128   address delta.
    int lineDiff;    // sleb128   line delta.
    int registerNum; // uleb128   register number.
    int nameIndex;   // uleb128p1 string index.    Needs indexMap adjustment.
    int typeIndex;   // uleb128p1 type index.      Needs indexMap adjustment.
    int sigIndex;    // uleb128p1 string index.    Needs indexMap adjustment.

    while (true) {
        int opcode = in.readByte();
        debugInfoOut.writeByte(opcode);

        switch (opcode) {
        case DBG_END_SEQUENCE:
            return;

        case DBG_ADVANCE_PC:
            addrDiff = in.readUleb128();
            debugInfoOut.writeUleb128(addrDiff);
            break;

        case DBG_ADVANCE_LINE:
            lineDiff = in.readSleb128();
            debugInfoOut.writeSleb128(lineDiff);
            break;

        case DBG_START_LOCAL:
        case DBG_START_LOCAL_EXTENDED:
            registerNum = in.readUleb128();
            debugInfoOut.writeUleb128(registerNum);
            nameIndex = in.readUleb128p1();
            debugInfoOut.writeUleb128p1(indexMap.adjustString(nameIndex));
            typeIndex = in.readUleb128p1();
            debugInfoOut.writeUleb128p1(indexMap.adjustType(typeIndex));
            if (opcode == DBG_START_LOCAL_EXTENDED) {
                sigIndex = in.readUleb128p1();
                debugInfoOut.writeUleb128p1(indexMap.adjustString(sigIndex));
            }
            break;

        case DBG_END_LOCAL:
        case DBG_RESTART_LOCAL:
            registerNum = in.readUleb128();
            debugInfoOut.writeUleb128(registerNum);
            break;

        case DBG_SET_FILE:
            nameIndex = in.readUleb128p1();
            debugInfoOut.writeUleb128p1(indexMap.adjustString(nameIndex));
            break;

        case DBG_SET_PROLOGUE_END:
        case DBG_SET_EPILOGUE_BEGIN:
        default:
            break;
        }
    }
}
 
开发者ID:johnlee175,项目名称:dex,代码行数:71,代码来源:DexMerger.java

示例14: transformAnnotationDirectory

import com.android.dex.Dex; //导入方法依赖的package包/类
/**
 * Transform all annotations on a class.
 */
private void transformAnnotationDirectory(
        Dex.Section directoryIn, IndexMap indexMap) {
    contentsOut.annotationsDirectories.size++;
    annotationsDirectoryOut.assertFourByteAligned();
    indexMap.putAnnotationDirectoryOffset(
            directoryIn.getPosition(), annotationsDirectoryOut.getPosition());

    int classAnnotationsOffset = indexMap.adjustAnnotationSet(directoryIn.readInt());
    annotationsDirectoryOut.writeInt(classAnnotationsOffset);

    int fieldsSize = directoryIn.readInt();
    annotationsDirectoryOut.writeInt(fieldsSize);

    int methodsSize = directoryIn.readInt();
    annotationsDirectoryOut.writeInt(methodsSize);

    int parameterListSize = directoryIn.readInt();
    annotationsDirectoryOut.writeInt(parameterListSize);

    for (int i = 0; i < fieldsSize; i++) {
        // field index
        annotationsDirectoryOut.writeInt(indexMap.adjustField(directoryIn.readInt()));

        // annotations offset
        annotationsDirectoryOut.writeInt(indexMap.adjustAnnotationSet(directoryIn.readInt()));
    }

    for (int i = 0; i < methodsSize; i++) {
        // method index
        annotationsDirectoryOut.writeInt(indexMap.adjustMethod(directoryIn.readInt()));

        // annotation set offset
        annotationsDirectoryOut.writeInt(
                indexMap.adjustAnnotationSet(directoryIn.readInt()));
    }

    for (int i = 0; i < parameterListSize; i++) {
        // method index
        annotationsDirectoryOut.writeInt(indexMap.adjustMethod(directoryIn.readInt()));

        // annotations offset
        annotationsDirectoryOut.writeInt(
                indexMap.adjustAnnotationSetRefList(directoryIn.readInt()));
    }
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:49,代码来源:DexMerger.java

示例15: transformStaticValues

import com.android.dex.Dex; //导入方法依赖的package包/类
private void transformStaticValues(Dex.Section in, IndexMap indexMap) {
    contentsOut.encodedArrays.size++;
    indexMap.putStaticValuesOffset(in.getPosition(), encodedArrayOut.getPosition());
    indexMap.adjustEncodedArray(in.readEncodedArray()).writeTo(encodedArrayOut);
}
 
开发者ID:johnlee175,项目名称:dex,代码行数:6,代码来源:DexMerger.java


注:本文中的com.android.dex.Dex.Section方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。