简体   繁体   English

在Android中,MAC地址是否随时间而变化

[英]Does MAC address changes over time in Android

Hello I want to get the MAC address of the android device so there is two ways either use WiFi or BlueTooth adapter for this. 您好我想获取Android设备的MAC地址,因此有两种方法可以使用WiFiBlueTooth适配器。

Does this MAC address changes over the time when you turn on/off WiFi or BlueTooth or restart your device or factory reset. 当您打开/关闭WiFiBlueTooth或重启设备或BlueTooth出厂设置时,此MAC地址是否会发生变化。 Any idea ? 任何的想法 ?

MAC address is unique to each piece of hardware. MAC地址对于每个硬件都是唯一的。 They won't change. 他们不会改变。 First few characters of the MAC address contains manufacturer information. MAC地址的前几个字符包含制造商信息。

ps Except for those MAC addresses generated by simulator / VM, etc. ps除了模拟器/ VM等生成的MAC地址外。


UPDATE UPDATE

Since Android 5.x, iOS 8+ and Windows 10+, MAC Address is generated and randomized each time Wi-Fi is turned on to protect user's privacy. 自Android 5.x,iOS 8+和Windows 10+起,每次打开Wi-Fi时都会生成并随机化MAC地址,以保护用户的隐私。 Some operating systems even have different MAC address for each connected network. 某些操作系统甚至为每个连接的网络具有不同的MAC地址。

Not entirely true Raptor. Raptor并不完全正确。 Android WILL generate a MAC address every time WiFi is activated if it doesn't have one. 如果没有WiFi,则每次激活WiFi时都会生成一个MAC地址。 Here's how to tell (and how I fixed it on my Chinese tablet) 这是如何判断(以及如何在我的中文平板电脑上修复它)

  1. Root the device. 根设备。
  2. Open file "/data/nvram/APCFG/APRDEB/WIFI" with a hex editor. 使用十六进制编辑器打开文件“/ data / nvram / APCFG / APRDEB / WIFI”。
  3. if bytes 4 thru 9 are 0 then Android will generate a MAC address on-the-fly. 如果字节4到9为0,则Android将即时生成MAC地址。

To FIX (hard-code) a MAC address, edit the "WIFI" file above and type a (any) MAC address into those byte locations (in hex notation, as you see it). 要修改(硬编码)MAC地址,编辑上面的“WIFI”文件并在这些字节位置键入(任意)MAC地址(十六进制表示法,如您所见)。 Save the file. 保存文件。 Reboot / restart WIFI and see setting. 重新启动/重启WIFI并查看设置。 You should see your new address. 你应该看到你的新地址。 And Android will now recognise your new address and won't generate a new one every time. Android现在可以识别您的新地址,并且不会每次生成新地址。

I did then to persist MAC filtering in my router, else the kids keep abusing my bandwidth by adding new i-devices. 然后我在路由器中坚持MAC过滤,否则孩子们会通过添加新的i-devices来滥用我的带宽。

Hope this helps 希望这可以帮助

Android蓝牙MAC地址永远不会改变。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM