14 lines
503 B
Text
14 lines
503 B
Text
|
#!/bin/bash
|
||
|
set -euo pipefail
|
||
|
|
||
|
database="$1"
|
||
|
|
||
|
# Saving binary files only
|
||
|
# .smil parts are ignored (not used by Chatty)
|
||
|
# Plain text attachments will be converted into message bodies
|
||
|
# cf. chatty:src/mm/chatty-mmsd.c:chatty_mmsd_process_mms_message_attachments
|
||
|
while read path; do
|
||
|
mkdir -p "$(dirname "$path")"
|
||
|
sqlite3 "$database" "select binary_data from part where savepath='$path';" | base64 -d >"$path"
|
||
|
done <<<"$(sqlite3 "$database" "select savepath from part where binary_data is not null;")"
|