Android 8,登录时每个用户的 ANDROID_ID 值不同?

标签 android google-signin

Googles 写道有一个 different value of the ANDROID_ID for different users .

In O, Android ID (Settings.Secure.ANDROID_ID or SSAID) has a different value for each app and each user on the device.

如果我执行 Google SignIn 意味着什么在一个应用程序中。确切地说:该设备在用户“A@google.com”下运行。用户在其设备上拥有帐户“A@google.com”、“B@google.com”、“C@google.com”。

当用户在“A@google.com”下运行设备并在安装应用程序后首次登录时,他将看到一个包含可能帐户的弹出窗口。假设他选择“A@google.com”。选择将保存在应用程序存储数据中。如果他清理数据并重新启动应用程序,他将再次弹出此帐户,理论上他可以选择另一个帐户。 假设他现在在登录时选择了另一个帐户“B@google.com”,因此他的设备仍以“A@google.com”运行,但他使用“B@google.com”登录到应用程序。那么 ANDROID_ID 是什么?来自 A 还是来自 B 的 ANDROID_ID? (本人没有安卓8的设备,无法自行查看)

最佳答案

我认为您混淆了由 AccountManager 管理的帐户用户,由 UserManager 管理.

Users are different from accounts, which are managed by AccountManager. Each user can have their own set of accounts.

我的猜测是 ANDROID_ID 取决于 user serial number

从您提供的链接:

The ANDROID_ID value won't change on package uninstall/reinstall, as long as the package name and signing key are the same. Apps can rely on this value to maintain state across reinstalls.

在您的情况下,如果应用程序的数据被清除,应用程序 ID、签名和用户是相同的,因此 ANDROID_ID 不应更改。

关于Android 8,登录时每个用户的 ANDROID_ID 值不同?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53044381/

相关文章:

android - 在更新方法中只更新当前的 Android widget ID

javascript - 网站代码的基本 Google 登录在 Internet Explorer 11 中不起作用

android - Google 新登录,未调用 onActivityResult()

Android 应用程序,通过 UART 通过 BLE 模块接收微 Controller 发送的数据

java - 如何从模式 dd-MMM-yyyy 中的给定字符串日期获取整数中的日月和年

java - 如果提供了不正确的登录凭据,如何避免 Android 中的 httpsURLConnection.getInputStream() 挂起?

javascript - Firebase Web 获取 Google 和 Facebook 中的提供商数据(性别和生日)

android - 试图了解需要将哪些 SHA-1(开发和发布)添加到 firebase android 项目

reactjs - react 谷歌登录默默失败

java - 文件以 UTF-8 格式保存,但俄语中有奇怪的符号