'preconfiguring WIFI SSID and password in AOSP build 9 and above

How to place SSID and password in AOSP before build so that the device will automatically get connected to preconfigured wifi after flashing the rom into the device

for Android 7 and 8, we can add the credentials into wpa_supplicant_overlay.conf file Is there any way for android 9 and above



Solution 1:[1]

This is now being called Wi-Fi Easy Connect ...in wpa_supplicant/android.config:

# Easy Connect (Device Provisioning Protocol - DPP R1 & R2)
CONFIG_DPP=y
CONFIG_DPP2=y

The documentation misses CONFIG_DPP2 ...

Set update_config=1 to enable the use of tools, alike in wpa_supplicant_template.conf.
One still can configure just any network. as shown in the example wpa_supplicant.conf.

The specification: https://www.wi-fi.org/file/wi-fi-easy-connect-specification

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1