essentials icon indicating copy to clipboard operation
essentials copied to clipboard

[Bug]: HiLight's settings doesn't respect the Privileged access method

Open Celestial04 opened this issue 1 month ago • 4 comments

Bug Description

Why HiLight function need Shizuku or Porter if I've root?

Steps to Reproduce

  1. Go to settings
  2. Make sure "Privileged access" is selected to "root"
  3. Go to HiLight setting
  4. Tap to a "Try out" button on these settings page

Expected Behavior

To respect selected the Privileged access method.

Screenshots

No response

Android Version

Android 17

Device

Pixel 11 Pro

App Version

19.1-beta.2

Additional Context

No response

Celestial04 avatar Oct 13 '26 23:10 Celestial04

Thanks for the report. This is currently expected behaviour rather than a regression, but it's a fair gap.

Hilight drives the LEDs through the system lights service (ILightsManager), which needs CONTROL_DEVICE_LIGHTS. That permission is signature|privileged, so it can't be granted to the app with pm grant. Shizuku and Porter work because they hand Essentials a binder running as the shell user, which already holds it. Root mode in Essentials only runs su -c shell commands, so there's no binder to call the lights service through. That's why HilightLights.isModeSupported() only accepts Shizuku and Porter, and why "Try it" does nothing in Root mode.

Workaround for now: if you start Shizuku (it can run as root), set Privileged access to Shizuku or Auto and Hilight will work.

Possible fixes:

  1. In Root mode, fall back to Shizuku's binder when Shizuku is running, and make the status text clearer when it isn't.
  2. Proper root support via libsu's RootService: a small service running as uid 0 that makes the ILightsManager calls (getLights, openSession, setLightStates, closeSession) over a tiny AIDL interface, with HilightLights picking the Shizuku or root path.

@sameerasw would you be open to option 2? It adds the libsu dependency, so I wanted to check before opening a PR. Happy to do option 1 on its own if you'd rather not.

jawzf avatar Oct 14 '26 03:10 jawzf

Thanks for the report. This is currently expected behaviour rather than a regression, but it's a fair gap.

Hilight drives the LEDs through the system lights service (ILightsManager), which needs CONTROL_DEVICE_LIGHTS. That permission is signature|privileged, so it can't be granted to the app with pm grant. Shizuku and Porter work because they hand Essentials a binder running as the shell user, which already holds it. Root mode in Essentials only runs su -c shell commands, so there's no binder to call the lights service through. That's why HilightLights.isModeSupported() only accepts Shizuku and Porter, and why "Try it" does nothing in Root mode.

Workaround for now: if you start Shizuku (it can run as root), set Privileged access to Shizuku or Auto and Hilight will work.

Possible fixes:

  1. In Root mode, fall back to Shizuku's binder when Shizuku is running, and make the status text clearer when it isn't.
  2. Proper root support via libsu's RootService: a small service running as uid 0 that makes the ILightsManager calls (getLights, openSession, setLightStates, closeSession) over a tiny AIDL interface, with HilightLights picking the Shizuku or root path.

@sameerasw would you be open to option 2? It adds the libsu dependency, so I wanted to check before opening a PR. Happy to do option 1 on its own if you'd rather not.

I am fine but we do need some external proper testing with this as we don't got rooted devices to test.

sameerasw avatar Oct 14 '26 05:10 sameerasw

I totally agree. We especially need rooted Pixel 11 devices. Unless @Celestial04 you are willing to help me with the testing?

jawzf avatar Oct 14 '26 09:10 jawzf

8. I totally agree. We especially need rooted Pixel 11 devices. Unless @Celestial04 you are willing to help me with the testing?

yep, ofc!

Celestial04 avatar Oct 18 '26 19:10 Celestial04