锐单电子商城 , 一站式电子元器件采购平台!
  • 电话:400-990-0325

android的一些简单配置修改(2)

时间:2023-02-25 23:30:00 pcb传感器进口201a75

一、连接wifi提示网络有限,但可以上网

连接后的log:

D NetworkMonitor/100: PROBE_DNS www.google.com 107ms OK 104.244.46.85 D NetworkMonitor/100: PROBE_DNS connectivitycheck.gstatic.com 118ms OK 203.208.50.66 D NetworkMonitor/100: PROBE_HTTP http://connectivitycheck.gstatic.com/generate_204 time=35ms ret=302 request={Connection=[close], User-Agent=[Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.32 Safari/537.36]} headers={null=[HTTP/1.0 302 Moved Temporarily], Allow=[GET,POST,HEAD], Location=[http://10.10.1.2:8080/cn/index.html], MIME-Version=[1.0], Pragma=[No-Cache], Server=[AP Server 1.0], X-Android-Received-Millis=[1615220820212], X-Android-Response-Source=[NETWORK 302], X-Android-Selected-Protocol=[http/1.0], X-Android-Sent-Millis=[1615220820196]} D NetworkMonitor/100: PROBE_HTTPS https://www.google.com/generate_204 Probe failed with exception javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found. D NetworkMonitor/100: isCaptivePortal: isSuccessful()=false isPortal()=true RedirectUrl=http://10.10.1.2:8080/cn/index.html isPartialConnectivity()=false Time=172ms 

修改解析DNS网站,改为国内

/packages/modules/NetworkStack$ git show  diff --git a/res/values/config.xml b/res/values/config.xml index d6a11ab..7b6d44c 100644 --- a/res/values/config.xml    b/res/values/config.xml @@ -21,8  21,8 @@           config_captive_portal_https_url and *NOT* by changing or overlaying           this resource. It will break if he enforcement of overlayable starts.
          -->
-    <string name="default_captive_portal_https_url" translatable="false">https://www.google.com/generate_204
-
+       <!-- <string name="default_captive_portal_https_url" translatable="false">https://www.google.com/generate_204 -->
+       <string name="default_captive_portal_https_url" translatable="false">https://developers.google.cn/generate_204
     <!-- List of fallback URLs to use for detecting captive portals. -->
     <!-- default_captive_portal_fallback_urls is not configured as overlayable
          so OEMs that wish to change captive_portal_fallback_urls configuration
@@ -31,8 +31,8 @@
          this resource. It will break if the enforcement of overlayable starts.
          -->
     <string-array name="default_captive_portal_fallback_urls" translatable="false">
-        <item>http://www.google.com/gen_204
-        <item>http://play.googleapis.com/generate_204
+       <item>http://developers.google.cn/gen_204
+       <item>http://play.googleapis.com/generate_204
     </string-array>
     <!-- Configuration hooks for the above settings.
          Empty by default but may be overridden by RROs. -->

二、wifi提示连接失败

wifi连接失败,一直提示已经保存。
log为:

[ 1479.260269] [dhd][wlan0] _dhd_set_mac_address : MACID ae:dc:f9:d5:e8:1a is overwritten
[ 1479.345057] [dhd][wlan0] wl_run_escan : LEGACY_SCAN sync ID: 7, bssidx: 0
[ 1482.007423] [dhd][wlan0] wl_ext_set_chanspec : channel 40, 0xe12a
[ 1482.015055] [dhd][wlan0] wl_conn_debug_info : Connecting with 48:0e:ec:22:f5:f2 ssid "vantron_test5_5G", len (10
[ 1482.985424] [dhd][wlan0] wl_bss_connect_done : Report connect result - connection failed
[ 1482.985528] [dhd][wlan0] wl_ext_iapsta_event : connect failed event=0, reason=0, status=5
[ 1482.993597] [dhd][wlan0] IAPSTA-ERROR) wl_ext_in4way_sync_sta : WPA failed at 15
[ 1483.010426] [dhd][wlan0] wl_iw_event : [0 times] disconnected with 00:00:00:00:00:00, event 11, reason 8
[ 1483.020228] [dhd][wlan0] wl_ext_iapsta_event : [S] Link down with 00:00:00:00:00:00, WLC_E_DISASSOC(11), reason8

同样的,wifi不能同时自动切换5G和2.4G的频段,wifi的热点也不能打开2.4G或者5G的频段都可以修改这里
关闭ACS信道自动选择

--- a/common/wifi/WifiOverlay/res/values/config.xml
+++ b/common/wifi/WifiOverlay/res/values/config.xml
@@ -27,7 +27,7 @@
     <bool translatable="false" name="config_wifi_background_scan_support">true</bool>
 
     <!-- Enable ACS (auto channel selection) for Wifi hotspot (SAP) -->
-    <bool translatable="false" name="config_wifi_softap_acs_supported">true</bool>
+    <bool translatable="false" name="config_wifi_softap_acs_supported">false</bool>
 

三、网络时间无法自动更新

切换ntp服务器网址。
前提是你的网络正常,不会显示网络受限这种。
log会打印为:

ntp_failure: [time.android.com/2001:4860:4806::,java.net.sockettimeoutexception: poll timed out]
//time.android.com 这个就是你要修改的网址
/frameworks/base/
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -2037,7 +2037,7 @@
     <bool name="config_actionMenuItemAllCaps">true</bool>
 
     <!-- Remote server that can provide NTP responses. -->
-    <string translatable="false" name="config_ntpServer">time.android.com</string>
+    <string translatable="false" name="config_ntpServer">asia.pool.ntp.org</string>

四、wifi的mac地址读取会改变

开发板中去读取这个节点的内容的时候

cat /sys/class/net/wlan0/address   
d4:9c:dd:5a:2e:8a

每次更换一个wifi都会更换一个对应的网络的mac地址
修改

cluo@cluo:/sd1/NXP/VT-SBC-BIOL/device/nxp/common$ git diff .
diff --git a/common/wifi/WifiOverlay/res/values/config.xml b/common/wifi/WifiOverlay/res/values/config.xml
index ffce3d1e..201a1c54 100644
--- a/common/wifi/WifiOverlay/res/values/config.xml
+++ b/common/wifi/WifiOverlay/res/values/config.xml
@@ -33,7 +33,7 @@
     <bool translatable="false" name="config_wifi_softap_ieee80211ac_supported">true</bool>
 
     <!-- True if the firmware supports connected MAC randomization -->
-    <bool name="config_wifi_connected_mac_randomization_supported">true</bool>
+    <bool name="config_wifi_connected_mac_randomization_supported">false</bool>

     <!-- True if the firmware supports p2p MAC randomization -->
     <bool name="config_wifi_p2p_mac_randomization_supported">true</bool>

锐单商城拥有海量元器件数据手册IC替代型号,打造电子元器件IC百科大全!

相关文章