Guide: Restoring macros if MacroDroid is inaccessible

Endercraft

Moderator (& bug finder :D)
I have created this thread so that users can restore their macros if MacroDroid is inaccessible for some reason.

ROOT (macros.json) : If you are rooted, this is very easy (I still recommend to try other methods, but if you don't have auto backups, this is the way to go). Go to /data/data/com.arlosoft.macrodroid/files and copy out the macros.json file.
Then try the other methods mentioned here. If they don't work, uninstall/clear all data of MacroDroid. Then install/open MacroDroid and disable it (very important if you got a badly made macro). Then kill MacroDroid in the app's settings (to make sure that nothing goes wrong) and make sure it is not running in background. Then access /data/data/com.arlosoft.macrodroid/files again and replace the macros.json file with the one you copied earlier.
Note that this will only restore the macros and not all other settings, unlike with normal backups.

NOT ROOTED:
There are several ways to restore your macros if you are not rooted.

AUTO BACKUP

If you have auto backups enabled (which is recommended), you are able to restore your macros without accessing MacroDroid.

Local backup: Use a file manager that can access Android/data (I use ZArchiver which uses a workaround to access the directory). Once you are in this directory, search for "com.arlosoft.macrodroid", then go to files/MacroDroid/Autobackup. There you can find your backups.

Cloud backup : If you have the pro version of MacroDroid and are logged in with an account (with auto backups enabled), you can safely uninstall MacroDroid. Then, you can reinstall it back, disable it (especially if you have got a bad macro, that you can delete/disable), log into your account at the autobackup section and all your cloud backups should appear (I recommend also doing the previous method with local backups before uninstalling MacroDroid first just in case something goes wrong). You can then restore your macros by clicking on the latest backup.


Quick Setting Tile
There is a quick settings tile that allows you to enable/disable MacroDroid outside the app. It will only work if MacroDroid is working for at least a few seconds. Here are the steps to follow.

  1. Open the quick settings tile section of the status bar.
  2. Add a new tile called "Enable/Disable" with a MacroDroid icon.
  3. If the app only crashes when you open it, click this tile to disable MacroDroid. Otherwise, start MacroDroid and quickly click the tile.

If you do not have auto backups and are (not) rooted, you can try these methods:
  • Boot into safe mode (Google how to do this on your device) or quickly open MacroDroid once your device has booted and disable it.
  • Try opening the app directly (not from a shortcut).
  • If you really don't want to lose your data, contact the developer at support@macrodroid.com and he may create a fix for your problem. Then wait for an update.

Reinstalling MacroDroid with all data using adb (experimental)

I've written a script that will uninstall and reinstall MacroDroid again without losing any data.
This should help in cases where MacroDroid is broken after a system update but as written this is experimental and we don't know if it actually works. It comes in 2 different versions (depending on your OS).
You'll need to establish an adb connection to your device where you run adb commands.
The scripts are attached to this post, the file to run is called 'script.bat/sh'.

What to do to avoid losing your macros

There are 2 main actions you can take to keep your macros safe :

  1. Turn on auto backup issue in MacroDroid's auto backup section.
  2. Create/install a macro that will automatically disable MacroDroid on startup (great for macros gone wrong). You can use this macro : https://www.macrodroidlink.com/macrostore?id=16975
One detail about the above macro is that it can delete all your macros if MacroDroid crashes in quick succession. I have no idea how.

IMPORTANT NOTE:
If you see this thread before updating to a new OS version or doing a system update (especially on Samsung), make sure you backup your macros as updating to a new version often breaks MacroDroid!

If you have any questions feel free to ask and reply to this thread.
 

Attachments

  • MD_reinstall.zip
    2.9 MB · Views: 12
Last edited:

Nonhocapito

New member
One of my macros causes strange issues to MD. When I try to open/edit it (not run it) the app hangs and the whole phone goes dark and inoperable for a few seconds (the app crashes).
I have previous manual backups that include earlier states of this macro. I want to overwrite it, but without overwriting all the other ones. Is it possible?
 

Endercraft

Moderator (& bug finder :D)
One of my macros causes strange issues to MD. When I try to open/edit it (not run it) the app hangs and the whole phone goes dark and inoperable for a few seconds (the app crashes).
I have previous manual backups that include earlier states of this macro. I want to overwrite it, but without overwriting all the other ones. Is it possible?
You mean removing it from the backup ? It is possible, but you have to give me your backup file and it has to have less than let's say 300 macros.
If you mean removing it directly, I'm afraid you will need to use root (and in this case let me access the macros.json file). +
Alternatively,
Contact the developer at support@macrodroid.com and he may create a fix for your issue. Then wait for an update.
 

Nonhocapito

New member
You mean removing it from the backup ? It is possible, but you have to give me your backup file and it has to have less than let's say 300 macros.
If you mean removing it directly, I'm afraid you will need to use root (and in this case let me access the macros.json file). +
Alternatively,
Thank you, but I am not sure I want to share all of my macros, which are designed for private use.

I looked into the backup files and, with a bit of guidance, I think I could find the part where the macro in question begins and ends, extract that part, and import it.

Could you maybe give some details on how to read that backup file, how to find the beginning and end of a given macro, perhaps also how to beautify it?
 

Endercraft

Moderator (& bug finder :D)
Thank you, but I am not sure I want to share all of my macros, which are designed for private use.

I looked into the backup files and, with a bit of guidance, I think I could find the part where the macro in question begins and ends, extract that part, and import it.

Could you maybe give some details on how to read that backup file, how to find the beginning and end of a given macro, perhaps also how to beautify it?
I'm currently making a macro to inspect backups easily, but if it has too many macros I'm afraid you can't do anything to do that unless you got some PC/laptop to handle it.
 
Had to start from scratch 3 times before when MacroDroid would crash upon opening so this is my way to combat that, now I don't have to worry about losing everything and at the same time I have multiple versions.
Screenshot_20230411_184130_MacroDroid.png
 
Talking about MacroDroid crashing, what's has made it crash the most recently for me.. is the export macros function.
I'm still not too sure why it was happening to me but I think it was either because I enabled all the adb permissions or it was something to do with the export and how it would ask permission to store the files in the folder but it would get revoked after awhile, probably made a post about it but it hasn't happened again so far.
 

ruzgar6467

New member
I have created this thread so that users can restore their macros if MacroDroid is inaccessible for some reason.

ROOT (macros.json) : If you are rooted, this is very easy (I still recommend to try other methods, but if you don't have auto backups, this is the way to go). Go to /data/data/com.arlosoft.macrodroid/files and copy out the macros.json file.
Then try the other methods mentioned here. If they don't work, uninstall/clear all data of MacroDroid. Then install/open MacroDroid and disable it (very important if you got a badly made macro). Then kill MacroDroid in the app's settings (to make sure that nothing goes wrong) and make sure it is not running in background. Then access /data/data/com.arlosoft.macrodroid/files again and replace the macros.json file with the one you copied earlier.
Note that this will only restore the macros and not all other settings, unlike with normal backups.

NOT ROOTED:
There are several ways to restore your macros if you are not rooted.

AUTO BACKUP

If you have auto backups enabled (which is recommended), you are able to restore your macros without accessing MacroDroid.

Local backup: Use a file manager that can access Android/data (I use ZArchiver which uses a workaround to access the directory). Once you are in this directory, search for "com.arlosoft.macrodroid", then go to files/MacroDroid/Autobackup. There you can find your backups.

Cloud backup : If you have the pro version of MacroDroid and are logged in with an account (with auto backups enabled), you can safely uninstall MacroDroid. Then, you can reinstall it back, disable it (especially if you have got a bad macro, that you can delete/disable), log into your account at the autobackup section and all your cloud backups should appear (I recommend also doing the previous method with local backups before uninstalling MacroDroid first just in case something goes wrong). You can then restore your macros by clicking on the latest backup.


Quick Setting Tile
There is a quick settings tile that allows you to enable/disable MacroDroid outside the app. It will only work if MacroDroid is working for at least a few seconds. Here are the steps to follow.

  1. Open the quick settings tile section of the status bar.
  2. Add a new tile called "Enable/Disable" with a MacroDroid icon.
  3. If the app only crashes when you open it, click this tile to disable MacroDroid. Otherwise, start MacroDroid and quickly click the tile.

If you do not have auto backups and are (not) rooted, you can try these methods:
  • Boot into safe mode (Google how to do this on your device) or quickly open MacroDroid once your device has booted and disable it.
  • Try opening the app directly (not from a shortcut).
  • If you really don't want to lose your data, contact the developer at support@macrodroid.com and he may create a fix for your problem. Then wait for an update.

Reinstalling MacroDroid with all data using adb (experimental)

I've written a script that will uninstall and reinstall MacroDroid again without losing any data.
This should help in cases where MacroDroid is broken after a system update but as written this is experimental and we don't know if it actually works. It comes in 2 different versions (depending on your OS).
You'll need to establish an adb connection to your device where you run adb commands.
The scripts are attached to this post, the file to run is called 'script.bat/sh'.

What to do to avoid losing your macros

There are 2 main actions you can take to keep your macros safe :

  1. Turn on auto backup issue in MacroDroid's auto backup section.
  2. Create/install a macro that will automatically disable MacroDroid on startup (great for macros gone wrong). You can use this macro : https://www.macrodroidlink.com/macrostore?id=16975
One detail about the above macro is that it can delete all your macros if MacroDroid crashes in quick succession. I have no idea how.

IMPORTANT NOTE:
If you see this thread before updating to a new OS version or doing a system update (especially on Samsung), make sure you backup your macros as updating to a new version often breaks MacroDroid!

If you have any questions feel free to ask and reply to this thread.
Can i do it without opening in safe mode?
 

ruzgar6467

New member
Which step ? Safe mode is a last method in case all others don't work.
If you do not have auto backups and are (not) rooted, you can try these methods:
  • Boot into safe mode (Google how to do this on your device) or quickly open MacroDroid once your device has booted and disable it.
  • Try opening the app directly (not from a shortcut).
  • If you really don't want to lose your data, contact the developer at support@macrodroid.com and he may create a fix for your problem. Then wait for an update.
this method

you know, i talked to you before, because of some macro my macrodroid doesnt open

if i lose my macrodroid data, my macrodroid premium is losed too

macrodroid is my phone life, i love macrodroid, please save my macros 💖
 

ruzgar6467

New member
If you do not have auto backups and are (not) rooted, you can try these methods:
  • Boot into safe mode (Google how to do this on your device) or quickly open MacroDroid once your device has booted and disable it.
  • Try opening the app directly (not from a shortcut).
  • If you really don't want to lose your data, contact the developer at support@macrodroid.com and he may create a fix for your problem. Then wait for an update.
this method

you know, i talked to you before, because of some macro my macrodroid doesnt open

if i lose my macrodroid data, my macrodroid premium is losed too

macrodroid is my phone life, i love macrodroid, please save my macros 💖
I dont want open my phone in safe mode, because there is some app in my phone doesnt support safe mode, they will deleted auto if i open in safe mode, and i am scaring from opening my from Recovery Mode or Safe Mode and i dont know how to open it too. I read something about "safe mode is disabling ALL 3rd. party applicactions"
My phone : Samsung Galaxy A51
i only wants save my macros
 

Endercraft

Moderator (& bug finder :D)
Do you have auto backup enabled ?
By the way as I have told you unless you change something it is pretty much guaranteed that you won't lose your macros (that's the whole point).
 

ruzgar6467

New member
Do you have auto backup enabled ?
By the way as I have told you unless you change something it is pretty much guaranteed that you won't lose your macros (that's the whole point).
My phone is not rooted, thats because of there is not macros.json, there is some backups but i dont know autobackup is on before this happening, but hthere is 5 or 6 backups some or 145mb some of are 280mb (most is 280mb and this is last created too)
 

Endercraft

Moderator (& bug finder :D)
If you have a backup then you can see when it was created, it's in its name. The macros.json file is the most up to date one but I don't think it's worth going through rooting. Going with the backup file the best option.
 

ruzgar6467

New member
If you have a backup then you can see when it was created, it's in its name. The macros.json file is the most up to date one but I don't think it's worth going through rooting. Going with the backup file the best option.
Bro cant you understand me?
My phone dont have root, and you said there need to be macros.json but there is no macros.json, it gives me clear cache? Error per 5 minutes! I am scaring from press clear cache button mistakenly... if i press it, all macros will be deleted and that was dangerous, it says: An error was found in the macrodroid application. This error causes the application to crash. Should you clear the cache? Thats dangerous i think, there is cancel and clear button. I think you need to connect me with Teamviewer if giving apps name not allowed, sorry. i want my macros only and my pro.
 

Endercraft

Moderator (& bug finder :D)
You don't need root, you can use other non rooted methods described under the root method. Read all of the first post carefully.
Concerning Team viewer I'm not sure when I'll be able to use it but I'd like to not use it until necessary (if you still don't understand).
 

ruzgar6467

New member
You don't need root, you can use other non rooted methods described under the root method. Read all of the first post carefully.
Concerning Team viewer I'm not sure when I'll be able to use it but I'd like to not use it until necessary (if you still don't understand).
Is there is some other think to message with you?, i am asking because we are chatting
too much time difference to messaging,like when i sent message, i am getting answer in 10/15 minutes
 
Top