Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to access wifi password from flutter code?

So i have a device a want to connect to wifi. I know i can get the SSID from the network my phone is connected to, but i also want the app to find the password so user dont have to write it.

I have seen when you connect to a chromecast, the configuration app lets you pick a network form available networks, and if you choose the one your phone was connected to, the configuration app asks "Get wifi password from this mobile device?".

So my question is maybe then, how does google access the information of wifi-password, and is it possible to do this using flutter.

I have tried to find some plugins that can do this, but the closest i came whas this one: https://github.com/alternadom/WiFiFlutter Photo from chromcast configuration

like image 692
Harald Haugen Johnsen Avatar asked Oct 24 '25 20:10

Harald Haugen Johnsen


1 Answers

Password in Android are stored in one of the files in /data/misc/wifi, usually inside wpa_supplicant.conf. However, I also found that information inside the same folder but in a file called WifiConfigStore.xml.

I don't know how to get this through code, but hopefully this can be useful for you. Also note you need root privileges to access those files from adb.

like image 155
mariotorrone Avatar answered Oct 27 '25 12:10

mariotorrone



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!