Skip to content

Instantly share code, notes, and snippets.

@vv01f
Created August 19, 2017 21:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vv01f/fba02b679c80b8a3982f20879d54925a to your computer and use it in GitHub Desktop.
Save vv01f/fba02b679c80b8a3982f20879d54925a to your computer and use it in GitHub Desktop.
backup for conversations account data

When creating an accoutn in conversations the account data often is nor well remebered and some servers do not provide the option to retrieve the missing information. This worked today for two people that wanted to replace the f-droid version by the one from play store and reuse their accounts after the fresh installation.

#!/bin/sh
####
# howto backup conversations account data
####
#activate developer mode
#activate android debugging
#connect via usb
#test with `adb shell`, if that fails resume until it works
adb shell -x exit 0 && echo "[OK] debuggin is enabled" || echo "[KO] activate android debugging first!" && exit 1
echo "trying to backup of Conversations …"
adb backup -apk -obb eu.siacs.conversations -f conversations.ab
echo "create a copy without custom header"
dd if=conversations.ab bs=1 skip=24 > conversations.enc
echo "add standardized header"
printf "\x1f\x8b\x08\x00\x00\x00\x00\x00"|cat - conversations.enc|gunzip -c > conversations.tar
echo "unpack archive"
tar xf conversations.tar
echo "copy sqlite db"
cp ./apps/eu.siacs.conversations/db/history ./history.sqlite
echo "delete obsolete files"
rm -fR ./apps ./conversations.enc
echo "./history.sqlite contains the account data in the table with that name"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment