在 AOSP / Android 类原生系统上解决 Wifi 连接警告问题

自 Android 5.0 起,谷歌引入了Captive Portal的机制,用于检测 WiFi网络认证是否正常。由于众所周知的原因,我们在中国大陆并无法访问谷歌的网络,这在某些情况下会导致一些问题,例如:在中国大陆使用一些类原生的ROM时,会提示Wifi连接正常,但无法访问互联网

我们可以通过打开USB调试,并执行以下命令来修复这个问题。

shell 复制代码
adb shell settings put global captive_portal_http_url http://api.hestudio.net/generate_204
adb shell settings put global captive_portal_https_url https://api.hestudio.net/generate_204

详细解释:

我们通过替换captive_portal_http_urlcaptive_portal_https_url的值,来修复这个问题。我们将captive_portal_http_urlcaptive_portal_https_url更换为我们自己的API,当然你也可以更换成其他的服务。

shell 复制代码
# MIUI
adb shell settings put global captive_portal_http_url http://connect.rom.miui.com/generate_204
adb shell settings put global captive_portal_https_url https://connect.rom.miui.com/generate_204
相关推荐
百***61872 小时前
Spring的构造注入
android·java·spring
Tom4i2 小时前
Kotlin 中的 inline 和 reified 关键字
android·开发语言·kotlin
yi诺千金3 小时前
Android U 自由窗口(浮窗)——启动流程(system_server侧流程)
android
清空mega5 小时前
第11章 网络编程
android·网络
自动化BUG制造器5 小时前
Android UI 线程不一定是主线程
android
无知的前端5 小时前
一文读懂-Jetpack与AndroidX
android·kotlin·android jetpack
河铃旅鹿7 小时前
Android开发-java版:SQLite数据库
android·数据库·笔记·学习·sqlite
旋律逍遥7 小时前
《Framework 开发》3、开发工具及命令行知识装备
android
啦啦9117147 小时前
安卓手机/平板/TV版 Rotation强制横屏显示工具!免ROOT可用!再推荐突破手机限制的3款神器
android·智能手机·电脑
汤面不加鱼丸8 小时前
flutter实践:混合app在部分android旧机型上显示异常
android·flutter