admin管理员组

文章数量:1288016

I am using android12 device and below code try to use reflection to access hiden API:

    public static void setDisplaySurface(IBinder displayToken, Surface surface) {
        try {
            CLASS.getMethod("setDisplaySurface", IBinder.class, Surface.class).invoke(null, displayToken, surface);
        } catch (Exception e) {
            throw new AssertionError(e);
        }
    }

But it report exception:

AndroidRuntime: java.lang.AssertionError: java.lang.reflect.InvocationTargetException

Any gracefull way to make it work?

本文标签: javaAccess android hiden API by reflection not workStack Overflow