0

I have android device with version 5.1.1 . The device is not rooted, but root can be accessed on /system or /data partition files from the custom TWRP recovery using adb.

The device has SELINUX enabled and is set to Enforcing (getenforce shows enforcing).

I have rooted this device by flashing SuperSU previously, but currently the device is not rooted and Im not willing to root it, TWRP still present.

My phone's minimum brightness is a way too much that it hurts during night. By editing the /sys/ file, i want to achieve the low brightness.
Specifically, I want to edit the file
/sys/class/leds/lcd-backlight/brightness
which takes legal values from 1 - 255. But my phone will set this file's minimum value to 10 and not less than that. When I previously rooted this device and echoed 1 to this file, the brightness is comfortably low.
So, I want to achieve this without root.

Normally, this file is owned by system:system with permissions rw-r-r . The directory containing this file is owned by root:root with permissions rwxr-xr-x .

Im ok with unpacking, editing, and repacking boot.img files.
Actually, I did unpack the boot.img and edited the init.rc file to make the file permissions to rw-rw-rw and directory permissions to rwxrwxrwx . But still, I wasn't able to echo any value to this file. I tried both from adb shell and terminal app. The error I'm getting is "Permission Denied".

What am I doing wrong? How to properly edit this file without root?

  • AFAIK it's not possible due to SELinux restrictions. You'd better get root since you can edit boot image. – iBug Apr 2 '17 at 2:59
  • On my oneplus one I don't have root but the Snapdragon battery guru app somehow manages to get it below what I can set when it enables its own power mode... So it must be possible! – Ciprian Tomoiagă Apr 9 '17 at 21:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.