Android 5/6/7/7.1.x 去除网络感叹号方法

貌似自从Android 5.0 Lollipop开始,Google就增加了一个Portal Server门户服务器的连通性测试,大意是为了在连接到需要验证的Public Wi-Fi时,能根据连通测试的情况自动弹出Wi-Fi登陆提示页面,但是默认的地址是 [国内不存在的] gstatic.com 的,鉴于国内的奇葩环境,不管Wi-Fi是不是好的,都会被认为网络是不通的显示一个感叹号提示(Android 7.0 Nougat改成了小叉叉)……

注意:本文提到的方法都无需root,但是需要adb工具并开启开发者选项。

Android 5.0 Lollipop & Android 6.0 Marshmallow的解决方法

在Android 5.0 Lollipop & Android 6.0 Marshmallow时,根据小狐狸分析,可以用以下两个方法解决

  • 方法一:直接禁用Portal Server的连通性测试
  • 在开启了开发者选项的情况下,连接电脑,安装最新版的adb工具,然后执行以下命令:

    然后飞行模式一下,就没有了,但是有个弊端,就是如果你连接公共Wifi需要验证的时候,会发现不会自动弹出验证网页,需要自己打开浏览器访问任意网页才行。

  • 方法二:更改默认的Portal Server地址
  • 网上有一些热心人士提供了在国内可正常连接的Portal Server,包括小狐狸v2exg.cn等,我个人比较喜欢g.cn的,同样在adb下输入以下命令可以达到修改Portal Server的目的:

方法二我一直都在用,但是直到Android 7 Nougat这个办法就失效了……如果你用了方法一,应该不用往下看,以下都是基于方法二的调整。

Android 7.0 Nougat的解决方法

这个时候,之前的方法失效了,于是遍寻网上,后来有人发现是验证方法改成HTTPS了,而之前是HTTP的,于是热心人士的服务器纷纷失效了,因此v2ex还升级了之前提供的服务,开出了一个子域名专门做Portal Server,并同时提供HTTP和HTTPS两种连接方式。同样可用的热心人士服务器有Google.cn …… 如果你之前用的就是v2ex的,那么在v2升级后,你就检测就会恢复了,不需要再修改设置。

在Android 7 Nougat仍然可以通过禁用检测的方式来解决这个问题,但我更喜欢无损解决,所以,把上面方法二的服务器换一下就行:

Android 7.1.x Nougat的解决方法

到这个版本,不知道为什么HTTPS的服务器也歇菜了,真是命运多舛,我的Nexus 5X根本就不想unlock和root,所以继续找办法,直到有人发现这次不管怎么改,都会连接到 gstatic.com 这个米上面,于是开始有人通过改hosts的方法来解决,但是我不想root……

于是刚才又找到一个方法,这次需要直接修改Portal Server的URL了……因为不会在末尾自动加 /generate_204 了……

请执行以下命令

目前来看,我刚升级到7.1.1的Nexus 5x是解决了这个问题了,不知道下次版本升级又会发生什么……

以上的操作,如果要恢复出厂原始设置,可以执行以下命令:

P.S:个人极力推荐有各种科学上网需求的童鞋,完全可以买一个Google Project Fi的SIM卡来日常用,天然科学上网,自带米国手机号,无障碍平滑激活Google Now/Location等服务,等有空写写Fi的使用体会。

-EOF-

——————–
引用参考:

  1. 狐狸的小小窝:关于 android 5.0 网络图标上的感叹号及其解决办法
  2. V2EX:关于 V2EX 提供的 Android Captive Portal Server 地址的更新
  3. V2EX:关于 Android 7.0 的 global captive_server_use_https 设置的默认值
  4. V2EX:可否加入 generate_204 ,方便 Android L 消除叹号。
  5. 私家折腾笔记:Android 7.1.1 去除网络叉号

Published by

贰壹

忙忙碌碌仍在路上的人,热爱IT,挚爱16。

2 thoughts on “Android 5/6/7/7.1.x 去除网络感叹号方法”

    1. 之前也没太关心,但是我找了一下客服,大概是跟我说,他们倒是没这个规定,但是如果万一国际漫游服务出现什么问题的话,还得让你跑一趟米国才能解决,原文如下:

      Michael11:45 AM
      Thanks for contacting Google Support. My name is Michael.
      Michael11:45 AM
      How has your day been so far, Benny?
      Benny Chen11:45 AM
      Hello Michael
      Benny Chen11:45 AM
      I heard someone says I need come back to US every half-year to using my Fi mobile service, but I’m have a long-term overseas job, Will you cancel my service?
      Michael11:46 AM
      Well, no, your service will continue as long as it is paid for. Extended periods oversea will not stop it from working. Though you will get little support while out there.
      Michael11:46 AM
      I would not recommend using Project Fi if you do not live in the US.
      Michael11:46 AM
      What device are you using?
      Benny Chen11:46 AM
      I’m use the Nexus 5X
      Michael11:47 AM
      Alright. Just curious, seeing a weird device name here. Anyway, your service will be fine, but if your international functionality has any issue, there will not be much we can do. If your international settings get turned off for any reason(accident or what not) you would need to return to the US to even turn them back on.
      Michael11:48 AM
      It is very risky to use Project Fi abroad for that long.
      Benny Chen11:49 AM
      Nice. I see. Whenever possible, I will try to return to the US to use my Fi.
      Benny Chen11:49 AM
      Thanks for your help!
      Michael11:50 AM
      Well, not really what I was saying, you should be ok while there. I am just make sure you are aware of the risks.
      Benny Chen11:51 AM
      Yes, I’m clear
      Michael11:51 AM
      Alright. =)

Leave a Reply

Your email address will not be published.

Captcha Code

This site uses Akismet to reduce spam. Learn how your comment data is processed.