/** * Loads the class defs list. */ void loadClassDefs() throws IOException { int count = mHeaderItem.classDefsSize; mClassDefs = new ClassDefItem[count]; //System.out.println("reading " + count + " classDefs"); seek(mHeaderItem.classDefsOff); for (int i = 0; i < count; i++) { mClassDefs[i] = new ClassDefItem(); mClassDefs[i].classIdx = readInt(); /* access_flags = */ readInt(); /* superclass_idx = */ readInt(); /* interfaces_off = */ readInt(); /* source_file_idx = */ readInt(); /* annotations_off = */ readInt(); /* class_data_off = */ readInt(); /* static_values_off = */ readInt(); //System.out.println(i + ": " + mClassDefs[i].classIdx + " " + // mStrings[mTypeIds[mClassDefs[i].classIdx].descriptorIdx]); } }
/** * Loads the class defs list. */ void loadClassDefs() throws IOException { int count = mHeaderItem.classDefsSize; mClassDefs = new ClassDefItem[count]; //System.out.println("reading " + count + " classDefs"); seek(mHeaderItem.classDefsOff); for (int i = 0; i < count; i++) { mClassDefs[i] = new ClassDefItem(); mClassDefs[i].classIdx = readInt(); /* access_flags = */ readInt(); /* superclass_idx = */ readInt(); /* interfaces_off = */ readInt(); /* source_file_idx = */ readInt(); /* annotations_off = */ readInt(); /* class_data_off = */ readInt(); /* static_values_off = */ readInt(); //System.out.println(i + ": " + mClassDefs[i].classIdx + " " + // mStrings[mTypeIds[mClassDefs[i].classIdx].descriptorIdx]); } }
/** * Loads the class defs list. */ void loadClassDefs() throws IOException { int count = mHeaderItem.classDefsSize; mClassDefs = new ClassDefItem[count]; //System.out.println("reading " + count + " classDefs"); seek(mHeaderItem.classDefsOff); for (int i = 0; i < count; i++) { mClassDefs[i] = new ClassDefItem(); mClassDefs[i].classIdx = readInt(); /* access_flags = */ readInt(); /* superclass_idx = */ readInt(); /* interfaces_off = */ readInt(); /* source_file_idx = */ readInt(); /* annotations_off = */ readInt(); /* class_data_off = */ readInt(); /* static_values_off = */ readInt(); //System.out.println(i + ": " + mClassDefs[i].classIdx + " " + // mStrings[mTypeIds[mClassDefs[i].classIdx].descriptorIdx]); } }
/** * Loads the class defs list. */ void loadClassDefs() throws IOException { int count = mHeaderItem.classDefsSize; mClassDefs = new ClassDefItem[count]; //System.out.println("reading " + count + " classDefs"); seek(mHeaderItem.classDefsOff); for (int i = 0; i < count; i++) { mClassDefs[i] = new ClassDefItem(); mClassDefs[i].classIdx = readInt(); /* access_flags = */ readInt(); /* superclass_idx = */ readInt(); /* interfaces_off = */ readInt(); /* source_file_idx = */ readInt(); /* annotations_off = */ readInt(); /* class_data_off = */ readInt(); /* static_values_off = */ readInt(); //System.out.println(i + ": " + mClassDefs[i].classIdx + " " + // mStrings[mTypeIds[mClassDefs[i].classIdx].descriptorIdx]); } }
/** * Loads the type ID list. */ void loadTypeIds() throws IOException { int count = mHeaderItem.typeIdsSize; mTypeIds = new TypeIdItem[count]; //System.out.println("reading " + count + " typeIds"); seek(mHeaderItem.typeIdsOff); for (int i = 0; i < count; i++) { mTypeIds[i] = new TypeIdItem(); mTypeIds[i].descriptorIdx = readInt(); //System.out.println(i + ": " + mTypeIds[i].descriptorIdx + // " " + mStrings[mTypeIds[i].descriptorIdx]); } }
/** * Loads the type ID list. */ void loadTypeIds() throws IOException { int count = mHeaderItem.typeIdsSize; mTypeIds = new TypeIdItem[count]; //System.out.println("reading " + count + " typeIds"); seek(mHeaderItem.typeIdsOff); for (int i = 0; i < count; i++) { mTypeIds[i] = new TypeIdItem(); mTypeIds[i].descriptorIdx = readInt(); //System.out.println(i + ": " + mTypeIds[i].descriptorIdx + // " " + mStrings[mTypeIds[i].descriptorIdx]); } }
/** * Loads the type ID list. */ void loadTypeIds() throws IOException { int count = mHeaderItem.typeIdsSize; mTypeIds = new TypeIdItem[count]; //System.out.println("reading " + count + " typeIds"); seek(mHeaderItem.typeIdsOff); for (int i = 0; i < count; i++) { mTypeIds[i] = new TypeIdItem(); mTypeIds[i].descriptorIdx = readInt(); //System.out.println(i + ": " + mTypeIds[i].descriptorIdx + // " " + mStrings[mTypeIds[i].descriptorIdx]); } }
/** * Loads the type ID list. */ void loadTypeIds() throws IOException { int count = mHeaderItem.typeIdsSize; mTypeIds = new TypeIdItem[count]; //System.out.println("reading " + count + " typeIds"); seek(mHeaderItem.typeIdsOff); for (int i = 0; i < count; i++) { mTypeIds[i] = new TypeIdItem(); mTypeIds[i].descriptorIdx = readInt(); //System.out.println(i + ": " + mTypeIds[i].descriptorIdx + // " " + mStrings[mTypeIds[i].descriptorIdx]); } }
/** * Loads the type ID list. */ void loadTypeIds() throws IOException { int count = mHeaderItem.typeIdsSize; mTypeIds = new TypeIdItem[count]; //System.out.println("reading " + count + " typeIds"); seek(mHeaderItem.typeIdsOff); for (int i = 0; i < count; i++) { mTypeIds[i] = new TypeIdItem(); mTypeIds[i].descriptorIdx = readInt(); //System.out.println(i + ": " + mTypeIds[i].descriptorIdx + // " " + mStrings[mTypeIds[i].descriptorIdx]); } }
/** * Loads the method ID list. */ void loadMethodIds() throws IOException { int count = mHeaderItem.methodIdsSize; mMethodIds = new MethodIdItem[count]; //System.out.println("reading " + count + " methodIds"); seek(mHeaderItem.methodIdsOff); for (int i = 0; i < count; i++) { mMethodIds[i] = new MethodIdItem(); mMethodIds[i].classIdx = readShort() & 0xffff; mMethodIds[i].protoIdx = readShort() & 0xffff; mMethodIds[i].nameIdx = readInt(); //System.out.println(i + ": " + mMethodIds[i].nameIdx + // " " + mStrings[mMethodIds[i].nameIdx]); } }
/** * Loads the field ID list. */ void loadFieldIds() throws IOException { int count = mHeaderItem.fieldIdsSize; mFieldIds = new FieldIdItem[count]; //System.out.println("reading " + count + " fieldIds"); seek(mHeaderItem.fieldIdsOff); for (int i = 0; i < count; i++) { mFieldIds[i] = new FieldIdItem(); mFieldIds[i].classIdx = readShort() & 0xffff; mFieldIds[i].typeIdx = readShort() & 0xffff; mFieldIds[i].nameIdx = readInt(); //System.out.println(i + ": " + mFieldIds[i].nameIdx + // " " + mStrings[mFieldIds[i].nameIdx]); } }
/** * Loads the field ID list. */ void loadFieldIds() throws IOException { int count = mHeaderItem.fieldIdsSize; mFieldIds = new FieldIdItem[count]; //System.out.println("reading " + count + " fieldIds"); seek(mHeaderItem.fieldIdsOff); for (int i = 0; i < count; i++) { mFieldIds[i] = new FieldIdItem(); mFieldIds[i].classIdx = readShort() & 0xffff; mFieldIds[i].typeIdx = readShort() & 0xffff; mFieldIds[i].nameIdx = readInt(); //System.out.println(i + ": " + mFieldIds[i].nameIdx + // " " + mStrings[mFieldIds[i].nameIdx]); } }
/** * Loads the field ID list. */ void loadFieldIds() throws IOException { int count = mHeaderItem.fieldIdsSize; mFieldIds = new FieldIdItem[count]; //System.out.println("reading " + count + " fieldIds"); seek(mHeaderItem.fieldIdsOff); for (int i = 0; i < count; i++) { mFieldIds[i] = new FieldIdItem(); mFieldIds[i].classIdx = readShort() & 0xffff; mFieldIds[i].typeIdx = readShort() & 0xffff; mFieldIds[i].nameIdx = readInt(); //System.out.println(i + ": " + mFieldIds[i].nameIdx + // " " + mStrings[mFieldIds[i].nameIdx]); } }
/** * Loads the field ID list. */ void loadFieldIds() throws IOException { int count = mHeaderItem.fieldIdsSize; mFieldIds = new FieldIdItem[count]; //System.out.println("reading " + count + " fieldIds"); seek(mHeaderItem.fieldIdsOff); for (int i = 0; i < count; i++) { mFieldIds[i] = new FieldIdItem(); mFieldIds[i].classIdx = readShort() & 0xffff; mFieldIds[i].typeIdx = readShort() & 0xffff; mFieldIds[i].nameIdx = readInt(); //System.out.println(i + ": " + mFieldIds[i].nameIdx + // " " + mStrings[mFieldIds[i].nameIdx]); } }
/** * Loads the method ID list. */ void loadMethodIds() throws IOException { int count = mHeaderItem.methodIdsSize; mMethodIds = new MethodIdItem[count]; //System.out.println("reading " + count + " methodIds"); seek(mHeaderItem.methodIdsOff); for (int i = 0; i < count; i++) { mMethodIds[i] = new MethodIdItem(); mMethodIds[i].classIdx = readShort() & 0xffff; mMethodIds[i].protoIdx = readShort() & 0xffff; mMethodIds[i].nameIdx = readInt(); //System.out.println(i + ": " + mMethodIds[i].nameIdx + // " " + mStrings[mMethodIds[i].nameIdx]); } }
/** * Loads the method ID list. */ void loadMethodIds() throws IOException { int count = mHeaderItem.methodIdsSize; mMethodIds = new MethodIdItem[count]; //System.out.println("reading " + count + " methodIds"); seek(mHeaderItem.methodIdsOff); for (int i = 0; i < count; i++) { mMethodIds[i] = new MethodIdItem(); mMethodIds[i].classIdx = readShort() & 0xffff; mMethodIds[i].protoIdx = readShort() & 0xffff; mMethodIds[i].nameIdx = readInt(); //System.out.println(i + ": " + mMethodIds[i].nameIdx + // " " + mStrings[mMethodIds[i].nameIdx]); } }
/** * Loads the field ID list. */ void loadFieldIds() throws IOException { int count = mHeaderItem.fieldIdsSize; mFieldIds = new FieldIdItem[count]; //System.out.println("reading " + count + " fieldIds"); seek(mHeaderItem.fieldIdsOff); for (int i = 0; i < count; i++) { mFieldIds[i] = new FieldIdItem(); mFieldIds[i].classIdx = readShort() & 0xffff; mFieldIds[i].typeIdx = readShort() & 0xffff; mFieldIds[i].nameIdx = readInt(); //System.out.println(i + ": " + mFieldIds[i].nameIdx + // " " + mStrings[mFieldIds[i].nameIdx]); } }
/** * Loads the method ID list. */ void loadMethodIds() throws IOException { int count = mHeaderItem.methodIdsSize; mMethodIds = new MethodIdItem[count]; //System.out.println("reading " + count + " methodIds"); seek(mHeaderItem.methodIdsOff); for (int i = 0; i < count; i++) { mMethodIds[i] = new MethodIdItem(); mMethodIds[i].classIdx = readShort() & 0xffff; mMethodIds[i].protoIdx = readShort() & 0xffff; mMethodIds[i].nameIdx = readInt(); //System.out.println(i + ": " + mMethodIds[i].nameIdx + // " " + mStrings[mMethodIds[i].nameIdx]); } }
/** * Loads the method ID list. */ void loadMethodIds() throws IOException { int count = mHeaderItem.methodIdsSize; mMethodIds = new MethodIdItem[count]; //System.out.println("reading " + count + " methodIds"); seek(mHeaderItem.methodIdsOff); for (int i = 0; i < count; i++) { mMethodIds[i] = new MethodIdItem(); mMethodIds[i].classIdx = readShort() & 0xffff; mMethodIds[i].protoIdx = readShort() & 0xffff; mMethodIds[i].nameIdx = readInt(); //System.out.println(i + ": " + mMethodIds[i].nameIdx + // " " + mStrings[mMethodIds[i].nameIdx]); } }
/** * Loads the string table out of the DEX. * * First we read all of the string_id_items, then we read all of the * string_data_item. Doing it this way should allow us to avoid * seeking around in the file. */ void loadStrings() throws IOException { int count = mHeaderItem.stringIdsSize; int stringOffsets[] = new int[count]; //System.out.println("reading " + count + " strings"); seek(mHeaderItem.stringIdsOff); for (int i = 0; i < count; i++) { stringOffsets[i] = readInt(); } mStrings = new String[count]; seek(stringOffsets[0]); for (int i = 0; i < count; i++) { seek(stringOffsets[i]); // should be a no-op mStrings[i] = readString(); //System.out.println("STR: " + i + ": " + mStrings[i]); } }