AI智能
改变未来

Android 获取本地Mac

获取Wlan的唯一Mac

fun getMac(context: Context): String {val wm = context.applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager;val wi = wm.connectionInfoif (wi?.macAddress == null) {return \"\"}return if (\"02:00:00:00:00:00\" == wi.macAddress.trim()) {\"\"} else {wi.macAddress.trim();}}
赞(0) 打赏
未经允许不得转载:爱站程序员基地 » Android 获取本地Mac