Doing a backup of Android devices is becoming more and more difficult. In former times on most devices it was at least possible to boot into a custom recovery and to create a Nandroid-backup file which could be flashed back in case of emergency, nowadays it's not even guaranteed that a custom recovery for a device is avaialable. Especially for newer devices launched with Android 9 or later TWRP support is very limited or it does not even exist.
This was the motivation to start the Android Backup Restore Tools project, which provides a set of scripts / tools / etc. to extract data off of a device resp. re-install applications (and related data) back if needed. The first version of the tools consisted of a set of shell tools. They worked quite well but were usable only on Ubuntu / a Linux environment. The version developed now is re-written in Java so that also other operating systems like MacOS and Winddows are supported now. The Java version does not yet provide all the features the script based version is offering but works already for apk/data backup and restore (which is the most important/useful feature).
Sources are available on my GitHub account