android.permission.CLEAR_APP_CACHE
的方法freeStorageAndNotify()
来删除所有已安装应用程序的系统缓存。但是自从 Android Marshmallow 6.0 版本以后,该方法开始抛出InvocationTargetException
异常。
经过搜索,我发现与此问题相关的报告在这里:Android M reflection method freeStorageAndNotify exception。
所以结论是,由于谷歌现在已将该方法的签名级别提高至signature|system,因此freeStorageAndNotify()
不再起作用。但现在的问题是,其他第三方应用程序,例如“Clean Master”,如何通过获取用户对 6.0 设备的辅助功能权限仍能够删除所有已安装应用程序的系统缓存?