use of org.jf.dexlib2.iface.value.MethodHandleEncodedValue in project smali by JesusFreke.
the class DexBackedCallSiteReference method getMethodHandle.
@Nonnull
@Override
public MethodHandleReference getMethodHandle() {
EncodedArrayItemIterator iter = getCallSiteIterator();
if (iter.getItemCount() < 3) {
throw new ExceptionWithContext("Invalid call site item: must contain at least 3 entries.");
}
EncodedValue encodedValue = getCallSiteIterator().getNextOrNull();
assert encodedValue != null;
if (encodedValue.getValueType() != ValueType.METHOD_HANDLE) {
throw new ExceptionWithContext("Invalid encoded value type (%d) for the first item in call site %d", encodedValue.getValueType(), callSiteIndex);
}
return ((MethodHandleEncodedValue) encodedValue).getValue();
}
use of org.jf.dexlib2.iface.value.MethodHandleEncodedValue 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;
}
}
Aggregations