Skip to content

Instantly share code, notes, and snippets.

@Liki4
Forked from chenyiping1995/Android_CN.sh
Created December 13, 2022 03:30
Show Gist options
  • Save Liki4/cf48e66c765aec8d0985ccdafbdf9115 to your computer and use it in GitHub Desktop.
Save Liki4/cf48e66c765aec8d0985ccdafbdf9115 to your computer and use it in GitHub Desktop.
Changes the NTP server and Captive Portal Server for Chinese users.
# Settings to the NTP server since Android 4.0
adb -d shell settings put global ntp_server time.pool.aliyun.com
# Android 4.2 - 6.0.1
adb -d shell settings put global captive_portal_detection_enabled 1
adb -d shell settings put global captive_portal_server www.google.cn
# Android 7.0 - 7.1
adb -d shell settings put global captive_portal_detection_enabled 1
adb -d shell settings put global captive_portal_use_https 1
adb -d shell settings put global captive_portal_server www.google.cn
# Android 7.1.1
adb -d shell settings put global captive_portal_detection_enabled 1
adb -d shell settings put global captive_portal_use_https 1
adb -d shell settings put global captive_portal_https_url https://www.google.cn/generate_204
adb -d shell settings put global captive_portal_http_url http://www.google.cn/generate_204
adb -d shell settings put global captive_portal_fallback_url https://connect.rom.miui.com/generate_204
adb -d shell settings put global captive_portal_other_fallback_urls https://connectivitycheck.gstatic.com/generate_204,https://www.google-analytics.com/generate_204,https://services.googleapis.cn/generate_204,https://www.gstatic.cn/generate_204,https://source.android.google.cn/generate_204,https://developers.android.google.cn/generate_204,https://developer.android.google.cn/generate_204,https://services.googleapis.cn/generate_204,https://www.gstatic.com/generate_204,https://connectivitycheck.platform.hicloud.com/generate_204,https://wifi.vivo.com.cn/generate_204,https://www.qualcomm.cn/generate_204,https://captive.v2ex.co/generate_204,https://www.v2ex.com/generate_204,https://liukebin.avosapps.com/generate_204,https://204.io/generate_204,https://204.ustclug.org/generate_204,https://gen204.applinzi.com/generate_204,https://www.noisyfox.io/generate_204
# Android 7.1.2 or later
adb -d shell settings put global captive_portal_mode 1
adb -d shell settings put global captive_portal_use_https 1
adb -d shell settings put global captive_portal_https_url https://www.google.cn/generate_204
adb -d shell settings put global captive_portal_http_url http://www.google.cn/generate_204
adb -d shell settings put global captive_portal_fallback_url https://connect.rom.miui.com/generate_204
adb -d shell settings put global captive_portal_other_fallback_urls https://connectivitycheck.gstatic.com/generate_204,https://www.google-analytics.com/generate_204,https://services.googleapis.cn/generate_204,https://www.gstatic.cn/generate_204,https://source.android.google.cn/generate_204,https://developers.android.google.cn/generate_204,https://developer.android.google.cn/generate_204,https://services.googleapis.cn/generate_204,https://www.gstatic.com/generate_204,https://connectivitycheck.platform.hicloud.com/generate_204,https://wifi.vivo.com.cn/generate_204,https://www.qualcomm.cn/generate_204,https://captive.v2ex.co/generate_204,https://www.v2ex.com/generate_204,https://liukebin.avosapps.com/generate_204,https://204.io/generate_204,https://204.ustclug.org/generate_204,https://gen204.applinzi.com/generate_204,https://www.noisyfox.io/generate_204
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment