{
try {
List<NetworkInterface> all = Collections.list(NetworkInterface.getNetworkInterfaces());
for (NetworkInterface nif : all) {
if (!nif.getName().equalsIgnoreCase("wlan0")) continue;
byte[] macBytes = nif.getHardwareAddress();
if (macBytes == null) {
macTestResultString = "";
}
}
} catch (Exception ex) {
Log.e(App.TAG, EXCEPTION + ex.getMessage());
}
return macTestResultString;
}
在设备 api 上获取超过 10 个的 mac 地址几乎是不可能的。 Android新安全限制不再允许访问mac地址在这里读 https://developer.android.com/training/articles/user-data-ids#mac-11-plus。
为什么你需要 mac 地址提及原因可能是有一些其他解决方案可能会有所帮助。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)