Shizuku implementation

FrameXX

Well-known member
Have you ever heard of app called Shizuku?

In simple terms and as far as I understand it is aimed to provide privilegied access and permission to apps like MacroDroid or similiar and remove the need of manual ADB hacking for every app. There are more andvantages of using Shizuku. More can be read here:


On Android 11 onwards you no longer need computer to start ADB/debugging. You can start it directly from the device. With Shizuku you can start a wireless debugging and only thing you need is Wi-Fi connection. This makes it much more convenient to start Shizuku after every restart and clean app UI and guidiance makes it easy for the user.
MacroDroid could of course firstly use Shizuku to grant itself the permissions it needs, but also could probably use Shizuku running server to access some more Android functions I am unaware of.

Although I doubt you would plan such a implementation in near feature I wanted to make you aware of such an option. I think Shizuku is a nice and functional project (even though not much apps implemented shizuku, but there are some) providing a better user experience when trying to provide privilegied access for user apps.

 
Last edited:

Dimlos

Well-known member
I actually used an app called Hail that supports Shizuku and thought it was interesting.
However, it is a bit troublesome on non-root devices because it is not possible to set Shizuku to start automatically after rebooting.
 

Attachments

  • shizuku.jpg
    shizuku.jpg
    193.4 KB · Views: 18

Dimlos

Well-known member
This may be difficult because simply launching the application does not launch the Shizuku service.
 

FrameXX

Well-known member
Well. The main point here is that MacroDroid only needs to access Shizuku once to grant itself the needed permissions, so it's like an extra option how to grant MacroDroid prvilegied permission, without any PC or other external device. The ability to run shell is just a cherry on top.
 

Dimlos

Well-known member
At this time, MacroDroid does not support Shizuku, so it does not appear on the list.
As for rebooting, we can't do anything without the Shizuku service running, can we?

However, I think it is attractive to be able to grant root access as well as ADB hack.
 

Dimlos

Well-known member
@e.t.l
MacroDroid itself cannot execute adb commands with wireless debugging, so use Termux or LADB.
Just run adb shell sh /sdcard/Android/data/moe.shizuku.privileged.api/start.sh.
 

e.t.l

Member
@e.t.l
MacroDroid itself cannot execute adb commands with wireless debugging, so use Termux or LADB.
Just run adb shell sh /sdcard/Android/data/moe.shizuku.privileged.api/start.sh.
I'm aware of that. But if the solution to every issue was "just do it manually" then none of us would have installed Macrodroid ;)

MD can run adb commands via plug-ins. I'm currently trying to find which one is the most reliable.
 

Dimlos

Well-known member
@e.t.l
ADB Shell [Tasker Plugin] is not an option because it cannot be used immediately after reboot.
LADB is unstable in some areas, so if stability is important to you, I think Termux is the way to go.

I am interested to know which method you use and how you set up your macros and scripts.
 

e.t.l

Member
I thought the Termux:Tasker plugin would work well, but I'm having difficulty with it. I think I'm not configuring it right. Would appreciate any help or examples of working configurations for the plugin
 

Dimlos

Well-known member
@e.t.l
Unlike MacroDroid, Termux and Termux:Tasker are more challenging because they cannot be operated via GUI.

Here is a link to a thread that explains Termux, which may be helpful.
 

yeedatoy

New member
Dhizuku runs like shizuku but as a device manager so it starts on boot. Hail supports it. Regarding Shizuku running on boot you can use Automate. There is an automation that starts wireless debugging and shizuku on boot so apps such as rootless jamesDSP will always run
 

e.t.l

Member
@Dimlos so far I have paired Tasker via ADB wireless and can launch adb (and therefore start.sh) from MD using the Tasker:Termux app. MD is also capable of enabling Wireless Debug (assuming the device is connected to an Allowed network). I'm stuck right now because for some reason, Termux does not connect automatically to ADB. Every time I launch Termux, I have to run adb connect [localhost_IP]:[port], and that's a problem because the port number is randomized every time Wireless Debug is toggled. Other apps like ADB seem to remember the connection and do not need to reconnect with the port number each time it's launched (or at least, they're able to query the port number programmatically), but I don't know HOW they do that.
 

e.t.l

Member
Dhizuku runs like shizuku but as a device manager so it starts on boot.
Seems interesting. What does it actually DO, though? It's a little unclear from the repo. Does it do all of Shizuku's functions, AND act as device owner? What added benefit is there to be able to letting other apps act as device owner? What is a use case for this?
 

Endercraft

Moderator (& bug finder :D)
Other apps like ADB seem to remember the connection and do not need to reconnect with the port number each time it's launched (or at least, they're able to query the port number programmatically), but I don't know HOW they do that.
Either they use Logcat to get the port of they run adb tcpip (port, probably 5555) which lets you connect to adb using the same port even if you're disconnected from network.
 

e.t.l

Member
Either they use Logcat to get the port of they run adb tcpip
Oh yeah it's probably tcpip. I tried that and adb connect [localhost_IP]:5555 returned "device already connected", but when I ran adb devices it showed the localhost... as "Offline". So now I'm stuck here - can't figure out how to make the phone appear online to Termux even after it's connected :/
 

Dimlos

Well-known member
I think that there is nothing difficult, but it is recognized normally.
 

Attachments

  • Termux.jpg
    Termux.jpg
    431.3 KB · Views: 10
Top