The phone is a general purpose computer, and you can run LineageOS on it, with a custom bootloader.
Then you basically have 3 partitions boot, system, data. encrypting and uploading "data" can be done. It still requires little manual work, i.e. i don't know if an app can do it.