Guide: Restoring macros if MacroDroid is inaccessible

ruzgar6467

New member

1694720067135.png

I am getting this error ultra much, i need to get rid of this because pressing button in the right will reset my macrodroid! i am scaring to press mistakenly, I HATE THIS ERROR!!!!
 

MacroJeff

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.
Regarding Auto Backup, I apologize if I don't see it, but is there a setting somewhere for the user to specify where Auto Backups are saved to (i.e. external SD card location, for example)?

If not, can this be considered for a feature request?

Thanks in advance for any info.
 

Endercraft

Moderator
Regarding Auto Backup, I apologize if I don't see it, but is there a setting somewhere for the user to specify where Auto Backups are saved to (i.e. external SD card location, for example)?

If not, can this be considered for a feature request?

Thanks in advance for any info.
They are always saved within MacroDroid's data folder (accessible by user), so if you need the backup and you can't open MacroDroid you can access it via this folder - just don't uninstall the app.

You can make a macro that makes backup to external storage yourself by using the export macros action.
 

philscorp54

New member
Bonjour, suite à un écran cassé, j'ai dû changer de téléphone. J'ai pu cloner l'ancien sur le nouveau mais toutes mes macros ont disparues. Je n'ai plus accès à mon ancien téléphone. Je n'ai rien dans /data/data/com.arlosoft.macrodroid/filesmacros.json/data/data/com.arlosoft.macrodroid. je ne pense pas avoir de sauvegarde. Les macros sont-elles sur le nouveau après le clonage?
Merci pour votre aide.
 

Endercraft

Moderator
Bonjour, suite à un écran cassé, j'ai dû changer de téléphone. J'ai pu cloner l'ancien sur le nouveau mais toutes mes macros ont disparues. Je n'ai plus accès à mon ancien téléphone. Je n'ai rien dans /data/data/com.arlosoft.macrodroid/filesmacros.json/data/data/com.arlosoft.macrodroid. je ne pense pas avoir de sauvegarde. Les macros sont-elles sur le nouveau après le clonage?
Merci pour votre aide.
Please write in English.

If your macros are gone from your old phone (which is weird if you haven't done anything) then if you had auto backup enabled you might find something in Android/data/com.arlosoft.macrodroid
If you have cloud backup enabled you should be able to get your macros by logging into the same account on the newer device.
 

philscorp54

New member
Please write in English.

If your macros are gone from your old phone (which is weird if you haven't done anything) then if you had auto backup enabled you might find something in Android/data/com.arlosoft.macrodroid
If you have cloud backup enabled you should be able to get your macros by logging into the same account on the newer device.
My macros haven't disappeared from my old phone but I no longer have access to my old phone. The screen is dead. The repairman connected a screen to be able to clone the old phone to the new one. The old phone was thrown away. I didn't check when I got the new phone if my macros were there. I thought cloning would give me an identical phone...
 

Endercraft

Moderator
To fully clone phones they would both have to be rooted. Cloning them would be an even worse idea than root as you would be taking an OS made for a certain device to a completely different one. So I imagine the apps were transferred without any internal data (maybe through Google).
Say goodbye to your macros I suppose.
 

philscorp54

New member
To fully clone phones they would both have to be rooted. Cloning them would be an even worse idea than root as you would be taking an OS made for a certain device to a completely different one. So I imagine the apps were transferred without any internal data (maybe through Google).
Say goodbye to your macros I suppose.
I used the same model (Huawei P30) for ease and to put all the chances on my side but that wasn't enough :(
 

md_sgf

Well-known member
Then try the other methods mentioned here.

That link isn't working. I have tried (mobile) opera & chrome.

google chrome - What exactly is the `#:~:text=` location hash in an URL? - Stack Overflow

"Apparently this is a feature called Scroll To Text Fragment. It is enabled by default since Chrome 80, but apparently not yet implemented in other browsers"

"You can use #:~:text=<first word>,<last word> to highlight a whole section of text"
(this is what your link uses)

test #1

GIVEN UP
 
Last edited:

md_sgf

Well-known member
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.
I am wondering if you could share that macro? As I've starting working on deciphering .mdr files, so that ultimately i can extract specific macros, on a computer that is (i'll use an automating/scripting language called AutoHotkey). But I could do with some help. I mean why reinvent the wheel?. As far as i know, this hasn't quite been done yet. Any shortcuts to doing this will be gladly received. :giggle:
 

Endercraft

Moderator
I am wondering if you could share that macro? As I've starting working on deciphering .mdr files, so that ultimately i can extract specific macros, on a computer that is (i'll use an automating/scripting language called AutoHotkey). But I could do with some help. I mean why reinvent the wheel?. As far as i know, this hasn't quite been done yet. Any shortcuts to doing this will be gladly received. :giggle:
Of course.
Be aware that it might do strange things sometimes. Make sure to reconfigure variables in the action block located in the extraction loop like this:
Screenshot_2024-05-12-12-43-53-065_com.arlosoft.macrodroid-edit.jpg
 

Attachments

  • Extract_macros_from_backup_-_v1.1.macro
    1 MB · Views: 5

md_sgf

Well-known member
Thanks. I've installed both the old & new versions from template store. These 2 attached macros seem the same. Or are they slightly different versions?
 

Endercraft

Moderator
Thanks. I've installed both the old & new versions from template store. These 2 attached macros seem the same. Or are they slightly different versions?
Oops, looks like something went wrong. Edited it. They are the same but one still has variables from when I used it.
 
Top