获取密码列表 Wi-Fi [英] Get a list of passwords Wi-Fi

查看:37
本文介绍了获取密码列表 Wi-Fi的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一种在安卓手机上查看之前保存的 WiFi ssid 和密码的方法吗?

I want a way to view the previously saved WiFi ssid and passwords on the android phone ?

例如

好孩子221548dshvshg

good boy 221548dshvshg

此代码用于在没有密码的情况下获取 WiFi 数据.我想获取网络名称的密码

This code is for fetching WiFi data without a password. I want to get the password with the network name

 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />

List myListrow = new List();

        var wifiMgr = (WifiManager)GetSystemService(WifiService);
        var wifiList = wifiMgr.ScanResults;

        foreach (var item in wifiList)
        {
            var wifiLevel = WifiManager.CalculateSignalLevel(item.Level, 100);
             myListrow.Add(($"Wifi Name: {item.Ssid} - Single: {wifiLevel}"));

        }

推荐答案

无需root - 由于安全原因,您不能这样做.您只能通过每个网络的capabilities 来检查网络的安全类型.

Without rooting - due to security reasons, you cannot do that. You can only check the security type of the network through each network's capabilities.

生根 - 您只需阅读/data/misc/wifi/wpa_supplicant.conf 文件的内容即可.不幸的是,这并非适用于所有手机,您会发现此配置文件有时位于其他位置,具体取决于手机制造商.

With rooting - You can do it by simply reading the contents of /data/misc/wifi/wpa_supplicant.conf file. Unfortunately, this is not universal for all phones and you will find out that this configuration file is sometimes located somewhere else, depending of the phone's manufacturer.

这篇关于获取密码列表 Wi-Fi的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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