use of org.jf.dexlib2.iface.reference.MethodProtoReference in project smali by JesusFreke.
the class CallSiteUtil method getEncodedCallSite.
public static ArrayEncodedValue getEncodedCallSite(CallSiteReference callSiteReference) {
return new BaseArrayEncodedValue() {
@Nonnull
@Override
public List<? extends EncodedValue> getValue() {
List<EncodedValue> encodedCallSite = Lists.newArrayList();
encodedCallSite.add(new BaseMethodHandleEncodedValue() {
@Nonnull
@Override
public MethodHandleReference getValue() {
return callSiteReference.getMethodHandle();
}
});
encodedCallSite.add(new ImmutableStringEncodedValue(callSiteReference.getMethodName()));
encodedCallSite.add(new BaseMethodTypeEncodedValue() {
@Nonnull
@Override
public MethodProtoReference getValue() {
return callSiteReference.getMethodProto();
}
});
encodedCallSite.addAll(callSiteReference.getExtraArguments());
return encodedCallSite;
}
};
}
use of org.jf.dexlib2.iface.reference.MethodProtoReference 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