com.android.dex.ProtoId Java Examples

The following examples show how to use com.android.dex.ProtoId. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MethodInfo.java    From Box with Apache License 2.0 5 votes vote down vote up
private MethodInfo(DexNode dex, int mthIndex) {
	MethodId mthId = dex.getMethodId(mthIndex);
	name = dex.getString(mthId.getNameIndex());
	alias = name;
	aliasFromPreset = false;
	declClass = ClassInfo.fromDex(dex, mthId.getDeclaringClassIndex());

	ProtoId proto = dex.getProtoId(mthId.getProtoIndex());
	retType = dex.getType(proto.getReturnTypeIndex());
	args = dex.readParamList(proto.getParametersOffset());
	shortId = makeSignature(true);
}
 
Example #2
Source File: DexIndexPrinter.java    From Box with Apache License 2.0 5 votes vote down vote up
private void printProtoIds() throws IOException {
    int index = 0;
    for (ProtoId protoId : dex.protoIds()) {
        System.out.println("proto " + index + ": " + protoId);
        index++;
    }
}
 
Example #3
Source File: MethodInfo.java    From Box with Apache License 2.0 5 votes vote down vote up
private MethodInfo(DexNode dex, int mthIndex) {
	MethodId mthId = dex.getMethodId(mthIndex);
	name = dex.getString(mthId.getNameIndex());
	alias = name;
	aliasFromPreset = false;
	declClass = ClassInfo.fromDex(dex, mthId.getDeclaringClassIndex());

	ProtoId proto = dex.getProtoId(mthId.getProtoIndex());
	retType = dex.getType(proto.getReturnTypeIndex());
	args = dex.readParamList(proto.getParametersOffset());
	shortId = makeSignature(true);
}
 
Example #4
Source File: DexIndexPrinter.java    From Box with Apache License 2.0 5 votes vote down vote up
private void printProtoIds() throws IOException {
    int index = 0;
    for (ProtoId protoId : dex.protoIds()) {
        System.out.println("proto " + index + ": " + protoId);
        index++;
    }
}
 
Example #5
Source File: DexLimitTracker.java    From bazel with Apache License 2.0 5 votes vote down vote up
static MethodDescriptor fromDex(Dex dex, int methodIndex) {
  MethodId method = dex.methodIds().get(methodIndex);
  ProtoId proto = dex.protoIds().get(method.getProtoIndex());
  String name = dex.strings().get(method.getNameIndex());
  String declaringClass = typeName(dex, method.getDeclaringClassIndex());
  String returnType = typeName(dex, proto.getReturnTypeIndex());
  TypeList parameterTypeIndices = dex.readTypeList(proto.getParametersOffset());
  ImmutableList.Builder<String> parameterTypes = ImmutableList.builder();
  for (short parameterTypeIndex : parameterTypeIndices.getTypes()) {
    parameterTypes.add(typeName(dex, parameterTypeIndex & 0xFFFF));
  }
  return new AutoValue_DexLimitTracker_MethodDescriptor(
      declaringClass, name, parameterTypes.build(), returnType);
}
 
Example #6
Source File: DexIndexPrinter.java    From buck with Apache License 2.0 5 votes vote down vote up
private void printProtoIds() throws IOException {
    int index = 0;
    for (ProtoId protoId : dex.protoIds()) {
        System.out.println("proto " + index + ": " + protoId);
        index++;
    }
}
 
Example #7
Source File: DexNode.java    From Box with Apache License 2.0 4 votes vote down vote up
public ProtoId getProtoId(int protoIndex) {
	return dexBuf.protoIds().get(protoIndex);
}
 
Example #8
Source File: IndexMap.java    From Box with Apache License 2.0 4 votes vote down vote up
public ProtoId adjust(ProtoId protoId) {
    return new ProtoId(target,
            adjustString(protoId.getShortyIndex()),
            adjustType(protoId.getReturnTypeIndex()),
            adjustTypeListOffset(protoId.getParametersOffset()));
}
 
Example #9
Source File: DexNode.java    From Box with Apache License 2.0 4 votes vote down vote up
public ProtoId getProtoId(int protoIndex) {
	return dexBuf.protoIds().get(protoIndex);
}
 
Example #10
Source File: IndexMap.java    From Box with Apache License 2.0 4 votes vote down vote up
public ProtoId adjust(ProtoId protoId) {
    return new ProtoId(target,
            adjustString(protoId.getShortyIndex()),
            adjustType(protoId.getReturnTypeIndex()),
            adjustTypeListOffset(protoId.getParametersOffset()));
}
 
Example #11
Source File: IndexMap.java    From buck with Apache License 2.0 4 votes vote down vote up
public ProtoId adjust(ProtoId protoId) {
    return new ProtoId(target,
            adjustString(protoId.getShortyIndex()),
            adjustType(protoId.getReturnTypeIndex()),
            adjustTypeListOffset(protoId.getParametersOffset()));
}