当前位置:首页 » 《资源分享》 » 正文

解决LineageOS提示网络受限问题

19 人参与  2024年10月30日 13:21  分类 : 《资源分享》  评论

点击全文阅读


版权归作者所有,如有转发,请注明文章出处: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_204adb 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 serverNTP_SERVER=time.izatcloud.net

修改如下

#NTP serverNTP_SERVER=ntp.aliyun.com

参考:
原生安卓-解决WiFi网络受限以及修改NTP服务器


点击全文阅读


本文链接:http://m.zhangshiyu.com/post/179957.html

<< 上一篇 下一篇 >>

  • 评论(0)
  • 赞助本站

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

最新文章

  • 咸鱼翻身从刷开始(柳如烟李诗琪)_咸鱼翻身从刷开始柳如烟李诗琪
  • 影帝求我别离婚,我转身去了对家列表_影帝求我别离婚,我转身去了对家(季淮顾言陆景行)
  • 点天灯后,偷我勋章的男友疯了(沈娇娇陆沉)_点天灯后,偷我勋章的男友疯了
  • 重生后,我让妻子后悔(云璟陆沈清)
  • 为了给我妈鸣冤,我在我爸六十大寿上毒翻全场(苏恒苏洛),为了给我妈鸣冤,我在我爸六十大寿上毒翻全场
  • 完结文老婆把女儿送给师弟练手后,后悔疯了列表_完结文老婆把女儿送给师弟练手后,后悔疯了(沈安姜向玉)
  • 白月光守寡后,夫君要纳她为妾留青赵恒完本_白月光守寡后,夫君要纳她为妾(留青赵恒)
  • 全书浏览妻子叫我转八十万给实习生(顾祁秦冉)_妻子叫我转八十万给实习生(顾祁秦冉)全书结局
  • 全文男友拿我的生活费给我开亲密付(夏染陈政)列表_全文男友拿我的生活费给我开亲密付
  • 大数据助力,我把妈妈告上法庭欣欣妈妈完本_大数据助力,我把妈妈告上法庭(欣欣妈妈)
  • 年薪百万后,我主动要求给穷光蛋生儿子(李明李小花)全书浏览_年薪百万后,我主动要求给穷光蛋生儿子全书浏览
  • 全书浏览年薪百万后,我主动要求给穷光蛋生儿子(李明李小花)_年薪百万后,我主动要求给穷光蛋生儿子(李明李小花)全书结局

    关于我们 | 我要投稿 | 免责申明

    Copyright © 2020-2022 ZhangShiYu.com Rights Reserved.豫ICP备2022013469号-1