====== Android Captive Portal URLs & Commands ======
===== Commands =====
settings put global captive_portal_detection_enabled 0
settings put global captive_portal_mode 0
settings put global captive_portal_detection_enabled 1
settings put global captive_portal_mode 1
settings put global captive_portal_use_https 0
settings put global captive_portal_server captive.v2ex.co
settings put global captive_portal_http_url http://captive.v2ex.co/generate_204
settings put global captive_portal_https_url https://captive.v2ex.co/generate_204
settings put global captive_portal_detection_enabled 1
settings put global captive_portal_mode 1
settings put global captive_portal_use_https 0
settings put global captive_portal_server connect.rom.miui.com
settings put global captive_portal_http_url http://connect.rom.miui.com/generate_204
settings put global captive_portal_https_url https://connect.rom.miui.com/generate_204
settings put global captive_portal_detection_enabled 1
settings put global captive_portal_mode 1
settings put global captive_portal_use_https 0
settings put global captive_portal_server developers.google.cn
settings put global captive_portal_http_url http://developers.google.cn/generate_204
settings put global captive_portal_https_url https://developers.google.cn/generate_204
settings put global captive_portal_detection_enabled 1
settings put global captive_portal_mode 1
settings put global captive_portal_use_https 0
settings put global captive_portal_server www.qualcomm.cn
settings put global captive_portal_http_url http://www.qualcomm.cn/generate_204
settings put global captive_portal_https_url https://www.qualcomm.cn/generate_204
===== Settings =====
* ''captive_portal_detection_enabled'': 5.0 ~ 7.1.1
* Setting to turn off captive portal detection. Feature is enabled by default and the setting needs to be set to 0 to disable it.
* ''captive_portal_mode'': 7.1.2 ~
* 0: ''CAPTIVE_PORTAL_MODE_IGNORE'' Don't attempt to detect captive portals.
* 1: ''CAPTIVE_PORTAL_MODE_PROMPT'' When detecting a captive portal, display a notification that prompts the user to sign in.
* 2: ''CAPTIVE_PORTAL_MODE_AVOID'' When detecting a captive portal, immediately disconnect from the network and do not reconnect to that network in the future.
* ''captive_portal_use_https'': 7.0 ~
* Whether to use HTTPS for network validation. This is enabled by default and the setting needs to be set to 0 to disable it. This setting is a misnomer because captive portals don't actually use HTTPS, but it's consistent with the other settings.
* ''captive_portal_server'': 5.0 ~ 7.1.0
* The server used for captive portal detection upon a new conection. A 204 response code from the server is used for validation.
* ''captive_portal_http_url'': 7.1.1 ~
* The URL used for HTTP captive portal detection upon a new connection. A 204 response code from the server is used for validation.
* ''captive_portal_https_url'': 7.1.1 ~
* The URL used for HTTPS captive portal detection upon a new connection. A 204 response code from the server is used for validation.
* ''captive_portal_fallback_url'': 7.1.1 ~
* The URL used for fallback HTTP captive portal detection when previous HTTP and HTTPS captive portal detection attemps did not return a conclusive answer.
* ''captive_portal_user_agent'': 7.1.1 ~
* Which User-Agent string to use in the header of the captive portal detection probes. The User-Agent field is unset when this setting has no value (HttpUrlConnection default).
===== See Alsos =====
* https://www.noisyfox.cn/android-captive-portal.html
* https://twitter.com/wzyboy/status/856065582277435392
* https://android.googlesource.com/platform/frameworks/base/+/android-7.1.2_r5/services/core/java/com/android/server/connectivity/NetworkMonitor.java#645
* https://android.googlesource.com/platform/frameworks/base/+/android-7.1.2_r5/core/java/android/provider/Settings.java#8027
{{tag>android as-chinese}}