Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
topics:android-captive-portal [2017/03/26 06:31]
orzfly [See Alsos]
topics:android-captive-portal [2017/04/23 20:26] (current)
orzfly 7.1.2
Line 2: Line 2:
  
 ===== Commands ===== ===== Commands =====
 +
 +<code bash captive-disable.sh>
 +settings put global captive_portal_detection_enabled 0
 +settings put global captive_portal_mode 0
 +</code>
  
 <code bash captive-v2ex-co.sh> <code bash captive-v2ex-co.sh>
 settings put global captive_portal_detection_enabled 1 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_use_https 0
 settings put global captive_portal_server captive.v2ex.co settings put global captive_portal_server captive.v2ex.co
Line 13: Line 19:
 <code bash connect-rom-miui-com.sh> <code bash connect-rom-miui-com.sh>
 settings put global captive_portal_detection_enabled 1 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_use_https 0
 settings put global captive_portal_server connect.rom.miui.com settings put global captive_portal_server connect.rom.miui.com
Line 21: Line 28:
 <code bash developers-google-cn.sh> <code bash developers-google-cn.sh>
 settings put global captive_portal_detection_enabled 1 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_use_https 0
 settings put global captive_portal_server developers.google.cn settings put global captive_portal_server developers.google.cn
Line 29: Line 37:
 <code bash www-qualcomm-cn.sh> <code bash www-qualcomm-cn.sh>
 settings put global captive_portal_detection_enabled 1 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_use_https 0
 settings put global captive_portal_server www.qualcomm.cn settings put global captive_portal_server www.qualcomm.cn
Line 35: Line 44:
 </code> </code>
  
-===== Android Version ===== +===== Settings ===== 
-  * ''captive_portal_detection_enabled'': 5.0 ~+  * ''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 ~   * ''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   * ''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 ~   * ''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 ~   * ''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 ===== ===== See Alsos =====
   * https://www.noisyfox.cn/android-captive-portal.html   * 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}} {{tag>android as-chinese}}