在 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
相关推荐
simplepeng2 小时前
我的天,我真是和androidx的字体加载杠上了
android
小猫猫猫◍˃ᵕ˂◍3 小时前
备忘录模式:快速恢复原始数据
android·java·备忘录模式
CYRUS_STUDIO5 小时前
使用 AndroidNativeEmu 调用 JNI 函数
android·逆向·汇编语言
梦否5 小时前
【Android】类加载器&热修复-随记
android
徒步青云6 小时前
Java内存模型
android
今阳6 小时前
鸿蒙开发笔记-6-装饰器之@Require装饰器,@Reusable装饰器
android·app·harmonyos
-优势在我11 小时前
Android TabLayout 实现随意控制item之间的间距
android·java·ui
hedalei11 小时前
android13修改系统Launcher不跟随重力感应旋转
android·launcher
Indoraptor12 小时前
Android Fence 同步框架
android
峥嵘life12 小时前
DeepSeek本地搭建 和 Android
android