目前仅提供由于访问http://clients3.google.com/generate_204失败,导致的WiFi和移动网络提示“已连接 但无法访问互联网”问题。

使用方法:

首先配置好Android SDK并更新,其次请打开手机的开发者模式,然后打开Linux终端,通过如下操作即可。

进入到SDK文件夹中的platform-tools子文件夹(例如:cd android-sdk/platform-tools);
注:可能命令前需要添加sudo以提升权限
然后:

使用Google的服务器:
adb shell settings put global captive_portal_server www.google.cn
adb reboot

对于Android 7.1.2请使用带有https加密的验证方式:
adb shell settings put global captive_portal_http_url www.google.cn/generate_204
adb shell settings put global captive_portal_https_url www.google.cn/generate_204

想恢复也很简单:

adb shell settings delete global captive_portal_server
adb shell settings put global captive_portal_detection_enabled 1
adb reboot

对于Android 7.1.2后的恢复方式:
adb shell settings delete global captive_portal_https_url
adb shell settings delete global captive_portal_http_url