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?