My phone is rooted and i wrote code in my app to change file permission of system file which is located at /sys/class/leds/lcd-backlight/brightness
Runtime.getRu
Download the RootTools.jar from this link https://github.com/Stericson/RootTools/releases
Put that .jar file into your project's 'libs' directory
import com.stericson.RootTools.*;
. .
Command cmd=new Command(0,"chmod 766 /sys/class/leds/lcd-backlight/brightness");
RootShell.getShell(true).add(cmd);
That's not how you execute su-ed commands. Please refer to http://su.chainfire.eu/ for guidance.