TeamAmaze / AmazeFileManager

Material design file manager for Android
https://teamamaze.xyz
GNU General Public License v3.0
5.26k stars 1.57k forks source link

Crash, on try to open a text file on SD-Card #1367

Open Loopbuilder opened 6 years ago

Loopbuilder commented 6 years ago

To reproduce:

  1. Write a Text-file on a SD card
  2. Open Amaze and navigate to the folder with the text file on the sd card ( /storage/1DF0-4711/Folder
  3. Click on the text file and choose: open with Amaze Text Editor -> Amaze crashes.

logcat says: java.lang.SecurityException: External path: /storage/1DF0-4711/Folder/W.txt: Neither user 10165 nor current process has android.permission.WRITE_MEDIA_STORAGE.

AndroidRuntime: FATAL EXCEPTION: Thread-945 Process: com.amaze.filemanager, PID: 12698

EmmanuelMess commented 6 years ago

It seems that WRITE_MEDIA_STORAGE is a signatureOrSystem level permission. Unless the phone is rooted it cannot be granted to us. See this post by Jorrit "Chainfire" Jongma.

Loopbuilder commented 6 years ago

Yes, this excuse sounds good. Right: I have a device that has not been rooted.

But: Take a look at the open source program Open Camera. This app can easily save photos on the external SD card.

If the statement should be correct that there is no possibility to get the right: WRITE_MEDIA_STORAGE for the application, then the app Open Camera should also not write on the SD card. Correct?

But they can do it!

EmmanuelMess commented 6 years ago

This app can easily save photos on the external SD card.

The app doesn't seem to let you choose where it should save the images, are you sure it is saving in external sd? What's your phone model and Android version?

Loopbuilder commented 6 years ago

Hi. Yes, the app writes on the external SD-card. Realy!!! And it works. To set the saving location on this app: Properties -> more camera settings -> save location ( A save explorer open's and you can choose on the left: internal storage oder SD-Card, after this the folder..)

I use android 6.01 on a samsung galaxy J5

EmmanuelMess commented 6 years ago

Is OpenCamera using Storage Access Framework (SAF) (you can check this in preferences, right below the storage folder selection setting)?

For future reference, here is how OpenCamera deals with saving files.