martinstoeckli / SilentNotes

SilentNotes is a simple note taking app which respects your privacy.

Home Page:https://www.martinstoeckli.ch/silentnotes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What should I do to read and save notes content on my own software.

asasn opened this issue · comments

Thank you for your excellent SilentNotes. I'm very sorry to post about this issue, but in fact, I have tried my best and as an amateur programming enthusiast, it's really difficult to understand the code.
What should I do to read and save notes content on my own software.
I usually use silent notes as an inspiration collector and edit from them.
However, when I use it on my computer, I usually open another software to work, and silent notes are only used as an aid. If I can directly read my inspiration notes in another software, it would be very cool.
By the way, the software I am using is also a C # program, which is a writing tool.
My idea is to try to parse silent notes_ Repository.silentnotes file...
The difficulties I encountered are also here.
I have successfully added an editing specified. txt file to my software and uploaded and downloaded it through webdav (which may not be secure, I don't know if HTTPS encryption is sufficient during transmission), but read and save silent notes_ The repository.silent notes file seems to involve issues with encryption, decryption, and file lists... it's a bit difficult for me.
May I ask for your advice? Do you have any good suggestions?

The easiest way would be to read the locally stored repository, it is plain text (but for the notes in the safe of course). The format is pure XML and you could use the available class RepositoryStorageServiceBase to read it. The problem of this approach is, that the OS prevents access to the app directories, in Android you would need root privileges, in Windows with enough privileges you could make it accessible.

More difficult is to read from the online storage, WebDav may be the choice here, because the other ones (DropBox, OneDrive, GoogleDrive) require OAuth2 authentification which is a complex beast (delegating control to external browser and deep linking). With this approach you would need the transfercode but it's not necessary to read it, your app could simply ask for it.

A good starting point is SynchronizationStoryBoard.RunSilent(), it is the method called at startup to synchronize without user interaction, when all necessary information is already available. In method DecryptCloudRepositoryStep.RunSilent() the decryption happens. If you only need read access it would simplify the steps even more and the rest of the steps (merge and reupload) could be ignored.

Good luck!