Quote: Originally Posted by strophy Originally Posted by Hey, so this issue has made what is otherwise an excellent phone almost useless in China. Battery life has more than halved, my phone bill has skyrocketed due to the constant fallover to mobile network, and the phone constantly thinks it is offline. I really don't want to downgrade to Kitkat again - my main hope at the moment is that Cyanogen will add this as an option once their code stabilises. I am also going to try working from the other end and open a ticket with China Unicom, but I need to know the specific server or IP address used by Lollipop to verify connectivity to see if they can open the firewall for those packets. (It's a long shot, I know.) I'm keen to try and investigate this myself, and have installed Wireshark, can anyone with a bit more experience walk me through the steps to catch this kind of packet or point me at a blog/forum that deals with this sort of thing?



Thanks!

Solution 1 (does not require root):

Solution 2 (root required)

Code: adb shell su -c "settings put global captive_portal_detection_enabled 0"

Code: adb shell su -c "settings put global captive_portal_server {alternate_host} "

Code: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_URI} /generate_204$ RewriteRule $ / [R=204] </IfModule>

Code: location /generate_204 { return 204; }

Solution 3 (root required)

Also in China here. This being a serious usability issue to an OS in a country where it is used by more than 80% of smartphone users - estimated at 527 million last July - I thought the demand to solve this issue must be much bigger locally and someone would have figured it out already. So I set out to look for a solution in Chinese. Low and behold, I found a number of solutions within minutes, and I thought I could at least share them here. Disclaimer: I've only tested solution 1.1. Reboot phone and wait until Wifi is connected2. Go to Settings and create a new user3. Continue with user setup until you see "checking connection"4. As soon as you see "checking connection", switch off your phone5. Switch on your phone again6. Toggle Wifi, and the exclamation mark should disappear quickly7. You may optionally remove the new user you just createdDon't ask me why this works, I am not even an Android user, I was only searching for a friend who can't read Chinese, but we tested this method on his Nexus 4 and it does work. Battery life is comparable to before the Lollipop update. Also, this is the only one we tested as his device isn't rooted.A Chinese developer "Little Fox" published detailed account of what's going on under the hood. The culprit is a method isCaptivePortal() which access clients3.google.com/generate_204 to test if a connection is deemed "usable". The page, as its name suggest, is designed to always return a HTTP 204 status code. Based on this you have a couple options:The down side is that isCaptivePortal() is actually useful to detect for example when a WiFi network requires login. If the request to the 204 page gets redirected to a login page (not a 204), the system will understand and display the exclamation mark as intended.Replace the Google host with a host that is accessible within China. This host should also be returning 204 every time /generate_204 is accessed. Little Fox provided his host "xn--yet824cpd.xn--fiqs8s" but mentioned that it is not fast. You can easily set up your own host to do the same, if you have one.For apache with mod_rewrite, add the following to .htaccessFor nginx, add this directly to configIf neither works, you can also create an EMPTY document named generate_204 under root directory. Android will interpret it as a 204.Check Little Fox's page with Google Translate if you want more detail, he also posted a handy apk for people who are not familiar with adbhxxp://xn--yet824cpd.xn--fiqs8s/45.html (looks funny because it's a Chinese domain)Now that you know what's going on, you can of course choose to use hosts file as your preferred solution.Hope this help!