private Code readCode() { int registersSize = readUnsignedShort(); int insSize = readUnsignedShort(); int outsSize = readUnsignedShort(); int triesSize = readUnsignedShort(); int debugInfoOffset = readInt(); int instructionsSize = readInt(); short[] instructions = readShortArray(instructionsSize); Try[] tries; CatchHandler[] catchHandlers; if (triesSize > 0) { if (instructions.length % 2 == 1) { readShort(); // padding } /* * We can't read the tries until we've read the catch handlers. * Unfortunately they're in the opposite order in the dex file * so we need to read them out-of-order. */ Section triesSection = open(data.position()); skip(triesSize * SizeOf.TRY_ITEM); catchHandlers = readCatchHandlers(); tries = triesSection.readTries(triesSize, catchHandlers); } else { tries = new Try[0]; catchHandlers = new CatchHandler[0]; } return new Code(registersSize, insSize, outsSize, debugInfoOffset, instructions, tries, catchHandlers); }
private Code readCode() { int registersSize = readUnsignedShort(); int insSize = readUnsignedShort(); int outsSize = readUnsignedShort(); int triesSize = readUnsignedShort(); int debugInfoOffset = readInt(); int instructionsSize = readInt(); short[] instructions = readShortArray(instructionsSize); Try[] tries; CatchHandler[] catchHandlers; if (triesSize > 0) { if (instructions.length % 2 == 1) { readShort(); // padding } /* * We can't read the tries until we've read the catch handlers. * Unfortunately they're in the opposite order in the dex file * so we need to read them out-of-order. */ Section triesSection = open(data.position()); skip(triesSize * SizeOf.TRY_ITEM); catchHandlers = readCatchHandlers(); tries = triesSection.readTries(triesSize, catchHandlers); } else { tries = new Try[0]; catchHandlers = new CatchHandler[0]; } return new Code(registersSize, insSize, outsSize, debugInfoOffset, instructions, tries, catchHandlers); }
private Code readCode() { int registersSize = readUnsignedShort(); int insSize = readUnsignedShort(); int outsSize = readUnsignedShort(); int triesSize = readUnsignedShort(); int debugInfoOffset = readInt(); int instructionsSize = readInt(); short[] instructions = readShortArray(instructionsSize); Try[] tries; CatchHandler[] catchHandlers; if (triesSize > 0) { if (instructions.length % 2 == 1) { readShort(); // padding } /* * We can't read the tries until we've read the catch handlers. * Unfortunately they're in the opposite order in the dex file * so we need to read them out-of-order. */ Section triesSection = open(data.position()); skip(triesSize * SizeOf.TRY_ITEM); catchHandlers = readCatchHandlers(); tries = triesSection.readTries(triesSize, catchHandlers); } else { tries = new Try[0]; catchHandlers = new CatchHandler[0]; } return new Code(registersSize, insSize, outsSize, debugInfoOffset, instructions, tries, catchHandlers); }
public FieldId readFieldId() { int declaringClassIndex = readUnsignedShort(); int typeIndex = readUnsignedShort(); int nameIndex = readInt(); return new FieldId(Dex.this, declaringClassIndex, typeIndex, nameIndex); }
public FieldId readFieldId() { int declaringClassIndex = readUnsignedShort(); int typeIndex = readUnsignedShort(); int nameIndex = readInt(); return new FieldId(Dex.this, declaringClassIndex, typeIndex, nameIndex); }
private Try[] readTries(int triesSize, CatchHandler[] catchHandlers) { Try[] result = new Try[triesSize]; for (int i = 0; i < triesSize; i++) { int startAddress = readInt(); int instructionCount = readUnsignedShort(); int handlerOffset = readUnsignedShort(); int catchHandlerIndex = findCatchHandlerIndex(catchHandlers, handlerOffset); result[i] = new Try(startAddress, instructionCount, catchHandlerIndex); } return result; }
public MethodId readMethodId() { int declaringClassIndex = readUnsignedShort(); int protoIndex = readUnsignedShort(); int nameIndex = readInt(); return new MethodId(Dex.this, declaringClassIndex, protoIndex, nameIndex); }
public MethodId readMethodId() { int declaringClassIndex = readUnsignedShort(); int protoIndex = readUnsignedShort(); int nameIndex = readInt(); return new MethodId(Dex.this, declaringClassIndex, protoIndex, nameIndex); }
public MethodHandle readMethodHandle() { MethodHandleType methodHandleType = MethodHandleType.fromValue(readUnsignedShort()); int unused1 = readUnsignedShort(); int fieldOrMethodId = readUnsignedShort(); int unused2 = readUnsignedShort(); return new MethodHandle(Dex.this, methodHandleType, unused1, fieldOrMethodId, unused2); }
private Try[] readTries(int triesSize, CatchHandler[] catchHandlers) { Try[] result = new Try[triesSize]; for (int i = 0; i < triesSize; i++) { int startAddress = readInt(); int instructionCount = readUnsignedShort(); int handlerOffset = readUnsignedShort(); int catchHandlerIndex = findCatchHandlerIndex(catchHandlers, handlerOffset); result[i] = new Try(startAddress, instructionCount, catchHandlerIndex); } return result; }
public MethodId readMethodId() { int declaringClassIndex = readUnsignedShort(); int protoIndex = readUnsignedShort(); int nameIndex = readInt(); return new MethodId(Dex.this, declaringClassIndex, protoIndex, nameIndex); }
private Try[] readTries(int triesSize, CatchHandler[] catchHandlers) { Try[] result = new Try[triesSize]; for (int i = 0; i < triesSize; i++) { int startAddress = readInt(); int instructionCount = readUnsignedShort(); int handlerOffset = readUnsignedShort(); int catchHandlerIndex = findCatchHandlerIndex(catchHandlers, handlerOffset); result[i] = new Try(startAddress, instructionCount, catchHandlerIndex); } return result; }
public FieldId readFieldId() { int declaringClassIndex = readUnsignedShort(); int typeIndex = readUnsignedShort(); int nameIndex = readInt(); return new FieldId(Dex.this, declaringClassIndex, typeIndex, nameIndex); }