前言
在使用完Pixel VPN后,软路由就必须设置为Redir模式,这个模式下,部分设备老是无法正常科学上网
所以还是想改回Fake-IP模式,但改回Fake-ip后,Pixel就无法连接VPN了
所以就想还是让Pixel获取不经过软路由的IP上网
但是上网后老是提示WIFI网络连接受限
搜索网上的教程,有修改Capive Portal地址的
但是我看了一下地址基本是国内手机厂家的地址
为了安全,我还是自己建一个CaptivePortal吧
开始
1、在Nginx中新建主机
2、配置中增加
location /generate_204 {
return 204;
}
保存
3、然后在VPS上使用curl -i http://xxxx.com/generate_204,提示如下表示成功
C:\Users\ELI>curl -i http://xxxx.com/generate_204
HTTP/1.1 204 No Content
Server: nginx
Date: Mon, 15 Jul 2024 15:54:45 GMT
Connection: keep-alive
Strict-Transport-Security: max-age=31536000
4、同样的给主机增加SSL配置,因为这个检测优先检测HTTPS
5、用USB线将Pixel连接到电脑,打开USB调试,并进入adb shell
6、在adb shell中输入
adb shell "settings put global captive_portal_http_url http://your.domain.name/generate_204";
adb shell "settings put global captive_portal_https_url https://your.domain.name/generate_204";
里面的http://your.domain.name/为你的域名
检查设置,输入以下命令核查修改是否成功
settings get global captive_portal_http_url
settings get global captive_portal_https_url
7、恢复原始设置命令(以备不时之需)
settings delete global captive_portal_http_url
settings delete global captive_portal_https_url
8、忘记WIFI后重新连接试试,一般就OK了
2 comments
可以了 谢谢大佬
试过了感谢