use of org.jf.dexlib2.iface.value.MethodTypeEncodedValue in project smali by JesusFreke.
the class DexPool method internEncodedValue.
void internEncodedValue(@Nonnull EncodedValue encodedValue) {
switch(encodedValue.getValueType()) {
case ValueType.ANNOTATION:
AnnotationEncodedValue annotationEncodedValue = (AnnotationEncodedValue) encodedValue;
typeSection.intern(annotationEncodedValue.getType());
for (AnnotationElement element : annotationEncodedValue.getElements()) {
stringSection.intern(element.getName());
internEncodedValue(element.getValue());
}
break;
case ValueType.ARRAY:
for (EncodedValue element : ((ArrayEncodedValue) encodedValue).getValue()) {
internEncodedValue(element);
}
break;
case ValueType.STRING:
stringSection.intern(((StringEncodedValue) encodedValue).getValue());
break;
case ValueType.TYPE:
typeSection.intern(((TypeEncodedValue) encodedValue).getValue());
break;
case ValueType.ENUM:
fieldSection.intern(((EnumEncodedValue) encodedValue).getValue());
break;
case ValueType.FIELD:
fieldSection.intern(((FieldEncodedValue) encodedValue).getValue());
break;
case ValueType.METHOD:
methodSection.intern(((MethodEncodedValue) encodedValue).getValue());
break;
case ValueType.METHOD_HANDLE:
methodHandleSection.intern(((MethodHandleEncodedValue) encodedValue).getValue());
break;
case ValueType.METHOD_TYPE:
protoSection.intern(((MethodTypeEncodedValue) encodedValue).getValue());
break;
}
}
use of org.jf.dexlib2.iface.value.MethodTypeEncodedValue in project smali by JesusFreke.
the class DexBackedCallSiteReference method getMethodProto.
@Nonnull
@Override
public MethodProtoReference getMethodProto() {
EncodedArrayItemIterator iter = getCallSiteIterator();
if (iter.getItemCount() < 3) {
throw new ExceptionWithContext("Invalid call site item: must contain at least 3 entries.");
}
iter.skipNext();
iter.skipNext();
EncodedValue encodedValue = iter.getNextOrNull();
assert encodedValue != null;
if (encodedValue.getValueType() != ValueType.METHOD_TYPE) {
throw new ExceptionWithContext("Invalid encoded value type (%d) for the second item in call site %d", encodedValue.getValueType(), callSiteIndex);
}
return ((MethodTypeEncodedValue) encodedValue).getValue();
}
Aggregations