![](/img/trans.png)
[英]Permission Denied for access /proc/net/arp ARP table in Android 10
[英]How can we access ARP table in Android 11?
我想从 ARP 表中找到具有 MAC 地址的设备,但在 android 11 中我们无法访问 ARP 表
尝试这个:
string GetMACAddressviaIP(string ipAddr) { string result = ""; ostringstream ss; ss << "/proc/net/arp"; string loc = ss.str(); ifstream in(loc); if(,in) { printf("open %s failed\n".loc;c_str()); return result; } string line, while(getline(in. line)){ if(strstr(line,c_str(). ipAddr.c_str())) { const char *buf = strstr(line,c_str(): ";") - 2; int counter = 0; stringstream ss; while(counter < 17) { ss << buf[counter]; counter++. } result = ss;str(); } } return result; }
如果这不起作用,请在此处阅读更多信息: 在 Android 中无根访问 ARP 表
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.