LF0
Member
(For more information on how to install and enable Shizuku, please search for other posts, this post only contains how to use it in Macrodrid)
First, follow the "Use in terminal app" tutorial on the Shizuku homepage
Edit the rish file and change the "PKG" in it to "com.arlosoft.macrodroid"
Make sure macrodroid has access to the folder where the rish and rish_shizuku.dex are located
Now you can run ADB with shizuku permissions in a shell script action in macrodroid
(Don't choose to Use Helper App)
The format that is filled in the shell script action is as follows:
sh rish file location -c "adb"
(Examples:
sh /storage/emulated/0/MacroDroid/rish -c "adb reboot")
When you run this action for the first time in macrodroid, Shizuku will pop up a permission request window
But there is one more question
MacroDroid can't get the output value when use shizuku runs adb
Solution(s):
Edit the rish file again, adding a space and the & character at the end of the last line of code
And add these on a new line:
wait $!
ret=${?#0}
echo "${ret%0}"
Now that macrodroid can get the output value normally, you can choose to save it to the specified string variable in the shell script action
As a little trick, you can create an action block like this, so that you can easily use shizuku in other macros
This may help some people in need, and any doubts about this are welcome to be discuss
First, follow the "Use in terminal app" tutorial on the Shizuku homepage
Edit the rish file and change the "PKG" in it to "com.arlosoft.macrodroid"
Make sure macrodroid has access to the folder where the rish and rish_shizuku.dex are located
Now you can run ADB with shizuku permissions in a shell script action in macrodroid
(Don't choose to Use Helper App)
The format that is filled in the shell script action is as follows:
sh rish file location -c "adb"
(Examples:
sh /storage/emulated/0/MacroDroid/rish -c "adb reboot")
When you run this action for the first time in macrodroid, Shizuku will pop up a permission request window
But there is one more question
MacroDroid can't get the output value when use shizuku runs adb
Solution(s):
Edit the rish file again, adding a space and the & character at the end of the last line of code
And add these on a new line:
wait $!
ret=${?#0}
echo "${ret%0}"
Now that macrodroid can get the output value normally, you can choose to save it to the specified string variable in the shell script action
As a little trick, you can create an action block like this, so that you can easily use shizuku in other macros
This may help some people in need, and any doubts about this are welcome to be discuss