Created
February 16, 2016 17:27
-
-
Save MawKKe/f7d4e7322c4eccc0e56b to your computer and use it in GitHub Desktop.
Query Jolla's commhistory.db for SMS's
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
jolla-sms.sql - Query Jolla's commhistory.db for SMS's. | |
- Shows sent/received from last 2 months, oldest to newest. | |
- Messages are printed with newlines replaced by spaces. | |
--- | |
Usage: | |
1) Place this file in ~/.local/ | |
2) Put this function in your ~/.bashrc | |
function smsread(){ | |
local SMS_SQL="$HOME/.local/jolla-sms.sql" | |
local COMMHIST="$HOME/.local/share/commhistory/commhistory.db" | |
cat "$SMS_SQL" | sqlite3 "$COMMHIST" -list -separator '|' -header | column -t -s '|' | |
} | |
3) Now you can run it via ssh: | |
$ ssh nemo@jolla smsread | |
4) Vuala! | |
--- | |
Author: Markus H (MawKKe) ekkwam@gmail.com - 2016-02-16 | |
*/ | |
select | |
datetime(startTime, "unixepoch", "localtime") as timestamp, | |
(case when direction = 1 then "RECV" else "SENT" end) as dir, | |
printf("[%s]",remoteUid) as remote, | |
replace(replace(freeText, char(13), ' '), char(10), ' ') as message | |
from | |
Events | |
where | |
date("now","-2 month") < date(startTime,"unixepoch") | |
and | |
type = 2 | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment