Trying to use Shizuku with MacroDroid

Golem64

Member
Hello, as the title suggests I'm trying to use Shizuku with MacroDroid using the script shell action.

Everything is setup for : Shizuku is activated properly, i have stored the rish_shizuku.dex somewhere i know.

The problem is that Everytime I try to execute it, it returns me
Aborted

I tried to change the delay to 10 minutes but doesn't change anything. I also tried to use the MacroDroid helper but it's just stuck for 10 minutes and then it abort.

Can someone please help me ? Here is the code i use :
[ -z "$RISH_APPLICATION_ID" ] && export RISH_APPLICATION_ID=com.arlosoft.macrodroid /system/bin/app_process -Djava.class.path="/storage/emulated/0/Macrodroid/rish_shizuku.dex" /system/bin --nice-name=rish rikka.shizuku.shell.ShizukuShellLoader "$@"
And with the helper, you just add .helper at the end of the RISH_APPLICATION_ID otherwise it returns an error that this is not the right application.

Btw : yes i use the code from the rish file, i can't execute it directly due to storage limitations with android 11. And if i try with the helper, it just crashes and restart.
 

tanutanu

Well-known member
Hello, as the title suggests I'm trying to use Shizuku with MacroDroid using the script shell action.

Everything is setup for : Shizuku is activated properly, i have stored the rish_shizuku.dex somewhere i know.

The problem is that Everytime I try to execute it, it returns me
Aborted

I tried to change the delay to 10 minutes but doesn't change anything. I also tried to use the MacroDroid helper but it's just stuck for 10 minutes and then it abort.

Can someone please help me ? Here is the code i use :
[ -z "$RISH_APPLICATION_ID" ] && export RISH_APPLICATION_ID=com.arlosoft.macrodroid /system/bin/app_process -Djava.class.path="/storage/emulated/0/Macrodroid/rish_shizuku.dex" /system/bin --nice-name=rish rikka.shizuku.shell.ShizukuShellLoader "$@"
And with the helper, you just add .helper at the end of the RISH_APPLICATION_ID otherwise it returns an error that this is not the right application.

Btw : yes i use the code from the rish file, i can't execute it directly due to storage limitations with android 11. And if i try with the helper, it just crashes and restart.
It should be one liner with ";" if it contains 2 or more. MD shell script action can handle single statement.
And I don't think it can access /system/bin if not rooted:unsure:
 

Golem64

Member
It should be one liner with ";" if it contains 2 or more. MD shell script action can handle single statement.
And I don't think it can access /system/bin if not rooted:unsure:
The ; doesn't change anything, it's still Aborted. And i think it can access /system/bin bc Termux can execute this line of code without any problems. I don't see why Termux could do it but not MacroDroid
 

Golem64

Member
Also, i noticed that it doesn't even output an error when i change the RISH_APPLICATION_ID with another app when not using the helper, it simply days aborted. So there is something that MacroDroid can't handle and make it stop the process
 

tanutanu

Well-known member
The ; doesn't change anything, it's still Aborted. And i think it can access /system/bin bc Termux can execute this line of code without any problems. I don't see why Termux could do it but not MacroDroid
MD shell is completely same as Toybox mksh, so It is different than bash on Termux(has own binary executables internally and virtual paths). If your script is working in very ordinary terminal emulator such as jackpal.androidterm, it works on MD action as well.
 

Golem64

Member
MD shell is completely same as Toybox mksh, so It is different than bash on Termux(has own binary executables internally and virtual paths). If your script is working in very ordinary terminal emulator such as jackpal.androidterm, it works on MD action as well.
And that's the problem : it works on jackpal.androidterm but not on MacroDroid, i just tried
 

tanutanu

Well-known member
And that's the problem : it works on jackpal.androidterm but not on MacroDroid, i just tried
Gotcha. Yes, seems to be an issue I had never experienced:unsure:
Can you show me the output(stdout & stderr naturally) on the emulator console?
How long do you estimate to process something in the external Shizuku app?
 

Golem64

Member
Gotcha. Yes, seems to be an issue I had never experienced:unsure:
Can you show me the output(stdout & stderr naturally) on the emulator console?
How long do you estimate to process something in the external Shizuku app?
Here's what I did on androidterm. Shizuku takes about 5 seconds to respond and show the little windows asking if we allow the app to access Shizuku
 

Attachments

  • Screenshot_2022-01-21-13-19-08-959_jackpal.androidterm.jpg
    Screenshot_2022-01-21-13-19-08-959_jackpal.androidterm.jpg
    87.2 KB · Views: 16
  • Screenshot_2022-01-21-13-19-56-487_moe.shizuku.privileged.api.jpg
    Screenshot_2022-01-21-13-19-56-487_moe.shizuku.privileged.api.jpg
    173.8 KB · Views: 16
  • Screenshot_2022-01-21-13-20-04-887_jackpal.androidterm.jpg
    Screenshot_2022-01-21-13-20-04-887_jackpal.androidterm.jpg
    118.7 KB · Views: 14

tanutanu

Well-known member
Here's what I did on androidterm. Shizuku takes about 5 seconds to respond and show the little windows asking if we allow the app to access Shizuku
Thanks.
I'm not sure Shizuku can grant the access permission to MD. I don't think it can do in consoleless MD action. Do you have similar property Termux offers in MD app info? Otherwise ADB shell pm grant has possibility to invoke the required permission.
And the screen doesn't show post permitted and still unknown how long it need to process what you really want.
 

Attachments

  • IMG_20220121_213354.jpg
    IMG_20220121_213354.jpg
    77.5 KB · Views: 11

Golem64

Member
Thanks.
I'm not sure Shizuku can grant the access permission to MD. I don't think it can do in consoleless MD action. Do you have similar property Termux offers in MD app info? Otherwise ADB shell pm grant has possibility to invoke the required permission.
And the screen doesn't show post permitted and still unknown how long it need to process what you really want.
The problem is that the permission only appear if it is declared in the app. And a simple grant will not work because Macrodroid has not requested the permission. Although, that where the rish comes in where it can grant the permission to apps that haven't asked first, for example with Termux and androidterm. And that's also what I'm trying to do with Macrodroid
 
Last edited:

szk2022

New member
I tried

- use MD to run rish command directly
- use MD-Helper to run command
- use Termux:Tasker and Termux app to run rish

They are all not working
 

Golem64

Member
I tried

- use MD to run rish command directly
- use MD-Helper to run command
- use Termux:Tasker and Termux app to run rish

They are all not working
Yep I noticed that, i also tried to execute using a .wav extension since MacroDroid is restricted to media files (and it still works in Androidterm even with the wav extension) but it didn't worked either
 
Top