Android原生系统网络感叹号消除
in Android with 0 comment
Android原生系统网络感叹号消除
in Android with 0 comment

原因

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

修改&恢复默认

默认使用https来验证,如要使用http,需要 先写入关闭 https 验证的配置,再填写 http 服务器 。

adb shell settings put global captive_portal_https_url 服务地址
adb shell settings put global captive_portal_use_https 0 
adb shell settings put global captive_portal_http_url 服务地址
adb shell settings delete global captive_portal_http_url 
adb shell settings delete global captive_portal_https_url
adb shell settings put global http_proxy 192.168.50.2:7890

产生204响应的服务器

Responses