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


Java Input类代码示例

本文整理汇总了Java中org.jf.dexlib.Util.Input的典型用法代码示例。如果您正苦于以下问题:Java Input类的具体用法?Java Input怎么用?Java Input使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: OdexHeader

import org.jf.dexlib.Util.Input; //导入依赖的package包/类
public OdexHeader(Input in) {
    magic = in.readBytes(8);

    if (Arrays.equals(MAGIC_35, magic)) {
        version = 35;
    } else if (Arrays.equals(MAGIC_36, magic)) {
        version = 36;
    } else {
        throw new RuntimeException("The magic value is not one of the expected values");
    }

    dexOffset = in.readInt();
    dexLength = in.readInt();
    depsOffset = in.readInt();
    depsLength = in.readInt();
    auxOffset = in.readInt();
    auxLength = in.readInt();
    flags = in.readInt();
    in.readInt(); //padding
}
 
开发者ID:DocGerd,项目名称:DalvikSSA,代码行数:21,代码来源:OdexHeader.java

示例2: OdexDependencies

import org.jf.dexlib.Util.Input; //导入依赖的package包/类
public OdexDependencies (Input in) {
    modificationTime = in.readInt();
    crc = in.readInt();
    dalvikBuild = in.readInt();

    int dependencyCount = in.readInt();

    dependencies = new String[dependencyCount];
    dependencyChecksums = new byte[dependencyCount][];

    for (int i=0; i<dependencyCount; i++) {
        int stringLength = in.readInt();

        try {
            dependencies[i] = new String(in.readBytes(stringLength), 0, stringLength-1, "US-ASCII");
        } catch (UnsupportedEncodingException ex) {
            throw new RuntimeException(ex);
        }
        dependencyChecksums[i] = in.readBytes(20);
    }
}
 
开发者ID:DocGerd,项目名称:DalvikSSA,代码行数:22,代码来源:OdexDependencies.java

示例3: readItem

import org.jf.dexlib.Util.Input; //导入依赖的package包/类
/** {@inheritDoc} */
protected void readItem(Input in, ReadContext readContext) {
    int size = in.readInt();

    for (int i=0; i<size; i++) {
        ItemType itemType = ItemType.fromInt(in.readShort());

        //unused
        in.readShort();

        int sectionSize = in.readInt();
        int sectionOffset = in.readInt();

        readContext.addSection(itemType, sectionSize, sectionOffset);
    }
}
 
开发者ID:DocGerd,项目名称:DalvikSSA,代码行数:17,代码来源:MapItem.java

示例4: readItem

import org.jf.dexlib.Util.Input; //导入依赖的package包/类
/** {@inheritDoc} */
protected void readItem(Input in, ReadContext readContext) {
    classType = dexFile.TypeIdsSection.getItemByIndex(in.readInt());
    accessFlags = in.readInt();
    superType = dexFile.TypeIdsSection.getOptionalItemByIndex(in.readInt());
    implementedInterfaces = (TypeListItem)readContext.getOptionalOffsettedItemByOffset(ItemType.TYPE_TYPE_LIST,
            in.readInt());
    sourceFile = dexFile.StringIdsSection.getOptionalItemByIndex(in.readInt());
    annotations = (AnnotationDirectoryItem)readContext.getOptionalOffsettedItemByOffset(
            ItemType.TYPE_ANNOTATIONS_DIRECTORY_ITEM, in.readInt());
    classData = (ClassDataItem)readContext.getOptionalOffsettedItemByOffset(ItemType.TYPE_CLASS_DATA_ITEM, in.readInt());
    staticFieldInitializers = (EncodedArrayItem)readContext.getOptionalOffsettedItemByOffset(
            ItemType.TYPE_ENCODED_ARRAY_ITEM, in.readInt());

    if (classData != null) {
        classData.setParent(this);
    }
    if (annotations != null) {
        annotations.setParent(this);
    }
}
 
开发者ID:DocGerd,项目名称:DalvikSSA,代码行数:22,代码来源:ClassDefItem.java

示例5: OdexHeaderItem

import org.jf.dexlib.Util.Input; //导入依赖的package包/类
public OdexHeaderItem(Input in) {
    magic = in.readBytes(8);

    for (int i=0; i<8; i++) {
        if (MAGIC[i] != magic[i]) {
            throw new RuntimeException("The magic value is not the expected value");
        }
    }

    dexOffset = in.readInt();
    dexLength = in.readInt();
    depsOffset = in.readInt();
    depsLength = in.readInt();
    auxOffset = in.readInt();
    auxLength = in.readInt();
    flags = in.readInt();
    in.readInt(); //padding
}
 
开发者ID:Sukelluskello,项目名称:VectorAttackScanner,代码行数:19,代码来源:OdexHeaderItem.java

示例6: readFrom

import org.jf.dexlib.Util.Input; //导入依赖的package包/类
/**
 * Read the specified number of items from the given <code>Input</code> object
 * @param size The number of items to read
 * @param in The <code>Input</code> object to read from
 * @param readContext a <code>ReadContext</code> object to hold information that is
 * only needed while reading in a file
 */
protected void readFrom(int size, Input in, ReadContext readContext) {
    //readItems() expects that the list will already be the correct size, so add null items
    //until we reach the specified size
    items.ensureCapacity(size);
    for (int i = items.size(); i < size; i++) {
        items.add(null);
    }

    in.alignTo(ItemType.ItemAlignment);
    offset = in.getCursor();

    //call the subclass's method that actually reads in the items
    readItems(in, readContext);
}
 
开发者ID:DocGerd,项目名称:DalvikSSA,代码行数:22,代码来源:Section.java

示例7: readItem

import org.jf.dexlib.Util.Input; //导入依赖的package包/类
/** {@inheritDoc} */
protected void readItem(Input in, ReadContext readContext) {
    annotations = new AnnotationItem[in.readInt()];

    for (int i=0; i<annotations.length; i++) {
        annotations[i] = (AnnotationItem)readContext.getOffsettedItemByOffset(ItemType.TYPE_ANNOTATION_ITEM,
                in.readInt());
    }
}
 
开发者ID:DocGerd,项目名称:DalvikSSA,代码行数:10,代码来源:AnnotationSetItem.java

示例8: ArrayEncodedSubValue

import org.jf.dexlib.Util.Input; //导入依赖的package包/类
/**
 * Constructs a new <code>ArrayEncodedSubValue</code> by reading the value from the given <code>Input</code> object.
 * The <code>Input</code>'s cursor should be set to the 2nd byte of the encoded value
 * @param dexFile The <code>DexFile</code> that is being read in
 * @param in The <code>Input</code> object to read from
 */
public ArrayEncodedSubValue(DexFile dexFile, Input in) {
    values = new EncodedValue[in.readUnsignedLeb128()];

    for (int i=0; i<values.length; i++) {
        values[i] = EncodedValue.readEncodedValue(dexFile, in);
    }
}
 
开发者ID:DocGerd,项目名称:DalvikSSA,代码行数:14,代码来源:ArrayEncodedSubValue.java

示例9: AnnotationEncodedSubValue

import org.jf.dexlib.Util.Input; //导入依赖的package包/类
/**
* Constructs a new <code>AnnotationEncodedSubValue</code> by reading the value from the given <code>Input</code>
* object.
* @param dexFile The <code>DexFile</code> that is being read in
* @param in The <code>Input</code> object to read from
*/
public AnnotationEncodedSubValue(DexFile dexFile, Input in) {
    annotationType = dexFile.TypeIdsSection.getItemByIndex(in.readUnsignedLeb128());
    names = new StringIdItem[in.readUnsignedLeb128()];
    values = new EncodedValue[names.length];

    for (int i=0; i<names.length; i++) {
        names[i] = dexFile.StringIdsSection.getItemByIndex(in.readUnsignedLeb128());
        values[i] = EncodedValue.readEncodedValue(dexFile, in);
    }
}
 
开发者ID:DocGerd,项目名称:DalvikSSA,代码行数:17,代码来源:AnnotationEncodedSubValue.java

示例10: readItems

import org.jf.dexlib.Util.Input; //导入依赖的package包/类
/** {@inheritDoc} */
protected void readItems(Input in, ReadContext readContext) {
    for (int i = 0; i < items.size(); i++) {
        T item = (T)ItemFactory.makeItem(ItemType, DexFile);
        items.set(i, item);
        item.readFrom(in, i, readContext);
    }
}
 
开发者ID:DocGerd,项目名称:DalvikSSA,代码行数:9,代码来源:IndexedSection.java

示例11: readFrom

import org.jf.dexlib.Util.Input; //导入依赖的package包/类
/**
 * Read in the item from the given input stream, and initialize the index
 * @param in the <code>Input</code> object to read from
 * @param index the index within the containing section of the item being read in
 * @param readContext a <code>ReadContext</code> object to hold information that is
 * only needed while reading in a file
 */
protected void readFrom(Input in, int index, ReadContext readContext) {
    try {
        assert AlignmentUtils.isAligned(in.getCursor(), getItemType().ItemAlignment);

        this.offset = in.getCursor();
        this.index = index;

        this.readItem(in, readContext);
    } catch (Exception ex) {
        throw addExceptionContext(ex);
    }
}
 
开发者ID:DocGerd,项目名称:DalvikSSA,代码行数:20,代码来源:Item.java

示例12: readItem

import org.jf.dexlib.Util.Input; //导入依赖的package包/类
/** {@inheritDoc} */
protected void readItem(Input in, ReadContext readContext) {
    annotationSets = new AnnotationSetItem[in.readInt()];

    for (int i=0; i<annotationSets.length; i++) {
        annotationSets[i] = (AnnotationSetItem)readContext.getOptionalOffsettedItemByOffset(
                ItemType.TYPE_ANNOTATION_SET_ITEM, in.readInt());
    }
}
 
开发者ID:DocGerd,项目名称:DalvikSSA,代码行数:10,代码来源:AnnotationSetRefList.java

示例13: readItem

import org.jf.dexlib.Util.Input; //导入依赖的package包/类
/** {@inheritDoc} */
protected void readItem(Input in, ReadContext readContext) {
    int stringDataOffset = in.readInt();

    stringDataItem = (StringDataItem)readContext.getOffsettedItemByOffset(ItemType.TYPE_STRING_DATA_ITEM,
            stringDataOffset);
}
 
开发者ID:DocGerd,项目名称:DalvikSSA,代码行数:8,代码来源:StringIdItem.java

示例14: readItem

import org.jf.dexlib.Util.Input; //导入依赖的package包/类
/** {@inheritDoc} */
protected void readItem(Input in, ReadContext readContext) {
    int size = in.readInt();
    typeList = new TypeIdItem[size];
    for (int i=0; i<size; i++) {
        int typeIndex = in.readShort();
        typeList[i] = dexFile.TypeIdsSection.getItemByIndex(typeIndex);
    }
}
 
开发者ID:DocGerd,项目名称:DalvikSSA,代码行数:10,代码来源:TypeListItem.java

示例15: readItem

import org.jf.dexlib.Util.Input; //导入依赖的package包/类
/** {@inheritDoc} */
protected void readItem(Input in, ReadContext readContext) {
    classType = dexFile.TypeIdsSection.getItemByIndex(in.readInt());
    accessFlags = in.readInt();
    superType = dexFile.TypeIdsSection.getOptionalItemByIndex(in.readInt());
    implementedInterfaces = (TypeListItem)readContext.getOptionalOffsettedItemByOffset(ItemType.TYPE_TYPE_LIST,
            in.readInt());
    sourceFile = dexFile.StringIdsSection.getOptionalItemByIndex(in.readInt());
    annotations = (AnnotationDirectoryItem)readContext.getOptionalOffsettedItemByOffset(
            ItemType.TYPE_ANNOTATIONS_DIRECTORY_ITEM, in.readInt());
    classData = (ClassDataItem)readContext.getOptionalOffsettedItemByOffset(ItemType.TYPE_CLASS_DATA_ITEM, in.readInt());
    staticFieldInitializers = (EncodedArrayItem)readContext.getOptionalOffsettedItemByOffset(
            ItemType.TYPE_ENCODED_ARRAY_ITEM, in.readInt());
}
 
开发者ID:longluo,项目名称:smali,代码行数:15,代码来源:ClassDefItem.java


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