Created
May 30, 2024 23:07
-
-
Save ewalk153/80d0a4a2cc4f96d487dee84142362452 to your computer and use it in GitHub Desktop.
Small script to extract apple notes files from the source sqlite3 file. Files extracted to their compressed files. Output is a protobuf doc. For simple notes the text is typically usable.
This file contains hidden or 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
import sqlite3 | |
import zipfile | |
con = sqlite3.connect("NoteStore.sqlite") | |
res = con.execute("select Z_PK, ZDATA from ZICNOTEDATA") | |
for row in res.fetchall(): | |
print(f"ID: {row[0]}") | |
# this is a protobuf doc but the text is usually readable | |
temp_file_name = f"doc{row[0]}.txt.zip" | |
f = open(temp_file_name, "wb") | |
f.write(row[1]) | |
f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment