马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
x
版权归作者全部,如有转发,请注明文章出处:https://cyrus-studio.github.io/blog/
问题原因
由于 LineageOS 源码里默认是使用 google captive连接验证服务,所以国内会一直提示网络受限,但是实际上是可以访问网络的。
要办理这个问题可以通过把 captive_portal_https_url 改为国内的就好了,比如用MIUI的。
更换 captive 连接验证服务器
1. 通过 adb 修改
- adb shell settings put global captive_portal_https_url https://connect.rom.miui.com/generate_204
- adb shell settings put global captive_portal_http_url http://connect.rom.miui.com/generate_204
复制代码 2. 修改源码
编辑 packages/modules/NetworkStack/res/values/config.xml
- <!-- HTTP URL for network validation, to use for detecting captive portals. -->
- <string name="default_captive_portal_http_url" translatable="false">http://connectivitycheck.gstatic.com/generate_204</string>
- <!-- HTTPS URL for network validation, to use for confirming internet connectivity. -->
- <string name="default_captive_portal_https_url" translatable="false">https://www.google.com/generate_204</string>
- <!-- List of fallback URLs to use for detecting captive portals. -->
- <string-array name="default_captive_portal_fallback_urls" translatable="false">
- <item>http://www.google.com/gen_204</item>
- <item>http://play.googleapis.com/generate_204</item>
- </string-array>
复制代码 修改如下
- <!-- HTTP URL for network validation, to use for detecting captive portals. -->
- <string name="default_captive_portal_http_url" translatable="false">https://connect.rom.miui.com/generate_204</string>
- <!-- HTTPS URL for network validation, to use for confirming internet connectivity. -->
- <string name="default_captive_portal_https_url" translatable="false">https://connect.rom.miui.com/generate_204</string>
- <!-- List of fallback URLs to use for detecting captive portals. -->
- <string-array name="default_captive_portal_fallback_urls" translatable="false">
- <item>https://connect.rom.miui.com/generate_204</item>
- <item>https://connect.rom.miui.com/generate_204</item>
- </string-array>
复制代码 当时间不准时修改使用(修改为阿里云)
1. 通过adb修改
- adb shell settings put global ntp_server ntp.aliyun.com
复制代码 2. 修改源码
编辑 device/vendor/device/gps/etc/gps.conf(vendor和device是对应的厂家和设备)
- #NTP server
- NTP_SERVER=time.izatcloud.net
复制代码 修改如下
- #NTP server
- NTP_SERVER=ntp.aliyun.com
复制代码 参考:
原生安卓-办理WiFi网络受限以及修改NTP服务器
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。 |