在棉花糖和牛轧糖Android中阅读浏览器历史记录 [英] Read browser history in Marshmallow And Nougat Android

查看:137
本文介绍了在棉花糖和牛轧糖Android中阅读浏览器历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Android棉花糖中使用Android Browser.BOOKMARKS_URI.在使用Lollipop之前,有一种使用权限从Chrome浏览器中读取历史记录的方法.但是在棉花糖中,权限被删除了.还有其他替代方法可用于读取棉花糖设备上的浏览器历史记录吗?

I am trying to use Android Browser.BOOKMARKS_URI in Android Marshmallow. Until Lollipop, there is a way to read the history from the Chrome Browser using the permission. But in Marshmallow the permission is removed. Does any other alternative available for reading the browser history on a Marshmallow device?

我提到了此官方Android文档,但不清楚.

谢谢.

推荐答案

由于安全原因,应用程序现在无法读取/写入浏览器历史记录. Google在API >= 23之后采取了这一步骤.

Due to security reason the browser history read/write are now not accessible by to the app. This step was taken by Google after API >= 23.

query()调用hasReadAccess(),后者调用hasPermission("com.android.browser.permission.READ_HISTORY_BOOKMARKS"),在API >= M上它会忽略权限参数,而是检查 com.android.chrome.permission.READ_WRITE_BOOKMARK_FOLDERS . 此权限仅限于系统应用和使用Google密钥签名的应用.

query() calls hasReadAccess(), which calls hasPermission("com.android.browser.permission.READ_HISTORY_BOOKMARKS"), which on API >= M ignores the permission argument and instead checks for com.android.chrome.permission.READ_WRITE_BOOKMARK_FOLDERS. This permission is limited to system apps and apps signed with Google's key.

https://developer .android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-bookmark-browser

这篇关于在棉花糖和牛轧糖Android中阅读浏览器历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆