Seal icon indicating copy to clipboard operation
Seal copied to clipboard

Storage Access Framework support for download directories

Open JunkFood02 opened this issue 2 years ago • 11 comments

  • [ ] Use SAF to move downloaded files to other directories.

JunkFood02 avatar Jun 29 '22 11:06 JunkFood02

For devices running Android 10 (API 29) or higher, App gain write permission to Download/ and Documents/ by default. But the only way for accessing or writing files outside these two directories is to use Storage Access Framework. Seal does not support SAF currently. As a result, any download outside these two directories would get a Permission Denied error.

JunkFood02 avatar Jun 29 '22 12:06 JunkFood02

With SAF support, we could manually copy downloaded files to destination and delete original files after finish downloading without permission problems. SAF could also provide SD Card support #25 Reference: dvd

JunkFood02 avatar Jun 29 '22 12:06 JunkFood02

@farabox1 Hi, you can just uninstall/reinstall the app or clear the data of app to reset the download directory

JunkFood02 avatar Jul 30 '22 07:07 JunkFood02

#85

Donkey-Doug avatar Jul 31 '22 23:07 Donkey-Doug

🥰

TPAXcc avatar Aug 01 '22 20:08 TPAXcc

Check this maybe it helps https://github.com/anggrayudi/SimpleStorage

xibr avatar Aug 21 '22 06:08 xibr

also see: https://github.com/K1rakishou/Fuck-Storage-Access-Framework

ganchair avatar Sep 08 '22 13:09 ganchair

Hi

achanta8 avatar Sep 19 '22 02:09 achanta8

@JunkFood02 Check this project out when you have the time, i think it will help you get references on how to implement a way to access other directories then Download

https://github.com/deniscerri/ytdlnis

Marco-9456 avatar Sep 29 '22 10:09 Marco-9456

references on how to implement a way to access other directories then Download

The use case in Seal could be much more complicated than this and dvd. Such as custom command, temporary files management, and resume download with .part files, some of these features may conflict with the SAF.

JunkFood02 avatar Sep 29 '22 11:09 JunkFood02

references on how to implement a way to access other directories then Download

The use case in Seal could be much more complicated than this and dvd. Such as custom command, temporary files management, and resume download with .part files, some of these features may conflict with the SAF.

I see, anyway I thought it would help a little 😃

Marco-9456 avatar Sep 29 '22 11:09 Marco-9456

Screenshot_2022-10-12-12-43-24-09_2b0c70832456616f1f794bb05bb8d2fa This problem is coming, what should I do?

MuhammadSharukh avatar Oct 12 '22 07:10 MuhammadSharukh

We haven't implemented yet SAF, a storage framework that Google made for making the file saving more secure and controllable by the users. In Seal this is kinda hard to implement because it probably means to a rewrite of the basic functions of the app.

BobbyESP avatar Oct 12 '22 07:10 BobbyESP

I'm using latest beta as of writing this and mine is saving audio only to music as selected in that system file access manager and YouTube folder which is default for seal anyway I think. I get what you're saying about adding the function to make this problem go away but be nice if we could dismiss the warning once understood if possible. Lovely ui and app thankyou!

Jeffdow85 avatar Oct 21 '22 09:10 Jeffdow85

@JunkFood02 I'm trying to implement SAF in the app that I'm actually developing. If I'm able to do it I'm gonna share the code with you so we can add it to Seal. I know that there are some files like config.txt or cookies.txt that can't be saved with SAF because they need to be localizable to the app in all moment, but according to Android Developers documentation, there is an App-specific file storing so we can use that for both of that files and SAF for the Downloads.

BobbyESP avatar Nov 26 '22 09:11 BobbyESP

@JunkFood02 I'm trying to implement SAF in the app that I'm actually developing. If I'm able to do it I'm gonna share the code with you so we can add it to Seal. I know that there are some files like config.txt or cookies.txt that can't be saved with SAF because they need to be localizable to the app in all moment, but according to Android Developers documentation, there is an App-specific file storing so we can use that for both of that files and SAF for the Downloads.

config.txt and cookies.txt are already created in app's internal storage. The real problem of SAF migration is not the plain implementation but actually the conflict with other features, since many of them needs directly access to the file system

JunkFood02 avatar Nov 28 '22 07:11 JunkFood02

Yeah, true... I need to think about it

BobbyESP avatar Nov 28 '22 19:11 BobbyESP

Temporary solution could be to allow parts… Either finalise each video or emulate zip file creation (no compression).

Noitarud avatar Dec 26 '22 02:12 Noitarud

#455 Workaround PR for being able to use SD cards in Seal. It was only tested in Android 12. The changes can be reverted/changed.

BobbyESP avatar Dec 29 '22 11:12 BobbyESP

Added in v1.8.0-beta.1, please help test this new feature out, we're ready to hear your feedback 🙌

JunkFood02 avatar Jan 05 '23 13:01 JunkFood02

Going to test it in a few minutes

BobbyESP avatar Jan 05 '23 13:01 BobbyESP

SD downloading works fine!

BobbyESP avatar Jan 05 '23 13:01 BobbyESP

I'm gonna test OTG cable because we were having issues in my PR

BobbyESP avatar Jan 05 '23 14:01 BobbyESP

Downloading through OTG cable also works.

BobbyESP avatar Jan 05 '23 14:01 BobbyESP

Isu

RuhulBoss avatar Jan 26 '23 05:01 RuhulBoss