我通过编程获得的安卓设备UDID与同一设备的AirWatch Udid不同。是否有其他方法可以获取设备Udid?
我使用Secure.ANDROID_ID来获取udid,但它仍然与AirWatch获得的UDID不同。
Secure.getString(getContentResolver(), Secure.ANDROID_ID);AirWatch UDID的长度如下:ak26fs007bf8S786f2fr281d22c6996d
我希望得到相同的输出,但是我从上面的代码中得到的Udid是:63a34441u6ajj2ed
发布于 2021-04-12 08:02:37
air watch UDID是通过将设备的多个方面进行哈希而生成的,其中Secure.ANDROID_ID只是其中之一- ro.serialno可能是另一个,但要点是它们将这些方面放在一起,使用128位哈希,这就是您所得到的。
如果你一定要匹配他们的计算,这并不是很难找到他们的APK .dex,他们在一个类方法中执行计算,并通过反编译来自己查看代码。
他们的代码自然是模糊的,但是你可以从
com.airwatch.core.AirWatchDevice.isDeviceUDIDInitialized()
它是从一个或两个位置调用的,并且-如果返回false -它们调用UDID方法(实际的完整方法名在这里是无用的,因为它被混淆了,沿着"d.a.p0.d0.g0.c“的行,它在每次构建中都会改变,但isDeviceUDIDInitialized()仍然可见)。
另一种方法是寻找他们在哪里钓到ro.serialno,
通过java.lang.Class.getMethod("android.os.SystemProperties","get",..)
其中,它们还寻找android.os.Build.MANUFACTURER和一堆其他属性。
此外,在一些构建中,formatDeviceUid作为一种方法--直接应用MD5。
发布于 2019-07-01 00:56:01
我想您是Android应用程序开发的新手。在android中,与唯一设备标识符相关的问题一直存在。ANDROID_ID是在API level 3中引入的,返回的值是不同的。
在此之前,Android操作系统提供了一些唯一的设备id。但如果设备已格式化或安装了新的自定义操作系统,则会返回新值。随后,在某些设备中会返回null值。在Oreo (Android 8.0)之后,它的工作方式就不同了。
谷歌建议应用程序开发人员跟踪应用程序安装,而不是设备,这将适用于大多数使用情况。
为了跟踪应用程序的安装,您可以创建一个唯一的id,如UUID.randomUUId().toString(),也可以创建自己的变通方法。
这里有一些可能对你有帮助的链接。
在best practices上写的一些要点是:
When working with Android identifiers, follow these best practices:
#1: Avoid using hardware identifiers. In most use cases, you can avoid using hardware identifiers, such as SSAID (Android ID) and IMEI, without limiting required functionality.
#2: Only use an Advertising ID for user profiling or ads use cases. When using an Advertising ID, always respect users' selections regarding ad tracking. Also, ensure that the identifier cannot be connected to personally identifiable information (PII), and avoid bridging Advertising ID resets.
#3: Use an Instance ID or a privately stored GUID whenever possible for all other use cases, except for payment fraud prevention and telephony. For the vast majority of non-ads use cases, an Instance ID or GUID should be sufficient.
#4: Use APIs that are appropriate for your use case to minimize privacy risk. Use the DRM API for high-value content protection and the SafetyNet APIs for abuse protection. The SafetyNet APIs are the easiest way to determine whether a device is genuine without incurring privacy risk.https://stackoverflow.com/questions/56825826
复制相似问题