Access MacroDroid's data directory

Endercraft

Moderator (& bug finder :D)
So one day I think to myself: "If MacroDroid can't access the storage because it doesn't have the all files permission, then it's the one that runs the shell script. But MacroDroid is the owner of the /data/data/com.arlosoft.macrodroid directory.. So we can access it with the shell script."
I forgot to test it out, but yesterday in the middle of the night at 2:45AM I just suddenly remembered and tried it out. And it worked
!
I tried to run chmod 777 to access from Termux but it didn't work (presumably because Termux doesn't have execute access to /data/data) however I've seen apps bypass that using some unknown tricks which lets me access their data from Termux.

I looked at MacroDroid's files folder and I discovered that for some reason when you export macros/action blocks/categories they don't get deleted afterwards? One of the attached macros solves this.

Now you don't need the user to export a backup to modify macros, you can do it using macros.json. Which would also let you delete that file but I'm pretty sure it gets recreated within an instant if MacroDroid is still active and a macro updates a variable for example.

Another attached macro lets you explore the folder yourself (I tried with the helper's directory but it only contains a settings file and the Xiaomi helper apk).
 

Attachments

  • Clean_files.macro
    999 bytes · Views: 9
  • Simple_Data_Explorer.macro
    33 KB · Views: 12

Endercraft

Moderator (& bug finder :D)
I can open both on v5.38.8
I don't think the macro scheme has changed but who knows. I'll check
Edit: I don't see any problem. There is a 00 byte to act as a separator but that doesn't seem to cause any problems.
 
Top