-
get the 'adb' binary: install android debug tools
-
Settings -> About -> Tap Build Number 7 times to enable Developer options
-
install a version of OpenSSL with zlib support so you can open the android backup
cd ~
curl https://www.openssl.org/source/openssl-1.1.1d.tar.gz -o openssl-1.1.1d.tar.gz
tar -zxvf openssl-1.1.1d.tar.gz
cd openssl-1.1.1d
./config zlib
make
sudo make install
which openssl
# => /usr/bin/openssl (this is not the OpenSSL you just installed)
ls /usr/local/bin/openssl # should return a binary that has zlib support
-
plug your phone into your computer
-
Settings -> Developer -> USB Debugging: On
-
Backup the Dhamma.org app data
adb backup -f ~/org-dhamma-backup -noapk org.dhamma
...unlock your phone, do not enter a password for the backup, click "do the backup"
- Turn the backup into a .tar file
dd if=org-dhamma-backup bs=24 skip=1|/usr/local/bin/openssl zlib -d > org-dhamma-backup.tar
- Get the logbook from the .tar file
tar -tvf org-dhamma-backup.tar | grep apps/org.dhamma/db/dhamma.org # might return errors; that's ok
tar -xf org-dhamma-backup.tar apps/org.dhamma/db/dhamma.org # still returns errors, but it works
- Run this query against the 'db/dhamma.org' file you just extracted, using any SQLite client:
select count(FILE_DURATION) from LOGBOOK_DATA where FILE_DURATION like '1 hr %';
- TADA! You now know the total number of hours you've meditated!