Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I programmatically read wifi passwords in Android

I am trying to get the WiFi passwords programmatically from a non-rooted Android device.

All I need is to be able to read the passwords, I do not need to be able to edit them.

Can I get permission in the manifest file?

like image 576
fergany Avatar asked Jan 24 '14 10:01

fergany


Video Answer


2 Answers

This is not possible as this would be a major security risk.

You may be able to if the phone is rooted but I do not know, I would imagine, and hope, even if you could get to where it is stored on the phone, it would be encrypted.

like image 85
Boardy Avatar answered Oct 07 '22 23:10

Boardy


If your application is a privileged app (that is - installed in /system/priv-app for example using SuperUser) then you can use the new WifiManager#getPrivilegedConfiguredNetworks() API in Lollipop and newer.

See: https://android.googlesource.com/platform/frameworks/base/+/758bdf4a915c313f1c3bef0b95b494c91f363f03%5E%21/#F1

like image 40
Aldrian Avatar answered Oct 08 '22 01:10

Aldrian