Manually backup/restore Android application's data
Android stores application’s data in /data/data directory, it can be accessed via adb only on a rooted phone.
To make a backup copy the correspondent directory:
$ adb root
$ adb pull /data/data/eu.siacs.conversations
Application’s data can also be extracted from a full system backup made with TWRP:
$ tar -xvf data.ext4.win000
Restoring the backup is the tricky part since Android uses SELinux and every app has it’s own unix user.
Before copying back on the phone the already backupped files reinstall the app from f-droid or whatever, then proceed as follow:
$ adb push data/data/eu.siacs.conversations /data/data/eu.siacs.conversations
The next step consists in finding out what user is assigned to the appplication and then proceed to change file ownership and restoring SELinux context accordingly.
$ adb shell
$ su
$ dumpsys package eu.siacs.conversations | grep userId
userId=12345
$ chown -R 12345:12345 /data/data/eu.siacs.conversations
$ restorecon -Rv /data/data/com.example.app
Finally open the application and everything should work.
This tedious procedure was not needed when oandbackup was still working but it appears to be broken at least on CM14.1/LineageOS 14.1