首页天道酬勤安卓手机改mac地址,手机伪装mac地址软件

安卓手机改mac地址,手机伪装mac地址软件

admin 08-30 07:51 339次浏览

满意答案

kgcvzz

2015.12.14

采纳率:45%    等级:9

已帮助:515人

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;

}

02分享举报

vue不能用index做为唯一标识的原因是什么win7电脑文件夹如何加密
爬虫请求头 神箭手云爬虫,造数云爬虫
相关内容