Skip to content

licht1stein/ColorNote-backup-decryptor

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ColorNote backup decryptor

ColorNote doesn’t support any kind of export (!?) and the backup format is both proprietary and encrypted using an undocumented method.

NB: If you have the app installed or have access to an android phone the alternative methods listed at the end might be simpler.

I’ve included a prebuild jar for convenience.

There is at least two versions of the backup format. I haven’t invested in figuring out a detection mechanism so trial and error is the game :)

New Version

Based on the original version, we have prepared a new version of the tool, that does all the decryption, decoding and saving to JSON, EDN or Markdown a breeze. Here’s the CLI interface:

/img/cli.png

Basic Use Cases

Export to a Markdown Folder

This will export your backed up notes into a folder, with each note being a separate Markdown file, ready to add to any proper notes program like Obsidian etc:

java -jar decryptor.jar YOUR_BACKUP_FILE -f markdown -t output

You’ll find your markdown in output/ directory.

Export to JSON

Exports your notes to a json file for further processing:

java -jar decryptor.jar YOUR_BACKUP_FILE -f json -t notes.json

Export to EDN

Exports your notes to a json file for further processing:

java -jar decryptor.jar YOUR_BACKUP_FILE -f edn -t notes.edn

Print json (for piping or testing)

This is a default option, so all you need to do is:

java -jar decryptor.jar YOUR_BACKUP_FILE

Only decrypt

This is the basic operation, in case our parsing doesn’t work in some cases. You can pipe it to the scripts mentioned below or do your own thing with it:

java -jar decryptor.jar YOUR_BACKUP_FILE -f decrypt

Original Version

Usage

The old verision jar ca n be found in lib/ and used as described.

java -jar colornote-decrypt.jar PASSWORD OFFSET < INPUT_FILE > OUTPUT_FILE

If you use oracle’s JRE (likely the case if you’re on windows) you’ll need to run the class file directly instead (send your thanks to the US for their silly encryption export restrictions… and to java for making it unbelivable hard to make a properly bundled program):

Unix:

java -cp lib/bcprov-jdk15on-154.jar:lib/bcpkix-jdk15on-154.jar:bin ColorNoteBackupDecrypt PASSWORD OFFSET < INPUT_FILE > OUTPUT_FILE

Windows: (note the different class path separators : -> ;

java -cp lib/bcprov-jdk15on-154.jar;lib/bcpkix-jdk15on-154.jar;bin ColorNoteBackupDecrypt PASSWORD OFFSET < INPUT_FILE > OUTPUT_FILE

The script reads from standard input and writes to standard output.

The decrypted output is json with some weird prefix and note separators (probably encoding the length of the file and individual notes). A small script attempts to clean the json.

Try both versions below. The following error message indicates that the input file uses another format version:

Exception in thread "main" java.io.IOException: javax.crypto.IllegalBlockSizeException: last block incomplete in decryption

Note: the file-extension of the backup files is sometimes .dat and sometimes .doc (might indicate the version?)

V1:

# 0000 is the default password
java -jar colornote-decrypt.jar 0000 < the-backup-file.doc | fixup-v1 > notes.json

V2:

# 0000 is the default password and 28 is a magic offset
java -jar colornote-decrypt.jar 0000 28 < the-backup-file.doc | fixup-v2 > notes.json

If the json still contains garbage, try tailing the n last lines (one note takes one line): tail -n 100 notes.json (Source)

Each fixup script is only based on a single backup file so they could be incomplete. Let me know if you have problems.

When you have the json file the next step is up to you.

Use format-notes to get a quick view of the notes or the following to get a csv format:

jq --raw-output '[.created_date, .modified_date, .title, .note] | @csv' < notes.json > notes.cvs

Alternative methods

Rooted phone

If you have root access you can get hold of the sqlite db directly: http://danyilbohdan.com/blog/colornote/

I haven’t tried it myself, but someone suggested that you could restore the backup in an emulator if you don’t have a rooted phone.

Using android’s built-in backup system to access the app-private data

Restore your encrypted backup onto a color note installation and do a full app backup using adb: (tested on v4.0.6)

adb backup -noapk com.socialnmobile.dictapps.notepad.color.note

Unpack the resulting backup.ab and you’ll have access to the colornote.db sqlite database.

(Source)

About

Decrypt a ColorNote backup file to export your notes (https://www.colornote.com)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Clojure 59.5%
  • Java 25.2%
  • Shell 15.3%