check sqlcipher version (fix #85)
This commit is contained in:
@@ -137,6 +137,10 @@ def get_key(imei, uin):
|
||||
def do_decrypt(input, output, key):
|
||||
conn = sqlite.connect(input)
|
||||
c = conn.cursor()
|
||||
version_str = list(conn.execute("PRAGMA cipher_version"))[0][0]
|
||||
version = tuple([int(x) for x in version_str.split(".")])
|
||||
assert version >= (4, 1), "Sqlcipher>=4.1 is required"
|
||||
|
||||
c.execute("PRAGMA key = '" + key + "';")
|
||||
# https://github.com/sqlcipher/sqlcipher/commit/e4b66d6cc8a2b7547a32ff2c3ac52f148eba3516
|
||||
c.execute("PRAGMA cipher_compatibility = 1;")
|
||||
|
||||
Reference in New Issue
Block a user