android中通过"反射"的到android隐藏的API

try {

			Class clazz = this.getClass().getClassLoader()
					.loadClass("android.widget.AppSecurityPermissions");

			Constructor constructor = clazz.getConstructor(new Class[] {
					Context.class, String.class });

			Object object = constructor.newInstance(new Object[] { this,
					"cn.itcast.mobilesafe" });

			Method method = clazz.getDeclaredMethod("getPermissionsView",
					new Class[] {});

			View view = (View) method.invoke(object, new Object[] {});
			setContentView(view);

		} catch (Exception e) {
			e.printStackTrace();
		}

参考

参考2

参考3

你可能感兴趣的:(android中通过"反射"的到android隐藏的API)