修改时间服务器

修改工具下载:minimal_adb_fastboot_1.4.3_portable.rar

食用方法

  • 打开adb设置-系统-关于-连续点击4次 Android TV操作系统版本,此时回到系统就有开发者选项-勾选USB调试
  • 连接adb(下载adb工具包-位于网盘) 如果有弹框 请点击确定按钮,如果没有弹框,请检查开发者模式下的USB调试模式是否打开,也可以反复开启和关闭USB调试按钮的开关,还可以点击下方的撤销调试模式的授权,ADB这个功能在android底层本身还是有一些bug的,需要是反复开启和关闭,直到你输入
  1. shell 回车之后,能成功进入命令行模式,才算是真正的连接成功。退出命令行模式用exit回车
adb connect 192.168.xx.xx
  • 写入新的ntp服务器地址
adb shell settings put global ntp_server ntp2.aliyun.com
国内ntp服务器 备用地址

ntp1.aliyun.com
ntp2.aliyun.com
ntp3.aliyun.com
ntp4.aliyun.com
ntp5.aliyun.com
ntp6.aliyun.com
ntp7.aliyun.com
更多NTP地址可访问:https://dns.iui.im/ntp/

如果你没有使用软路由,而是在电视盒子里使用了代理软件比如clash或者其他vpn,那么你会发现,即便修改了时间服务器地址,每次重启盒子,首先是wifi并不会自动连接,其次就算连接也还是会提示网络受限。这是因为Android原生电视盒子的联网原理导致的,源码中有一个叫做isCaptivePortal() 的函数,用来检查网络状况的判断,它需要一个返回值http 204 (空内容的意思)的网址,源码里默认使用 clients3.google.com/generate_204 这个网址,很显然这个网址,你若没用代理是访问不到的。因此安卓就没法正确判断当前的网络状态,所以要想解决此问题,需要我们换成一个能在国内直接访问的,用于返回http 204的网址。我们姑且把它叫做 验证服务器 吧。目前已经有很多公司制作了这样的验证服务器。

小米: connect.rom.miui.com/generate_204
华为: connectivitycheck.platform.hicloud.com/generate_204
Vivo: wifi.vivo.com.cn/generate_204
google: https://www.google.cn/generate_204
  • 具体修改方法:设置一个返回204 空内容的服务器
adb shell settings put global captive_portal_use_https 0
adb shell settings put global captive_portal_http_url http://connect.rom.miui.com/generate_204

或者直接关闭验证功能
adb shell settings put global captive_portal_mode 0

  • 如何查看设置的参数?
    adb shell settings list global
  • 如何恢复原来的参数?
    使用默认,即删除配置
adb shell settings delete global captive_portal_http_url
adb shell settings delete global captive_portal_https_url