use of jadx.api.plugins.input.data.IMethodRef in project jadx by skylot.
the class Smali method writeMethodDef.
private void writeMethodDef(SmaliWriter smali, IMethodData mth, LineInfo lineInfo) {
smali.add(AccessFlags.format(mth.getAccessFlags(), METHOD));
IMethodRef methodRef = mth.getMethodRef();
methodRef.load();
lineInfo.smaliMthNode.setDefPos(smali.getLength());
smali.add(methodRef.getName()).add('(');
methodRef.getArgTypes().forEach(smali::add);
smali.add(')');
smali.add(methodRef.getReturnType());
AnnotationsAttr annotationsAttr = new AttributeStorage(mth.getAttributes()).get(JadxAttrType.ANNOTATION_LIST);
if (annotationsAttr != null && !annotationsAttr.isEmpty()) {
smali.incIndent();
writeAnnotations(smali, annotationsAttr.getList());
smali.decIndent();
smali.startLine();
}
}
use of jadx.api.plugins.input.data.IMethodRef in project jadx by skylot.
the class Smali method method.
private static String method(InsnData insn) {
Opcode op = insn.getOpcode();
if (op == INVOKE_CUSTOM || op == INVOKE_CUSTOM_RANGE) {
insn.getIndexAsCallSite().load();
return String.format("%s # call_site@%04x", insn.getIndexAsCallSite().toString(), insn.getIndex());
}
IMethodRef mthRef = insn.getIndexAsMethod();
mthRef.load();
if (op == INVOKE_POLYMORPHIC || op == INVOKE_POLYMORPHIC_RANGE) {
return String.format("%s, %s # method@%04x, proto@%04x", mthRef.toString(), insn.getIndexAsProto(insn.getTarget()).toString(), insn.getIndex(), insn.getTarget());
}
return String.format("%s # method@%04x", mthRef.toString(), insn.getIndex());
}
use of jadx.api.plugins.input.data.IMethodRef in project jadx by skylot.
the class InsnDecoder method invoke.
private InsnNode invoke(InsnData insn, InvokeType type, boolean isRange) {
IMethodRef mthRef = InsnDataUtils.getMethodRef(insn);
if (mthRef == null) {
throw new JadxRuntimeException("Failed to load method reference for insn: " + insn);
}
MethodInfo mthInfo = MethodInfo.fromRef(root, mthRef);
return new InvokeNode(mthInfo, insn, type, isRange);
}
Aggregations