From 07e25ef1df911162ae3bc6fb16fbe012d6f9ebb7 Mon Sep 17 00:00:00 2001 From: Milk <1871357815@qq.com> Date: Mon, 26 Jul 2021 17:10:09 +0800 Subject: [PATCH] add getMethods --- .../java/top/niunaijun/blackbox/core/VMCore.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Bcore/src/main/java/top/niunaijun/blackbox/core/VMCore.java b/Bcore/src/main/java/top/niunaijun/blackbox/core/VMCore.java index 9162442..4ea8188 100644 --- a/Bcore/src/main/java/top/niunaijun/blackbox/core/VMCore.java +++ b/Bcore/src/main/java/top/niunaijun/blackbox/core/VMCore.java @@ -160,7 +160,20 @@ public class VMCore { } } - Method[] declaredMethods = aClass.getDeclaredMethods(); + try { + Method[] declaredMethods = aClass.getDeclaredMethods(); + for (Method declaredMethod : declaredMethods) { + if (declaredMethod.getName().equals(methodName)) { + String desc = MethodUtils.getDesc(declaredMethod); + if (desc.equals(signature)) { + return declaredMethod; + } + } + } + } catch (Throwable ignored) { + } + + Method[] declaredMethods = aClass.getMethods(); for (Method declaredMethod : declaredMethods) { if (declaredMethod.getName().equals(methodName)) { String desc = MethodUtils.getDesc(declaredMethod);