Discover Nearby Smartphone Devices on Android

假如想象 提交于 2020-05-28 04:33:07

问题


Problem Statement

I am trying to make an application for Android that can detect nearby smartphone devices. I need to discover smartphone devices regardless of their connection to a WLAN or their operating system. The only requirement is that their bluetooth or wifi setting is enabled. I am trying to capture the MAC Address and maybe RSSI of these devices. An example of an application I am trying to emulate is Meshlium.

Methods Already Considered

  1. Android Classic Bluetooth:

    • I have followed the guide to discover devices that aren't currently paired with my device.
    • The smartphones I am trying to discover need to be in "discovery" mode in order to be found. For most modern phones that means they need to be on their bluetooth settings page.
  2. Android P2P (Wifi Direct):

    • I have followed the guide again and can't discover smartphones nearby.
    • Similar to bluetooth, both devices (mine and the device I am trying to find) need to be both trying to discover wifi direct devices.
    • Also it seems iOS doesn't support wifi direct anyways.
  3. Google Nearby:

    • Nearby Connections works only with devices running an application that is using the nearby connections api. So only devices with the app currently running the advertising or discovery feature will be available for detection.
  4. Wifi Network Service Discovery:

    • This lets me see devices that are currently advertising services on a network and not the actual devices themselves.

Device Specifications

The device I am using is running android version 6.0.1 and Model number rk3368-box. The device also has root permissions.

Question

Is there a way on my android device to discover the nearby smartphones with the only requirement being their wifi or bluetooth is enabled? Perhaps packet sniffing the probe requests of the devices? I have researched packet sniffing but can't find any solid resources for Android. Also I would love to be able to do so in c# and Xamarin.Android if possible.

Update

Is a custom ROM an option? I am not looking to make an application for the play store, but one for custom hardware. Perhaps when I enable the wifi hotspot on the device it logs the probe requests from the devices nearby and saves as a file to export later?


回答1:


There is no way to do this. And there shouldn't be- unless I'm working with you (in which case multiple of the above will work) its a massive invasion of my privacy for you to be able to detect my device.




回答2:


If you are able to find mac address for WLAN adaptor of a device than try to search for bluetooth devices having mac address same as WLAN adaptor but last digit changed by 1. This way you can find a Bluetooth device even if it's visibility is hidden



来源:https://stackoverflow.com/questions/51407316/discover-nearby-smartphone-devices-on-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!