https://www.v2ex.com/t/303889
I am currently in a hostile environment which blocks my connection to Google. From Lollipop onward 1), Android checks the Internet connectivity of your current Wifi connection by making a HTTP request. Due to the fact that I cannot connect to Google, my Nexus 5 keeps thinking that my Wifi connection is not working, and it keeps trying to use the EDGE network. This costs me money.
In order to solve that problem, you need to have control over a server which has Apache.
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_URI} /generate_204$ RewriteRule $ / [R=204] </IfModule>
rewrite
plugin, and restart Apache.adb shell "settings put global captive_portal_server murica.fangfufu.co.uk" adb shell "settings put global captive_portal_https_url https://murica.fangfufu.co.uk/generate_204"; adb shell "settings put global captive_portal_http_url http://murica.fangfufu.co.uk/generate_204";