how Google home can get specific wifi's password programmatically?
Asked Answered
E

4

9

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?

Endowment answered 1/2, 2017 at 1:17 Comment(1)
Time to reverse engineer it!Gary
M
7

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.

Moultrie answered 23/10, 2017 at 18:30 Comment(1)
It's most likely a private API. Google Play Services is a system app and has more access rights than a usual app.Novia
S
2

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
Sclerophyll answered 12/6, 2019 at 8:25 Comment(0)
H
0

This is api to securely transfer wifi creds from one device to another.
https://developer.android.com/preview/features#wifi-suggest

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.

Harley answered 17/6, 2019 at 15:3 Comment(0)
T
-1

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.

https://support.google.com/googlehome/answer/7029485?co=GENIE.Platform%3DAndroid&hl=en

Telford answered 1/2, 2017 at 1:44 Comment(1)
I know that my Wi-Fi password is encrypted and can not be accessed from Android. Nonetheless, Google Home does not ask for an encrypted WiFi password, but instead finds a saved WiFi password and associates it with a Google home device. I am asking how programmatically that is possible without rooting.Endowment

© 2022 - 2024 — McMap. All rights reserved.