textricate is a script which extracts SMS messages from Textra SMS and exports them to a format understood by the popular SMS Backup and Restore, in a similar vein to several existing projects. However, unlike these solutions, textricate maintains encoding (handling emojis properly) and additionally attempts to repair a database damaged by previous usages of these scripts by removing duplicate messages and fixing encoding errors where possible. SMS Backup and Restore can be used to write the resulting XML file to the Android SMS provider (system database).
On initialisation, Textra takes a copy of Android's SMS database in its own database for improved performance. Several situations can lead to this database becoming desynchronised from the Android provider and your messages being stuck inside Textra, the most obvious of which being that you have a backup of Textra's app data but not your messages themselves. textricate allows you to extract messages from Textra's database and write them to the system database so that they can be used by other apps.
python3 -m pip install ftfy
)messages.db
from /data/data/com.textra/databases/
on your device to the same directory as the script using ADB (i.e. adb pull /data/data/com.textra/databases/messages.db
)python3 textricate.py
and transfer the generated XML file back to your device (e.g. adb push textricate.xml /sdcard/
)