美文网首页
getDeviceId获取到MEID

getDeviceId获取到MEID

作者: 6f827b5010b5 | 来源:发表于2018-07-10 09:57 被阅读0次

getDeviceId获取到MEID

在华为揽阅M3中,SIM卡为中国移动物联网卡,通过getDeviceId取得MEID码,经过排查。通过反射传参可以获得IMEI号

     Method method = tm.getClass().getMethod("getDeviceId", int.class);

     String imei = (String) method.invoke(tm, TelephonyManager.PHONE_TYPE_CDMA);

getDeviceId()方法中可以传递以下四个参数,由于这个方法在sdk22才支持,因此使用反射。

TelephonyManager.PHONE_TYPE_GSM

TelephonyManager.PHONE_TYPE_CDMA

TelephonyManager.PHONE_TYPE_NONE

TelephonyManager.PHONE_TYPE_SIP

此时若把SIM卡更换为电信物联网卡,则无法取出设备IMEI号,无论参数用的哪一个,都不行。

相关文章

网友评论

      本文标题:getDeviceId获取到MEID

      本文链接:https://www.haomeiwen.com/subject/fmffpftx.html