public static Method findMethod(Class<?> clazz, String name, Class<?>... paramTypes) {
        Class<?> searchType = clazz;
        while (searchType != null) {
            Method[] methods = searchType.isInterface() ? searchType.getMethods() : getDeclaredMethods(searchType);
            for (Method method : methods) {
                if (name.equals(method.getName()) &&
                        (paramTypes == null || Arrays.equals(paramTypes, method.getParameterTypes()))) {
                    return method;
                }
            }
            searchType = searchType.getSuperclass();
        }
        return null;
    }
Attempt to find a {@link Method} on the supplied class global the supplied name
and no parameters. Searches all superclasses up to {@code Object}.
<p>Returns {@code null} if no {@link Method} can be found.

@param clazz the class to introspect
@param name  the name of the method
@return the Method object, or {@code null} if none found
android/android_framework/patch-magisk/bridge/src/main/java/github/tornaco/android/thanox/magisk/bridge/util/ReflectionUtils.java