Extract the saved wifi passwords from your phone. The app requires root.
There are several apps with the same functionality, however I prefer to give root permissions to apps I fully trust, so I created mine.
The code is simple and completely open source: https://github.com/markszabo/AndroidWifiPasswordExtractor
There is only one class with all the Java code: https://github.com/markszabo/AndroidWifiPasswordExtractor/blob/master/app/src/main/java/ hu/szabosimon/mark/wifipasswordextractor/MainActivity.java