Default [Q] How to flash images in app similarly to xposed

I need to incorporate the ability to flash code in app similarly to xposed's options with soft reboot and reboot. Thanks