fcoiffie / decode-ColorNote

Python decoder for Android ColorNote backup files
MIT License
12 stars 4 forks source link

Has the API changed? #2

Open vineet131 opened 3 years ago

vineet131 commented 3 years ago

After using python decode-ColorNote.py -p xxxx c:\folder my file decodes perfectly fine, as evident from the notes.bin file but I still get UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf7 in position 1939: invalid start byte.

Now my notes are in multiple languages but opening notes.bin in Notepad++ and setting it to UTF-8 shows that they translate well and without any problem. But in between the notes, there are characters like \x0\x0\x0\x2\x0\x0\x1\xF7\x0\x0\x2\xA0 and this is where the problem is coming from.

I tried setting json_chunk = json.loads(chunk.decode("utf-8", "ignore")) but that just leads to json.decoder.JSONDecodeError: Extra data: line 1 column 7 (char 6) since the decoded file doesn't seem to be formatted in a proper JSON format. Any help would be appreciated

seiki commented 2 years ago

did you ever work this out?

vineet131 commented 2 years ago

did you ever work this out?

Unfortunately not. I improvised and just deleted the unwanted characters between the starting and ending curly braces of the actual JSON dict.

seiki commented 2 years ago

I ended up using the alternative method of getting the sqlite database like it says on this repo: https://github.com/olejorgenb/ColorNote-backup-decryptor

vineet131 commented 2 years ago

I ended up using the alternative method of getting the sqlite database like it says on this repo: https://github.com/olejorgenb/ColorNote-backup-decryptor

Thank you, I will take a look at it. How did you do this? Maybe you could submit a PR or fork the library and make changes to combine the two.

seiki commented 2 years ago

I didn't code anything. I did the whole getting the .db file from a rooted android thing: https://dbohdan.com/wiki/colornote

fcoiffie commented 2 years ago

@vineet131 Could you share a .doc file which has the encoding problem ?

vineet131 commented 2 years ago

notes - Copy.txt

@vineet131 Could you share a .doc file which has the encoding problem ?

Here you go! Deleted most of the data, but you can get a gist of it

I didn't code anything. I did the whole getting the .db file from a rooted android thing: https://dbohdan.com/wiki/colornote

Thank you for this! I wasn't aware, let me check it out. But would be so nice if I can do this via Python

fcoiffie commented 2 years ago

In fact, I don't understand the structure of the decrypted data. Usually, we have: image But in your file, we cannot see the beginning of the JSON part and the length is invalid: image

vineet131 commented 2 years ago

Well, I used the same code as I pointed out in the first comment. Does this have something to do with the fact that I don't use English characters, and your code only accounts for notes written in English?