I was going through a question about how to find a saved password in a rooted phone and while doing this I found a file in
data/misc/wifi/softap.conf. What is the content of this file?
.conf file is usually readable by any text file reader as long as permissions are correct.
The said file contains SSID and password of your portable Wi-Fi hotspot. E.g.:
Android.SE is the SSID which other users would see when trying to locate Wi-Fi network and
#$#$ANDROID is the password they need to enter to connect to your hotspot.
As for the name is concerned, I never researched for it because I know
ap → Access point, and I've seen
softap term in logcat's output when enabling hotspot.
There are other ways to see the content of this file. In my Android 4.2.1, I can do:
adb shell su -c 'service call wifi 30'
As for the Android 5.0 (CM12), it would be:
adb shell service call wifi 36
The output isn't very human-friendly but it's not unreadable, and you can easily see SSID and password of hotspot.
Edit: For those who might wonder what those
adb shell .. commands actually does in bits and pieces, here is a missing piece:
adb shell: you get a remote shell (access to device)
su: to attain root privileges, use if only necessary;
-c: is to pass the following command which would be executed with root privileges
service: it allows you to read and manipulate services running in your system. Enter
adb shell service listto see a list of running ones, and
adb shell serviceto see the command's usage.
call connectivity: to call a particular service (
connectivityhere). Name of services can be found using
36is the number assigned to a function of the connectivity service amongst many of it, which we're calling here. You can also pass an integer or a string to the function like
adb shell service call connectivity 36 i32 1, but it would take effect only if the function has provision to accept such value. Take a look here to see such functions.