Fix for external SD-Card on Marshmallow

sleepless shared this idea 3 years ago
Declined

Hi,


can you insert automatically the following line in the "packages.xml" (data->System) @ your package line?


<item name="android.permission.WRITE_MEDIA_STORAGE" granted="true" flags="0" />


Always i must do this manually after a update to get the write/read access back!!


Thank you

Comments (12)

photo
1

Good day sleepless,

may you please forward me on web page, where may I read more about this permission and why should I insert it into Locus? I'm trying to find some, but cannot find and useful info.

Also where you insert these lines, directly into Locus manifest file after update?

photo
1

Hey,

i found this on xda-developers as the solution for external sd card fix on Android 6. On marshmallow the old ways from lollipop etc. doesn't work anymore. (they uses the fstab.void)

so here locus show me a message, that's something wrong on my way points etc and i should restart my phone.

this is only happens, because locus map can't write to the external storage, this external sd called a path like "eefd-ddsd".

To get the write acess to this sd card, i must insert this line in the package.xml. You found this in: /data/system/.

search for your line in this big file (search for the word "locus") and add this to the other <item> lines.

after this and a restart i can use locus with all files (including vector maps) on this annoying Android 6...

photo
1

Hi Sleepless, hi Menion,


@Sleepless : You're right for packages.xml


For information, if you know "Xposed framework", there's now an Xposed Module called "Marshmallow SD fix" that solve the Google MM nice little present and can automatically do the trick for you and for any app you want. I use it for a couple of weeks now, and i'm happy with.


Normally, with Lollipop and Marshmallow you have to be rooted AND and have a custom recovery (like CWM or TWRP) to install the Xposed framework. However, it is also possible to install it on rooted Lollipop and Marshmallow smartphones without custom recovery with the app Flashfire (at you own risk) : http://www.andromods.com/apps-mod/easy-install-lollipop-xposed-framework-without-twrp-cwm-recovery.html


@Menion : did you found the info you were looking for about "android.permission.WRITE_MEDIA_STORAGE" ?

Take an eye there maybe ? http://www.androidpolice.com/2014/02/17/external-blues-google-has-brought-big-changes-to-sd-cards-in-kitkat-and-even-samsung-may-be-implementing-them/ and https://stackoverflow.com/questions/12853752/eaccess-permission-denied-in-android


Hope it will help.


Cheers


Fifi

photo
1

Hi Fifi,

that doesn't work.

I have previously installed framework on my devices since Android 4.4... so i know that buggy framework..

but this app don't do his job right... still i get this error message... look attachment... clear words @ error message

if I do this how i described, it's work fine...

photo
1

Hmmmm ... just to try to understand why it is not working for you, let's compare what you have with what i have.


My device : Samsung S5 Mini (SM-G800F)


Modified /etc/permissions/platform.xml following that thread : http://stackoverflow.com/questions/34982064/android-marshmallow-rooted-how-to-read-write-any-file


Xposed Version : 3.0 alpha4


Xposes modules installed and configured : HandleExternalStorage, XInternalSD, Marshmallow SD fix

photo
1

Why is anything like that required?

I run locus without issue on my external SD...

photo
1

@Jens :


And your device run Android Marshmallow ?


And your external SD Card is mounted as real External SD Card like the previous versions of android and not as an Adoptable SD Card (Marshmallow SD Card setup that mount an External SD Card as an Internal SD Card formatted as Ext4 and encrypted, that make it not readable by other devices like your computer for example) ?

photo
1

@Fifi I run Android 6.0.1 and my SD card is formatted the same since Android 2.3 I believe, that is Fat32 I think.

I have the same naming scheme as mentioned above "/storage/4035-1df4/".

Locus has Permission to access the storage, but I don't remember if I had to toggle the switch or if it was requested.

photo
1

Actually, the proper fix is for the Locus app to use the SD card Access API, as described here:

https://stackoverflow.com/questions/26744842/how-to-use-the-new-sd-card-access-api-presented-for-lollipop

This way Locus can get permission to write in any specific directory on the external SD card without any extra hackery, special formatting, rooting the device and granting permissions, etc.

Quite a few apps already support this API, for an example check the FX explorer app, which even provides a menu entry and hints to the user on how to enable access. See here for the free version (not affiliated, just an example, etc. etc.): https://play.google.com/store/apps/details?id=nextapp.fx&hl=en

The newest version of Locus (3.8.15) doesn't seem to support this (trying to choose SD card storage simply shows the directory as unavailable and prompts for alternative locations), so I had to resort to editing the package.xml and granting the permission as described above. This works, but requires root. Thanks to @sleepless for the hint, which saved me a lot of digging in the docs.


I also suspect that this particular permission can't be included by the dev, I only see it on system apps on my device, but then I don't really develop for Android and I don't know the platform all that well.

Hope this helps,

photo
1

Hello guys,

let's move little bit with this problematic.

My view (as developer)


So from my point of view, there is nothing I can do for now, sorry.

photo
1

Well, that's too bad, I didn't know the new API is so half-assed. Rooting and fixing the permissions file is the only way, then. Thanks for the explanation.

photo
1

Hi, for rooted phones modification proposed by sleepless for me is so far the easiest way. It works on Marshmallow, as I have just checked. Thanks for hint.