When factory reset occurs, it deletes all user apps and preferences but leaves all system apps. When there is an update of the rom, it writes the system partition, having root privileges. So there are two possibilities: with root privileges, install the app as a system app or build the rom with the app included. In both cases you have to get informed what this implies in building the app because system apps have some differences from normal (user) apps.
0
solved Android App which not removes even after System reset