apk端的代码
//获取wifi mac 地址
public static String getMacAddr() {
try {
return loadFileAsString("/sys/class/net/wlan0/address")
.toUpperCase().substring(0, 17);
} catch (IOException e) {
e.printStackTrace();
return "";
}
}
private static String loadFileAsString(String filePath)
throws java.io.IOException {
StringBuffer fileData = new StringBuffer(1000);
BufferedReader reader = new BufferedReader(new FileReader(filePath));
char[] buf = new char[1024];
int numRead = 0;
while ((numRead = reader.read(buf)) != -1) {
String readData = String.valueOf(buf, 0, numRead);
fileData.append(readData);
}
reader.close();
return fileData.toString();
}
//end 获取wifi m