Probably for the most of situations your application will not require root access to the system. But, who knows why, sometimes you maybe need it. When developing my new application someone asked for a special feature: save the WiFi password which you are connected to. Well, you can get some of the wireless SSID infomation by calling the correct API functions, but not the password. The password is, so far, storaged into the wpa_supplicant.conf file and to have access to it you will need root privileges. Of course someone can simple type in the password and it’s done.So, for this case, more than run away from the solution I was curious in how could I get root access from my application. After dinging a while I got a solution by watching a You can't view the links! Click here to register video from “Marijsoft sviluppo software”, that he was kind for provide new links for the source code, that I tested on XE8 and DX Seattle and worked as expected.By reading the files (Androidapi.JNI.Runtime, Androidapi.JNI.Stream2and FMX.Android.Runtime) we will discover that source belongs to 天轶_黄金
I needed to do a little fix on it (?) so I was able to make it work as I expected. I guess someone else can really improve this code, but for my purpose it is enough now. You can download the required files You can't view the links! Click here to register (fixed by me), and the original one You can't view the links! Click here to register (while it exists there). Basically you will find 2 functions:![Click to large size! İmage]()
You can't view the links! Click here to register. Once allowed by SuperSu, my application can have root access. Here I made a simple program to read the wpa_supplicant.conf(Memo1.Lines.ReadFromFile(<fullfilename> was enough) and voilà!
![Click to large size! İmage]()
At this point you application can handle the device with root privileges and now can manipulate whatever you want. Does I told you to be careful already?

- HaveRoot():boolean
- RunAndroidCmd(string, boolean, TStrings)

You can't view the links! Click here to register. Once allowed by SuperSu, my application can have root access. Here I made a simple program to read the wpa_supplicant.conf(Memo1.Lines.ReadFromFile(<fullfilename> was enough) and voilà!

At this point you application can handle the device with root privileges and now can manipulate whatever you want. Does I told you to be careful already?