In previous versions of Android, the password file was located at the address data/misc/wifi/wpa_supplicant.conf
It will be more correct to say that this is a file with configuration settings for the background authentication service wpa_supplicant.
More details about this are told here.
In the new version of Android 8.0 Oreo the old file is, but it contains this:
I do not know how on other devices, but on Nexus 5x all the authentication settings are in another file WifiConfigStore.xml
And its contents:
In the new version of the Wi-Fi password manager, this behavior of the system is already supported. The article on working with XML will be written later. In the meantime, you need to carefully monitor the updates to Android. Who knows where the system settings for wifi will be next time?