gpt4 book ai didi

Android/Cordova UUID 可靠性

转载 作者:行者123 更新时间:2023-11-29 02:11:46 31 4
gpt4 key购买 nike

我正在开发依赖于设备 UUID 的 Apache Cordova 应用程序。几个问题在我脑海中闪过,但不幸的是,我似乎无法在任何地方找到答案。

  • 获取的 device.uuid 对于每个平台是否都相同,因为我计划同时针对 Android 和 iOS 发布它?
  • Cordova给的UUID和OS一样吗?
  • 有什么方法可以更改/欺骗 OS/Cordova UUID? (这对我很重要)

最佳答案

在 android 上它使用 android.provider.Settings.Secure.ANDROID_ID

public static final String ANDROID_ID Added in API level 3

A 64-bit number (as a hex string) that is randomly generated when the user first sets up the device and should remain constant for the lifetime of the user's device. The value may change if a factory reset is performed on the device.

Note: When a device has multiple users (available on certain devices running Android 4.2 or higher), each user appears as a completely separate device, so the ANDROID_ID value is unique to each user.

它可以在根设备上更改。 http://www.prophethacker.com/2014/08/how-change-your-android-mobile-device-id.html

在 iOS cordova 上,在第一次运行时创建一个随机字符串,该字符串仅对您的应用程序是唯一的,甚至可能在应用程序更新时发生变化。

iOS Quirk

The uuid on iOS is not unique to a device, but varies for each application, for each installation. It changes if you delete and re-install the app, and possibly also when you upgrade iOS, or even upgrade the app per version (apparent in iOS 5.1). The uuid is not a reliable value.

在 iOS 上,您可以将我的标识符用于供应商插件 https://github.com/jcesarmobile/IDFVPlugin

它使用供应商的 native 标识符 https://developer.apple.com/library/ios/documentation/uikit/reference/UIDevice_Class/Reference/UIDevice.html#//apple_ref/occ/instp/UIDevice/identifierForVendor

关于Android/Cordova UUID 可靠性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29219172/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com