客户测试发现QuickSearchBox 为乱码
image.png
2025-07-17 15:24:02.772 6027-6027/? I/QSB.SuggestionsProviderImpl: chars:2,source:Source{name=com.android.quicksearchbox/.google.GoogleSearch}
2025-07-17 15:24:02.777 6027-6065/? D/GoogleSearch: Sending request: https://www.google.com/complete/search?hl=zh-CN&client=android&q=%E4%BC%98%E9%85%B7
2025-07-17 15:24:02.783 453-6078/? I/resolv: GetAddrInfoHandler::run: {100 100 100 983140 10142 0}
2025-07-17 15:24:02.787 453-6079/? I/resolv: res_nmkquery: (QUERY, IN, AAAA)
2025-07-17 15:24:02.787 453-6080/? I/resolv: res_nmkquery: (QUERY, IN, A)
2025-07-17 15:24:02.794 453-470/? I/doh::connection::driver: optional_timeout: timeout=Some(998.545375ms), network 100
2025-07-17 15:24:02.996 453-470/? I/doh::connection::driver: optional_timeout: timeout=Some(600.662292ms), network 100
2025-07-17 15:24:03.004 453-470/? I/doh::connection::driver: optional_timeout: timeout=Some(602.304625ms), network 100
2025-07-17 15:24:03.005 453-470/? I/doh::connection::driver: optional_timeout: timeout=Some(601.5375ms), network 100
2025-07-17 15:24:03.197 453-470/? I/doh::connection::driver: Connection f70b07a497fb4e6ce70bdb486680b75dc34ed999 established on network 100
2025-07-17 15:24:03.199 453-470/? I/doh::connection::driver: Handling DNS request on network 100, is_in_early_data=false, stats=[recv=7 sent=8 lost=0 retrans=0 sent_bytes=741 recv_bytes=6210 lost_bytes=0 peer_tps={ max_idle_timeout=240000, max_udp_payload_size=1472, initial_max_data=196608, initial_max_stream_data_bidi_local=131072, initial_max_stream_data_bidi_remote=131072, initial_max_stream_data_uni=131072, initial_max_streams_bidi=100, initial_max_streams_uni=103, ack_delay_exponent=3, max_ack_delay=25, disable_active_migration=false, active_conn_id_limit=2, max_datagram_frame_size=Some(65536)}], peer_streams_left_bidi=100, peer_streams_left_uni=99
2025-07-17 15:24:03.199 453-470/? I/doh::connection::driver: Handled DNS request: stream ID 0, network 100, stream_capacity=Ok(11747)
2025-07-17 15:24:03.201 453-470/? I/doh::connection::driver: optional_timeout: timeout=Some(599.000166ms), network 100
2025-07-17 15:24:03.201 453-470/? I/doh::connection::driver: Handling DNS request on network 100, is_in_early_data=false, stats=[recv=7 sent=13 lost=0 retrans=0 sent_bytes=1149 recv_bytes=6210 lost_bytes=0 peer_tps={ max_idle_timeout=240000, max_udp_payload_size=1472, initial_max_data=196608, initial_max_stream_data_bidi_local=131072, initial_max_stream_data_bidi_remote=131072, initial_max_stream_data_uni=131072, initial_max_streams_bidi=100, initial_max_streams_uni=103, ack_delay_exponent=3, max_ack_delay=25, disable_active_migration=false, active_conn_id_limit=2, max_datagram_frame_size=Some(65536)}], peer_streams_left_bidi=99, peer_streams_left_uni=99
2025-07-17 15:24:03.201 453-470/? I/doh::connection::driver: Handled DNS request: stream ID 4, network 100, stream_capacity=Ok(11577)
2025-07-17 15:24:03.202 453-470/? I/doh::connection::driver: optional_timeout: timeout=Some(597.744666ms), network 100
2025-07-17 15:24:03.399 453-470/? I/doh::connection::driver: optional_timeout: timeout=Some(400.973458ms), network 100
2025-07-17 15:24:03.402 453-470/? I/doh::connection::driver: optional_timeout: timeout=Some(331.261625ms), network 100
2025-07-17 15:24:03.402 453-470/? I/doh::connection::driver: optional_timeout: timeout=Some(258.821111ms), network 100
2025-07-17 15:24:03.403 453-470/? I/doh::connection::driver: optional_timeout: timeout=Some(405.439939ms), network 100
2025-07-17 15:24:03.415 453-470/? I/doh::connection::driver: Got 468 bytes of response data from stream ID 0 on network 100
2025-07-17 15:24:03.416 453-470/? I/doh::connection::driver: optional_timeout: timeout=Some(364.189521ms), network 100
2025-07-17 15:24:03.418 453-470/? I/doh::connection::driver: optional_timeout: timeout=Some(362.551896ms), network 100
2025-07-17 15:24:03.419 453-6080/? I/resolv: res_doh_send: Https query result: 468, netid=100
2025-07-17 15:24:03.420 453-6080/? I/resolv: doQuery: rcode=0, ancount=1, return value=468
2025-07-17 15:24:03.439 453-470/? I/doh::connection::driver: Got 468 bytes of response data from stream ID 4 on network 100
2025-07-17 15:24:03.439 453-470/? I/doh::connection::driver: optional_timeout: timeout=Some(341.033855ms), network 100
2025-07-17 15:24:03.441 453-470/? I/doh::connection::driver: optional_timeout: timeout=Some(339.048896ms), network 100
2025-07-17 15:24:03.442 453-6079/? I/resolv: res_doh_send: Https query result: 468, netid=100
2025-07-17 15:24:03.442 453-6079/? I/resolv: doQuery: rcode=0, ancount=1, return value=468
2025-07-17 15:24:03.445 6027-6065/? D/TrafficStats: tagSocket(110) with statsTag=0xffffffff, statsUid=-1
2025-07-17 15:24:03.624 453-470/? I/doh::connection::driver: optional_timeout: timeout=Some(54.999738125s), network 100
2025-07-17 15:24:04.333 736-736/? W/rwnx_fill_station_info ModTx(0): 2 TxIndex:7 ModRx(0):2 RxHTIndex:7 RxVHTIndex:2 RxHEIndex:0 RSSI:-42
2025-07-17 15:24:04.355 601-3123/? D/FileUtils: Rounded bytes from 1861488640 to 2000000000
2025-07-17 15:24:04.393 6027-6065/? D/GoogleSearch: Got 10 results sb=["�ſ�",["�ſ�","�ſ���ʰ�","�ſ�����","�ſ�ֱ��","�ſ��Ա","�ſ�app","�ſ���ʰ�����","�ſ���Ӱ�","�ſ�����","�ſ�svip"],["","","","","","","","","",""],[],{"google:suggestsubtypes":[[512],[512],[512],[512],[512],[512],[512],[512],[512],[512]]}]
设置编码格式
Index: GoogleSuggestClient.kt
===================================================================
@@ -103,7 +103,7 @@
* array containing 4 other arrays. We only care about the middle
* 2 which contain the suggestions and their popularity.
*/
- val reader = BufferedReader(InputStreamReader(inputStream))
+ val reader = BufferedReader(InputStreamReader(inputStream,"GBK"))
val sb: StringBuilder = StringBuilder()
var line: String?
while (reader.readLine().also { line = it } != null) {
00dc0464cdfb43253f339427d29ad89.png