6

Within an app I am trying to create, I want to check for the availability of a hidden WiFi SSID. Sadly, networks with hidden SSIDs dont show up in scans so I cant wait for scan results returned via WifiManager.SCAN_RESULTS_AVAILABLE_ACTION.

I attempted to use android.net.wifi.WifiManager.enableNetwork(int netId, boolean disableOthers) after creating the WifiConfig for the network, thinking that it would return true if the network was able to be connected to, and false otherwise, but that pretty much always returns true, even in cases where i create gibberish WifiConfigs.

I just need to test if the hidden network is broadcasting or not. I know all of its information, including the SSID.

4

1 回答 1

3

隐藏网络的 SSID 隐藏得很好。所以他们没有广播他们的 SSID。要检查隐藏网络的可用性,您应该尝试连接到网络。如果成功,它就在那里,否则不存在。第二个选项是在监控模式下嗅探网络中的流量,并查找相应的 BSSID。不过,这需要 root,以及一些允许您执行此操作的工具或应用程序。第一个选项将始终有效,但您一直处于活动状态。第二个允许您被动检查网络,但需要root。

于 2013-09-17T16:47:22.063 回答