FORUMS
Remove All Ads from XDA

GUIDE: How to avoid the Captive Portal Checkin to Google

345 posts
Thanks Meter: 137
 
By dhacke, Senior Member on 5th May 2019, 06:10 PM
Post Reply Email Thread
Dear XDA community,

this my first own thread and guide so please be forbear with me
And i hope i choose the right section
As the topic in the thread says it handles about the Captive Portal Checkin done by Android.
So first some general info about this.

1. What is the Captive Portal Checkin?

Every time your android phone connects to the internet via mobile connection or wlan it sends a request to the following url:
http://connectivitycheck.gstatic.com (Google URL).

After that your gets device gets http 204 answer from the mentioned url and at that point the x-symbol at your network icon in the status bar disappears.
The reason for that behavior is that Android wants to be sure that your connection has internet access.
If you block that request via AfWall for example the dns fails in some cases and you can't go into the Internet.
Silly.

2. Why is this problematic?

That's a good question because this answer from Google doesn't much hold data. But every time when this connection is done Google get the following information:
- IP-adress
- Time of the internet access
- the Browser which you use

In my case i use custom roms and no Gapps to avoid Google as much as i can. So i don't want that "ping" to Google.
That's the reason why i searched for possibilitys to get rid of this ping. And thanks to a german security and privacy specalist i found a possibilty to avoid the ping to Google and have working Internet, too.

3. What did that guy do?

Very simple. He just started his own Captive Portal Checkin Service. So no need for Google anymore


WHAT YOU NEED:
- Computer with installed ADB
- Active USB Debugging at your phone
- At least Android 7

TESTED ON:

I tested his instructions on my old Xperia Z3 phone (CarbonROM 7.0 based on Android 9, Custom Rom).

IMPORTANT:
You need to execute the commands with a booted system (valid for both posts where i write the instructions). It DOESN'T work in the terminal of recoveries (e.g. twrp).
Thanks @jaysir for the information.

INSTRUCTIONS:

Android 7:

1. Connect the phone with your computer
2. Activate ADB and test the connection with the "adb devices" command. If your phone shows up go to step 3.
3. Execute these commands in your terminal:
=> adb shell 'settings put global captive_portal_http_url "http://captiveportal.kuketz.de" '
=> adb shell 'settings put global captive_portal_https_url "https://captiveportal.kuketz.de" '

Android 8 and 9:

1. Connect the phone with your computer
2. Activate ADB and test the connection with the "adb devices" command. If your phone shows up go to step 3.
3. Execute these commands in your terminal:
=> adb shell 'settings put global captive_portal_http_url "http://captiveportal.kuketz.de" '
=> adb shell 'settings put global captive_portal_https_url "https://captiveportal.kuketz.de" '
=> adb shell 'settings put global captive_portal_fallback_url "http://captiveportal.kuketz.de" '
=> adb shell 'settings put global captive_portal_other_fallback_urls "http://captiveportal.kuketz.de" '

Well that's it. When you want to revert back just execute the commands again with this url:

http command: http://connectivitycheck.gstatic.com/generate_204

https command:
https://connectivitycheck.gstatic.com/generate_204

Link to the source:
https://www.kuketz-blog.de/android-c...tal-kuketz-de/

If i make any typos tell me
The Following 3 Users Say Thank You to dhacke For This Useful Post: [ View ] Gift dhacke Ad-Free
 
 
4th July 2019, 12:04 PM |#2  
OP Senior Member
Thanks Meter: 137
 
More
Thanks again to the german security researcher and his community there is a way to deactivate the captive portal checkin completly.

It works on Android 7 and Android 8.1/9. But in comparision to the method in my first post this needs root access on your phone.

For all new users:
I recommend Magisk to gain root.

So now the instructions:

For Android 8/9:
1. Open a terminal on your phone (via terminal apps).

2. Type the following command:
- su
- su
- pm disable com.android.captiveportallogin
- settings put global captive_portal_detection_enabled 0
- settings put global captive_portal_server localhost
- settings put global_portal_mode 0

3. Then reboot your phone (via hardware buttons, system or terminal app).


For Android 7:
1. Open a terminal on your phone (via terminal apps).

2. Type the following commands:
- su
- settings put global captive_portal_detection_enabled 0
- settings put global captive_portal_server localhost
- settings put global captive_portal_mode 0

3. Then reboot your phone (via hardware buttons, system or terminal app).
The Following 2 Users Say Thank You to dhacke For This Useful Post: [ View ] Gift dhacke Ad-Free
4th July 2019, 02:43 PM |#3  
Oswald Boelcke's Avatar
Forum Moderator / Recognized Translator
Flag Preserving Air Supremacy over XDA!
Thanks Meter: 6,486
 
More
Very nice and very important tutorial!
Just for completeness; and I don't claim and definitely don't have a copyright. I reported these procedures already here end of April in the thread "Enhanced Privacy, Security and Battery Duration! My Measures...". I mentioned it also once here in the AFWall+ thread.

I'm very glad that these procedures get repeated and repeated again. From my personal point of view it's so important to develop the stance to not allow Google to collect our data. I've subscribed to Mike Kuketz and am very grateful for his job and dedication.
The Following User Says Thank You to Oswald Boelcke For This Useful Post: [ View ] Gift Oswald Boelcke Ad-Free
4th July 2019, 03:09 PM |#4  
OP Senior Member
Thanks Meter: 137
 
More
Quote:
Originally Posted by Oswald Boelcke

Very nice and very important tutorial!


Just for completeness; and I don't claim and definitely don't have a copyright. I reported these procedures already here end of April in the thread "Enhanced Privacy, Security and Battery Duration! My Measures...". I mentioned it also once here in the AFWall+ thread.
I'm very glad that these procedures get repeated and repeated again. From my personal point of view it's so important to develop the stance to not allow Google to collect our data. I've subscribed to Mike Kuketz and am very grateful for his job and dedication.

I agree to you. It's a pity that so much people don't care about it.
I must admit i forgot to search in forum whether the instructions was already posted but as you said every mention helps.
The Following User Says Thank You to dhacke For This Useful Post: [ View ] Gift dhacke Ad-Free
24th July 2019, 09:38 AM |#5  
Junior Member
Thanks Meter: 3
 
More
Thanks, however, not working on pixel experience rom.

Update:
Seems no settings command under ADB shell, worked when turning on Usb debugging.
The Following User Says Thank You to jaysir For This Useful Post: [ View ] Gift jaysir Ad-Free
24th July 2019, 10:17 AM |#6  
OP Senior Member
Thanks Meter: 137
 
More
Quote:
Originally Posted by jaysir

Thanks, however, not working on pixel experience rom.
seems no settings command under ADB shell

Thx for your info. And i will try it on my old z3 with the custom rom which you mentioned.
I know there is a Android 9 based Pixel Experience for the z3.
Will report then.
25th July 2019, 02:33 AM |#7  
Junior Member
Thanks Meter: 3
 
More
Quote:
Originally Posted by dhacke

Thx for your info. And i will try it on my old z3 with the custom rom which you mentioned.
I know there is a Android 9 based Pixel Experience for the z3.
Will report then.

Sorry, I did not make myself clear.
It just not working under recovery mode.
After booting to the system and opening the USB debugging, it is working.
The Following User Says Thank You to jaysir For This Useful Post: [ View ] Gift jaysir Ad-Free
25th July 2019, 07:32 AM |#8  
OP Senior Member
Thanks Meter: 137
 
More
Quote:
Originally Posted by jaysir

Sorry, I did not make myself clear.
It just not working under recovery mode.
After booting to the system and opening the USB debugging, it is working.

Good to know (and i'm happy that now everything works)
I will edit the guide and add your information to it.
Thanks.
The Following User Says Thank You to dhacke For This Useful Post: [ View ] Gift dhacke Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes