自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
隐私安全性最佳做法
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本页面包含一系列数据收集指南和建议,可确保 Android 用户能够控制其数据的处理方式。
数据日志记录
记录数据的做法会增加数据遭泄露的风险并降低系统性能。之前曾发生过多起因记录敏感用户数据而导致的公共安全事件。
- 请勿登录 SD 卡。
- 应用或系统服务不应记录第三方应用提供的可能包含敏感信息的数据。
- 应用不得在正常操作过程中记录任何个人身份信息 (PII),除非是为了提供应用的核心功能而绝对有必要这样做。
CTS 中有些测试可以检查日志中是否存在可能敏感的信息。
指标收集
为了了解应用使用情况以及改善整体用户体验,收集指标可以是很关键的一环。但是,指标收集如果过于宽泛,也会导致用户隐私面临风险。
- 尽量不要收集指标。
- 如果您必须收集指标,请首先征求用户的明确同意,告知用户收集指标的意义所在。
- 请仅收集支持服务可靠性所需的指标(个别情况除外)。
- 尽可能避免收集可识别用户身份或可能敏感的数据,例如硬件标识符。
- 尽可能确保所有数据都得到聚合与匿名处理。
间谍软件
间谍软件指旨在实现以下目的的软件:在用户或设备不知情的情况下收集其相关信息,并可能未经用户同意将其信息发送给其他实体。
- 如果软件在未通知用户的情况下或以出乎用户意料的方式传输以下用户或设备数据,则会被视为间谍软件(以下列表只是列举了一些主要示例,并不是详尽无遗的):
- 用户联系人的相关信息(姓名、电话号码、电子邮件)
- 照片或其他文件
- 用户电子邮件中的内容
- 通话记录
- 短信日志
- 网络历史记录
- 浏览器书签
- 其他应用(不公开
/data/
目录)中的个人信息
- 音频或通话录音
- 密码
- OAuth 令牌
- 位置信息
- 确保所有应用都会在用户安装应用之前向他们提供合理的披露说明。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Privacy security best practices\n\nThis page contains a collection of data collection guidance\nand recommendations to ensure that Android users have control over the\nhandling of their data.\n\nData logging\n------------\n\nLogging data increases the risk of exposure of that data and reduces system\nperformance. Multiple public security incidents have occurred as a result of\nlogging sensitive user data.\n\n- Don't log to the sdcard.\n- Apps or system services shouldn't log data provided from third-party apps that might include sensitive information.\n- Apps must not log any Personally Identifiable Information (PII) as part of normal operation, unless it's absolutely necessary to provide the core functionality of the app.\n\nCTS includes tests that check for the presence of potentially sensitive\ninformation in logs.\n\nMetrics collection\n------------------\n\nCollecting metrics can be an essential part of understanding usage of your\napp and making improvements for the overall user experience. However, overly\nbroad metrics collection can also present a risk to user privacy.\n\n- If at all possible, don't collect metrics.\n - If you must collect metrics, first request explicit, informed, and meaningful user consent.\n- With few exceptions, only collect metrics that are necessary to support the reliability of the service.\n- Avoid collecting identifiable or potentially sensitive data whenever possible, such as [hardware identifiers](https://developer.android.com/training/articles/user-data-ids).\n- Ensure data is sufficiently aggregated and anonymized whenever possible.\n\nSpyware\n-------\n\nSpyware is defined as software that aims to gather information about a user\nor device without their knowledge, that might send user information to another\nentity without consent.\n\n- Transmission of the following user or device data without disclosure or in a manner that is unexpected to the user is considered spyware (this list contains top examples, but isn't an exhaustive list):\n - Information about the user's contacts (names, numbers, emails)\n - Photos or other files\n - Content from user email\n - Call log\n - SMS log\n - Web history\n - Browser bookmarks\n - Private information from other apps (private `/data/` directories)\n - Audio or call recording\n - Passwords\n - OAuth tokens\n - Location\n- Ensure that all apps provide a reasonable explanation disclosure to the user prior to installation."]]