getDeviceId() 返回十六进制...为什么?

发布于 2024-09-24 22:21:18 字数 412 浏览 2 评论 0原文

我只为英国构建了一个应用程序,它使用设备 ID 来唯一标识设备。该应用程序仅添加到特定手机(而不是通过市场),因此对谁拥有该应用程序的控制相当高。

我们现在从设备获取数据,发现一些设备 ID 是十六进制的,而不是纯数字(IMEI 应该是)。

某些数据返回绝对正确,而某些数据似乎是无效的十六进制。

由于某些数据是正确的,欧洲设备是否可以通过任何方式返回 MEID 号码,因为这似乎就是正在发生的情况。

返回设备 ID 的代码(包含适当的权限):

{
  tm = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
  return tm.getDeviceId();
}

有什么想法吗?

I've built an app for the UK only which uses the device ID to uniquely identify the device. The app is only being added to specific handsets (not via the market) so the control of who has the app is quite high.

We're now getting the data back from the devices, and finding that some of the device IDs are hexadecimal and not purely digits (as IMEI should be).

Some of the data is returning absolutely correctly and some appears to be invalid hexadecimal.

Because some of the data is correct, is there any way that European devices can return MEID numbers or not, because that appears to be what is happening.

Code to return device id (with appropriate permissions included):

{
  tm = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
  return tm.getDeviceId();
}

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半世晨晓 2024-10-01 22:21:18

是的,该方法会返回 IMEI、MEID 或 ESN,具体取决于手机。

http://developer.android.com/reference/ android/telephony/TelephonyManager.html#getDeviceId%28%29

Yes, the method returns an IMEI, MEID or ESN depending on the phone.

http://developer.android.com/reference/android/telephony/TelephonyManager.html#getDeviceId%28%29

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文