BiglyBT-Android icon indicating copy to clipboard operation
BiglyBT-Android copied to clipboard

Android TV - Folder Permissions Needed

Open azatsh opened this issue 1 year ago • 12 comments
trafficstars

Hi ! When I try to download a torrent that has a folder I get an error "Folder Permissions Needed". If I download another torrent without folder (just files) it works normally. BTW I did setup BiglyBT to use registered media storage which is available for writing. I can create folders using adb (connecting from home PC) and linux commands. Please help !

Details:

  • Android TV (Core version 4.9.125)
  • BiglyBT 1.3.4.3

Pics: error1 error2 storage bt_version device

azatsh avatar Aug 04 '24 17:08 azatsh

Update: After getting the red error message if I click on it it shows me a prompt asking for authorize. But when I click on authorize it shows me white rectangle, no buttons there. Pushing OK button (on remote control) does not help either.

Pics: prompt white_box

azatsh avatar Aug 04 '24 17:08 azatsh

Actually what app is it trying to open/show after clicking on authorize ?

azatsh avatar Aug 04 '24 17:08 azatsh

this is probably a duplicate of https://github.com/BiglySoftware/BiglyBT-Android/issues/248

in permission there is no setting to allow management of all files

for new android versions. that's why BiglyBT can't create folders.

As a workaround you can try to format hdd as "internal".

antonsoroko avatar Oct 24 '24 16:10 antonsoroko

this is probably a duplicate of #248

in permission there is no setting to allow management of all files

for new android versions. that's why BiglyBT can't create folders.

As a workaround you can try to format hdd as "internal".

I have tried, this. If you try to format hdd as internal storage, the path doesn't show up any more in the options.

QaisarRajput avatar Dec 02 '24 23:12 QaisarRajput

@QaisarRajput This is expected. This is how android does this. Your internal memory and external HDD will by "united" under same "path". Then you should move app's data to HDD in android settings for apps. Then if you choose app data folder (Android/data/com.biglybt.android.client/...) as storage folder - then app will always write to HDD. If you don't do that , then data will be still written first to internal flash. Or you can choose some other directory, like Download, in this case you do not need to move app to HDD, as I understand. You can eject HDD to verify that data was not written to internal flash memory, e.g. remember how much free space of flash memory you had before joining with HDD, download something, eject HDD in settings, check free space of flash memory.

good reading about internal (aka "Adoptable") storage: https://www.reddit.com/r/Android/comments/496sn3/lets_clear_up_the_confusion_regarding_storage_in/

antonsoroko avatar Dec 03 '24 09:12 antonsoroko

Then if you choose app data folder (Android/data/...) as storage folder - then theoretically app will always write to hdd.

How to set save directory /storage/Disk/Movie instead internal app folder /storage/Disk/Android/data/com.biglybt.androud.client/files ?

App doesn't allow to choose another folder, not possible go up to hdd-root directory. Zidoo Z3000 Pro, Android 11, AML928x, 1.2.01_G

Please add MANAGE_EXTERNAL_STORAGE to manifest and ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION in code

Image Image Image Image

phoxerity avatar Feb 03 '25 11:02 phoxerity

@phoxerity

How to set save directory /storage/Disk/Movie instead internal app folder /storage/Disk/Android/data/com.biglybt.androud.client/files ?

have you tried to click that "arrow" in top left corner of your 2nd screenshot? because on my device with certified android tv 11 i can choose any directory on my external hdd, like /storage/DISC_ID/Download/BiglyBT/.

~app has WRITE_EXTERNAL_STORAGE+READ_EXTERNAL_STORAGE which seems to be enough for writing to any directory on external hdd.~ https://github.com/BiglySoftware/BiglyBT-Android/blob/a55edc3d540d11386825e16aa2ae9d0269244da1/app/src/main/AndroidManifest.xml#L9 about MANAGE_EXTERNAL_STORAGE - see https://github.com/BiglySoftware/BiglyBT-Android/pull/211

but with such path i get "write permission denied" if i download torrent that has non-media files (like .txt file), ~because app lacks ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION or ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION.~ with /storage/Disk/Android/data/com.biglybt.androud.client/files it works ok, but in android 11 you can't access this directory :-D so this is the huge blocker.

there are several similar issues about this, but for some reason devs do not participate in discussion.

antonsoroko avatar Feb 04 '25 11:02 antonsoroko

have you tried to click that "arrow" in top left corner of your 2nd screenshot?

Nothing happen if click to arrow. Eventually if manually in remote client set root of disk as default directory then Bigly ask Grant permissions and after click Authorize message appeared 'No such app found'

phoxerity avatar Feb 06 '25 02:02 phoxerity

@phoxerity

  1. i missed that on your 1st screenshot it says "read only" for both your HDDs, while for me it does not say that. i choose /storage/SOME-ID and then i am able to navigate to needed folder (e.g. /storage/SOME-ID/Download/). but if i choose "biglybt private external storage" like you did - then i also can't navigate "up" via "arrow".

  2. i also was wrong about MANAGE_EXTERNAL_STORAGE. it is needed to be able to download non-media files (like .txt or .srt) into "not app related" location. without MANAGE_EXTERNAL_STORAGE app can write non-media files into Android/data/ but with MANAGE_EXTERNAL_STORAGE i was able to download non-media files to arbitrary path. and i was wrong about ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION & ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION - those are just "intentions" used to open settings and does not really affect anything, it is just an usability thing.

antonsoroko avatar Feb 17 '25 17:02 antonsoroko

@phoxerity 3. i managed to add MANAGE_EXTERNAL_STORAGE to apk by myself. a. i downloaded apk from https://f-droid.org/ru/packages/com.biglybt.android.client/ b. APK Editor Studio from https://qwertycube.com/apk-editor-studio/ c. then open apk in editor and add needed permission: Image

note: after such edit you will have different apk signature, so it will not be possible to install it on top of original apk, so old app should be uninstalled first, which means that you will lose settings and torrents data, if data in Android/data/. so backup files first, if needed.

antonsoroko avatar Feb 17 '25 17:02 antonsoroko

ideally, devs should build a separate APK with MANAGE_EXTERNAL_STORAGE and distribute it via github or via f-droid. like libretorrent bittorent client does https://gitlab.com/proninyaroslav/libretorrent/ (they also do not have MANAGE_EXTERNAL_STORAGE in google play so they provide alternative build)

antonsoroko avatar Feb 17 '25 17:02 antonsoroko

So to summarize, at the moment users can:

  1. Modify .apk file to add MANAGE_EXTERNAL_STORAGE, see https://github.com/BiglySoftware/BiglyBT-Android/issues/250#issuecomment-2663788139
  2. Format HDD as internal and move BiglyBT's app data to HDD, see https://github.com/BiglySoftware/BiglyBT-Android/issues/250#issuecomment-2513965774
  3. Use HDD formatted as portable if your Android allows it: if you see that in BiglyBT's list of "storages" your /storage/SOME-ID is NOT marked as "Read Only" then you should choose /storage/SOME-ID and then you will be able to navigate to needed folder (e.g. /storage/SOME-ID/Download/). Do NOT choose "BiglyBT private external storage" - then you will not be able to navigate "up" via "arrow" button.

antonsoroko avatar Apr 06 '25 10:04 antonsoroko

This happens to me if the files are already in the directory.

lunar-balance avatar Sep 08 '25 15:09 lunar-balance

When I click the authorization button, a message appears saying that there is no suitable app.

lunar-balance avatar Sep 08 '25 15:09 lunar-balance

If I delete the file from the download directory, the download will start successfully

lunar-balance avatar Sep 08 '25 15:09 lunar-balance

I did what I described above in /storage/SOME-ID/Download/

lunar-balance avatar Sep 08 '25 15:09 lunar-balance

open fails for '/storage/1086D38F7FC5F4DA/Download/linuxmint-22.2-cinnamon-64bit.iso', File not found: /storage/1086D38F7FC5F4DA/Download/linuxmint-22.2-cinnamon-64bit.iso: open failed: EACCES (Permission denied) (allocateFiles existing:/storage/1086D38F7FC5F4DA/Download/linuxmint-22.2-cinnamon-64bit.iso)

lunar-balance avatar Sep 08 '25 16:09 lunar-balance

But if I download a torrent that has no files in the download folder, and then delete the torrent in the app without deleting the files, then when I add the torrent, the file verification will succeed.

lunar-balance avatar Sep 08 '25 16:09 lunar-balance

If I stop a healthy torrent, move its files using fm to another location, and then move them back, and then start it again, the check and start will be successful. The file system on my hard drive is in ntfs format.

lunar-balance avatar Sep 08 '25 16:09 lunar-balance

Basically, I want to check and download files that I haven't fully downloaded yet, but I can only start downloading by deleting the existing files. Please fix this.

lunar-balance avatar Sep 09 '25 11:09 lunar-balance