Search in sources :

Example 1 with MethodRefHandle

use of jadx.api.plugins.input.data.impl.MethodRefHandle in project jadx by skylot.

the class ConstPoolReader method getMethodHandle.

private IMethodHandle getMethodHandle(int idx) {
    jumpToData(idx);
    int kind = data.readU1();
    int refIdx = data.readU2();
    MethodHandleType handleType = convertMethodHandleKind(kind);
    if (handleType.isField()) {
        return new FieldRefHandle(handleType, getFieldRef(refIdx));
    }
    return new MethodRefHandle(handleType, getMethodRef(refIdx));
}
Also used : MethodRefHandle(jadx.api.plugins.input.data.impl.MethodRefHandle) MethodHandleType(jadx.api.plugins.input.data.MethodHandleType) FieldRefHandle(jadx.api.plugins.input.data.impl.FieldRefHandle)

Example 2 with MethodRefHandle

use of jadx.api.plugins.input.data.impl.MethodRefHandle in project jadx by skylot.

the class SectionReader method getMethodHandle.

public IMethodHandle getMethodHandle(int idx) {
    int methodHandleOff = dexReader.getHeader().getMethodHandleOff();
    absPos(methodHandleOff + idx * 8);
    MethodHandleType handleType = getMethodHandleType(readUShort());
    skip(2);
    int refId = readUShort();
    if (handleType.isField()) {
        return new FieldRefHandle(handleType, getFieldRef(refId));
    }
    return new MethodRefHandle(handleType, getMethodRef(refId));
}
Also used : MethodRefHandle(jadx.api.plugins.input.data.impl.MethodRefHandle) MethodHandleType(jadx.api.plugins.input.data.MethodHandleType) FieldRefHandle(jadx.api.plugins.input.data.impl.FieldRefHandle)

Aggregations

MethodHandleType (jadx.api.plugins.input.data.MethodHandleType)2 FieldRefHandle (jadx.api.plugins.input.data.impl.FieldRefHandle)2 MethodRefHandle (jadx.api.plugins.input.data.impl.MethodRefHandle)2