There are two methods, the second one does not require recompiling, which is more convenient
1. Violent modification-system layer
If you want to support 5G hotspots, you need to change the channel to 149 (you can check the available channels through the iwlist c command), you also need to modify hw_mode=a,
modify the source code: system/netd/server/SoftapController.cpp
asprintf(&wbuf, "interface=%s\ndriver=nl80211\nctrl_interface="
"/data/misc/wifi/hostapd\nssid=%s\nchannel=%d\nieee80211n=1\n"
"hw_mode=%c\nignore_broadcast_ssid=%d\nwowlan_triggers=any\n",
argv[2], argv[3], channel, (channel <= 14) ? 'g' : 'a', hidden);
change into:
asprintf(&wbuf, "interface=%s\ndriver=nl80211\nctrl_interface="
"/data/misc/wifi/hostapd\nssid=%s\nchannel=%d\nieee80211n=1\n"
"hw_mode=%c\nignore_broadcast_ssid=%d\nwowlan_triggers=any\n",
argv[2], argv[3], 149, 'a', hidden);
Directly write channel as 149 and hw_mode as a
2. Application layer modification
3. Channel rating
Recommended software: WiFi analysis assistant/instrument