【Frida】Java反射调用

通过反射调用,获取类名
参数Object obj 类名
String str 方法名

    static Object a(Object obj, String str) {
        try {
            return obj.getClass().getMethod(str, new Class[0]).invoke(obj, new Object[0]); //Java反射
        } catch (Exception e) {
            return null;
        }
    }

获取类属性
参数Object obj 类名
String str 属性名

    private static Object b(Object obj, String str) {
        try {
            return obj.getClass().getField(str).get(obj);
        } catch (Exception e) {
            return null;
        }
    }

posted @ 2023-02-04 12:34  xsir161  阅读(162)  评论(0编辑  收藏  举报