bepaald / signalbackup-tools

Tool to work with Signal Backup files.
GNU General Public License v3.0
755 stars 36 forks source link

Can I use this as a library? #198

Closed steeric1 closed 5 months ago

steeric1 commented 5 months ago

Is it feasible to use this program as a library in my own project?

bepaald commented 5 months ago

Hi! I'm afraid you the honest answer to that is: no, you practically can't do that.

Technically of course, any (C/C++) code can be turned into a library, just by leaving out the main function and adding the proper compile flags (and passing the objects through ar for a static lib). But generally when a project is used as a library, thought should be put into the available functions, their implementations and perhaps a stable API and even a stable ABI. None of that has happened for this project.

You could of course just fork it and make the changes you want, or just include the needed source code itself in your project (adhering to the license of course). Alternatively, if you're not stuck on C++, I know of a python library for reading Signal backup files (since I contributed a little to that one). It can be found here: https://github.com/DLu/SignalBackupParser/, maybe that one is useful to you?

Other developers using this project have generally just used the compiled binary and processed its output. But that might not be efficient (or possible) depending on what you want to accomplish.

I'm going to close this, as I think I've answered as much as I could, and there isn't really any issue here. But if you have more questions please feel free to post them, I'll attempt to answer what I can when I have time.

Thanks!