public int processFields(List<FieldNode> fields) throws DecodeException { int count = Leb128.readUnsignedLeb128(in); for (int i = 0; i < count; i++) { Object value = parseValue(); if (i < fields.size()) { fields.get(i).addAttr(FieldInitAttr.constValue(value)); } } return count; } }
private void decode0() throws IOException { ByteInput bs = new ByteArrayByteInput(encoded); line = Leb128.readUnsignedLeb128(bs); int szParams = Leb128.readUnsignedLeb128(bs); StdTypeList params = desc.getParameterTypes(); int curReg = getParamBase(); int reg = Leb128.readUnsignedLeb128(bs); int nameIdx = readStringIndex(bs); int typeIdx = readStringIndex(bs); int reg = Leb128.readUnsignedLeb128(bs); int nameIdx = readStringIndex(bs); int typeIdx = readStringIndex(bs); int reg = Leb128.readUnsignedLeb128(bs); LocalEntry prevle; LocalEntry le; int reg = Leb128.readUnsignedLeb128(bs); LocalEntry prevle; LocalEntry le; address += Leb128.readUnsignedLeb128(bs); break; line += Leb128.readSignedLeb128(bs); break;
/** * Gets the write size for a given value. * * @param value {@code non-null;} the string value * @return {@code >= 2}; the write size, in bytes */ private static int writeSize(CstString value) { int utf16Size = value.getUtf16Size(); // The +1 is for the '\0' termination byte. return Leb128.unsignedLeb128Size(utf16Size) + value.getUtf8Size() + 1; }
public void writeUleb128(int i) { try { Leb128.writeUnsignedLeb128(this, i); } catch (ArrayIndexOutOfBoundsException e) { throw new DexException("Section limit " + data.limit() + " exceeded by " + name); } }
/** {@inheritDoc} */ @Override public int writeSleb128(int value) { if (stretchy) { ensureCapacity(cursor + 5); // pessimistic } int cursorBefore = cursor; Leb128.writeSignedLeb128(this, value); return (cursor - cursorBefore); }
public int readSleb128() { return Leb128.readSignedLeb128(this); }
private void decode0() throws IOException { ByteInput bs = new ByteArrayByteInput(encoded); line = Leb128.readUnsignedLeb128(bs); int szParams = Leb128.readUnsignedLeb128(bs); StdTypeList params = desc.getParameterTypes(); int curReg = getParamBase(); int reg = Leb128.readUnsignedLeb128(bs); int nameIdx = readStringIndex(bs); int typeIdx = readStringIndex(bs); int reg = Leb128.readUnsignedLeb128(bs); int nameIdx = readStringIndex(bs); int typeIdx = readStringIndex(bs); int reg = Leb128.readUnsignedLeb128(bs); LocalEntry prevle; LocalEntry le; int reg = Leb128.readUnsignedLeb128(bs); LocalEntry prevle; LocalEntry le; address += Leb128.readUnsignedLeb128(bs); break; line += Leb128.readSignedLeb128(bs); break;
/** * Gets the write size for a given value. * * @param value {@code non-null;} the string value * @return {@code >= 2}; the write size, in bytes */ private static int writeSize(CstString value) { int utf16Size = value.getUtf16Size(); // The +1 is for the '\0' termination byte. return Leb128.unsignedLeb128Size(utf16Size) + value.getUtf8Size() + 1; }
/** {@inheritDoc} */ @Override public int writeUleb128(int value) { if (stretchy) { ensureCapacity(cursor + 5); // pessimistic } int cursorBefore = cursor; Leb128.writeUnsignedLeb128(this, value); return (cursor - cursorBefore); }
/** {@inheritDoc} */ public int writeSleb128(int value) { if (stretchy) { ensureCapacity(cursor + 5); // pessimistic } int cursorBefore = cursor; Leb128.writeSignedLeb128(this, value); return (cursor - cursorBefore); }
public int readSleb128() { return Leb128.readSignedLeb128(this); }
int count = Leb128.readUnsignedLeb128(in); List<Object> values = new ArrayList<>(count); for (int i = 0; i < count; i++) {
private void decode0() throws IOException { ByteInput bs = new ByteArrayByteInput(encoded); line = Leb128.readUnsignedLeb128(bs); int szParams = Leb128.readUnsignedLeb128(bs); StdTypeList params = desc.getParameterTypes(); int curReg = getParamBase(); int reg = Leb128.readUnsignedLeb128(bs); int nameIdx = readStringIndex(bs); int typeIdx = readStringIndex(bs); int reg = Leb128.readUnsignedLeb128(bs); int nameIdx = readStringIndex(bs); int typeIdx = readStringIndex(bs); int reg = Leb128.readUnsignedLeb128(bs); LocalEntry prevle; LocalEntry le; int reg = Leb128.readUnsignedLeb128(bs); LocalEntry prevle; LocalEntry le; address += Leb128.readUnsignedLeb128(bs); break; line += Leb128.readSignedLeb128(bs); break;
/** * Gets the write size for a given value. * * @param value {@code non-null;} the string value * @return {@code >= 2}; the write size, in bytes */ private static int writeSize(CstString value) { int utf16Size = value.getUtf16Size(); // The +1 is for the '\0' termination byte. return Leb128.unsignedLeb128Size(utf16Size) + value.getUtf8Size() + 1; }
public void writeUleb128(int i) { try { Leb128.writeUnsignedLeb128(this, i); } catch (ArrayIndexOutOfBoundsException e) { throw new DexException("Section limit " + data.limit() + " exceeded by " + name); } }
/** {@inheritDoc} */ @Override public int writeSleb128(int value) { if (stretchy) { ensureCapacity(cursor + 5); // pessimistic } int cursorBefore = cursor; Leb128.writeSignedLeb128(this, value); return (cursor - cursorBefore); }
public int readSleb128() { return Leb128.readSignedLeb128(this); }
/** * Reads a string index. String indicies are offset by 1, and a 0 value * in the stream (-1 as returned by this method) means "null" * * @return index into file's string ids table, -1 means null * @throws IOException */ private int readStringIndex(ByteInput bs) throws IOException { int offsetIndex = Leb128.readUnsignedLeb128(bs); return offsetIndex - 1; }
private void decode0() throws IOException { ByteInput bs = new ByteArrayByteInput(encoded); line = Leb128.readUnsignedLeb128(bs); int szParams = Leb128.readUnsignedLeb128(bs); StdTypeList params = desc.getParameterTypes(); int curReg = getParamBase(); int reg = Leb128.readUnsignedLeb128(bs); int nameIdx = readStringIndex(bs); int typeIdx = readStringIndex(bs); int reg = Leb128.readUnsignedLeb128(bs); int nameIdx = readStringIndex(bs); int typeIdx = readStringIndex(bs); int reg = Leb128.readUnsignedLeb128(bs); LocalEntry prevle; LocalEntry le; int reg = Leb128.readUnsignedLeb128(bs); LocalEntry prevle; LocalEntry le; address += Leb128.readUnsignedLeb128(bs); break; line += Leb128.readSignedLeb128(bs); break;
/** * Gets the write size for a given value. * * @param value {@code non-null;} the string value * @return {@code >= 2}; the write size, in bytes */ private static int writeSize(CstString value) { int utf16Size = value.getUtf16Size(); // The +1 is for the '\0' termination byte. return Leb128.unsignedLeb128Size(utf16Size) + value.getUtf8Size() + 1; }