public static String getOptionalReferenceAnnotation(@Nonnull DexBackedDexFile dexFile, int stringIndex, boolean quote) { if (stringIndex == -1) { return "string_id_item[NO_INDEX]"; } return getReferenceAnnotation(dexFile, stringIndex, quote); }
@Nonnull public static String getReferenceAnnotation(@Nonnull DexBackedDexFile dexFile, int stringIndex) { return getReferenceAnnotation(dexFile, stringIndex, false); }
public static String getOptionalReferenceAnnotation(@Nonnull DexBackedDexFile dexFile, int stringIndex, boolean quote) { if (stringIndex == -1) { return "string_id_item[NO_INDEX]"; } return getReferenceAnnotation(dexFile, stringIndex, quote); }
public static String getOptionalReferenceAnnotation(@Nonnull DexBackedDexFile dexFile, int stringIndex, boolean quote) { if (stringIndex == -1) { return "string_id_item[NO_INDEX]"; } return getReferenceAnnotation(dexFile, stringIndex, quote); }
@Nonnull public static String getReferenceAnnotation(@Nonnull DexBackedDexFile dexFile, int stringIndex) { return getReferenceAnnotation(dexFile, stringIndex, false); }
@Nonnull public static String getReferenceAnnotation(@Nonnull DexBackedDexFile dexFile, int stringIndex) { return getReferenceAnnotation(dexFile, stringIndex, false); }
@Override protected void annotateItem(@Nonnull AnnotatedBytes out, int itemIndex, @Nullable String itemIdentity) { int stringIndex = dexFile.readSmallUint(out.getCursor()); out.annotate(4, StringIdItem.getReferenceAnnotation(dexFile, stringIndex)); } };
@Override protected void annotateItem(@Nonnull AnnotatedBytes out, int itemIndex, @Nullable String itemIdentity) { int stringIndex = dexFile.readSmallUint(out.getCursor()); out.annotate(4, StringIdItem.getReferenceAnnotation(dexFile, stringIndex)); } };
@Override protected void annotateItem(@Nonnull AnnotatedBytes out, int itemIndex, @Nullable String itemIdentity) { int stringIndex = dexFile.readSmallUint(out.getCursor()); out.annotate(4, StringIdItem.getReferenceAnnotation(dexFile, stringIndex)); } };
@Override protected void annotateItem(@Nonnull AnnotatedBytes out, int itemIndex, @Nullable String itemIdentity) { int classIndex = dexFile.readUshort(out.getCursor()); out.annotate(2, "class_idx = %s", TypeIdItem.getReferenceAnnotation(dexFile, classIndex)); int typeIndex = dexFile.readUshort(out.getCursor()); out.annotate(2, "return_type_idx = %s", TypeIdItem.getReferenceAnnotation(dexFile, typeIndex)); int nameIndex = dexFile.readSmallUint(out.getCursor()); out.annotate(4, "name_idx = %s", StringIdItem.getReferenceAnnotation(dexFile, nameIndex)); } };
@Override protected void annotateItem(@Nonnull AnnotatedBytes out, int itemIndex, @Nullable String itemIdentity) { int shortyIndex = dexFile.readSmallUint(out.getCursor()); out.annotate(4, "shorty_idx = %s", StringIdItem.getReferenceAnnotation(dexFile, shortyIndex)); int returnTypeIndex = dexFile.readSmallUint(out.getCursor()); out.annotate(4, "return_type_idx = %s", TypeIdItem.getReferenceAnnotation(dexFile, returnTypeIndex)); int parametersOffset = dexFile.readSmallUint(out.getCursor()); out.annotate(4, "parameters_off = %s", TypeListItem.getReferenceAnnotation(dexFile, parametersOffset)); } };
@Override protected void annotateItem(@Nonnull AnnotatedBytes out, int itemIndex, @Nullable String itemIdentity) { int shortyIndex = dexFile.readSmallUint(out.getCursor()); out.annotate(4, "shorty_idx = %s", StringIdItem.getReferenceAnnotation(dexFile, shortyIndex)); int returnTypeIndex = dexFile.readSmallUint(out.getCursor()); out.annotate(4, "return_type_idx = %s", TypeIdItem.getReferenceAnnotation(dexFile, returnTypeIndex)); int parametersOffset = dexFile.readSmallUint(out.getCursor()); out.annotate(4, "parameters_off = %s", TypeListItem.getReferenceAnnotation(dexFile, parametersOffset)); } };
@Override protected void annotateItem(@Nonnull AnnotatedBytes out, int itemIndex, @Nullable String itemIdentity) { int classIndex = dexFile.readUshort(out.getCursor()); out.annotate(2, "class_idx = %s", TypeIdItem.getReferenceAnnotation(dexFile, classIndex)); int typeIndex = dexFile.readUshort(out.getCursor()); out.annotate(2, "return_type_idx = %s", TypeIdItem.getReferenceAnnotation(dexFile, typeIndex)); int nameIndex = dexFile.readSmallUint(out.getCursor()); out.annotate(4, "name_idx = %s", StringIdItem.getReferenceAnnotation(dexFile, nameIndex)); } };
@Override public void annotateItem(@Nonnull AnnotatedBytes out, int itemIndex, @Nullable String itemIdentity) { int classIndex = dexFile.readUshort(out.getCursor()); out.annotate(2, "class_idx = %s", TypeIdItem.getReferenceAnnotation(dexFile, classIndex)); int protoIndex = dexFile.readUshort(out.getCursor()); out.annotate(2, "proto_idx = %s", ProtoIdItem.getReferenceAnnotation(dexFile, protoIndex)); int nameIndex = dexFile.readSmallUint(out.getCursor()); out.annotate(4, "name_idx = %s", StringIdItem.getReferenceAnnotation(dexFile, nameIndex)); } };
@Override protected void annotateItem(@Nonnull AnnotatedBytes out, int itemIndex, @Nullable String itemIdentity) { int shortyIndex = dexFile.readSmallUint(out.getCursor()); out.annotate(4, "shorty_idx = %s", StringIdItem.getReferenceAnnotation(dexFile, shortyIndex)); int returnTypeIndex = dexFile.readSmallUint(out.getCursor()); out.annotate(4, "return_type_idx = %s", TypeIdItem.getReferenceAnnotation(dexFile, returnTypeIndex)); int parametersOffset = dexFile.readSmallUint(out.getCursor()); out.annotate(4, "parameters_off = %s", TypeListItem.getReferenceAnnotation(dexFile, parametersOffset)); } };
@Override public void annotateItem(@Nonnull AnnotatedBytes out, int itemIndex, @Nullable String itemIdentity) { int classIndex = dexFile.readUshort(out.getCursor()); out.annotate(2, "class_idx = %s", TypeIdItem.getReferenceAnnotation(dexFile, classIndex)); int protoIndex = dexFile.readUshort(out.getCursor()); out.annotate(2, "proto_idx = %s", ProtoIdItem.getReferenceAnnotation(dexFile, protoIndex)); int nameIndex = dexFile.readSmallUint(out.getCursor()); out.annotate(4, "name_idx = %s", StringIdItem.getReferenceAnnotation(dexFile, nameIndex)); } };
@Override protected void annotateItem(@Nonnull AnnotatedBytes out, int itemIndex, @Nullable String itemIdentity) { int classIndex = dexFile.readUshort(out.getCursor()); out.annotate(2, "class_idx = %s", TypeIdItem.getReferenceAnnotation(dexFile, classIndex)); int typeIndex = dexFile.readUshort(out.getCursor()); out.annotate(2, "return_type_idx = %s", TypeIdItem.getReferenceAnnotation(dexFile, typeIndex)); int nameIndex = dexFile.readSmallUint(out.getCursor()); out.annotate(4, "name_idx = %s", StringIdItem.getReferenceAnnotation(dexFile, nameIndex)); } };
@Override public void annotateItem(@Nonnull AnnotatedBytes out, int itemIndex, @Nullable String itemIdentity) { int classIndex = dexFile.readUshort(out.getCursor()); out.annotate(2, "class_idx = %s", TypeIdItem.getReferenceAnnotation(dexFile, classIndex)); int protoIndex = dexFile.readUshort(out.getCursor()); out.annotate(2, "proto_idx = %s", ProtoIdItem.getReferenceAnnotation(dexFile, protoIndex)); int nameIndex = dexFile.readSmallUint(out.getCursor()); out.annotate(4, "name_idx = %s", StringIdItem.getReferenceAnnotation(dexFile, nameIndex)); } };
public static void annotateEncodedAnnotation(@Nonnull AnnotatedBytes out, @Nonnull DexReader reader) { assert out.getCursor() == reader.getOffset(); int typeIndex = reader.readSmallUleb128(); out.annotateTo(reader.getOffset(), TypeIdItem.getReferenceAnnotation(reader.dexBuf, typeIndex)); int size = reader.readSmallUleb128(); out.annotateTo(reader.getOffset(), "size: %d", size); for (int i=0; i<size; i++) { out.annotate(0, "element[%d]", i); out.indent(); int nameIndex = reader.readSmallUleb128(); out.annotateTo(reader.getOffset(), "name = %s", StringIdItem.getReferenceAnnotation(reader.dexBuf, nameIndex)); annotateEncodedValue(out, reader); out.deindent(); } }
@Override protected void annotateItem(AnnotatedBytes out, int itemIndex, String itemIdentity) { int classIndex = dexFile.readUshort(out.getCursor()); out.annotate(2, "class_idx = %s", TypeIdItem.getReferenceAnnotation(dexFile, classIndex)); int typeIndex = dexFile.readUshort(out.getCursor()); out.annotate(2, "return_type_idx = %s", TypeIdItem.getReferenceAnnotation(dexFile, typeIndex)); int nameIndex = dexFile.readSmallUint(out.getCursor()); out.annotate(4, "name_idx = %s", StringIdItem.getReferenceAnnotation(dexFile, nameIndex)); } };