Skip to content

Instantly share code, notes, and snippets.

@edwardw
Last active June 15, 2024 19:27
Show Gist options
  • Save edwardw/cb99236a592900c4f26fb0d8f474af3e to your computer and use it in GitHub Desktop.
Save edwardw/cb99236a592900c4f26fb0d8f474af3e to your computer and use it in GitHub Desktop.
Android captive portal settings

The android captive portal settings are responsible for the annoying question mark beside the wifi icon. If the device can't connect to the captive portals, the question mark will appear. And at the latest Pixel 8a (android-os 14 I believe), it will also route the traffic through the carrier network which is clearly not desirable.

The settings can be changed by adb (https://gist.github.com/tonyseek/bc5b72197ddb15418c61406061720186):

$ sudo pacman -S android-tools

$ adb shell settings put global captive_portal_https_url <some_server_address>
$ adb shell settings put global captive_portal_http_url <some_server_address>
$ adb shell settings put global captive_portal_fallback_url <some_server_address>
$ adb shell settings put global captive_portal_other_fallback_urls <some_server_address>

One set of portal server addresses that works behind the great firewall is from GrapheneOS.

There is also the suggestion to disable the captive portal detection altogether: How to disable captive portal detection. Didn't test it.

A dedicated app is also available: CaptivePortalController. But it needs adb to grant it permissions to do the work anyway, so didn't test it either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment