Option to allow externally modified file

Post your feature requets for new triggers, conditions, actions and other improvements.

Moderator: Martin

Locked
User avatar
jassing
Posts: 94
Joined: 16 Jul 2017 01:42
Location: SF Bay Area

Option to allow externally modified file

Post by jassing » 31 Dec 2019 18:17

I did a mass search/replace on a variable via a text editor.
But upon opening the file, it warns me that all flows will be disabled. Annoying.
Would be nice to have the option to accept that the file is legit; after all we'd know if we changed it...

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Option to allow externally modified file

Post by Desmanto » 01 Jan 2020 14:43

Do you make modification directly to the flows.xml? If yes, then it is expected. Depends on your need, it might be better to export all flows need to be changed first to a new xml. Do all the modification. Then reimport it back. I have helper flow to do some changes like that, but now rarely use it. But I once create it for a very specific usage, to create chart in widget. (duplicating element from 1 to 100).

Other option is to save all flows states first before modification. I have Automagic Statistic flow to do that, but I haven't found time to complete it yet (to share it here). I have used it several times to save me from the hassle of reenabling more that 100 flows after backup-restore.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

User avatar
jassing
Posts: 94
Joined: 16 Jul 2017 01:42
Location: SF Bay Area

Re: Option to allow externally modified file

Post by jassing » 01 Jan 2020 15:05

Still, it would be helpful to not reset all flows. If the response to a request is going to be "that is expected" then all requests are pointless. I'll not make any further requests.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Option to allow externally modified file

Post by Desmanto » 01 Jan 2020 18:21

Sorry if I might sound offensive. I didn't mean that.

Automagic need to verify the integrity of the xml first before loading it. So I would argue the safest way is to disable all flows if modification is made outside of Automagic UI. After editing, there might be some runaway/mis-edited flow, which trigger to do unexpected things. Let's say you have flow to delete certain files, and after some mis-edit in manual editing, the flow suddenly auto started and delete all your files. I certainly don't want it to happen, but bad things can happen though. So better be safe.

Editing the main flows.xml directly is very risky. If the syntax is wrong, you might lose all your flows. That's why I suggest you to export first. If you mis-edit that exported xml, you only lose that particular xml's flows. Of course, we already have backed-up the flows.xml first before editing. But the editing part still carry unknown risk.

I also have made other reequest too, seems related. viewtopic.php?f=4&t=7272
The 2nd request there is to have the flows.xml keep the flow state. Upon restoring, prompts us with the pre-selected enabled flow and ask us whether to enable it or disable. In AM 1.37. the flow state was kept upon restoring (not from external modified file). But the prompt and pre-select is not yet. Maybe the request can be combined to yours too.

Allow externally modified file, but then upon startup, prompt for choosing which flow to keep enabled, with pre-selected previously enabled flow
In my opinion, this will be safer than enabling all previously enabled flows and still very convenient for external modification. How do you think about it?
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Locked