You could potentially write a script to handle CM specific (and derivative) ROMs that backs up the app before system is wiped. Gapps are maintained in this way.
I'm sure this has to be documented somewhere else but I'm not seeing it..
XDA Developers was founded by developers, for developers. It is now a valuable resource for people who want to make the most of their mobile devices, from customizing the look and feel to adding new functionality. Are you a developer? | Terms of Service