Hello people.
First, I must apologize for my bad English. I speak and write not often in English.
So now back to the topic.
I have searched for a way to Stamina mode also be able to control via script, so you can use it for example in combination with Tasker.
Now I have found the solution and wanted to share with you.
The script is just an example of how to use it and can of course be reprogrammed.
The prerequisite is your Smartphone must be rooted.
Script:
First, I must apologize for my bad English. I speak and write not often in English.
So now back to the topic.
I have searched for a way to Stamina mode also be able to control via script, so you can use it for example in combination with Tasker.
Now I have found the solution and wanted to share with you.
The script is just an example of how to use it and can of course be reprogrammed.
The prerequisite is your Smartphone must be rooted.
Script:
#!/system/bin/sh
if [ "$USER" != "root" ]; then
su - root -s "$0" && exit;
elif [ "$(content query --uri content://com.sonymobile.superstamina.xperiapowerservice.provider/xssm/enabled --projection name=enabled --where "name='0'")" == "Row: 0 enabled=false" ]; then
content update --uri content://com.sonymobile.superstamina.xperiapowerservice.provider/xssm/enabled --bind enabled:b:true --where "name='0'";
else
content update --uri content://com.sonymobile.superstamina.xperiapowerservice.provider/xssm/enabled --bind enabled:b:false --where "name='0'";
fi;