Android AccountManager 帐户存储

发布于 2024-12-25 19:05:51 字数 52 浏览 5 评论 0原文

AccountManager 帐户存储在哪里?是在设备上吗?如果是的话保存在哪个文件夹中?

Where are the AccountManager Accounts stored? Is it on the device? If yes in which folder is it stored?

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

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

发布评论

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

评论(2

撞了怀 2025-01-01 19:05:51

它存储在这里:

Environment.getSystemSecureDirectory().getPath() + File.separator + DATABASE_NAME;

其中 getSystemSecureDirectory:

获取可用于安全存储的系统目录。如果加密
文件系统已启用,它返回一个加密目录
(/数据/安全/系统)。否则,它返回未加密的
/data/system 目录。

DATABASE_NAME = "accounts.db";

It is stored here:

Environment.getSystemSecureDirectory().getPath() + File.separator + DATABASE_NAME;

Where getSystemSecureDirectory:

Gets the system directory available for secure storage. If Encrypted
File system is enabled, it returns an encrypted directory
(/data/secure/system). Otherwise, it returns the unencrypted
/data/system directory.

and DATABASE_NAME = "accounts.db";

聆听风音 2025-01-01 19:05:51

虽然答案完全正确,但您应该记住“Environment.getSystemSecureDirectory()”是平台 API 方法,而不是公共 SDK API 的一部分。如果你查看它的javadoc,你会发现'@hide'注释:

<前> <代码> / **
* 获取可用于安全存储的系统目录。
* 如果启用加密文件系统,则返回加密目录 (/data/secure/system)。
* 否则,它返回未加密的/data/system目录。
* @return 表示安全存储系统目录的文件对象。
* @隐藏
*/

隐藏的方法仅供与平台本身一起分发的平台应用程序使用。它们是针对平台源而不是 SDK 源进行编译的,就像 Play/Market 的应用程序所要求的那样。

这意味着如果您想在 Play/Market 上分发您的应用程序,则不允许您使用它。

While the answer is perfectly correct, you should keep in mind that 'Environment.getSystemSecureDirectory()' is a platform API method and not part of the public SDK's API. If you look at its javadoc, you will realize the '@hide' annotation:

 /**
 * Gets the system directory available for secure storage.
 * If Encrypted File system is enabled, it returns an encrypted directory (/data/secure/system).
 * Otherwise, it returns the unencrypted /data/system directory.
 * @return File object representing the secure storage system directory.
 * @hide
 */

The hidden methods are meant for use only by platform apps that are distributed along with the platform itself. They are compiled against the platform source rather than the SDK source as apps for Play/Market are required to be.

This means that you're not allowed to use it if you want to distribute your app on Play/Market.

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