Codota Logo
TypeIdItem.getIndex
Code IndexAdd Codota to your IDE (free)

How to use
getIndex
method
in
org.jf.dexlib.TypeIdItem

Best Java code snippets using org.jf.dexlib.TypeIdItem.getIndex (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: sonyxperiadev/ApkAnalyser

/** {@inheritDoc} */
protected int compareValue(EncodedValue o) {
  TypeEncodedValue other = (TypeEncodedValue)o;
  return value.getIndex() - other.value.getIndex();
}
origin: sonyxperiadev/ApkAnalyser

  public int compare(AnnotationItem annotationItem, AnnotationItem annotationItem2) {
    int annotationItemIndex = annotationItem.getEncodedAnnotation().annotationType.getIndex();
    int annotationItemIndex2 = annotationItem2.getEncodedAnnotation().annotationType.getIndex();
    if (annotationItemIndex < annotationItemIndex2) {
      return -1;
    } else if (annotationItemIndex == annotationItemIndex2) {
      return 0;
    }
    return 1;
  }
});
origin: sonyxperiadev/ApkAnalyser

/** {@inheritDoc} */
public int placeValue(int offset) {
  return offset + EncodedValueUtils.getRequiredBytesForUnsignedIntegralValue(value.getIndex()) + 1;
}
origin: sonyxperiadev/ApkAnalyser

/**
 * @return the size of this <code>EncodedTypeAddrPair</code>
 */
private int getSize() {
  return Leb128Utils.unsignedLeb128Size(exceptionType.getIndex()) +
      Leb128Utils.unsignedLeb128Size(handlerAddress);
}
origin: sonyxperiadev/ApkAnalyser

/**
 * Writes the <code>EncodedTypeAddrPair</code> to the given <code>AnnotatedOutput</code> object
 * @param out the <code>AnnotatedOutput</code> object to write to
 */
private void writeTo(AnnotatedOutput out) {
  if (out.annotates()) {
    out.annotate("exception_type: " + exceptionType.getTypeDescriptor());
    out.writeUnsignedLeb128(exceptionType.getIndex());
    out.annotate("handler_addr: 0x" + Integer.toHexString(handlerAddress));
    out.writeUnsignedLeb128(handlerAddress);
  } else {
    out.writeUnsignedLeb128(exceptionType.getIndex());
    out.writeUnsignedLeb128(handlerAddress);
  }
}
origin: sonyxperiadev/ApkAnalyser

/** {@inheritDoc} */
protected void writeItem(AnnotatedOutput out) {
  //yes, the code to write the item is duplicated. This eliminates the need to iterate over the list twice
  if (out.annotates()) {
    out.annotate(4, "size: 0x" + Integer.toHexString(typeList.length) + " (" + typeList.length +")");
    for (TypeIdItem typeIdItem: typeList) {
      out.annotate(2, "type_id_item: " + typeIdItem.getTypeDescriptor());
    }
  }
  out.writeInt(typeList.length);
  for (TypeIdItem typeIdItem: typeList) {
    int typeIndex = typeIdItem.getIndex();
    if (typeIndex > 0xffff) {
      throw new RuntimeException(String.format("Error writing type_list entry. The type index of " +
        "type %s is too large", typeIdItem.getTypeDescriptor()));
    }
    out.writeShort(typeIndex);
  }
}
origin: sonyxperiadev/ApkAnalyser

/** {@inheritDoc} */
public int placeValue(int offset) {
  offset = offset + Leb128Utils.unsignedLeb128Size(annotationType.getIndex());
  offset = offset + Leb128Utils.unsignedLeb128Size(names.length);
  for (int i=0; i<names.length; i++) {
    offset = offset + Leb128Utils.unsignedLeb128Size(names[i].getIndex());
    offset = values[i].placeValue(offset);
  }
  return offset;
}
origin: sonyxperiadev/ApkAnalyser

/** {@inheritDoc} */
protected void writeItem(AnnotatedOutput out) {
  if (out.annotates()) {
    out.annotate(2, "class_type: " + classType.getTypeDescriptor());
    out.annotate(2, "field_type: " + fieldType.getTypeDescriptor());
    out.annotate(4, "field_name: " + fieldName.getStringValue());
  }
  int classIndex = classType.getIndex();
  if (classIndex > 0xffff) {
    throw new RuntimeException(String.format("Error writing field_id_item for %s. The type index of " +
        "defining class %s is too large", getFieldString(), classType.getTypeDescriptor()));
  }
  out.writeShort(classIndex);
  int typeIndex = fieldType.getIndex();
  if (typeIndex > 0xffff) {
    throw new RuntimeException(String.format("Error writing field_id_item for %s. The type index of field " +
        "type %s is too large", getFieldString(), fieldType.getTypeDescriptor()));
  }
  out.writeShort(typeIndex);
  out.writeInt(fieldName.getIndex());
}
origin: sonyxperiadev/ApkAnalyser

/** {@inheritDoc} */
protected void writeItem(AnnotatedOutput out) {
  if (out.annotates()) {
    out.annotate(2, "class_type: " + classType.getTypeDescriptor());
    out.annotate(2, "method_prototype: " + methodPrototype.getPrototypeString());
    out.annotate(4, "method_name: " + methodName.getStringValue());
  }
  int classIndex = classType.getIndex();
  if (classIndex > 0xffff) {
    throw new RuntimeException(String.format("Error writing method_id_item for %s. The type index of " +
        "defining class %s is too large", getMethodString(), classType.getTypeDescriptor()));
  }
  out.writeShort(classIndex);
  int prototypeIndex = methodPrototype.getIndex();
  if (prototypeIndex > 0xffff) {
    throw new RuntimeException(String.format("Error writing method_id_item for %0. The prototype index of " +
        "method prototype %s is too large", getMethodString(), methodPrototype.getPrototypeString()));
  }
  out.writeShort(prototypeIndex);
  out.writeInt(methodName.getIndex());
}
origin: sonyxperiadev/ApkAnalyser

/** {@inheritDoc} */
public void writeValue(AnnotatedOutput out) {
  byte[] bytes = EncodedValueUtils.encodeUnsignedIntegralValue(value.getIndex());
  if (out.annotates()) {
    out.annotate(1, "value_type=" + ValueType.VALUE_TYPE.name() + ",value_arg=" + (bytes.length - 1));
    out.annotate(bytes.length, "value: " + value.getTypeDescriptor());
  }
  out.writeByte(ValueType.VALUE_TYPE.value | ((bytes.length - 1) << 5));
  out.write(bytes);
}
origin: sonyxperiadev/ApkAnalyser

/** {@inheritDoc} */
protected void writeItem(AnnotatedOutput out) {
  if (out.annotates()) {
    out.annotate(4, "class_type: " + classType.getTypeDescriptor());
    out.annotate(4, "access_flags: " + AccessFlags.formatAccessFlagsForClass(accessFlags));
    out.annotate(4, "superclass_type: " + (superType==null?"":superType.getTypeDescriptor()));
    out.annotate(4, "interfaces: " +
        (implementedInterfaces==null?"":implementedInterfaces.getTypeListString(" ")));
    out.annotate(4, "source_file: " + (sourceFile==null?"":sourceFile.getStringValue()));
    out.annotate(4, "annotations_off: " +
        (annotations==null?"":"0x"+Integer.toHexString(annotations.getOffset())));
    out.annotate(4, "class_data_off:" +
        (classData==null?"":"0x"+Integer.toHexString(classData.getOffset())));
    out.annotate(4, "static_values_off: " +
        (staticFieldInitializers==null?"":"0x"+Integer.toHexString(staticFieldInitializers.getOffset())));
  }
  out.writeInt(classType.getIndex());
  out.writeInt(accessFlags);
  out.writeInt(superType==null?-1:superType.getIndex());
  out.writeInt(implementedInterfaces==null?0:implementedInterfaces.getOffset());
  out.writeInt(sourceFile==null?-1:sourceFile.getIndex());
  out.writeInt(annotations==null?0:annotations.getOffset());
  out.writeInt(classData==null?0:classData.getOffset());
  out.writeInt(staticFieldInitializers==null?0:staticFieldInitializers.getOffset());
}
origin: sonyxperiadev/ApkAnalyser

/** {@inheritDoc} */
public void writeValue(AnnotatedOutput out) {
  out.annotate("annotation_type: " + annotationType.getTypeDescriptor());
  out.writeUnsignedLeb128(annotationType.getIndex());
  out.annotate("element_count: 0x" + Integer.toHexString(names.length) + " (" + names.length + ")");
  out.writeUnsignedLeb128(names.length);
  for (int i=0; i<names.length; i++) {
    out.annotate(0, "[" + i + "] annotation_element");
    out.indent();
    out.annotate("element_name: " + names[i].getStringValue());
    out.writeUnsignedLeb128(names[i].getIndex());
    out.annotate(0, "element_value:");
    out.indent();
    values[i].writeValue(out);
    out.deindent();
    out.deindent();
  }
}
origin: sonyxperiadev/ApkAnalyser

/** {@inheritDoc} */
protected void writeItem(AnnotatedOutput out) {
  if (out.annotates()) {
    out.annotate(4, "shorty_descriptor: " + shortyDescriptor.getStringValue());
    out.annotate(4, "return_type: " + returnType.getTypeDescriptor());
    if (parameters == null) {
      out.annotate(4, "parameters:");
    } else {
      out.annotate(4, "parameters: " + parameters.getTypeListString(""));
    }
  }
  out.writeInt(shortyDescriptor.getIndex());
  out.writeInt(returnType.getIndex());
  out.writeInt(parameters == null?0:parameters.getOffset());
}
origin: org.smali/dexlib

  public int compare(AnnotationItem annotationItem, AnnotationItem annotationItem2) {
    int annotationItemIndex = annotationItem.getEncodedAnnotation().annotationType.getIndex();
    int annotationItemIndex2 = annotationItem2.getEncodedAnnotation().annotationType.getIndex();
    if (annotationItemIndex < annotationItemIndex2) {
      return -1;
    } else if (annotationItemIndex == annotationItemIndex2) {
      return 0;
    }
    return 1;
  }
});
origin: org.smali/dexlib

/** {@inheritDoc} */
public int placeValue(int offset) {
  return offset + EncodedValueUtils.getRequiredBytesForUnsignedIntegralValue(value.getIndex()) + 1;
}
origin: org.smali/dexlib

/**
 * @return the size of this <code>EncodedTypeAddrPair</code>
 */
private int getSize() {
  return Leb128Utils.unsignedLeb128Size(exceptionType.getIndex()) +
      Leb128Utils.unsignedLeb128Size(handlerAddress);
}
origin: org.smali/dexlib

/**
 * Writes the <code>EncodedTypeAddrPair</code> to the given <code>AnnotatedOutput</code> object
 * @param out the <code>AnnotatedOutput</code> object to write to
 */
private void writeTo(AnnotatedOutput out) {
  if (out.annotates()) {
    out.annotate("exception_type: " + exceptionType.getTypeDescriptor());
    out.writeUnsignedLeb128(exceptionType.getIndex());
    out.annotate("handler_addr: 0x" + Integer.toHexString(handlerAddress));
    out.writeUnsignedLeb128(handlerAddress);
  } else {
    out.writeUnsignedLeb128(exceptionType.getIndex());
    out.writeUnsignedLeb128(handlerAddress);
  }
}
origin: org.smali/dexlib

/** {@inheritDoc} */
public int placeValue(int offset) {
  offset = offset + Leb128Utils.unsignedLeb128Size(annotationType.getIndex());
  offset = offset + Leb128Utils.unsignedLeb128Size(names.length);
  for (int i=0; i<names.length; i++) {
    offset = offset + Leb128Utils.unsignedLeb128Size(names[i].getIndex());
    offset = values[i].placeValue(offset);
  }
  return offset;
}
origin: org.smali/dexlib

/** {@inheritDoc} */
public void writeValue(AnnotatedOutput out) {
  byte[] bytes = EncodedValueUtils.encodeUnsignedIntegralValue(value.getIndex());
  if (out.annotates()) {
    out.annotate(1, "value_type=" + ValueType.VALUE_TYPE.name() + ",value_arg=" + (bytes.length - 1));
    out.annotate(bytes.length, "value: " + value.getTypeDescriptor());
  }
  out.writeByte(ValueType.VALUE_TYPE.value | ((bytes.length - 1) << 5));
  out.write(bytes);
}
origin: org.smali/dexlib

/** {@inheritDoc} */
protected void writeItem(AnnotatedOutput out) {
  if (out.annotates()) {
    out.annotate(4, "shorty_descriptor: " + shortyDescriptor.getStringValue());
    out.annotate(4, "return_type: " + returnType.getTypeDescriptor());
    if (parameters == null) {
      out.annotate(4, "parameters:");
    } else {
      out.annotate(4, "parameters: " + parameters.getTypeListString(""));
    }
  }
  out.writeInt(shortyDescriptor.getIndex());
  out.writeInt(returnType.getIndex());
  out.writeInt(parameters == null?0:parameters.getOffset());
}
org.jf.dexlibTypeIdItemgetIndex

Popular methods of TypeIdItem

  • getTypeDescriptor
    Returns the type descriptor as a String for the given type
  • <init>
    Creates a new TypeIdItem for the given StringIdItem
  • compareTo
  • getRegisterCount
    Calculates the number of 2-byte registers that an instance of this type requires
  • hashCode
  • internTypeIdItem
    Returns a TypeIdItem for the given values, and that has been interned into the given DexFile
  • lookupTypeIdItem
    Looks up the TypeIdItem from the given DexFile for the given type descriptor
  • toShorty
    Returns the "shorty" representation of this type, used to create the shorty prototype string for a m

Popular in Java

  • Updating database using SQL prepared statement
  • notifyDataSetChanged (ArrayAdapter)
  • putExtra (Intent)
  • findViewById (Activity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • DecimalFormat (java.text)
    DecimalFormat is a concrete subclass ofNumberFormat that formats decimal numbers. It has a variety o
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • JLabel (javax.swing)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now