1

I need to read saved wifi password for one of application. I know that it is not possible directly due to security issues, but by rooting the android mobile device, It might because.[I don't want this solution].

But Google Home android application is allowed to read the saved WiFi passwords. How could it be possible?

I read few posts on SO and I came to know that only system apps can have access to it.

On WifiManager.java, we have a method to handle it getPrivilegedConfiguredNetwork(), but this method is hidden & only system apps can access it.

/** @hide */
@SystemApi
@RequiresPermission(allOf = {ACCESS_FINE_LOCATION, ACCESS_WIFI_STATE, READ_WIFI_CREDENTIAL})
public List<WifiConfiguration> getPrivilegedConfiguredNetworks() {
    try {
        ParceledListSlice<WifiConfiguration> parceledList =
                mService.getPrivilegedConfiguredNetworks(mContext.getOpPackageName());
        if (parceledList == null) {
            return Collections.emptyList();
        }
        return parceledList.getList();
    } catch (RemoteException e) {
        throw e.rethrowFromSystemServer();
    }
}

Can this method help on reading the Wifi password?

Shanmugapriyan
  • 953
  • 1
  • 10
  • 28
  • 1
    looks similar to: https://stackoverflow.com/q/21330520/5372462 – ofirule May 09 '20 at 10:47
  • No. My question is different. Please read completely. Google Home android application is allowed to read the saved WiFi passwords. How could it be possible? – Shanmugapriyan May 09 '20 at 14:26
  • This may provide a more complete answer: https://stackoverflow.com/questions/26752656/whats-the-meaning-of-new-systemapi-annotation-any-difference-from-hide. In a nutshell, any attempt to use `getPrivilegedConfiguredNetworks`, even via reflection, will result in an `invocationTargetException`. Without root privileges, you will not be able to access that API. – rfestag May 10 '20 at 18:06
  • @rfestag please check my previous comment. – Shanmugapriyan May 11 '20 at 13:39

0 Answers0