yashsingh1/xdaforums huggingface dataset:
[Galaxy S III Q&A, Help & Troubleshooting] catatized:
Yes this is working now! Thank you! :)

I want to list here specifically the steps I used to make titanium backup use my external storage because the threads I jumped to were not crystal clear on what to do. If this is not appropriate for here please just let me know and I will learn . I am relatively new to posting on XDA so please bear with me ... Thank you.

Specifically, in TB, I went to menu - preferences - backup settings - backup folder location. Tap Storage Provider and select DocumentProvider storage. Navigate to the top level of your SD card. Tap select. Then either create a new folder and select it or select an existing folder. Tap Use the Current Folder. Now when you exit preferences TB will reboot and you can backup to your external storage.
[Galaxy S III Q&A, Help & Troubleshooting] 65536:
I found a way to solve this issue. It's rather crude, so feel free to find a better solution ;)

The granted permissions for each installed app are stored in /data/system/packages.xml. This is done AFTER the package installer allowed installing the app, so there are no further permission enforcements.

All you need to do is finding the XML section for the app which should be able to write to the SD card, and add the tag

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

to the perms section. Doing so will grant the app the WRITE_MEDIA_STORAGE permission.

This permission is normally exclusive to signed system apps. It allows the app to write on /sdcard and any external storage, so it's essentially the same as WRITE_EXTERNAL_STORAGE in the pre-Kitkat-era.

I've tried it with several apps, and it worked like a charm:D. Maybe I will write a root app which allows to do this editing automatically.
[Galaxy S III Q&A, Help & Troubleshooting] le_zurdo:
Interesting. I checked that file in my stock rom. Some of my apps which don't have that permission (Motorola Camera and Clementine Remote) work fine in stock rom. Did it work with Motorola Camera for you?
[Galaxy S III Q&A, Help & Troubleshooting] c627627:
Yes please!!!

Can you imagine how many downloads you would get? This would be a huge deal... :)
[Galaxy S III Q&A, Help & Troubleshooting] 65536:
Can't test it with Motorola Camera, since I don't have a Motorola phone and can't install the app on my Samsung Galaxy S4.

Clementine remote, on the other hand, behaves as expected:

When I install it and set the save folder to a location on the SD card, it teels me it can't write to this location and doesn't accept this folder.

After granting it the WRITE_MEDIA_STORAGE permission in the packages.xml file it accepts the folder without complaining, so I assume the app can write to the SD card.
[Galaxy S III Q&A, Help & Troubleshooting] jesrani:
Can you please do this, it's really needed.
[Galaxy S III Q&A, Help & Troubleshooting] le_zurdo:
LOL, Sorry, I forgot that this thread was in a Galaxy forum. Anyway thanks for testing Clementine app and for the information. Will try it myself with Moto Camera and other apps and will post my findings

:good:
[Galaxy S III Q&A, Help & Troubleshooting] le_zurdo:
I can confirm it works with other phones. Tested with Moto X Play XT1563 to make Motorola Camera and Clementine Remote work. I needed to reboot after modifying packages.xml file.

Thank you very much!!
[Galaxy S III Q&A, Help & Troubleshooting] jesrani:
Do you have to add this line for each app? Which app to use for editing? I had opened the file but it was pretty long so it was confusing where to add this particular line? Any permissions to be modified?
[Galaxy S III Q&A, Help & Troubleshooting] VR.gtmini:
[MENTION=5472193]65536[/MENTION]

Great hack bro, I used to thwack back on lp from mm due to this only ****ing ass google's sticky sd ****.

Used to find solutions of my own and on enormous zillion pages, but now all credit to u

Now only thing left is to Test Debug this hack/trick/fix against all other write issues, os, app updations, write permission, ...

I only use ext4 formatted sd and won't format to ****FAT.

Will report soon if this hack works with ext4 too. (I hope Yes)

My own device is an xaomi redmi and an sgn2

[MENTION=5472193]65536[/MENTION] Please do announce if your app is ready. Thanks.

@op, [MENTION=373710]others[/MENTION]

Thanks for a keeping live this thread
[Galaxy S III Q&A, Help & Troubleshooting] gscollier:
Thank you, genius. Been looking for this for months.
[Galaxy S III Q&A, Help & Troubleshooting] jesrani:
I tried to do this but phone just won't book. Luckily had the backup of old file which I restored through AromaFM in recovery.

Can you please post instructions in detail how to do this.
[Galaxy S III Q&A, Help & Troubleshooting] VR.gtmini:
k, back on mm, apps works like was, with ext4 formatted sd too.
[Galaxy S III Q&A, Help & Troubleshooting] VR.gtmini:
How to - Provide WRITE PERMISSION on sd card for apps on Android Marshmallow

1. Backup File - packages.xml in /data/system folder

2. Open File - in QuickEdit app

3. Search - for app name

4. Paste - <item name="android.permission.WRITE_MEDIA_STORAGE" granted="true" flags="0" /> in/after <perms> tag

5. Save - by pressing back twice and confirming Yes(Grant Root permission if asks)

6 Reboot - ur done.

The only important task to do is ADDING that write permission WITHIN the <perms> tag of that specific app package name
[Galaxy S III Q&A, Help & Troubleshooting] le_zurdo:
Yes, you have to add that line for each app. I used adb shell to edit the file directly from my pc
[Galaxy S III Q&A, Help & Troubleshooting] jesrani:
I was trying to add this permission to an app called Memento Database. I could edit the file successfully with QuickEdit app and saved it. Rebooted. But when I tried to use the "Backup" function within the app to backup the "library" to SdCard, I again got the same EACCESS error.
[Galaxy S III Q&A, Help & Troubleshooting] jesrani:
I did as per your suggestion. Reopened the file after saving and closing just to check if line was there and it was. But after reboot the line disappeared. Is that possible?
[Galaxy S III Q&A, Help & Troubleshooting] 65536:
This is strange... Do you also use CM13?

I tried the Memento app, and for me it exports nicely to the SD card with the WRITE_MEDIA_STORAGE permission.

And despite everything I've tested, Android never deleted my added permissions from the packages.xml: I've installed and uninstalled several apps, updated an app with modified permissions, updated the ROM, and did several reboots in between, and Android doesn't seem to care about the edited permissions.

I expected that Android might rebuild the list when one installs/uninstall/updates an app, or when the Dalvik/ART cache gets updated. But this doesn't seem to be true.
[Galaxy S III Q&A, Help & Troubleshooting] jesrani:
Yes i am using CM13. Not sure why it happens. Will try again. Would be great if there can be some app for this
[Galaxy S III Q&A, Help & Troubleshooting] gr8den:
I have the same problem on Xperia Z3
[Galaxy S III Q&A, Help & Troubleshooting] zombie02:
I have the same problem on the Xperia Z2. With a reboot it just overwrites it's own packages.xml file or something
[Galaxy S III Q&A, Help & Troubleshooting] rauleeros:
same problem as the recent posters, my phone recreates the file once it is rebooted. S5 G900V running CM13

P.S. I have just checked again and it seems like the file is actually good. It says the permission thingie, but it doesn't affect the app (I have tried with OpenCamera and Mimi)
[Galaxy S III Q&A, Help & Troubleshooting] 2russell:
Me too. After reboot added permission will gone...
[Galaxy S III Q&A, Help & Troubleshooting] Datozzie:
Titanium Backup to SD card solution

Hey guys, not sure if it has been covered over the last 5 pages, but I have a Samsung Galaxy S7 with 6.0. I have had touble backing up to the SD Card, but have found the solution. Enter Preferences, then Backup Location, as normal, then change the Storage Provider to Document Provider Storage. Once this has been done go to SD Card in the File Explorer that pops up, and choose the folder. You will need to create a sub folder withing the folder, but it works.
[Galaxy S III Q&A, Help & Troubleshooting] maxmopp:
You are my marshmallow hero!
[Galaxy S III Q&A, Help & Troubleshooting] 65536:
With some playing around, I also managed to get Android to overwrite the packages.xml file again.

In fact, the only thing that works for me is the regular reboot. When using the quick reboot or just causing Android to crash, it will remove ther permission at the next boot.

When removing a permission, it writes something like

04-30 22:01:24.088 22758 22758 I PackageManager: Un-granting permission android.permission.WRITE_MEDIA_STORAGE from package com.keramidas.TitaniumBackup (protectionLevel=18 flags=0x3808be44)

into the system logcat.

But once Android "accepted" the permissions for one boot, they will stay in the file. So there definitely must be a backup somewhere in the flash memory.

I'm trying to figure out how this is done inside the PackageManager source code, maybe I find a solution.

But to be honest, I don't really like the whole way of editing the packages.xml and somehow circumvent Android's protections for this file. There must be a better way to get the damn write access to the SD card back!
[Galaxy S III Q&A, Help & Troubleshooting] jesrani:
Thanks for working on it, I think you are the first to find even this solution as I could not find anything elsewhere. Hopefully you can come up with an app for this most needed solution.
[Galaxy S III Q&A, Help & Troubleshooting] jesrani:
I had posted your solution in another thread (hope that is not a problem) and there seems to be a solution.

http://xdaforums.com/showpost.php?p=66686493&postcount=79

But someone has to try this and report. I am not very comfortable doing that. Maybe you or someone else can try this.
[Galaxy S III Q&A, Help & Troubleshooting] dreas74:
rufus is my hero!

it works with my z3c concept rom.

many thanks!
[Galaxy S III Q&A, Help & Troubleshooting] rufus.wilson:
I have created a zip file to fix it. It is available here.

Sent from my ONE E1003
[Galaxy S III Q&A, Help & Troubleshooting] althon:
Bravo, Rufus, it's working. Tested on Samsung Galaxy Express 2 with CM13. Thank you.
[Galaxy S III Q&A, Help & Troubleshooting] artlov:
At the first glance this patch working! Thanks.

Device and ROM in my signature (it's MM).

Do I understand correctly that after installing some new apps it's a good idea to run this patch again?
[Galaxy S III Q&A, Help & Troubleshooting] 2russell:
Hi bro. Does this metod works on other roms? I'm on marshmallow concept of Xperia z3.
[Galaxy S III Q&A, Help & Troubleshooting] rufus.wilson:
It has been tested on different ROMs and various phones. The best I can advise you is to make a backup of your system, flash it, reboot and report on the OT. If it does not work, restore your backup. If it does, get rid of the backup! :)
[Galaxy S III Q&A, Help & Troubleshooting] 2russell:
Wow bro it worked for me thank u so much. Love you bro. Device is z3 dual running marshmallow official 6.0.1.
[Galaxy S III Q&A, Help & Troubleshooting] luisflorit:
This works, but only partially. Once I update the app, the permission is gone...

Thanks,

L.
[Galaxy S III Q&A, Help & Troubleshooting] zabhi:
Your method is working on note 4 marshmallow as well.
[Galaxy S III Q&A, Help & Troubleshooting] althon:
It's working, but not for every app.

Overall it is better than nothing ;)

Thanks again and keep going with the good stuff.

Regards
[Galaxy S III Q&A, Help & Troubleshooting] Faraco80:
It's working fine in my S4 I9505 running CM13 official last nightly. I combined [MENTION=5472193]65536[/MENTION] solution with xposed's module XinternalSD.

I only had a problem with whatsapp. It's saving direct in the external SD fine but when i close the app and open again i cant open the images, videos and audios, its says "cant find in SD Card" but when i explore the external SD with ES Explorer i can find everything (audios, videos and images) there...

Someone know how to solve this?

Sorry my bad english...
[Galaxy S III Q&A, Help & Troubleshooting] Luckzzz:
For me was the contrary. The regular reboot made my Moto G 3rd Gen stuck at bootlogo.. I edited the file in Notepad++ on pc and granted the original permissions to the file (for me it was 0660).. So I'm trying to figure out how to adb push the backup file to the original folder.. Please help me :D

***EDIT**: I figure it out how to copy the original file (backup) from the externalsd to data/system/ folder without using adb push.. Use the File Explorer in TWRP (on menu click in Advanced > Explorer)! My Moto G is booting again.. !!!!!!!!
[Galaxy S III Q&A, Help & Troubleshooting] FuTChY:
Yes, copying the file using the file manager in TWRP should work.
[Galaxy S III Q&A, Help & Troubleshooting] kaodd:
Do it Man, just do it :) will be tons of download i think. everybody is waiting for a solution, specially noobs like myself :p
[Galaxy S III Q&A, Help & Troubleshooting] jtwilder:
SD Card Fix

Found a fix here. Formats the card as fat32, and android can mount it, and read/write. Use this as a portable SD card not internal!

Update...this does not fix the problem...sorry.
[Galaxy S III Q&A, Help & Troubleshooting] Bogazicili90:
Hello guys. I have a question. Does our S3 support Adaptable storage feature of MM 6.0.1? I tried to format my sd card as an internal storage by following the steps in storage section but each time it gives an error and doesn't format the sd card? Is it about the phone's capability or is it about the ROM issue? I made a quick research about that and it seems its about phone feature and even LG G5 and SG S7 said not to support it. The format should be as ext4 If I format the card as ext4 on my PC does it work on s3? What do you suggest about that?
[Galaxy S III Q&A, Help & Troubleshooting] snkmv:
The filesystem doesn't matter, when you choose to adopt sd as internal it will format the SD with its own filesystem, and yes our s3 supports, but it will refuse to accept slower cards..
[Galaxy S III Q&A, Help & Troubleshooting] smsm0111:
in htccamera app not work

I have huawei honor 3c with CM 13 on it .

install htc camera app on it and , and do above solution but this error shown : your removable storage is unavailable . storage has been switches to internal storage .
[Galaxy S III Q&A, Help & Troubleshooting] Bogazicili90:
Hello. Thank you for your reply. I couldn't format my SD Card as internal SD card. It is always interrupted with a pop up error message. I thought it was about hardware or kernel issue. I use boeffla kernel. According to your comment. My SD card is slow. This is why formatting as SD card isn't successful.
[Galaxy S III Q&A, Help & Troubleshooting] snkmv:
Can you be more specific with the error? Does it say anything?

And yes ofc our phone won't accept a slow card, speed is critical especially for an internal storage as we're constantly writing and reading it, slower cards - slower performance
[Galaxy S III Q&A, Help & Troubleshooting] Bogazicili90:
I don't remember what is exactly written. I formatted the card as portable SD card and it has tons of media inside. So I can't try to format it again since it takes some time for me to backup and put it inside again. It corrupts the SD card after error message. In the message there isn't any understandable explaination. It was technical and there were some codes and numbers. Thank you. I want to ask another thing. I can't back up my apps to SD card with Titanium Backup. This problem seems to be an MM problem. Can I use the method explained at the previous pages or is this about a supersu issue which titanium backup suggest to flash supersu?
[Galaxy S III Q&A, Help & Troubleshooting] snkmv:
I doubt it's because of cm's su, re-reading the thread and trying the methods might worth the shot..

Also check Apps>Titanium Backup>Permissions and see if you granted all permissions requested, ALL of them, I disabled the location service for a photo editor app and it went crazy on me
[Galaxy S III Q&A, Help & Troubleshooting] luisflorit:
Absolutely. It is either a CYM or a MM nasty bug.

I made an app myself that asks for storage write permission, the popup appears, user clicks ok, storage write permission is enabled in app manager..... and yet the app CANNOT write in the external sdcard.

Fir this reason, I am still using Android 4.4!

L.
[Galaxy S III Q&A, Help & Troubleshooting] Bogazicili90:
I read in another thread that external SD card write issue is because of marshmallow. And a developer made an zip file to grant the all permissions in order to write external SD card. I doubted included SU app but all of my other apps have no problem with SU. I think this is because of MM permissions not about SU. Marshmallow doesn't allow to write to external SD card.
[Galaxy S III Q&A, Help & Troubleshooting] Irumar:
Simple solution. Faced with the same problem in my lg g3, I formatted my sdcard as "internal storage", after rooting and changing the build prop edit. Now my swap ram enhancer is able to write, including titanium backup. I am on global android marshmallow, with stock kernel. It is a marshmallow issue. Only, I need to shut down phone, take out sdcard if needed, reinsert sdcard, and only then power it back on.
[Galaxy S III Q&A, Help & Troubleshooting] beningodfrey4:
How exactly would you use that app to provide all apps write access?? I'm practically a noob, so any help would be appreciated, thanks.
[Galaxy S III Q&A, Help & Troubleshooting] psycho75:
use this rom for i9300

Temasek MM Rom can write at sdcard. No MM bug. I tested many Roms. This is the only one, with write permissions. A great Rom. Try it out. Sorry. My English is not so good. http://xdaforums.com/galaxy-s3/development/rom-temaseks-unofficial-cyanogenmod-13-t3286265
[Galaxy S III Q&A, Help & Troubleshooting] heross:
Hello,

i have try it with edit/reboot and with edit on PC and push to /data/system in TWRP on my MM Xperia Z3c and Alcatel Idol 3.

The Xperia Z3c do not boot anymore. The Idol 3 boot with" optimize Apps" and after boot packages.xml no longer exists and i have only a file named "packages_backup.xml" without the line "WRITE_MEDIA_STORAGE". :crying:

You have write in the meantime a root App to add line? Ore have you found a better solution?
[Galaxy S III Q&A, Help & Troubleshooting] rufus.wilson:
I have written a flashable zip here. Support for MM is very experimental: for some ROMs it works and for others it does not...
[Galaxy S III Q&A, Help & Troubleshooting] eteles:
Apps Kodi (xbmc) and vuze already have the write to external sd card permissions in the XML file, but they still can't write to my sd card... what could be wrong?
[Galaxy S III Q&A, Help & Troubleshooting] balamu96m:
Fixed! :D

So, I wrote an Xposed Module to fix this issue and it works perfectly. No need to edit any xmls, this hooks up the system method and solves the issue. Thread coming up soon.

Attached a couple of screens.
[Galaxy S III Q&A, Help & Troubleshooting] eteles:
I want it!! :)

Enviado de meu Lenovo K50a40 usando Tapatalk
[Galaxy S III Q&A, Help & Troubleshooting] balamu96m:
Here you go. This Xposed module solves the issue!

link: http://xdaforums.com/xposed/modules/xposed-marshmallow-sd-fix-write-t3403263
[Galaxy S III Q&A, Help & Troubleshooting] zabhi:
Not working on note 4 N910c stock
[Galaxy S III Q&A, Help & Troubleshooting] eteles:
Did not work for me... I think the apps themselves (kodi and vuze) need to be updated... They already have the permission in the XML file, but can't write to the SD card, don't know why...

Enviado de meu Lenovo K50-t5 usando Tapatalk
[Galaxy S III Q&A, Help & Troubleshooting] Yamaha169:
I have same issue as this... I have tried to flash the MM ext sd fix...

tried to modify the platform.xml as described here (old Kitkat fix)

tried to change the api referencing to sdk 22 (instead of 23)

nothing works, and its causing the camera to "fail" and its causing my gallery images to "appear" missing and cant open them....

"although I have gotten native android to allow write" its not a solution if it breaks everything else :)

"WAITING" GO DEVS! thousands WAIT!
[Galaxy S III Q&A, Help & Troubleshooting] coukou:
Hello,

I upgraded my Galaxy Note 4 SM-910C from 5.1.1 to MM 6.0.1 ROM XEH-N910CXXU2DPE6 (original).

Everything works just fine except External SD card write restriction.

So, I added

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

line to all the apps (560) or rather I added the above line each set of <perms> and </perms> taking into account duplicates.

On the other hand, I've added anywhere

in/after <perms>tag

It was very laborious, but I got it... tested on a few apps... It works :D
[Galaxy S III Q&A, Help & Troubleshooting] Will1628:
Replace all

I'm too lazy to go through the whole file. I just did a replace all

<perms>

with

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

.

Seems to work so far but its a little sluggish on first boot.

No obvious issues so far.
[Galaxy S III Q&A, Help & Troubleshooting] coukou:
That was for a test.

Do not add that line to all apps, but only those that do not enable write to the SD card.
[Galaxy S III Q&A, Help & Troubleshooting] ElPoonPoon:
Massive thanks to "balamu96m" that xposed module works a treat! Definitely the easiest way to do it with specific app control. Was doing my head in not able to delete my own files off my own card without mounting it to PC.
[Galaxy S III Q&A, Help & Troubleshooting] pablo7890:
I can confirm it works on Xiaomi Redmi Note 3 Pro on Santosh's CM13.0.1. Awesome work. Keep it up ☝ :)
[Galaxy S III Q&A, Help & Troubleshooting] ScorpioSoft:
Thank you, man, you are great :) !

Above is working for me !
[Galaxy S III Q&A, Help & Troubleshooting] apollo_81:
Guys like you enable write access to external sd with Huawei mate 8 Android 6.0? thank you
[Galaxy S III Q&A, Help & Troubleshooting] Devilix:
Does exist a way to save pics from camera app directly on SD card???
[Galaxy S III Q&A, Help & Troubleshooting] sjlouis:
I've flashed AIPCP 11 which is based on CyanogenMod 13 on my LG G3 D855 and I've lost the ability to write on the external SD card. I've done a lot of tries before seeing this post : using applications as SD Fix or ExtSD Fix v2.9b, or modify platform.xml. First I added permissions which I had in the previous version but it doesn't work. And I've seen your post. The syntax is not exactly the same. For this section, I have :

<permission name="android.permission.WRITE_MEDIA_STORAGE" >
<group gid="media_rw" />
<group gid="sdcard_rw" />
</permission>

Then I tried to add "granted="true" flags="0" /" between "STORAGE" and ">", I tried to delete the 2 lines between the 2 "permissions", I delete all my paragraph and I add yours even if it's not the same construction but nothing works.

Is the problem with the syntax which is not the same? I have also red we have to do it for every application but I don't know how to create a paragraph and how to name every application.

I've found only 3 lines with application, for example :

<permission name="android.permission.ACCESS_FM_RADIO" >
<group gid="media" />
</permission>

But in my list application, its name is "FM Radio". Then why "ACCESS", "media"? I have for example to give permission to Dolphin and Stylenote Pro and I don't know how to process.

If you can help me :) .

When I modify "platform.xml", I use Total Commander and it's able to record the file and maintain the rights. It's convenient even if it would be better on PC but in this case, I can't modify rights. This new version is problematic :confused: .
[Galaxy S III Q&A, Help & Troubleshooting] jabiri1973:
Helo kies has not work after installing m.d.4 v13 on my s3 gt i9300
[Galaxy S III Q&A, Help & Troubleshooting] ZeeJcG:
LOL we are talking cm 13 not STOCK MM. Get lost dumb.
[Galaxy S III Q&A, Help & Troubleshooting] dry707jr:
Cannot write to SD card

My sys permission folder does not have a write to external storage cmd Marsmallow 6.0.1. Is there any way to add it?
[Galaxy S III Q&A, Help & Troubleshooting] DrXperience:
I did it for just one application, on my Xperia Z CM13 as well as Yu Yuphora Cm13 again. On both the phones the system stuck on boot screen.