禁用android中的强制门户检测

时间:2014-09-07 14:44:57

标签: java android android-wifi wifimanager wificonfiguration

WifiConfiguration wc = new WifiConfiguration();
                        String ssid = result.SSID;
                        wc.SSID ="\""+ AccessPointName+"\"";
                        wc.status = WifiConfiguration.Status.ENABLED;

                        wc.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);


                        int res = wifiManager.addNetwork(wc);
                        boolean x= wifiManager.enableNetwork(res, true);
                        wifiManager.reconnect();

这个ssid使用强制网络门户,是否有任何配置可以阻止android检查强制网站。

1 个答案:

答案 0 :(得分:0)

只需在终端以root身份执行以下命令:

设置put global captive_portal_server 127.0.0.1&&设置全局captive_portal_detection_enabled 0