I have an old backup of the WiFi passwords on my Nexus 7. I also have a new configuration which has some passwords that are newer and some that are older.

How can I merge the configuration in a controlled manner without having to entrust my WiFi passwords to some third-party app?

  • Do you have root access on your device? – Izzy Nov 6 '13 at 21:55
  • Than you can use the easy way (first part of my answer, see below). I will edit my answer and give a little example. – Izzy Nov 6 '13 at 22:05
  • Done. Enjoy! And let us know which approach you've used and how it went. Especially the second part ATM is pure theory for me, I've never tried that. – Izzy Nov 6 '13 at 22:15

If you have root access on your device:

  1. Grab a copy of /data/misc/wifi/wpa_supplicant.conf, e.g. using adb pull, and save it to your computer
  2. Restore the data from your backup, and grab a copy of that in the same manner
  3. Use a text editor, and merge the entries to a new file
  4. Put that file back into place, e.g. using adb push
  5. Make sure the file is owned by system:wifi and has permissions 664.

Without root access, it might be possible as well, but would be much more tricky (plus the overhead would probably not be worth it). The following is untested, and requires at least Android 4.0:

  1. Create an adb backup
  2. Restore the "old data" to your device
  3. Create another adb backup
  4. Extract both backups to different locations on your device (see: [How do you extract an App's data from a full backup made through “adb backup”?])(How do you extract an App's data from a full backup made through "adb backup"?)
  5. Merge the data from both wpa_supplicant.conf files
  6. Re-assemble the backup file
  7. Restore the re-assembled backup

A third way lies in between, but does not require to re-assemble and restore the backup file, nor to replace the wpa_supplicant.conf directly. But you will need a copy of that file, which you either can obtain via adb pull or by extracting the backup files.

Once you've got a copy of both files, you can simply read your connection data, and enter those you wish manually: everything is stored as plain-text here, completely unencrypted (including the passwords!). An example entry (slightly modified to hide the real data):


As you see: if you would like to use that data for the APN "smartcafe", simply edit your config and put the corresponding password (psk):

  1. Go to Settings → WiFi
  2. Scroll to the APN
  3. Long-press its entry, select "Change"
  4. Enter the new password

If it should be a new entry: At the same place, at the bottom of the screen, tap the "add network" button, and enter the data you've read from the file.

  • Excellent. Very concise description of the method. Will follow it tomorrow. – 0xC0000022L Nov 6 '13 at 23:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.