pyload/pyload-android

Check & request operation missing before choosing container file

aper-project opened this issue · 4 comments

Hi, there, I've found a issue in version 0.3.7, which is downloaded from F-Droid.

Description

This app does not check nd request the WRITE_EXTERNAL_STORAGE permission when I want choose a container file form storage.
There are two unexpected behaviors:

  1. choose file page is empty until I grant this permission in the system setting
  2. it will crash if I continue chose Parent Directory

Reproduce

  • Step 1 : Open pyLoad and select Add Links button.
    image

  • Step 2 : Click "CHOOSE" for choose container file
    Because this version does not check and request permission when I click "CHOOSE" button , no folders and files are read out on this page.
    image

  • Step 3 : go to system setting , grant the storage permission

  • Step 4 : repeat step 1 and step 2
    image

The call chain related to this bug :

	org.pyload.android.client.module.FileChooser.onCreate(android.os.Bundle)void
	 org.pyload.android.client.module.FileChooser.<clinit>()void
	  android.os.Environment.getExternalStorageDirectory()java.io.File

@GammaC0de
Could you help me review this issue? Very thanks!

Android support for checking for this setting starts from android 11.

Android support for checking for this setting starts from android 11.

Which update do you refer to? It seems that Android cannot automatically check and request a certain permission. If that permission is missing and you call an API that requires the permission, it simply crashes.

Android 11's updates to the permission system: https://developer.android.com/about/versions/11/privacy/permissions

I mean that there can be a fix for that but just for Android 11 and up, older versions (this app runs on 4.2 and up) cannot be dealt because of lack of support in the Android OS, they must set this settings manually

I mean that there can be a fix for that but just for Android 11 and up, older versions (this app runs on 4.2 and up) cannot be dealt because of lack of support in the Android OS, they must set this settings manually

IMG_0524.MOV.mp4

I tested it on an 11 device, and it seems that Android 11 also cannot grant that permission.

In fact, it can request for the permission programmatically, and it only requires Android 6 and above.

This is documented in Android's official tutorial.