Detecting presence of ADB Hack in macro

Ray_Johnson

New member
Hi all,

I would like to add functionality in my macro to detect if the ADB Hack is unstalled or not.
If ADB is not installed, I would like to show a message or notification when the macro is run.

What would be the simplest way to have a macro detect if the ADB Hack is installed or not?
 

Ray_Johnson

New member
If a MacroDroid command that requires the ADB Hack to be installed in order to function, is executed, but the ADB Hack is not installed, what happens then? Is the command simply ignored, or is an error message given?

If the command is simply ignored, I could use a command such as 'turn GPS on'. Then check if the GPS is indeed turned on. If it is, ADB Hack is installed, if the command did not function, ADB Hack is NOT installed .... But this would only work if MD does not choke on the command with an error message ....
 

Snurre

Well-known member
When you create a macro it's clearly highlighted that it needs root/adb hack, if you use it anyway the action will be ignored
You can see it in the log
You can also try this to check what's granted

adb shell dumpsys package com.arlosoft.macrodroid | grep permission

I don't think it can be invoked in a macro
 

Ray_Johnson

New member
When you create a macro it's clearly highlighted that it needs root/adb hack, if you use it anyway the action will be ignored
You can see it in the log
You can also try this to check what's granted

adb shell dumpsys package com.arlosoft.macrodroid | grep permission

I don't think it can be invoked in a macro
Yes, I noticed the remark in MD for every command that needs root or hack.
What I didn't know was, if you use such a command anyway, will MD fail with an error (if ADB is not installed) or will it simply ignore the command. If the command is ignored, as you say, that is not so bad.
I put in a feature request for a 'ADB Hack installed' check, but I noticed there is still so much on the MD wishlist .....
Thanks for your reply!
 

Snurre

Well-known member
Try to create a little test macro with one of the actions that require root/adb and an action like play a beep or something, when you run or test it will just beep
Then take look in the log
 

Ray_Johnson

New member
Try to create a little test macro with one of the actions that require root/adb and an action like play a beep or something, when you run or test it will just beep
Then take look in the log
Yes, but I have the hack installed now ... I would have to turn it off / uninstall it, in order to test this ....
 

Ray_Johnson

New member
Yea ok 😊
I have another phone without adb hack and it looks like this
That said .... If MD can notice that ADB Hack is not installed ... it basically already has a 'ADB Hack Installed' check internally .... So probably not much work to turn this into a regular MD command ... ;)
 
Top