Android 原生系统出现Wifi信号感叹号的解决方法

Android 5.0引入的网络评估机制:

就是当你连上网络后,会给目标产生204响应的服务器发送给一个请求,如果服务器返回的是状态码为204的响应,那么就被认为网络可以访问;否则,如返回的是其他状态码,那么将被视为网络访问需要登录操作等;没有响应的话,就被认为是网络不可访问。这里的情况就是,目标服务器不能正常访问

安卓 6.0

方法一:屏蔽网络检查功能,最简单快速,但是就没有办法提示wifi登录

手机终端中或者ADB远程输入以下指令

settings put global captive_portal_detection_enabled 0

方法二:用国内的服务器替换掉google的服务器

手机终端或者ADB远程输入,请将服务器地址替换成你想进行跳转的地址,不加 http 和后缀

settings put global captive_portal_server connect.rom.miui.com

安卓 6.0 以上,包括8.0,9.0及以上版本的方法

# 查看所有配置
adb shell settings list global

# 使用https
adb shell settings put global captive_portal_https_url xxxxx

# 使用http
adb shell settings put global captive_portal_use_https 0
adb shell settings put global captive_portal_http_url xxxxx

# 使用默认,即删除配置
adb shell settings delete global captive_portal_http_url
adb shell settings delete global captive_portal_https_url

国内可用204响应的服务器,推荐miui 的服务

http://connect.rom.miui.com/generate_204
http://www.v2ex.com/generate_204
https://captive.v2ex.co/generate_204
http://www.noisyfox.cn/generate_204
http://www.google.cn/

设置以后,再开关一下手机的飞行模式或者重启手机即可。

发表评论