@gioele: You have hit one of the inconsistencies of the Kobo firmware: Exactly how annotations are stored depends on the type of book and where it is stored.
A copy of the annotations for all types of books are stored in the device database. As you add and removed annotations, the database is updated.
But, for ePubs and PDFs in the main memory, the annotations are also stored in a file. This is stored under "Digital Editions\Annotations". The file name matches the path of the book and as the extension "ANNOT". The file is in the Adobe annotations storage format. The device uses this file as the primary source of annotations. When you open a book, if this file exists, it is loaded and replaces the annotations in the database. Unfortunately, there are some bugs in this that mean the order of annotations in the annotations list gets messed up.
Lastly, purchased kepubs sync the annotations back to the Kobo server. After a factory reset, the annotations are brought back.
All that means that there is currently no easy way to backup the annotations for books on the SD card. You can do it by dumping the data from the "Bookmark" table in the device database. And then restore it after the factory reset. But, I don't have a method to do that in the plugin.
The handling of annotations is the part of the plugin that I am least happy with. The annotations display is something I did very early on and haven't revisited. I am more likely to add the function to the Annotations plugin than to fix this. i added the backup of the annotations files because it was extremely easy to do. But, it has it's limitations. A more complete method is needed.
|