[英]How to scan MAC address of other devices in a local network in Android?
有没有一种清晰的方法并且可以轻松实现以扫描本地网络以获取连接到我在android中的WiFi网络的设备的MAC地址?
I don't believe that Android will allow you access to raw sockets in order to send ARP requests, so probably the easiest way is to sand some traffic (this can be any kind of traffic) to all IP addresses in the network forcing the phone to get the MAC addresses for all IPs via ARP. 我不相信Android会允许您访问原始套接字以发送ARP请求,因此最简单的方法可能是对网络中的所有IP地址进行一些流量(这可以是任何流量)的流量通过ARP获取所有IP的MAC地址。 Then you can read the ARP cache (
/proc/net/arp
) and get the IP to MAC mappings. 然后,您可以读取ARP缓存(
/proc/net/arp
)并获取IP到MAC的映射。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.