安卓系统文件变更许可 [英] Android : change permission of system files
本文介绍了安卓系统文件变更许可的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的手机是植根我写code。在我的应用程序,以改变它位于/ SYS /班/ LED灯/ LCD背光/亮度系统文件的文件权限
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.getRuntime().exec("su");
Runtime.getRuntime().exec("chmod 777 /sys/class/leds/lcd-backlight/brightness");
但这code不能更改指定的文件的文件许可权,我不会有任何错误或异常的
but this code can't change the file permission of the specified file and i won't got any kind of error or exception
推荐答案
从这个链接 https://github.com/Stericson/RootTools/releases
把该.jar文件到您的项目的库目录
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);
这篇关于安卓系统文件变更许可的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文