可以从另一个应用程序访问共享PREFERESCES/加密的共享Preference吗?

发布于 2025-02-03 03:28:16 字数 268 浏览 1 评论 0原文

我正在使用一个应用程序,该应用程序存储具有加密共享首选项的敏感数据。如果可以从另一个应用程序访问,我遇到了一些问题。一些答案指出,为了防止从另一个应用程序访问共享preferences,它需要使用mode_private(这是默认的一个),并且该应用程序总体上不包含来自另一个应用程序的相同签名凭据。不幸的是,我在有关这些案件的正式文档官方声明中找不到。

因此,我想问,是否有足够的安全性加密共享的偏好,以防止通过扎根设备从另一个应用程序访问? 如果不是,有什么可能的解决方案?

I'm working on an app which stores sensitive data with encrypted shared preferences. I came across some questions regarding that if it is possible to be accessed from another app. Some of the answers stated that to prevent SharedPreferences from being accessed from another app it needs to be in MODE_PRIVATE (which is the default one) and the app overall to not contain the same signing credentials from another app. Unfortunately I couldn't find in the official documentation official statement regarding these cases.

So I wanna ask, is encrypted shared preferences enough secure in order to prevent from being accessed from another app moreover via rooted device?
If not what are the possible solution?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你曾走过我的故事 2025-02-10 03:28:16

几年前,我遇到了同样的问题,所以我尝试了它,并将共享的偏好保存在一个应用程序中,并试图在另一个应用程序中打开它们,但是即使经过许多不同的尝试,我也无法打开它们。因此,是的,加密的共享偏好是足够安全的,以免任何其他应用程序打开。直到和除非我使用mode_world_readablemode_world_writable

edit> edit


My device is rooted as well for some reasons.

I had the same question few years back, so, I tried it and saved the shared preferences in one app and tried to open them in another app, but even after a lots of different tries I was not able to open them. So yes Encrypted Shared Preferences are secure enough not to be opened by any other app. Until and unless I used the MODE_WORLD_READABLE or MODE_WORLD_WRITEABLE

EDIT


My device is rooted as well for some reasons.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文