hamaluik / timecop

A time tracking app that respects your privacy and the gets the job done without being fancy.
https://timecop.app/
Apache License 2.0
796 stars 149 forks source link

Fixed the storage permission error when importing in Android by adding the 'read and write to external storage' permissions. #132

Closed JustScott closed 8 months ago

JustScott commented 9 months ago

I've added the "WRITE_EXTERNAL_STORAGE" permission but am unsure of how to implement exporting the database to the external storage instead of "Sharing" it like is done now.

I may open an issue requesting there to be a third option in the list when you click the database icon: ['Import Database', 'Export Database', 'Share Database'].

JustScott commented 8 months ago

@hamaluik I wasn't aware my second commit which changed the .gitignore to ignore the APK keystore files would automatically be added to this pull request, I can remove it if you'd like.

12people commented 8 months ago

@JustScott Thanks for the commit.

However, the WRITE_EXTERNAL_STORAGE flag doesn't do anything anymore, since the app targets a newer API — see this bit of official Android documentation.

As for sharing vs saving to disk — the share sheet should offer you file browsers as well, as long as you have one installed. The reason why the Share API is used is because that is a much more secure way of working with storage than just giving the app blanket permission to read and write across the whole filesystem.