If you have root access on your device:
- Grab a copy of
/data/misc/wifi/wpa_supplicant.conf
, e.g. using adb pull
, and save it to your computer
- Restore the data from your backup, and grab a copy of that in the same manner
- Use a text editor, and merge the entries to a new file
- Put that file back into place, e.g. using
adb push
- 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:
- Create an
adb backup
- Restore the "old data" to your device
- Create another
adb backup
- 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"?)
- Merge the data from both
wpa_supplicant.conf
files
- Re-assemble the backup file
- 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):
network={
ssid="smartcafe"
psk="cafesmart"
key_mgmt=WPA-PSK
priority=46
}
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
):
- Go to Settings → WiFi
- Scroll to the APN
- Long-press its entry, select "Change"
- 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.