bepaald / signalbackup-tools

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

View exported html on Android ? #228

Closed roma2580 closed 2 months ago

roma2580 commented 2 months ago

Hi @bepaald,

many thanks for this great tool ! I exported 2 threads from my signal backup into html, and the result is really impressing. Then I copied the complete html directory to a different location on the same Windows machine, and it still works perfect: On index.html, I see the 2 names, and when I select one of them then this thread appears, including any images. So I concluded, the code does not use any absolute path. However, when I copied the html directory to an Android phone (into directory "Downloads"), then I can open index.html in Chrome and I see the 2 names again, but this time these links are broken ! In other words, the resulting html export does not seem to work on Android. Maybe this is not a typical use case, but in my case it would be helpful for my conversation partner to recover otherwise lost contents when her phone was bricked (so her local signal backups are gone). Is there anything I can do ?

roma2580 commented 2 months ago

Oops, that shot was too fast! Now I copied that html directory to another Windows machine, and guess what ? This does not seem to work either ! I will do some more investigation, but maybe the reason for my initial success was my browser's cache... So my title should better change to "View exported html on another machine?".

roma2580 commented 2 months ago

Oops again!.It does work on another Windows machine, as long as you open the file index.html in the browser. It does not seem to work if you create a link to index.html on the desktop, and try to open that link in the browser. But this is Windows... So there is no problem when copying to another Windows machine, meaning the original title is ok.

bepaald commented 2 months ago

Hi!

Unfortunately, there is nothing I can do about this (as far as I know). This is a known situation on Android, it seems it is a security feature. A quick search around the internet shows others have had similar problems (here is one somewhat recent example), but no solutions are given. It is more complicated as the exact behavior when opening local HTML files on Android has changed over time with different Android versions and vendors. Some solutions from the past have been to put the files in a specific location or to use a specific browser, but it is likely none of those work anymore.

Either way, I'll leave checking that out up to you, I don't think there is anything wrong with the HTML output this program produces. If I can work around the Android somehow without breaking anything I'll gladly do it, but you (or anyone really) will need to tell me how.

As for the Windows behavior: I can not reproduce this. If I export to HTML and create a link (as 'shortcut' as Windows calls it) to index.html on the desktop, it seems to work just fine. Are you sure you didn't just move or copy the file instead?

roma2580 commented 2 months ago

Thanks for the immediate reply! If its like that, there is no point to tilt at windmills but better go what seems to be the clean way: I just installed "Simple HTTP Server" from play store, copied the files into the suggested directory, started the server at 127.0.0.1:8080, and here we go ! In this way, the html export created by your tool works like a charm on Android. For me, this is a perfect solution !

bepaald commented 2 months ago

Glad you've got it working!