Search in sources :

Example 1 with BaseMethodHandleEncodedValue

use of org.jf.dexlib2.base.value.BaseMethodHandleEncodedValue 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;
        }
    };
}
Also used : ImmutableStringEncodedValue(org.jf.dexlib2.immutable.value.ImmutableStringEncodedValue) BaseArrayEncodedValue(org.jf.dexlib2.base.value.BaseArrayEncodedValue) BaseMethodHandleEncodedValue(org.jf.dexlib2.base.value.BaseMethodHandleEncodedValue) BaseMethodTypeEncodedValue(org.jf.dexlib2.base.value.BaseMethodTypeEncodedValue) EncodedValue(org.jf.dexlib2.iface.value.EncodedValue) ArrayEncodedValue(org.jf.dexlib2.iface.value.ArrayEncodedValue) BaseArrayEncodedValue(org.jf.dexlib2.base.value.BaseArrayEncodedValue) Nonnull(javax.annotation.Nonnull) ImmutableStringEncodedValue(org.jf.dexlib2.immutable.value.ImmutableStringEncodedValue) MethodProtoReference(org.jf.dexlib2.iface.reference.MethodProtoReference) MethodHandleReference(org.jf.dexlib2.iface.reference.MethodHandleReference) BaseMethodHandleEncodedValue(org.jf.dexlib2.base.value.BaseMethodHandleEncodedValue) BaseMethodTypeEncodedValue(org.jf.dexlib2.base.value.BaseMethodTypeEncodedValue)

Aggregations

Nonnull (javax.annotation.Nonnull)1 BaseArrayEncodedValue (org.jf.dexlib2.base.value.BaseArrayEncodedValue)1 BaseMethodHandleEncodedValue (org.jf.dexlib2.base.value.BaseMethodHandleEncodedValue)1 BaseMethodTypeEncodedValue (org.jf.dexlib2.base.value.BaseMethodTypeEncodedValue)1 MethodHandleReference (org.jf.dexlib2.iface.reference.MethodHandleReference)1 MethodProtoReference (org.jf.dexlib2.iface.reference.MethodProtoReference)1 ArrayEncodedValue (org.jf.dexlib2.iface.value.ArrayEncodedValue)1 EncodedValue (org.jf.dexlib2.iface.value.EncodedValue)1 ImmutableStringEncodedValue (org.jf.dexlib2.immutable.value.ImmutableStringEncodedValue)1