如何更改或增添安卓手机的mac地址?

2025-03-13 21:02:28
推荐回答(5个)
回答1:

android 是Linux内核,linux中mac地址是保存在/etc/init.d/networ 文件中的
但是在android中mac地址是直接写在硬件中的,需要通过API 才能获取

1、Android 获取本机Mac 地址方法:
需要在AndroidManifest.xml文件中添加权限:

public String getLocalMacAddress() {
WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
WifiInfo info = wifi.getConnectionInfo();
return info.getMacAddress();
}

2、Android 获取本机IP地址方法:
public String getLocalIpAddress() {
try {
for (Enumeration en = NetworkInterface
.getNetworkInterfaces(); en.hasMoreElements();) {
NetworkInterface intf = en.nextElement();
for (Enumeration enumIpAddr = intf
.getInetAddresses(); enumIpAddr.hasMoreElements();) {
InetAddress inetAddress = enumIpAddr.nextElement();
if (!inetAddress.isLoopbackAddress()) {
return inetAddress.getHostAddress().toString();
}
}
}
} catch (SocketException ex) {
Log.e("WifiPreference IpAddress", ex.toString());
}
return null;
}

回答2:

这个好像只有刷机才可以改变,mac地址改变有多大的意义,真要想改手机root以后,貌似可以随便改,这个东西好像只和网络链接有关

回答3:

不能被,MAC无线网络的地址没有被,因为你不能改变ID号相同。

回答4:

目前俺知道的是,下载改mac软件,试试。

回答5:

http://wenku.baidu.com/view/dbc791d06f1aff00bed51ee4.html
这里有详细教程
望采纳