Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/olejorgenb/colornote-backup-decryptor

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

Last synced: about 1 month ago
JSON representation

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

Awesome Lists containing this project

README

        

* ColorNote backup decryptor
[[https://www.colornote.com/][ColorNote]] [[https://www.colornote.com/faq-question/can-i-read-a-colornote-note-in-other-word-processing-programs/][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 :)

*** Usage
: 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

Note: the cleanup scripts are written for linux, but this user ran them successfully using cygwin [https://github.com/olejorgenb/ColorNote-backup-decryptor/issues/9].

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:*
#+BEGIN_SRC shell-script
# 0000 is the default password
java -jar colornote-decrypt.jar 0000 < the-backup-file.doc | fixup-v1 > notes.json
#+END_SRC

*V2:*
#+BEGIN_SRC shell-script
# 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
#+END_SRC

If the json still contains garbage, try tailing the n last lines (one note takes one line): ~tail -n 100 notes.json~ ([[https://github.com/olejorgenb/ColorNote-backup-decryptor/issues/1#issuecomment-389010700][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:

#+BEGIN_SRC shell-script
jq --raw-output '[.created_date, .modified_date, .title, .note] | @csv' < notes.json > notes.cvs
#+END_SRC
*** 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 [[https://developer.android.com/studio/command-line/adb][adb]]: (tested on v4.0.6)

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

[[https://stackoverflow.com/questions/18533567/how-to-extract-or-unpack-an-ab-file-android-backup-file][Unpack]] the resulting ~backup.ab~ and you'll have access to the colornote.db sqlite database.

([[https://stackoverflow.com/questions/13006315/how-to-access-data-data-folder-in-android-device/17876731#17876731][Source]])