AndroidId 根据构建应用程序的用户而变化

AndroidId changing depending on user who builds the app

我们实际上正在开发一个 React Native 项目(android)。

对于我们的许可证管理,我们使用设备中的 "androidId"(使用包 react-native-device-info)。

代码在 git 上,但在应用程序上开发的每个用户的密钥库都不同。 问题是 AndroidId 正在改变。

例如:

我正在从我的计算机构建应用程序(在开发模式下),androidID 将为 XXXXXX 我的朋友正在他的计算机上构建应用程序(在开发模式下,使用相同的源代码),android应用程序中的 ID 将是 YYYYY...

我怎样才能弄清楚?我可以使用另一个唯一编号来管理 react-native 的许可证吗?

希望有人能帮帮我!

蒂博。

引用 the documentation:

For apps installed on a device running Android 8.0, the value of ANDROID_ID is now scoped per app signing key, as well as per user. The value of ANDROID_ID is unique for each combination of app-signing key, user, and device. As a result, apps with different signing keys running on the same device no longer see the same Android ID (even for the same user).

请注意,虽然文档指的是 Android 8.0,但实际上是 "Android 8.0 or higher"。

How can i figure it out ?

ANDROID_ID 不是一个特别适合用于任何事情的值。但是,如果您想依赖它,请标准化您的调试密钥库。

Is there another unique number I can use to manage license from react-native ?

如果您正在寻找特定于设备的标识符,则选项很少,主要是出于隐私和安全原因。 Google 提供 recommendations for identifiers 您可能希望查看。