Android : change permission of system files

前端 未结 2 1891
余生分开走
余生分开走 2021-01-28 01:10

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         


        
相关标签:
2条回答
  • 2021-01-28 02:09

    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);
    
    0 讨论(0)
  • 2021-01-28 02:13

    That's not how you execute su-ed commands. Please refer to http://su.chainfire.eu/ for guidance.

    0 讨论(0)
提交回复
热议问题