我是靠谱客的博主 激动大白,这篇文章主要介绍某些android手机获取不到IMEI问题,现在分享给大家,希望可以做个参考。

某些山寨机可能拿不到IMEI
如果非要IMEI可以模拟一个


private String getUniqueId() {
TelephonyManager tm = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
String uniqueId=tm.getDeviceId();
if(isEmpty(uniqueId)){
uniqueId=android.os.Build.SERIAL;
}
if(isEmpty(uniqueId)){
uniqueId=Settings.System.getString(getContentResolver(), Settings.System.ANDROID_ID);
}
if(isEmpty(uniqueId)){
uniqueId=getUUID(context);
}
return uniqueId;
}

private String getUUID(Context context){
String uuid=(String)SPUtils.get(context, "DeviceId", "");
if(isEmpty(uuid)){
uuid = UUID.randomUUID().toString();
SPUtils.put(context, "DeviceId", uuid);
}
return uuid;
}

最后

以上就是激动大白最近收集整理的关于某些android手机获取不到IMEI问题的全部内容,更多相关某些android手机获取不到IMEI问题内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(88)

评论列表共有 0 条评论

立即
投稿
返回
顶部