froggy But why to programm something completely new?
My suggestion is therefore to integrate Restic
AOSP includes its own backup manager service. It is what both seedvault and Google Backup use when they are doing a backup of app data. It is also what is used for modern device to device app data transfers. The kind used when moving to a new device.
Working with this system back service allows android app developers to indicate what data to backup. Making backups of app data thats encrypted with keys held in the Titan secure enclave would lead to an unhappy future when you restored the backup of that app to another device!
This service is secure and robust. Implementing another secure way to backup app data and keeping it working as android changes in the future would be massive undertaking.
Theres an overview and some diagrams of how things work at https://developer.android.com/guide/topics/data/testingbackup