In google home app, the app can connect with GoogleHome without asking password for connecting.
Even though, the app doesn’t have root permission to do that. How google home can connect with device?
Short answer: you cannot access the Wi-Fi password without root access. (with root it’s just stored as plain text on disk)
What Google does (I’m guessing) is to get your Wi-Fi password from your Android Phone’s backup. After all, after resetting your Android phone you just have to log in to your account and you magically have your Wi-Fi passwords back.
Note: They could also be using a private API, but as that would be a security risk, my best guess is the solution above.
Note2: This is very much in line with what Apple does in their WAC set up protocol. They’ve provided a proprietary flow to set up “Made for iOS” devices so you don’t have to ask a user for her password.
I don’t have an actual answer, but had too much background data for a comment.
From this Super User answer:
Chromecast acts as an access point when first turned on.
For the initial setup, you install an app on your Android, Windows or mac device, that will find it and connect to the chromecast’s AP directly. Then the chromecast scans for nearby access points, allowing you to pick one and enter in its password.
Once this is done, it will connect to that access point instead of acting as its own access point.
So the overall flow is:
- You install the app
- The app sees the Chromecast’s access point
- The app connects to the Chromecast access point (named ChromecastXXX, with random alphanumeric chars)
- The Chromecast scans for nearby access points
- You select your WiFi network
- You either enter your password, or the mysterious wifi share happens.
- Chromecast uses your WiFi network
This is api to securely transfer wifi creds from one device to another.
I found it in Q’s arsenal of secret 007 spy tools.
AFAIK (remember) I had to enter the wifi password on the google home app and wear os when I set up.
Basically your phone and home device are connected to the same Wifi. And your phone already is successfully connected to the Wifi. So the Wifi password is kind of auto fetched while Google Home device is connecting.
Below are some hints from the Google Home setup page –
Make sure to connect your mobile device/tablet to the same Wi-Fi
network that you intend to use to set up your Google Home device.
Choose the Wi-Fi network you want to connect to your Google Home. To
automatically fetch the password for this network on this device, tap
OK. The password will populate in the password field. Note: Android L
and above is required to auto fetch the password. Tap Continue. You
can also manually enter your password. Tap Continue.