0

On an Android device I would like to modify /data/misc/wifi/wpa_supplicant.conf with as minimal side effects to the rest of the device as possible. (there are unexposed APIs in Android framework)

Is it possible to just use a command line su executable to get permissions to modify the file?

Can I do this without an unlocked boot loader?

Would this be easier on a Nexus device?

1

In case this point is not clear; it's not enough to just have a su executable and run it.

Since you asked

Is it possible to just use a command line su executable to get permissions to modify the file?

The su executable must be properly installed, meaning that for it to do its job 'on behalf of' the superuser/root it has to have the SUID bit set (Switch User ID) for root. This process, called rooting needs to be done before any su executable becomes valid.

You can read all about the SUID bit and Linux file permissions as well as the rooting process by doing a search.

  • I know I chose not to comment on SELinux or su implementations via deamons where the suid bit for the executable might be 'missing' but I thought this would only confuse the issue. – reben Oct 2 '18 at 16:46
0

Have you rooted your device?? If yes then use root browser and navigate to wpa_supplicant. Conf. Then open and edit that file. It will not effect device at all.

  • Wrongly edited wpa_supplicant.conf can result in repeated force-close messages or even a boot issue which technically is affecting the device. – Firelord Sep 21 '15 at 7:56
0

As long as root access is configured properly, you could do what you want through terminal or any executable su that you plan of. This doesn't requires an unlocked bootloader in most cases. However, getting a properly configured root access, most of the time requires an unlocked bootloader.

  • What is properly configured (argue with improperly configured) root access and what does a bootloader has to do with it, let alone being unlocked? Please explain. If possible, use technical sources to back your claim. Thanks. – Firelord Sep 21 '15 at 7:57
0

Is it possible to just use a command line su executable to get permissions to modify the file?

Yes. It's that simple. With properly setup root permission you can easily modify most configuration files.

Can I do this without an unlocked boot loader?

Very unlikely though I've heard some. To root your phone you must first unlock your bootloader and ... that's the beginning :)

Would this be easier on a Nexus device?

I'm not very sure. The general procedure is Unlock bootloader -> Flash custom recovery -> Flash root package -> Boot into phone and get a root-capable text editor and modify the file.

AFAIK Nexus devices are the "most vanilla" so you shouldn't face any problem if you follow a comprehensive rooting guide.

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.