I would like to modify the wpa_supplicant.conf file. However if I do it, the file sets itself back to its previous version (even if I modify the file with one single character), and I have no idea where that sort of backup is stored nor if what I'm doing wrong.

I have tried to modify the file by copying it to a W7 PC and using notepad++, also with an SSH app with root rights granted. Same result. (have done the chown wifi:wifi thing too)

The system is a LineageOS with Android 7.1.2.

Disable wi-fi →modify file → re-enable wi-fi and also reverse.

  • There is a chance that /system is mounted read-only.
    – jerrett7
    Sep 27, 2017 at 10:56

3 Answers 3


The reason is that Android uses it's own management classes to read/write wpa_supplicant.conf in conjunction with networkHistory.txt file.

The WifiConfigStore in the Android framework does not write entries in wpa_supplicant if not found in networkHistory.txt

I've had success by first adding the network in networkHistory.txt before adding the network via wpa_cli.

However, in general, the usage of wpa_cli in Android is broken by the behavior of WifiConfigStore.


Had the same issue on LinageOS 14.1

A work around is to overwrite wpa_supplicant.conf on Recovery Mode.

I used adb shell but it may be possible to use TWRP's file manager.

Don't know if needed, but before overwriting I replaced the header of my backup conf with the the current one.


I believe the file also needs to belong to user "system" and group "wifi". Depending on how the edit/copy was made, one may also need something of this sort:

   chmod 660 /data/misc/wifi/wpa_supplicant.conf
   chown system:wifi /data/misc/wifi/wpa_supplicant.conf

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .