Cannot run Set LineageOS System Setting with root enabled

Post your questions and help other users.

Moderator: Martin

ariloc
Posts: 109
Joined: 05 Jun 2016 21:36

Re: Cannot run Set LineageOS System Setting with root enable

Post by ariloc » 11 Mar 2019 22:11

I'm pretty sure it's a security measure and also to avoid any conflict that may cause with any new values that exist in LOS 16 because of new features. I didn't know that the settings file was contained in that directory, so it's nice to know, as I could technically rewrite that file with the modified values I'd like to change. It's quite risky though, so I will consider it, but always trying to be careful around it, or maybe just wait for the bug fix :) .

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Cannot run Set LineageOS System Setting with root enable

Post by Martin » 12 Mar 2019 20:40

I've just had a chance to install LineageOS 16 on a Pixel XL. The LineageOS SDK to change system settings seems to be completely broken on LOS 16. I'll likely wait a few weeks to see if an update becomes available and then integrate it.
If you have root enabled I recommend to fall back to the command line version to change settings for now:
Template: Execute Root Command: settings put --lineage category key value
Examples:
Execute Root Command: settings put --lineage system qs_quick_pulldown 1
Execute Root Command: settings put --lineage secure stats_collection 0
Execute Root Command: settings put --lineage global power_notifications_enabled 1

This should work on 15.1 and 16. Maybe this could also work on RR 7. Does action Set Cyanogen/LineageOS Profile work on RR 7?

Regards,
Martin

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Cannot run Set LineageOS System Setting with root enable

Post by Martin » 12 Mar 2019 21:09

I've found two interesting issues:
1. There's a bug in the action Set LineageOS System Setting when root is enabled --> fixed in the next EAP build
2. the SDK on LOS 16 does not work properly because the SDK accesses hidden APIs which is not allowed anymore when an app targets Android P. Lineage has to either fix their SDK to not rely on such hidden APIs or whitelist the required APIs. You can workaround the issue with adb:

Code: Select all

adb shell settings put global hidden_api_policy_p_apps 1
then restart the device.

Regards,
Martin

ariloc
Posts: 109
Joined: 05 Jun 2016 21:36

Re: Cannot run Set LineageOS System Setting with root enable

Post by ariloc » 12 Mar 2019 23:38

Martin wrote: If you have root enabled I recommend to fall back to the command line version to change settings for now:
Template: Execute Root Command: settings put --lineage category key value
I've tried that out, it works! :) The only thing I'm concerned is that my main purpose to modify the LineageOS system settings, is to change the performance mode, so I can boost up my device whenever I open a heavy game, for example. That doesn't seem to work, neither any setting I tried, in the native LOS Terminal. While using Automagic with the Execute Root Command action, that works just fine as I checked that the value corresponding to performance_mode is changed, but it doesn't appear to be like that when checking in the settings. So I'm not sure if it works but the UI doesn't update, or it just doesn't work. Though I want to make clear that I tested with global dev_force_show_navbar (as it proved to be pretty obvious when changed, as it forced the device to show or not a navbar, keeping in mind that my device has capacitive navigation buttons), and works just fine. I'm going to find a way to test if it's really not working or I just can't see it, maybe see if it affects the cpu clock speed or similar.
Martin wrote: I've found two interesting issues:
1. There's a bug in the action Set LineageOS System Setting when root is enabled --> fixed in the next EAP build
Oh, I didn't notice that! Tested it and it's true, works just fine with root access disabled, same behaviour as mentioned above though. Great news that's getting fixed! Thanks! :D

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Cannot run Set LineageOS System Setting with root enable

Post by Desmanto » 13 Mar 2019 07:03

@Martin : It works too in RR 7.0.1, based on LOS 16. I really missed out the --lineage explanation when testing the command before. I should pay more attention to the help description.

I can use settings list --lineage system to list out all key value. Somehow, the SQLite db doesn't reflect the value immediately (the db seems contain stored value, not real value), but checking from this list, the value has changed. So change certain value to 1, the db still show 0; but query using list it is already 1 and already reflected by the system (if it can be changed).

Set Cyanogen/LineageOS Profile works properly in RR 7.0.0 - 7.0.1. Only the Set Lineage OS system Setting doesn't work. (which you will fixed in the next version).

I should make thread to request the feature properly, for the init LineageOS system setting and trigger LineageOS system setting changed. Then both init system and init lineageOS system should can init all value too.

@ariloc : That means the perfomance mode is protected by the special API. No way around it except Control UI. Maybe there is extra broadcast in the background while changing the mode. You can try to logcat it during the change, to see if there is any pattern you can spot.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Post Reply