如何在Android中以编程方式读取wifi密码 [英] How can I programmatically read wifi passwords in Android

查看:1136
本文介绍了如何在Android中以编程方式读取wifi密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试以编程方式从非root用户的Android设备获取WiFi密码.

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?

推荐答案

如果您的应用程序是特权应用程序(例如,使用SuperUser安装在/system/priv-app中),则可以在Lollipop中使用新的WifiManager#getPrivilegedConfiguredNetworks() API和更高版本.

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.

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

这篇关于如何在Android中以编程方式读取wifi密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆