本文整理汇总了Java中org.jf.dexlib.Util.Input.readInt方法的典型用法代码示例。如果您正苦于以下问题:Java Input.readInt方法的具体用法?Java Input.readInt怎么用?Java Input.readInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jf.dexlib.Util.Input
的用法示例。
在下文中一共展示了Input.readInt方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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
}
示例6: 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());
}
}
示例7: 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());
}
}
示例8: 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);
}
示例9: 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);
}
}
示例10: 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());
}
示例11: readItem
import org.jf.dexlib.Util.Input; //导入方法依赖的package包/类
/** {@inheritDoc} */
protected void readItem(Input in, ReadContext readContext) {
byte[] readMagic = in.readBytes(8);
for (int i=0; i<8; i++) {
if (MAGIC[i] != readMagic[i]) {
throw new RuntimeException("The magic value is not the expected value");
}
}
in.readBytes(20); //checksum
in.readInt(); //signature
in.readInt(); //filesize
if (in.readInt() != HEADER_SIZE) {
throw new RuntimeException("The header size is not the expected value (0x70)");
}
int endianTag = in.readInt();
if (endianTag == BIG_ENDIAN) {
throw new RuntimeException("This dex file is big endian. Only little endian is currently supported.");
} else if (endianTag != LITTLE_ENDIAN) {
throw new RuntimeException("The endian tag is not 0x12345678 or 0x78563412");
}
//link_size
if (in.readInt() != 0) {
throw new RuntimeException("This dex file has a link section, which is not supported");
}
//link_off
if (in.readInt() != 0) {
throw new RuntimeException("This dex file has a link section, which is not supported");
}
int sectionSize;
int sectionOffset;
//map_offset
sectionOffset = in.readInt();
readContext.addSection(ItemType.TYPE_MAP_LIST, 1, sectionOffset);
//string_id_item
sectionSize = in.readInt();
sectionOffset = in.readInt();
readContext.addSection(ItemType.TYPE_STRING_ID_ITEM, sectionSize, sectionOffset);
//type_id_item
sectionSize = in.readInt();
sectionOffset = in.readInt();
readContext.addSection(ItemType.TYPE_TYPE_ID_ITEM, sectionSize, sectionOffset);
//proto_id_item
sectionSize = in.readInt();
sectionOffset = in.readInt();
readContext.addSection(ItemType.TYPE_PROTO_ID_ITEM, sectionSize, sectionOffset);
//field_id_item
sectionSize = in.readInt();
sectionOffset = in.readInt();
readContext.addSection(ItemType.TYPE_FIELD_ID_ITEM, sectionSize, sectionOffset);
//method_id_item
sectionSize = in.readInt();
sectionOffset = in.readInt();
readContext.addSection(ItemType.TYPE_METHOD_ID_ITEM, sectionSize, sectionOffset);
//class_data_item
sectionSize = in.readInt();
sectionOffset = in.readInt();
readContext.addSection(ItemType.TYPE_CLASS_DEF_ITEM, sectionSize, sectionOffset);
in.readInt(); //data_size
in.readInt(); //data_off
}
示例12: readItem
import org.jf.dexlib.Util.Input; //导入方法依赖的package包/类
/** {@inheritDoc} */
protected void readItem(Input in, ReadContext readContext) {
int stringIdIndex = in.readInt();
this.typeDescriptor = dexFile.StringIdsSection.getItemByIndex(stringIdIndex);
}