[Question] Can I invert ambient display with Tasker? - Tasker Tips & Tricks

Hi, all. I have my phone set up using Substratum to switch to a dark theme at night. My ROM has the option to invert the color of notifications on the lock screen for dark/light themes. I'm guessing it's possible to do this with a shell command since it is a setting that can be toggled in my rom's UI. Does anyone know how I can automate this process with Tasker?

There is a command: settings
There are 3 types of settings: system, secure, global
To find the setting you are looking for, in a rooted terminal use: settings list <type>
To change it, in a rooted terminal or Run Shell action in Tasker (with use root checked), use: settings put <type> <setting> <value>
Only 'system' settings can be changed without root, and that requires a special procedure. I can tell you how, if you don't have root.

Vagelis1608 said:
There is a command: settings
There are 3 types of settings: system, secure, global
To find the setting you are looking for, in a rooted terminal use: settings list <type>
To change it, in a rooted terminal or Run Shell action in Tasker (with use root checked), use: settings put <type> <setting> <value>
Only 'system' settings can be changed without root, and that requires a special procedure. I can tell you how, if you don't have root.
Click to expand...
Click to collapse
I am rooted, thanks. I'll try this out later and let you know. Thank you so much!

Vagelis1608 said:
There is a command: settings
There are 3 types of settings: system, secure, global
To find the setting you are looking for, in a rooted terminal use: settings list <type>
To change it, in a rooted terminal or Run Shell action in Tasker (with use root checked), use: settings put <type> <setting> <value>
Only 'system' settings can be changed without root, and that requires a special procedure. I can tell you how, if you don't have root.
Click to expand...
Click to collapse
I just want to say thank you so much! You opened up a whole new world for me as far as Tasker goes!

Related

Trying to use Tasker Secure Settings to disable volume warning on Samsung S5.

Trying to use Secure Tools to disable volume warning Samsung S5 running Marshmallow. I installed everything and ran adb command. No error, but when I search for Secure Tools it says Not Installed. Then I read this doesn't work on Marshmallow?
My phone is NOT rooted. Any help would be much appreciated.
Thanks - Frankie
Frankie-o said:
Trying to use Secure Tools to disable volume warning Samsung S5 running Marshmallow. I installed everything and ran adb command. No error, but when I search for Secure Tools it says Not Installed. Then I read this doesn't work on Marshmallow?
My phone is NOT rooted. Any help would be much appreciated.
Thanks - Frankie
Click to expand...
Click to collapse
I'm confused. What app are you referring to? "AutoTool's secure settings" or the app "Secure settings" or something else that I'm missing?
TASKER and AUTO TOOLS
I guess I forgot to mention that I'm user Tasker to do this... Thank you.
Be very specific what you are using and what you are trying.
Trying to disable high volume warning on Samsung S5
Using Tasker Auto Tools to run a command on my phone that will allow me to override the Volume High Warning on the Samsung S5 phone. It's supposed to enable WRITE SECURE SETTINGS with this command - and the command runs fine but it's not working for me. But when I go back to the app and look for Secure Settings, it's not there.
adb shell pm grant com.joaomgcd.autotools android.permission.WRITE_SECURE_SETTINGS
Auto tools is a plugin to tasker.
The "adb shell pm grant com.joaomgcd.autotools android.permission.WRITE_SECURE_SETTINGS" is one of two steps required to give the type of system level OS access this tool needs. The first thing that should be done is to enable "allow modify system settings" for AutoTools.
From the AutoTools Secure Settings page:
To use this, AutoTools needs to be granted permission to change secure settings on your device
If you're on Android 6 or above click here to grant AutoTools the first Settings permission
Then follow these steps to grant AutoTools the Secure Settings permission:
Enable Developer Mode: Go to Android Settings -> About Phone and look for the Build Number option. Touch it multiple times until developer mode is enabled.
Enable USB Debugging: Go to Android Settings -> and look for the Developer Options option. In there, enable the USB debugging option.
Install ADB on your PC: Check here for a quick way to do it.
Connect device to PC: Connect your device to a PC and look on your phone. A prompt should show up asking you to allow your phone to be debugged by your PC. Accept this.
Grant permission: Open a command line on your PC and write
adb shell pm grant com.joaomgcd.autotools android.permission.WRITE_SECURE_SETTINGS
Congratulations, AutoTools should now be able to use the "Secure Settings" action!
Click to expand...
Click to collapse
Once those things are done ( I typically reboot for no good reason ☺ ), then go to tasker, add an action in a task, then: plugin -> Auto tools -> secure settings (scroll down the list) you'll end up in a screen where you can configure the AutoTools secure settings action.
WOW! I think I did it.. I just hope I can do it again - this was my "test" phone. I think I was messed up by doing the "search" for secure settings because it said it wasn't installed.. Yet I had looked for the secure settings option and didn't find before - although I had already done all the steps. Somehow I got on to a screen that said the app (I forget the exact words) didn't have permission to change the settings, and to press NO if I wanted to allow the permissions - and I pressed no! I had already created the task to disable the warning - but it's been so long, I'm not sure how I did that - but the bottom line is I think it's working.. I had found several sites that said this wouldn't work with Marshmallow unless the phone was rooted, and my phones are not rooted.. so that makes me skeptical, but I did a reboot, and the warning didn't come back. Thanks a ton for your help.. Let's hope I can re-create on the phone that really needs it.
In case this is found by someone else, many of those "how to use secure settings" posts from lollipop and marshmallow predate the (awareness of the) approach used by AutoTools. People spent a lot of effort trying to force an unsupported, outdated app (the original secure settings) to work in a systemless root environment.
I'm sad to say this did NOT work on my test phone.. It looked like it did, but it didn't.

[HOW-TO] Reset and restore quick setting to default

This is damn useful after doing dirty rom flashes.
I mean normally after you flash a rom without doing wipe, you might miss out new quick setting(wifi, bluetooth, data toggles on swiping down top screen to see notification)
adb shell settings put secure sysui_qs_tiles default
originally found here https://plus.google.com/+KieronQuinn/posts/3ZUzZhGa83s
can confirm this still works on 2020! i'm using miui on redmi note 8 and have no "edit" quick tiles, using this command i can bring back those missing quick tiles. thanks!
Yes thanks this worked for me in 2020 for Xiaomi Mi 10 Pro that was missing the quick setting toggle choices/second page and the edit toggles facility.
ninekaw9 said:
This is damn useful after doing dirty rom flashes.
I mean normally after you flash a rom without doing wipe, you might miss out new quick setting(wifi, bluetooth, data toggles on swiping down top screen to see notification)
adb shell settings put secure sysui_qs_tiles default
originally found here https://plus.google.com/+KieronQuinn/posts/3ZUzZhGa83s
Click to expand...
Click to collapse
I have the same problem: no second page, no edit button for quick toggles.
Unfortunately, the suggested solution with the adb command does not work for me because of some security issu:
Code:
adb shell settings put secure sysui_qs_tiles default
Security exception: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS
java.lang.SecurityException: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS
at com.android.providers.settings.SettingsProvider.enforceWritePermission(SettingsProvider.java:2050)
at com.android.providers.settings.SettingsProvider.mutateSecureSetting(SettingsProvider.java:1570)
at com.android.providers.settings.SettingsProvider.insertSecureSetting(SettingsProvider.java:1530)
at com.android.providers.settings.SettingsProvider.call(SettingsProvider.java:437)
at android.content.ContentProvider.call(ContentProvider.java:2161)
at android.content.ContentProvider$Transport.call(ContentProvider.java:477)
at com.android.providers.settings.SettingsService$MyShellCommand.putForUser(SettingsService.java:375)
at com.android.providers.settings.SettingsService$MyShellCommand.onCommand(SettingsService.java:277)
at android.os.ShellCommand.exec(ShellCommand.java:104)
at com.android.providers.settings.SettingsService.onShellCommand(SettingsService.java:49)
at android.os.Binder.shellCommand(Binder.java:881)
at android.os.Binder.onTransact(Binder.java:765)
at android.os.Binder.execTransactInternal(Binder.java:1021)
at android.os.Binder.execTransact(Binder.java:994)
Any suggestions on how I can make that work?
Edit: My phone is Xiaomi Mi 9T with global ROM, all updates installed.
Solution: "USB debugging (Security settings)" must also be activated. This requires a Mi-Account for the Xiaomi cloud the be entered in the phone settings.
After that, the adb command has worked and has solved the problem:
Code:
adb shell settings put secure sysui_qs_tiles default
Now I have a second page in the quick toggles and I can edit them. (I did not need to reboot the phone.)

Hide Quick Settings on Lock Screen

I did some research and found a way to make the quick settings tiles disappear on the lock screen. Note that your device needs to be rooted using either SuperSu or Magisk.
The first thing you have to do is download Tasker.
On the Tasker app, make a new profile
Event --> Display --> Display Off
Now make a task, we will name this task "Hide Tiles"
New Task --> Code --> Run Shell
‎Now important, if you're rooted with SuperSu then use the first code, if you're rooted with Magisk then use the second one.
‎First code is (without quotes): "settings put secure sysui_qs_tiles 0"
‎Second code is (WITH quotes): /sbin/su -c "settings put secure sysui_qs_tiles 0"
This is the profile that will hide the tiles when the phone is locked, now we need a profile where it shows them after the password/fingerprint is used on the phone.
Go ahead and create a new profile
Event --> Display --> Display Unlocked
Now make a task, we will name it "Show Tiles"
(SuperSu uses the first code, Magisk uses the second one)
‎New Task --> Code --> Run Shell
‎First code (without quotes): "settings put secure sysui_qs_tiles wifi,cell,location,dnd,rotation,bt,battery,flashlight,hotspot,airplane,inversion,saver,cast"
‎(From the screenshot you will learn which name refers to which tile, you can then add/remove/reorder them however you want)
Second code (WITH quotes): /sbin/su -c "settings put secure sysui_qs_tiles wifi,cell,location,dnd,rotation,bt,battery,flashlight,hotspot,airplane,inversion,saver,cast"
If these codes don't work with Tasker, you can use them in Secure Settings but instead of (New Task --> Code --> Run Shell) you have to do (New Task --> Plugin --> Secure Settings --> Configuration --> Action --> Run Command)
The code you'll have to use is the one we used for Supersu (it will work for both Magisk and SuperSu users) but make sure you check the USE ROOT box)
I have tried this on a Nexus 5X running Oreo 8.1 OPM3 and it works every single time.
Let me know if you have tried this on your phone so we'd know which devices it works on. Thank you!
nice, but too bad it crashes on miui based roms
Worked with Secure Settings an Oneplus 3t, Skydragon-Rom.
Thank you! :good:
There are some Quicksettings i don't know the name to let it show after unlock. Can anybody help me?
The tiles from the first picture would be great to know the correct name.
This is very interesting, thanks for the question.

System UI Tuner

Hi
Can anyone help - I want to access the System UI tuner on P20 pro, to remove icons like Bluetooth and NFC from the status bar.
I found a tutorial (link below) which gives me access to the System UI menu - however the options don't seem to have any effect and there is no option to turn off the NFC icon - can anyone help?
https://www.youtube.com/watch?v=gm8PEYKrjrw
This was so easy on my Oneplus.....not sure why Huawei make it so difficult!
Thanks
Don't bother with the tuner. Simply use adb:
adb shell settings put secure icon_blacklist nfc,bluetooth ... then reboot.
Or if you're rooted, just... settings put secure icon_blacklist nfc,bluetooth in a terminal emulator on the phone, then reboot
Full guide here... https://forum.xda-developers.com/htc-10/how-to/remove-nfc-icon-root-adb-t3507739 It's for the HTC10, but works for the P20 Pro
Thanks however I don't have access to a desktop. Only my phone or an iPad
colthekid said:
Don't bother with the tuner. Simply use adb:
adb shell settings put secure icon_blacklist nfc,bluetooth ... then reboot.
Or if you're rooted, just... settings put secure icon_blacklist nfc,bluetooth in a terminal emulator on the phone, then reboot
Full guide here... https://forum.xda-developers.com/htc-10/how-to/remove-nfc-icon-root-adb-t3507739 It's for the HTC10, but works for the P20 Pro
Click to expand...
Click to collapse
rob2005 said:
Thanks however I don't have access to a desktop. Only my phone or an iPad
Click to expand...
Click to collapse
Not possible without either root or adb AFAIK.
The inbuilt System UI Tuner (Demo Mode) doesn't work properly for me either and, as you said, doesn't have NFC as an option anyway.

Is there an ADB command for no root to swap back and recent on the navbar?

Hello all, I'm used to having my back on the right and recents on the left on the nav bar but for some reason Amazon won't let me swap them in the settings. So I tried to the ADB commands
adb shell settings put secure sysui_nav_bar "STRING"
And
adb shell settings put secure sysui_nav_bar "space,recent;home;back,space"
But the second command gave me an error and it didn't work. Is there something I'm missing or is rooting my only option?
SoapyTaco said:
Hello all, I'm used to having my back on the right and recents on the left on the nav bar but for some reason Amazon won't let me swap them in the settings. So I tried to the ADB commands
adb shell settings put secure sysui_nav_bar "STRING"
And
adb shell settings put secure sysui_nav_bar "space,recent;home;back,space"
But the second command gave me an error and it didn't work. Is there something I'm missing or is rooting my only option?
Click to expand...
Click to collapse
Even with root swapping back/recents is not easy (reliable) in the absence of a custom ROM or Xposed Framework + GravityBox or similar tool.
Davey126 said:
Even with root swapping back/recents is not easy (reliable) in the absence of a custom ROM or Xposed Framework + GravityBox or similar tool.
Click to expand...
Click to collapse
Ah, I see. I guess I can root and install Xposed and try it that way. Bit silly that something so basic isn't just included, I really hate FireOS.
SoapyTaco said:
Ah, I see. I guess I can root and install Xposed and try it that way. Bit silly that something so basic isn't just included, I really hate FireOS.
Click to expand...
Click to collapse
Key swapping isn't an option on most stock ROMs. Xposed likely won't load/run well with FireOS v5 not to mention the challenges of installing via FlashFire in absence of a custom recovery. You best option is to go with a custom ROM augmented with Xposed. Still requires root which can only be achieved with on 5th gen devices running FireOS 5.3.1 or lower.

Categories

Resources