/** * 获取设备唯一标识 如果IMEI为null则返回wifi mac * * @return */ public static String getDeviceId(Context mContext) { String deviceId = null; TelephonyManager telephonyManager = (TelephonyManager) mContext .getSystemService(Context.TELEPHONY_SERVICE); deviceId = telephonyManager.getDeviceId(); if (deviceId != null) return deviceId; WifiManager wm = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE); deviceId = wm.getConnectionInfo().getMacAddress(); if (deviceId != null) { deviceId.replace(":", ""); } return deviceId; }
获取设备唯一标识
最新推荐文章于 2023-12-26 16:27:10 发布