2

I have 285 different networks between the different campus apartments for which I am trying to add network profile information to a series of Lenovo Tab4 10 TB-X304F so they may connect without having our Apartment Managers carry around a list of wifi passwords.

So far, I have created a custom wpa_supplicant.conf file with all of the network blocks for each of the networks across the campus. I have rooted the device. I have pushed this custom file to /sdcard/TWRP. I then copied the file from /sdcard/TWRP to /data/misc/wifi.

Now we run into my issue, it appears that this file is stored in at least 3 locations which I have currently found, /etc/wifi, /system/etc/wifi and /data/misc/wifi. The other part of the problem is that these files appear to be rewritten/overwritten on boot.

Which of these file locations should I be updating with my custom wpa_supplicant.conf file? How do I stop the file from being rebuilt on boot? Or, how do I make the process, which builds the file on boot, build it with the networks I want added?

Am I missing any other steps?

I have also tried running " wpa_supplicant -iwlan0 -c/sdcard/TWRP/wpa_supplicant.conf -B " as a command in the adb shell with super user permissions and didn't receive any output or confirmation. What am I misunderstanding about the wpa_supplicant command?

Just in case here are the settings currently in /data/misc/wifi/wpa_supplicant.conf which I have copied into my custom file:

ctrl_interface=/data/misc/wifi/sockets
disable_scan_offload=1
driver_param=use_p2p_group_interface=1
update_config=1
device_name=LenovoTB-X304F
manufacturer=LENOVO
model_name=Lenovo TB-X304F
model_number=Lenovo TB-X304F
serial_number=<SerialNumber>
device_type=10-0050F204-5
config_methods=physical_display virtual_push_button
p2p_disabled=1
pmf=1
external_sim=1
tdls_external_control=1
AppleDon
  • 21
  • 3

1 Answers1

1

I do not really know much, but I can successfully edit/replace

   /data/misc/wifi/wpa_supplicant.conf

provided that (1) I have the device in Aeroplane Mode and (2) I make sure that the file belongs to user "system" and group "wifi", and has permissions 660. If I forget (1) or (2), somehow the file reverts later to the one before editing/replacing or is reinitialized to virtually empty (I am not sure when either happened exactly, but I noticed both cases). I believe your use of TWRP is effectively equivalent to my use of Aeroplane Mode--but I am not aware that you can "chown" a file in TWRP. I never had to touch any of the other locations where the file can apparently be found.

For reference, the commands to get the right ownership and permissions should be

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

Of course, all this needs one to be root.

Paolo
  • 123
  • 6
  • ...this worked for me perfectly. Activated airplane mode, sent updated wpa_supplicant.conf file to /data/misc/wifi/ and did .\adb shell su -c 'chmod 660 /data/misc/wifi/wpa_supplicant.conf' .\adb shell su -c 'chown system:wifi /data/misc/wifi/wpa_supplicant.conf' – 6opko Nov 16 '22 at 00:20