/** * 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; }
/** * 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; }
/** * 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; }
/** * 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 encode(DexFile file, AnnotatedOutput out, int lastIndex, int dumpSeq) { int fieldIdx = file.getFieldIds().indexOf(field); int diff = fieldIdx - lastIndex; int accessFlags = getAccessFlags(); if (out.annotates()) { out.annotate(0, String.format(" [%x] %s", dumpSeq, field.toHuman())); out.annotate(Leb128.unsignedLeb128Size(diff), " field_idx: " + Hex.u4(fieldIdx)); out.annotate(Leb128.unsignedLeb128Size(accessFlags), " access_flags: " + AccessFlags.fieldString(accessFlags)); } out.writeUleb128(diff); out.writeUleb128(accessFlags); return fieldIdx; } }
/** {@inheritDoc} */ @Override public int encode(DexFile file, AnnotatedOutput out, int lastIndex, int dumpSeq) { int fieldIdx = file.getFieldIds().indexOf(field); int diff = fieldIdx - lastIndex; int accessFlags = getAccessFlags(); if (out.annotates()) { out.annotate(0, String.format(" [%x] %s", dumpSeq, field.toHuman())); out.annotate(Leb128.unsignedLeb128Size(diff), " field_idx: " + Hex.u4(fieldIdx)); out.annotate(Leb128.unsignedLeb128Size(accessFlags), " access_flags: " + AccessFlags.fieldString(accessFlags)); } out.writeUleb128(diff); out.writeUleb128(accessFlags); return fieldIdx; } }
/** {@inheritDoc} */ @Override public int encode(DexFile file, AnnotatedOutput out, int lastIndex, int dumpSeq) { int fieldIdx = file.getFieldIds().indexOf(field); int diff = fieldIdx - lastIndex; int accessFlags = getAccessFlags(); if (out.annotates()) { out.annotate(0, String.format(" [%x] %s", dumpSeq, field.toHuman())); out.annotate(Leb128.unsignedLeb128Size(diff), " field_idx: " + Hex.u4(fieldIdx)); out.annotate(Leb128.unsignedLeb128Size(accessFlags), " access_flags: " + AccessFlags.fieldString(accessFlags)); } out.writeUleb128(diff); out.writeUleb128(accessFlags); return fieldIdx; } }
/** {@inheritDoc} */ @Override public int encode(DexFile file, AnnotatedOutput out, int lastIndex, int dumpSeq) { int fieldIdx = file.getFieldIds().indexOf(field); int diff = fieldIdx - lastIndex; int accessFlags = getAccessFlags(); if (out.annotates()) { out.annotate(0, String.format(" [%x] %s", dumpSeq, field.toHuman())); out.annotate(Leb128.unsignedLeb128Size(diff), " field_idx: " + Hex.u4(fieldIdx)); out.annotate(Leb128.unsignedLeb128Size(accessFlags), " access_flags: " + AccessFlags.fieldString(accessFlags)); } out.writeUleb128(diff); out.writeUleb128(accessFlags); return fieldIdx; } }
out.annotate(0, String.format(" [%x] %s", dumpSeq, method.toHuman())); out.annotate(Leb128.unsignedLeb128Size(diff), " method_idx: " + Hex.u4(methodIdx)); out.annotate(Leb128.unsignedLeb128Size(accessFlags), " access_flags: " + AccessFlags.methodString(accessFlags)); out.annotate(Leb128.unsignedLeb128Size(codeOff), " code_off: " + Hex.u4(codeOff));
out.annotate(0, String.format(" [%x] %s", dumpSeq, method.toHuman())); out.annotate(Leb128.unsignedLeb128Size(diff), " method_idx: " + Hex.u4(methodIdx)); out.annotate(Leb128.unsignedLeb128Size(accessFlags), " access_flags: " + AccessFlags.methodString(accessFlags)); out.annotate(Leb128.unsignedLeb128Size(codeOff), " code_off: " + Hex.u4(codeOff));
out.annotate(0, String.format(" [%x] %s", dumpSeq, method.toHuman())); out.annotate(Leb128.unsignedLeb128Size(diff), " method_idx: " + Hex.u4(methodIdx)); out.annotate(Leb128.unsignedLeb128Size(accessFlags), " access_flags: " + AccessFlags.methodString(accessFlags)); out.annotate(Leb128.unsignedLeb128Size(codeOff), " code_off: " + Hex.u4(codeOff));
out.annotate(0, String.format(" [%x] %s", dumpSeq, method.toHuman())); out.annotate(Leb128.unsignedLeb128Size(diff), " method_idx: " + Hex.u4(methodIdx)); out.annotate(Leb128.unsignedLeb128Size(accessFlags), " access_flags: " + AccessFlags.methodString(accessFlags)); out.annotate(Leb128.unsignedLeb128Size(codeOff), " code_off: " + Hex.u4(codeOff));
/** {@inheritDoc} */ @Override public void writeTo0(DexFile file, AnnotatedOutput out) { ByteArray bytes = value.getBytes(); int utf16Size = value.getUtf16Size(); if (out.annotates()) { out.annotate(Leb128.unsignedLeb128Size(utf16Size), "utf16_size: " + Hex.u4(utf16Size)); out.annotate(bytes.size() + 1, value.toQuoted()); } out.writeUleb128(utf16Size); out.write(bytes); out.writeByte(0); }
/** {@inheritDoc} */ @Override public void writeTo0(DexFile file, AnnotatedOutput out) { ByteArray bytes = value.getBytes(); int utf16Size = value.getUtf16Size(); if (out.annotates()) { out.annotate(Leb128.unsignedLeb128Size(utf16Size), "utf16_size: " + Hex.u4(utf16Size)); out.annotate(bytes.size() + 1, value.toQuoted()); } out.writeUleb128(utf16Size); out.write(bytes); out.writeByte(0); }
/** {@inheritDoc} */ @Override public void writeTo0(DexFile file, AnnotatedOutput out) { ByteArray bytes = value.getBytes(); int utf16Size = value.getUtf16Size(); if (out.annotates()) { out.annotate(Leb128.unsignedLeb128Size(utf16Size), "utf16_size: " + Hex.u4(utf16Size)); out.annotate(bytes.size() + 1, value.toQuoted()); } out.writeUleb128(utf16Size); out.write(bytes); out.writeByte(0); }
/** {@inheritDoc} */ @Override public void writeTo0(DexFile file, AnnotatedOutput out) { ByteArray bytes = value.getBytes(); int utf16Size = value.getUtf16Size(); if (out.annotates()) { out.annotate(Leb128.unsignedLeb128Size(utf16Size), "utf16_size: " + Hex.u4(utf16Size)); out.annotate(bytes.size() + 1, value.toQuoted()); } out.writeUleb128(utf16Size); out.write(bytes); out.writeByte(0); }