从ScanResult构建WifiConfiguration或:解释ScanResult的“capabilities”字符串

12

有没有 Android 高手知道如何从给定的 ScanResult 创建一个 WifiConfiguration 的开源代码?这将非常有帮助。实际上,我的抓包(2012 年 4 月中旬)中的 Android 源代码的第 483 行(/624)的 WifiConfiguration.java 是一个被注释掉的构造函数,旨在完成这个任务,但后面还有一个巨大的 TODO,问自己是否值得实现(见下面的引用)。我表示赞成,能不能有人支持一下呢?

我看到的主要挑战(实际上也是这个问题的重点)是如何解释 ScanResult.configuration 字符串。

  1. 我可以期望只有一些简单的东西,比如 [WPA2-PSK-CCMP][WPS] 等吗?
  2. 这些字符串在文档或代码库中被枚举吗?
  3. 应该知道哪些特定于设备/制造商/AP 的字符串?

来自 WifiConfiguration.java(可能会有点评论):

/** 
 * Construct a WifiConfiguration from a scanned network
 * @param scannedAP the scan result used to construct the config entry
 * TODO: figure out whether this is a useful way to construct a new entry.
 *   
public WifiConfiguration(ScanResult scannedAP) {
    networkId = -1; 
    SSID = scannedAP.SSID;
    BSSID = scannedAP.BSSID;
    // aaaah screw it I'm tired/lazy
}   
*/

https://code.google.com/p/android/issues/detail?id=60523

1个回答

4

该项目已经迁移至此处: https://github.com/kevin-yuan/android-wifi-connecter - ThomasW
最新链接:https://github.com/kevin-yuan/android-wifi-connecter/blob/master/src/com/farproc/wifi/connecter/Wifi.java https://github.com/kevin-yuan/android-wifi-connecter/blob/master/src/com/farproc/wifi/connecter/ConfigurationSecuritiesV8.java - ThomasW
已经过去8年了,所以你可以拿到支票了。 - QED

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接