Android automatically updates time & removes WIFI cannot connect to the Internet prompt

Using the Android system compiled by the AOSP project, due to some network problems 无法自动更新时间, the mobile phone 连接WIFIcan also see 无法连接互联网the prompt.

1. Environmental preparation

(1) Android system source code compilation environment (Android9.0)

Two, the solution

There are roughly two solutions:
(1) Use adb to modify the server address
(2) Modify the source code to modify the server address

Use adb to modify the server address

#去除WIFI'无法连接互联网'提示
adb shell settings put global captive_portal_https_url https://www.google.cn/generate_204
adb shell settings put global captive_portal_http_url http://www.google.cn/generate_204
#修改时间服务器地址(NTP服务器)
adb shell settings put global ntp_server asia.pool.ntp.org

Modify source code Modify server address

(1) Remove the WIFI 无法连接互联网prompt
file:
aosp\frameworks\base\services\core\java\com\android\server\connectivity\NetworkMonitor.java
Modify:
private static final String DEFAULT_HTTPS_URL = "https://www.google.cn/generate_204";

(2) Modify the time server address (NTP server)
file:
aosp\frameworks\base\core\res\res\values\config.xml
Modify:
<string translatable="false" name="config_ntpServer">asia.pool.ntp.org</string>

(3) Modify the default time zone
file:
aosp\build\core\main.mk
add:
ADDITIONAL_BUILD_PROPERTIES += persist.sys.timezone=Asia/Shanghai


asjhan for Android reverse

Guess you like

Origin blog.csdn.net/qq_35993502/article/details/123126262