sql client scripts

This commit is contained in:
Michael Kirk
2019-04-04 14:08:13 -06:00
parent ed8ac0523c
commit 6056fc4ab1
2 changed files with 45 additions and 0 deletions

22
Scripts/sqlclient Executable file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env bash
# e.g. put in whatever passphrase is actually being used
PASSPHRASE="x'e057e05681c8123bfa60c391eb075da2a022164eb230e88201b5447a9a5fc62b6d0b88087f5fa283391945b845087016'"
BIN_NAME=$0
function usage() {
echo "$BIN_NAME <path-to-database>"
echo "e.g. $BIN_NAME /Home/Users/foo/Library/Simulator/blah/database/signal.sqlite"
}
DB_PATH=$1
if [ -z $DB_PATH ]
then
usage
exit 1
fi
sqlcipher -cmd "PRAGMA key = \"${PASSPHRASE}\";" \
-cmd "PRAGMA cipher_plaintext_header_size = 32;" \
$DB_PATH

23
Scripts/sqlclient-legacy Executable file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/env bash
# e.g. put in whatever passphrase is actually being used
PASSPHRASE="x'e057e05681c8123bfa60c391eb075da2a022164eb230e88201b5447a9a5fc62b6d0b88087f5fa283391945b845087016'"
BIN_NAME=$0
function usage() {
echo "$BIN_NAME <path-to-database>"
echo "e.g. $BIN_NAME /Home/Users/foo/Library/Simulator/blah/database/signal.sqlite"
}
DB_PATH=$1
if [ -z $DB_PATH ]
then
usage
exit 1
fi
sqlcipher -cmd "PRAGMA key = \"${PASSPHRASE}\";" \
-cmd "PRAGMA cipher_plaintext_header_size = 32;" \
-cmd "PRAGMA cipher_compatibility = 3;" \
$DB_PATH