Closed john-70 closed 1 year ago
对应以上的代码,在编译后的字节码中,AService:handle()确实是调用了AService:baseHandle()方法
如果使用https://github.com/Adrninistrator/java-all-call-graph项目,使用生成向下的方法完整调用链的功能(参考TestRBCRunnerGenAllGraph4Caller
类),可以识别到以上baseHandle()方法是调用的BaseService.baseHandle()方法,再关联到BaseService.getStr()方法
例子中的baseHandle(), 访问修饰级别为defualt,此时会丢失。 JarEntryPreHandle2Parser的findClassExtendsInfo做了条件限制(abstract,public,protected)
// 遍历类的方法
for (Method method : javaClass.getMethods()) {
String methodName = method.getName();
if (!methodName.startsWith("<") &&
!method.isStatic()
&& (method.isAbstract() || method.isPublic() || method.isProtected())
) {
// 记录当前类的方法信息
methodAttributeMap.put(new MethodAndArgs(methodName, method.getArgumentTypes()), method.getAccessFlags());
}
}
这两天周末,我改一下这个问题
已解决,最新版本1.0.12
已验证
版本1.0.11
BaseService:baseHandle()在method_call中记录的是AService:baseHandle()
BaseService:baseHandle()的后续路径会丢失