Android 9 Wifi 调试

wifi无法上网可能原因

WiFi网络未验证(portal网络),访问时路由器会重定向到二次登录网址
运营商服务器或代理服务器问题,无法连接到外网
DNS服务器问题,导致DNS解析失败
系统时间不正常,导致证书失效,SSL/TLS握手失败,HTTPS无法上网
TCP连接长时间无数据收发,达到NAT超时时间,网络运营商切断TCP连接,导致长连接失效(push心跳间隔应小于NAT超时时间)
应用进入了后台且在mUidFirewallStandbyRules黑名单中,数据包被DROP
系统进入省电模式且应用不在mUidFirewallPowerSaveRules白名单中,数据包被DROP
系统进入Doze且应用不在mUidFirewallDozableRules白名单中,数据包被DROP

wifi debug 命令

[BEGIN] 2019/7/3 20:58:09
[2019/7/3 20:58:14] 1|dowork:/ # iptables -h                                           
[2019/7/3 20:58:15] iptables v1.6.1
[2019/7/3 20:58:15] 
[2019/7/3 20:58:15] Usage: iptables -[ACD] chain rule-specification [options]
[2019/7/3 20:58:15]        iptables -I chain [rulenum] rule-specification [options]
[2019/7/3 20:58:15]        iptables -R chain rulenum rule-specification [options]
[2019/7/3 20:58:15]        iptables -D chain rulenum [options]
[2019/7/3 20:58:15]        iptables -[LS] [chain [rulenum]] [options]
[2019/7/3 20:58:15]        iptables -[FZ] [chain] [options]
[2019/7/3 20:58:15]        iptables -[NX] chain
[2019/7/3 20:58:15]        iptables -E old-chain-name new-chain-name
[2019/7/3 20:58:15]        iptables -P chain target [options]
[2019/7/3 20:58:15]        iptables -h (print this help information)
[2019/7/3 20:58:15] 
[2019/7/3 20:58:15] Commands:
[2019/7/3 20:58:15] Either long or short options are allowed.
[2019/7/3 20:58:15]   --append  -A chain		Append to chain
[2019/7/3 20:58:15]   --check   -C chain		Check for the existence of a rule
[2019/7/3 20:58:15]   --delete  -D chain		Delete matching rule from chain
[2019/7/3 20:58:15]   --delete  -D chain rulenum
[2019/7/3 20:58:15] 				Delete rule rulenum (1 = first) from chain
[2019/7/3 20:58:15]   --insert  -I chain [rulenum]
[2019/7/3 20:58:15] 				Insert in chain as rulenum (default 1=first)
[2019/7/3 20:58:15]   --replace -R chain rulenum
[2019/7/3 20:58:15] 				Replace rule rulenum (1 = first) in chain
[2019/7/3 20:58:15]   --list    -L [chain [rulenum]]
[2019/7/3 20:58:15] 				List the rules in a chain or all chains
[2019/7/3 20:58:15]   --list-rules -S [chain [rulenum]]
[2019/7/3 20:58:15] 				Print the rules in a chain or all chains
[2019/7/3 20:58:15]   --flush   -F [chain]		Delete all rules in  chain or all chains
[2019/7/3 20:58:15]   --zero    -Z [chain [rulenum]]
[2019/7/3 20:58:15] 				Zero counters in chain or all chains
[2019/7/3 20:58:15]   --new     -N chain		Create a new user-defined chain
[2019/7/3 20:58:15]   --delete-chain
[2019/7/3 20:58:15]             -X [chain]		Delete a user-defined chain
[2019/7/3 20:58:15]   --policy  -P chain target
[2019/7/3 20:58:15] 				Change policy on chain to target
[2019/7/3 20:58:15]   --rename-chain
[2019/7/3 20:58:15]             -E old-chain new-chain
[2019/7/3 20:58:15] 				Change chain name, (moving any references)
[2019/7/3 20:58:15] Options:
[2019/7/3 20:58:15]     --ipv4	-4		Nothing (line is ignored by ip6tables-restore)
[2019/7/3 20:58:15]     --ipv6	-6		Error (line is ignored by iptables-restore)
[2019/7/3 20:58:15] [!] --protocol	-p proto	protocol: by number or name, eg. `tcp'
[2019/7/3 20:58:15] [!] --source	-s address[/mask][...]
[2019/7/3 20:58:15] 				source specification
[2019/7/3 20:58:15] [!] --destination -d address[/mask][...]
[2019/7/3 20:58:15] 				destination specification
[2019/7/3 20:58:15] [!] --in-interface -i input name[+]
[2019/7/3 20:58:15] 				network interface name ([+] for wildcard)
[2019/7/3 20:58:15]  --jump	-j target
[2019/7/3 20:58:15] 				target for rule (may load target extension)
[2019/7/3 20:58:15]   --goto      -g chain
[2019/7/3 20:58:15]                               jump to chain with no return
[2019/7/3 20:58:15]   --match	-m match
[2019/7/3 20:58:15] 				extended match (may load extension)
[2019/7/3 20:58:15]   --numeric	-n		numeric output of addresses and ports
[2019/7/3 20:58:15] [!] --out-interface -o output name[+]
[2019/7/3 20:58:15] 				network interface name ([+] for wildcard)
[2019/7/3 20:58:15]   --table	-t table	table to manipulate (default: `filter')
[2019/7/3 20:58:15]   --verbose	-v		verbose mode
[2019/7/3 20:58:15]   --wait	-w [seconds]	maximum wait to acquire xtables lock before give up
[2019/7/3 20:58:15]   --wait-interval -W [usecs]	wait time to try to acquire xtables lock
[2019/7/3 20:58:15] 				default is 1 second
[2019/7/3 20:58:15]   --line-numbers		print line numbers when listing
[2019/7/3 20:58:15]   --exact	-x		expand numbers (display exact values)
[2019/7/3 20:58:15] [!] --fragment	-f		match second or further fragments only
[2019/7/3 20:58:15]   --modprobe=		try to insert modules using this command
[2019/7/3 20:58:15]   --set-counters PKTS BYTES	set the counter during insert/append
[2019/7/3 20:58:15] [!] --version	-V		print package version.
[2019/7/3 20:58:16] dowork:/ # 
[2019/7/3 20:58:17] dowork:/ # 
[2019/7/3 20:58:17] dowork:/ # 
[2019/7/3 20:58:17] dowork:/ # 
[2019/7/3 20:58:17] dowork:/ # 
[2019/7/3 20:58:17] dowork:/ # 
[2019/7/3 20:58:17] dowork:/ # 
[2019/7/3 20:58:17] dowork:/ # 
[2019/7/3 20:58:17] dowork:/ # 
[2019/7/3 20:58:17] dowork:/ # 
[2019/7/3 20:58:17] dowork:/ # 
[2019/7/3 20:58:17] dowork:/ # 
[2019/7/3 20:58:17] dowork:/ # 
[2019/7/3 20:58:17] dowork:/ # 
[2019/7/3 20:58:17] dowork:/ # 
[2019/7/3 20:58:17] dowork:/ # 
[2019/7/3 20:58:17] dowork:/ # 
[2019/7/3 20:58:17] dowork:/ # 
[2019/7/3 20:58:17] dowork:/ # 
[2019/7/3 20:58:23] dowork:/ # ps -A |grep -E "iptables|netd"                          
[2019/7/3 20:58:23] root          2074     1   38200   8076 binder_thread_read  0 S netd
[2019/7/3 20:58:23] root          2080  2074    9808   3356 pipe_wait           0 S iptables-restore
[2019/7/3 20:58:23] dowork:/ # 
[2019/7/3 20:58:24] dowork:/ # 
[2019/7/3 20:58:24] dowork:/ # 
[2019/7/3 20:58:24] dowork:/ # 
[2019/7/3 20:58:24] dowork:/ # 
[2019/7/3 20:58:24] dowork:/ # 
[2019/7/3 20:58:24] dowork:/ # 
[2019/7/3 20:58:24] dowork:/ # 
[2019/7/3 20:58:24] dowork:/ # 
[2019/7/3 20:58:24] dowork:/ # 
[2019/7/3 20:58:24] dowork:/ # 
[2019/7/3 20:58:24] dowork:/ # 
[2019/7/3 20:58:24] dowork:/ # 
[2019/7/3 20:58:32] dowork:/ # dumpsys netd                                            
[2019/7/3 20:58:32] 
[2019/7/3 20:58:32]   NetworkController
[2019/7/3 20:58:32]     Default network: 101
[2019/7/3 20:58:32] 
[2019/7/3 20:58:32]     Networks:
[2019/7/3 20:58:32]       51 DUMMY dummy0
[2019/7/3 20:58:32]         No DNS servers defined
[2019/7/3 20:58:32]         No search domains defined
[2019/7/3 20:58:32]         Private DNS mode: OFF
[2019/7/3 20:58:32]         No Private DNS servers configured
[2019/7/3 20:58:32] 
[2019/7/3 20:58:32]       99 LOCAL
[2019/7/3 20:58:32]         No DNS servers defined
[2019/7/3 20:58:32]         No search domains defined
[2019/7/3 20:58:32]         Private DNS mode: OFF
[2019/7/3 20:58:32]         No Private DNS servers configured
[2019/7/3 20:58:32] 
[2019/7/3 20:58:32]       101 PHYSICAL wlan0
[2019/7/3 20:58:32]         Required permission: NONE
[2019/7/3 20:58:32]         DNS servers: # IP (total, successes, errors, timeouts, internal errors, RTT avg, last sample)
[2019/7/3 20:58:32]           10.100.135.1 (59, 59, 0, 0, 0, 30ms, 20s)
[2019/7/3 20:58:32]           202.96.134.133 
[2019/7/3 20:58:32]         search domains: YTKJSZ.com
[2019/7/3 20:58:32]         DNS parameters: sample validity = 1800s, success threshold = 25%, samples (min, max) = (8, 64)
[2019/7/3 20:58:32]         Private DNS mode: OPPORTUNISTIC
[2019/7/3 20:58:32]         Private DNS configuration (2 entries)
[2019/7/3 20:58:32]           10.100.135.1 name{} status{fail}
[2019/7/3 20:58:32]           202.96.134.133 name{} status{fail}
[2019/7/3 20:58:32] 
[2019/7/3 20:58:32]       102 PHYSICAL usb0
[2019/7/3 20:58:32]         Required permission: NONE
[2019/7/3 20:58:32]         DNS servers: # IP (total, successes, errors, timeouts, internal errors, RTT avg, last sample)
[2019/7/3 20:58:32]           10.0.0.1 
[2019/7/3 20:58:32]         No search domains defined
[2019/7/3 20:58:32]         DNS parameters: sample validity = 1800s, success threshold = 25%, samples (min, max) = (8, 64)
[2019/7/3 20:58:32]         Private DNS mode: OPPORTUNISTIC
[2019/7/3 20:58:32]         Private DNS configuration (1 entries)
[2019/7/3 20:58:32]           10.0.0.1 name{} status{fail}
[2019/7/3 20:58:32] 
[2019/7/3 20:58:32] 
[2019/7/3 20:58:32]     Interface <-> last network map:
[2019/7/3 20:58:32]       Ifindex: 9 NetId: 102
[2019/7/3 20:58:32]       Ifindex: 7 NetId: 101
[2019/7/3 20:58:32] 
[2019/7/3 20:58:32]     Interface addresses:
[2019/7/3 20:58:32]       address: 10.0.0.52/24 ifindices: [9]
[2019/7/3 20:58:32]       address: fe80::cc7a:6bff:fe60:9342/64 ifindices: [9]
[2019/7/3 20:58:32]       address: fe80::215:83ff:fe42:4ace/64 ifindices: [7]
[2019/7/3 20:58:32]       address: fe80::9501:478:a16b:47aa/64 ifindices: [9]
[2019/7/3 20:58:32]       address: fe80::5051:f4ff:fe7c:8c21/64 ifindices: [6]
[2019/7/3 20:58:32]       address: 10.100.132.111/24 ifindices: [7]
[2019/7/3 20:58:32]       address: ::1/128 ifindices: [1]
[2019/7/3 20:58:32]       address: 127.0.0.1/8 ifindices: [1]
[2019/7/3 20:58:32] 
[2019/7/3 20:58:32]   TrafficController
[2019/7/3 20:58:32]     BPF module status: ON
[2019/7/3 20:58:32] 
[2019/7/3 20:58:32]     mCookieTagMap status: OK
[2019/7/3 20:58:32]     mUidCounterSetMap status: OK
[2019/7/3 20:58:32]     mAppUidStatsMap status: OK
[2019/7/3 20:58:32]     mUidStatsMap status: OK
[2019/7/3 20:58:32]     mTagStatsMap status: OK
[2019/7/3 20:58:32]     mIfaceIndexNameMap status: OK
[2019/7/3 20:58:32]     mIfaceStatsMap status: OK
[2019/7/3 20:58:32]     mDozableUidMap status: OK
[2019/7/3 20:58:32]     mStandbyUidMap status: OK
[2019/7/3 20:58:32]     mPowerSaveUidMap status: OK
[2019/7/3 20:58:32] 
[2019/7/3 20:58:32]     Cgroup ingress program status: OK
[2019/7/3 20:58:32]     Cgroup egress program status: OK
[2019/7/3 20:58:32]     xt_bpf ingress program status: OK
[2019/7/3 20:58:32]     xt_bpf egress program status: OK
[2019/7/3 20:58:32] 
[2019/7/3 20:58:33] dowork:/ # 
[2019/7/3 20:58:34] dowork:/ # 
[2019/7/3 20:58:34] dowork:/ # 
[2019/7/3 20:58:34] dowork:/ # 
[2019/7/3 20:58:34] dowork:/ # 
[2019/7/3 20:58:34] dowork:/ # 
[2019/7/3 20:58:34] dowork:/ # 
[2019/7/3 20:58:34] dowork:/ # 
[2019/7/3 20:58:34] dowork:/ # 
[2019/7/3 20:58:34] dowork:/ # 
[2019/7/3 20:58:34] dowork:/ # 
[2019/7/3 20:58:40] dowork:/ # dumpsys wifip2p                                         
[2019/7/3 20:58:40] WifiP2pService:
[2019/7/3 20:58:40]  total records=0
[2019/7/3 20:58:40] curState=P2pDisabledState
[2019/7/3 20:58:40] mWifiP2pInfo groupFormed: false isGroupOwner: false groupOwnerAddress: null
[2019/7/3 20:58:40] mGroup null
[2019/7/3 20:58:40] mSavedPeerConfig 
[2019/7/3 20:58:40]  address: 
[2019/7/3 20:58:40]  wps:  setup: 0
[2019/7/3 20:58:40]  BSSID: null
[2019/7/3 20:58:40]  pin: null
[2019/7/3 20:58:40] 
[2019/7/3 20:58:40]  groupOwnerIntent: -1
[2019/7/3 20:58:40]  persist: -2
[2019/7/3 20:58:40] mGroups
[2019/7/3 20:58:40] 
[2019/7/3 20:58:40] mAutonomousGroup false
[2019/7/3 20:58:40] mJoinExistingGroup false
[2019/7/3 20:58:40] mDiscoveryStarted false
[2019/7/3 20:58:40] mNetworkInfo [type: WIFI_P2P[], state: UNKNOWN/IDLE, reason: (unspecified), extra: (none), failover: false, available: false, roaming: false]
[2019/7/3 20:58:40] mTemporarilyDisconnectedWifi false
[2019/7/3 20:58:40] mServiceDiscReqId null
[2019/7/3 20:58:40] mDeathDataByBinder {}
[2019/7/3 20:58:40] 
[2019/7/3 20:58:41] dowork:/ # 
[2019/7/3 20:58:41] dowork:/ # 
[2019/7/3 20:58:41] dowork:/ # 
[2019/7/3 20:58:41] dowork:/ # 
[2019/7/3 20:58:41] dowork:/ # 
[2019/7/3 20:58:41] dowork:/ # 
[2019/7/3 20:58:41] dowork:/ # 
[2019/7/3 20:58:42] dowork:/ # 
[2019/7/3 20:58:42] dowork:/ # 
[2019/7/3 20:58:42] dowork:/ # 
[2019/7/3 20:58:42] dowork:/ # 
[2019/7/3 20:58:42] dowork:/ # 
[2019/7/3 20:58:42] dowork:/ # 
[2019/7/3 20:58:42] dowork:/ # 
[2019/7/3 20:58:47] dowork:/ # service list                                            
[2019/7/3 20:58:48] Found 145 services:
[2019/7/3 20:58:48] 0	chinatsp.vehicle.network: [android.car.vehicle.proxy.aidl.IVehicleNetworkInterface]
[2019/7/3 20:58:48] 1	sip: [android.net.sip.ISipService]
[2019/7/3 20:58:48] 2	secure_element: [android.se.omapi.ISecureElementService]
[2019/7/3 20:58:48] 3	car_service: [android.car.ICar]
[2019/7/3 20:58:48] 4	carrier_config: [com.android.internal.telephony.ICarrierConfigLoader]
[2019/7/3 20:58:48] 5	phone: [com.android.internal.telephony.ITelephony]
[2019/7/3 20:58:48] 6	isms: [com.android.internal.telephony.ISms]
[2019/7/3 20:58:48] 7	iphonesubinfo: [com.android.internal.telephony.IPhoneSubInfo]
[2019/7/3 20:58:48] 8	simphonebook: [com.android.internal.telephony.IIccPhoneBook]
[2019/7/3 20:58:48] 9	isub: [com.android.internal.telephony.ISub]
[2019/7/3 20:58:48] 10	coagent.tbox: [android.car.tbox.aidl.ITboxInterface]
[2019/7/3 20:58:48] 11	contexthub: [android.hardware.location.IContextHubService]
[2019/7/3 20:58:48] 12	netd_listener: [android.net.metrics.INetdEventListener]
[2019/7/3 20:58:48] 13	connmetrics: [android.net.IIpConnectivityMetrics]
[2019/7/3 20:58:48] 14	bluetooth_manager: [android.bluetooth.IBluetoothManager]
[2019/7/3 20:58:48] 15	imms: [com.android.internal.telephony.IMms]
[2019/7/3 20:58:48] 16	statscompanion: [android.os.IStatsCompanionService]
[2019/7/3 20:58:48] 17	media.camera.proxy: [android.hardware.ICameraServiceProxy]
[2019/7/3 20:58:48] 18	slice: [android.app.slice.ISliceManager]
[2019/7/3 20:58:48] 19	media_projection: [android.media.projection.IMediaProjectionManager]
[2019/7/3 20:58:48] 20	crossprofileapps: [android.content.pm.ICrossProfileApps]
[2019/7/3 20:58:48] 21	launcherapps: [android.content.pm.ILauncherApps]
[2019/7/3 20:58:48] 22	shortcut: [android.content.pm.IShortcutService]
[2019/7/3 20:58:48] 23	media_router: [android.media.IMediaRouterService]
[2019/7/3 20:58:48] 24	media_resource_monitor: [android.media.IMediaResourceMonitor]
[2019/7/3 20:58:48] 25	media_session: [android.media.session.ISessionManager]
[2019/7/3 20:58:48] 26	restrictions: [android.content.IRestrictionsManager]
[2019/7/3 20:58:48] 27	print: [android.print.IPrintManager]
[2019/7/3 20:58:48] 28	graphicsstats: [android.view.IGraphicsStats]
[2019/7/3 20:58:48] 29	dreams: [android.service.dreams.IDreamManager]
[2019/7/3 20:58:48] 30	commontime_management: []
[2019/7/3 20:58:48] 31	network_time_update_service: []
[2019/7/3 20:58:48] 32	diskstats: []
[2019/7/3 20:58:48] 33	voiceinteraction: [com.android.internal.app.IVoiceInteractionManagerService]
[2019/7/3 20:58:48] 34	appwidget: [com.android.internal.appwidget.IAppWidgetService]
[2019/7/3 20:58:48] 35	backup: [android.app.backup.IBackupManager]
[2019/7/3 20:58:48] 36	wifip2p: [android.net.wifi.p2p.IWifiP2pManager]
[2019/7/3 20:58:48] 37	trust: [android.app.trust.ITrustManager]
[2019/7/3 20:58:48] 38	soundtrigger: [com.android.internal.app.ISoundTriggerService]
[2019/7/3 20:58:48] 39	jobscheduler: [android.app.job.IJobScheduler]
[2019/7/3 20:58:48] 40	wifiscanner: [android.net.wifi.IWifiScanner]
[2019/7/3 20:58:48] 41	wifi: [android.net.wifi.IWifiManager]
[2019/7/3 20:58:48] 42	hardware_properties: [android.os.IHardwarePropertiesManager]
[2019/7/3 20:58:48] 43	serial: [android.hardware.ISerialManager]
[2019/7/3 20:58:48] 44	usb: [android.hardware.usb.IUsbManager]
[2019/7/3 20:58:48] 45	DockObserver: []
[2019/7/3 20:58:48] 46	broadcastradio: [android.hardware.radio.IRadioService]
[2019/7/3 20:58:48] 47	audio: [android.media.IAudioService]
[2019/7/3 20:58:48] 48	wallpaper: [android.app.IWallpaperManager]
[2019/7/3 20:58:48] 49	search: [android.app.ISearchManager]
[2019/7/3 20:58:48] 50	country_detector: [android.location.ICountryDetector]
[2019/7/3 20:58:48] 51	location: [android.location.ILocationManager]
[2019/7/3 20:58:48] 52	devicestoragemonitor: []
[2019/7/3 20:58:48] 53	notification: [android.app.INotificationManager]
[2019/7/3 20:58:48] 54	updatelock: [android.os.IUpdateLock]
[2019/7/3 20:58:48] 55	system_update: [android.os.ISystemUpdateManager]
[2019/7/3 20:58:48] 56	servicediscovery: [android.net.nsd.INsdManager]
[2019/7/3 20:58:48] 57	connectivity: [android.net.IConnectivityManager]
[2019/7/3 20:58:48] 58	ethernet: [android.net.IEthernetManager]
[2019/7/3 20:58:48] 59	netpolicy: [android.net.INetworkPolicyManager]
[2019/7/3 20:58:48] 60	overlay: [android.content.om.IOverlayManager]
[2019/7/3 20:58:48] 61	netstats: [android.net.INetworkStatsService]
[2019/7/3 20:58:48] 62	persistent_data_block: [android.service.persistentdata.IPersistentDataBlockService]
[2019/7/3 20:58:48] 63	network_score: [android.net.INetworkScoreService]
[2019/7/3 20:58:48] 64	textclassification: [android.service.textclassifier.ITextClassifierService]
[2019/7/3 20:58:48] 65	textservices: [com.android.internal.textservice.ITextServicesManager]
[2019/7/3 20:58:48] 66	ipsec: [android.net.IIpSecService]
[2019/7/3 20:58:48] 67	network_management: [android.os.INetworkManagementService]
[2019/7/3 20:58:48] 68	clipboard: [android.content.IClipboard]
[2019/7/3 20:58:48] 69	statusbar: [com.android.internal.statusbar.IStatusBarService]
[2019/7/3 20:58:48] 70	device_policy: [android.app.admin.IDevicePolicyManager]
[2019/7/3 20:58:48] 71	deviceidle: [android.os.IDeviceIdleController]
[2019/7/3 20:58:48] 72	oem_lock: [android.service.oemlock.IOemLockService]
[2019/7/3 20:58:48] 73	lock_settings: [com.android.internal.widget.ILockSettings]
[2019/7/3 20:58:48] 74	uimode: [android.app.IUiModeManager]
[2019/7/3 20:58:48] 75	storagestats: [android.app.usage.IStorageStatsManager]
[2019/7/3 20:58:48] 76	mount: [android.os.storage.IStorageManager]
[2019/7/3 20:58:48] 77	accessibility: [android.view.accessibility.IAccessibilityManager]
[2019/7/3 20:58:48] 78	input_method: [com.android.internal.view.IInputMethodManager]
[2019/7/3 20:58:48] 79	pinner: []
[2019/7/3 20:58:48] 80	network_watchlist: [com.android.internal.net.INetworkWatchlistManager]
[2019/7/3 20:58:48] 81	vrmanager: [android.service.vr.IVrManager]
[2019/7/3 20:58:48] 82	input: [android.hardware.input.IInputManager]
[2019/7/3 20:58:48] 83	window: [android.view.IWindowManager]
[2019/7/3 20:58:48] 84	alarm: [android.app.IAlarmManager]
[2019/7/3 20:58:48] 85	consumer_ir: [android.hardware.IConsumerIrService]
[2019/7/3 20:58:48] 86	vibrator: [android.os.IVibratorService]
[2019/7/3 20:58:48] 87	dropbox: [com.android.internal.os.IDropBoxManagerService]
[2019/7/3 20:58:48] 88	settings: []
[2019/7/3 20:58:48] 89	content: [android.content.IContentService]
[2019/7/3 20:58:48] 90	account: [android.accounts.IAccountManager]
[2019/7/3 20:58:48] 91	telephony.registry: [com.android.internal.telephony.ITelephonyRegistry]
[2019/7/3 20:58:48] 92	scheduling_policy: [android.os.ISchedulingPolicyService]
[2019/7/3 20:58:48] 93	sec_key_att_app_id_provider: [android.security.keymaster.IKeyAttestationApplicationIdProvider]
[2019/7/3 20:58:48] 94	binder_calls_stats: []
[2019/7/3 20:58:48] 95	webviewupdate: [android.webkit.IWebViewUpdateService]
[2019/7/3 20:58:48] 96	usagestats: [android.app.usage.IUsageStatsManager]
[2019/7/3 20:58:48] 97	batteryproperties: [android.os.IBatteryPropertiesRegistrar]
[2019/7/3 20:58:48] 98	battery: []
[2019/7/3 20:58:48] 99	sensorservice: [android.gui.SensorServer]
[2019/7/3 20:58:48] 100	processinfo: [android.os.IProcessInfoService]
[2019/7/3 20:58:48] 101	permission: [android.os.IPermissionController]
[2019/7/3 20:58:48] 102	cpuinfo: []
[2019/7/3 20:58:48] 103	media.sound_trigger_hw: [android.hardware.ISoundTriggerHwService]
[2019/7/3 20:58:48] 104	dbinfo: []
[2019/7/3 20:58:48] 105	media.audio_policy: [android.media.IAudioPolicyService]
[2019/7/3 20:58:48] 106	media.camera: [android.hardware.ICameraService]
[2019/7/3 20:58:48] 107	gfxinfo: []
[2019/7/3 20:58:48] 108	meminfo: []
[2019/7/3 20:58:48] 109	procstats: [com.android.internal.app.procstats.IProcessStats]
[2019/7/3 20:58:48] 110	activity: [android.app.IActivityManager]
[2019/7/3 20:58:48] 111	user: [android.os.IUserManager]
[2019/7/3 20:58:48] 112	otadexopt: [android.content.pm.IOtaDexopt]
[2019/7/3 20:58:48] 113	package_native: [android.content.pm.IPackageManagerNative]
[2019/7/3 20:58:48] 114	package: [android.content.pm.IPackageManager]
[2019/7/3 20:58:48] 115	media.audio_flinger: [android.media.IAudioFlinger]
[2019/7/3 20:58:48] 116	display: [android.hardware.display.IDisplayManager]
[2019/7/3 20:58:48] 117	recovery: [android.os.IRecoverySystem]
[2019/7/3 20:58:48] 118	power: [android.os.IPowerManager]
[2019/7/3 20:58:48] 119	appops: [com.android.internal.app.IAppOpsService]
[2019/7/3 20:58:48] 120	batterystats: [com.android.internal.app.IBatteryStats]
[2019/7/3 20:58:48] 121	media.resource_manager: [android.media.IResourceManagerService]
[2019/7/3 20:58:48] 122	media.player: [android.media.IMediaPlayerService]
[2019/7/3 20:58:48] 123	drm.drmManager: [drm.IDrmManagerService]
[2019/7/3 20:58:48] 124	device_identifiers: [android.os.IDeviceIdentifiersPolicyService]
[2019/7/3 20:58:48] 125	storaged_pri: [android.os.storaged.IStoragedPrivate]
[2019/7/3 20:58:48] 126	storaged: [android.os.IStoraged]
[2019/7/3 20:58:48] 127	media.extractor.update: [android.media.IMediaExtractorUpdateService]
[2019/7/3 20:58:48] 128	media.extractor: [android.media.IMediaExtractorService]
[2019/7/3 20:58:48] 129	media.drm: [android.media.IMediaDrmService]
[2019/7/3 20:58:48] 130	media.metrics: [android.media.IMediaAnalyticsService]
[2019/7/3 20:58:48] 131	android.os.UpdateEngineService: [android.os.IUpdateEngine]
[2019/7/3 20:58:48] 132	android.service.gatekeeper.IGateKeeperService: [android.service.gatekeeper.IGateKeeperService]
[2019/7/3 20:58:48] 133	gpu: [android.ui.IGpuService]
[2019/7/3 20:58:48] 134	SurfaceFlinger: [android.ui.ISurfaceComposer]
[2019/7/3 20:58:48] 135	android.security.keystore: [android.security.IKeystoreService]
[2019/7/3 20:58:48] 136	stats: [android.os.IStatsManager]
[2019/7/3 20:58:48] 137	perfprofd: [android.os.IPerfProfd]
[2019/7/3 20:58:48] 138	wificond: [android.net.wifi.IWificond]
[2019/7/3 20:58:48] 139	incident: [android.os.IIncidentManager]
[2019/7/3 20:58:48] 140	thermalservice: [android.os.IThermalService]
[2019/7/3 20:58:48] 141	installd: [android.os.IInstalld]
[2019/7/3 20:58:48] 142	com.android.car.procfsinspector: [com.android.car.procfsinspector.IProcfsInspector]
[2019/7/3 20:58:48] 143	netd: [android.net.INetd]
[2019/7/3 20:58:48] 144	vold: [android.os.IVold]
[2019/7/3 20:58:49] dowork:/ # 
[2019/7/3 20:58:49] dowork:/ # 
[2019/7/3 20:58:49] dowork:/ # 
[2019/7/3 20:58:49] dowork:/ # 
[2019/7/3 20:58:49] dowork:/ # 
[2019/7/3 20:58:49] dowork:/ # 
[2019/7/3 20:58:49] dowork:/ # 
[2019/7/3 20:58:49] dowork:/ # 
[2019/7/3 20:58:49] dowork:/ # 
[2019/7/3 20:58:49] dowork:/ # 
[2019/7/3 20:58:50] dowork:/ # 
[2019/7/3 20:58:50] dowork:/ # 

supplicant扫描的调用过程(使用nl80211)

supplicant接收到”SCAN”命令后,由wpa_supplicant_ctrl_iface_process处理。
wpa_supplicant_ctrl_iface_process
wpas_ctrl_scan // 处理扫描命令
wpa_supplicant_req_scan
wpa_supplicant_scan
wpa_supplicant_trigger_scan
wpas_trigger_scan_cb
wpa_drv_scan // wpa_s->driver->scan2调用到driver_nl80211_scan2
driver_nl80211_scan2
wpa_driver_nl80211_scan
nl80211_scan_common
send_and_recv_msgs
触发扫描的内核调用过程

SYSCALL_DEFINE3(sendmsg, int, fd, struct msghdr __user *, msg, unsigned, flags)
__sys_sendmsg (net\socket.c)
sock_sendmsg
__sock_sendmsg
__sock_sendmsg_nosec (sock->ops->sendmsg调用netlink_sendmsg)
netlink_sendmsg
netlink_unicast
netlink_unicast_kernel (nlk->netlink_rcv调用genl_rcv)
genl_rcv (cb 为genl_rcv_msg)
genl_rcv_msg (ops->doit调用到nl80211_trigger_scan)
nl80211_trigger_scan (net\wireless\nl80211.c)
Wifi驱动的扫描行为

◆上层发起一次scan命令->wifi进行各个信道的sacn->驱动包扫描结果存储在scanned_queue->扫面完成->通过rtw_cfg80211_surveydone_event_callback(cfg80211_inform_bss_frame)把扫描的ap结果通知内核net/wireless/scan.c->通过rtw_indicate_scan_done(cfg80211_scan_done)通知内核、上层扫描结束。
◆Wifi驱动每次发起扫面前,都会检查上次扫描到的ap到现在的时间是否超过20s(SCANQUEUE_LIFETIME),若超过20s,就会调用rtw_list_delete把ap从scanned_queue中去掉,接下来再扫面到新的ap时,再加入scanned_queue。
◆每次扫描完所有信道后,会再次扫描一个信道,连接ap的情况下,扫描的信道为所连接ap的信道,没连接ap的情况下,为最后一个扫描信道。
◆对于接收到的beacon帧,由OnBeacon处理,只有在扫描状态的时候,beacon的ap才会被加入到scanned_queue,其它情况根据WIFI_FW状态进行不同操作,有触发start_clnt_auth,有更新ap信息等操作。
◆net/wireless中使用bss_list保存扫描到的ap结果,扫描结束后,应用层通过NL80211_CMD_GET_SCAN命令,由内核nl80211_dump_scan函数把结果发送给应用层,内核中保存ap有效时间为3s,超过3s该ap的信息会从bss_lis移除。
◆supplicant中通过wpa_s->bss保存扫描的ap,如果一个ap在180s(DEFAULT_BSS_EXPIRATION_AGE)内没有更新,就会删除该ap,每10s进行一次检测,由wpa_bss_timeout函数检查。

802.11区别

Android 9 Wifi 调试_第1张图片Android 9 Wifi 调试_第2张图片

策略路由

Android 9 Wifi 调试_第3张图片

10000:  from all fwmark 0xc0000/0xd0000 lookup legacy_system     这里表示iptables的mark标记为0xc00000xd0000为掩码,进来的包先和xd0000做AND与计算,结果为0xc0000的包)的查找legacy_system路由表。
10500:  from all iif lo oif wlan0 uidrange 0-0 lookup wlan0  这里表示从lo环回接口输入、从wlan0接口输出、uid为0(即系统用户)的包查找wlan0路由表。
[C:\~]$ adb shell ip rule help
Usage: ip rule [ list | add | del | flush ] SELECTOR ACTION
SELECTOR := [ not ] [ from PREFIX ] [ to PREFIX ] [ tos TOS ] [ fwmark FWMARK[/MASK] ]
            [ iif STRING ] [ oif STRING ] [ pref NUMBER ] [ uidrange UID1-UID2 ]
ACTION := [ table TABLE_ID ]
          [ prohibit | reject | unreachable ]
          [ realms [SRCREALM/]DSTREALM ]
          [ goto NUMBER ]
TABLE_ID := [ local | main | default | NUMBER ]

你可能感兴趣的:(Android,零碎知识记录)