TeamAmaze / TeamAmaze/AmazeFileManager
`SecurityException` when reading from `MediaProvider`
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 6.4k
- Forks
- 1.7k
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 1
Description
Describe the bug
do not give permission to AmazeFileManager, then click recent files, app crashes on version 3.7.2
To Reproduce
Steps to reproduce the behavior:
- install app and open it
- do not give permission to app
- click menu
- click recent files
- see crash
Expected behavior
no crash
Screenshots
If applicable, add screenshots to help explain your problem.
Smartphone (please complete the following information):
- Device: [e.g. Google Pixel 2]
- OS: [Android 8]
- Rooted: [e.g. No]
- Version: [ 3.7.2]
Additional context
Add any other context about the problem here.
Issue explanation (write below this line)
Exception
- App Name: Amaze File Manager
- Package: com.amaze.filemanager
- Version: 3.7.2
- User Action: UI Error
- Request: Application crash
- OS: Linux Android 8.0.0 - 26
- Device: generic_x86
- Model: Android SDK built for x86
- Product: sdk_gphone_x86
Crash log
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:353)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
at java.util.concurrent.FutureTask.run(FutureTask.java:271)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/file from pid=4454, uid=10077 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
at android.os.Parcel.readException(Parcel.java:1943)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
at android.content.ContentProviderProxy.query(ContentProviderNative.java:418)
at android.content.ContentResolver.query(ContentResolver.java:754)
at android.content.ContentResolver.query(ContentResolver.java:704)
at android.content.ContentResolver.query(ContentResolver.java:662)
at com.amaze.filemanager.asynchronous.asynctasks.LoadFilesListTask.listRecentFiles(LoadFilesListTask.java:551)
at com.amaze.filemanager.asynchronous.asynctasks.LoadFilesListTask.doInBackground(LoadFilesListTask.java:200)
at com.amaze.filemanager.asynchronous.asynctasks.LoadFilesListTask.doInBackground(LoadFilesListTask.java:77)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
... 3 more
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in LoadFilesListTask at listRecentFiles (line 551), called from doInBackground (line 200), and reproduce opening Recent Files without storage permission on Android 8. The crash log shows the failing MediaProvider query; done means opening Recent Files no longer crashes when permission is denied.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100