FORUMS
Remove All Ads from XDA
H10 GPU

[FIX]Fix external SD Card permissions (updated 2012-02-05)

2,644 posts
Thanks Meter: 2,746
 
By garyd9, Inactive Recognized Developer on 22nd January 2012, 02:03 AM
Post Reply Email Thread
NOTE: Please see the following post for the original modification (as far as I'm aware) and the manual method of doing the same thing: http://forum.xda-developers.com/show...96&postcount=7

This "update.zip" style installer simply automates the process of modifying /system/etc/permissions/platform.xml to make the tablet permissions act the same as previous versions of android.

In particular, programs with the WRITE_EXTERNAL_STORAGE permission will be able to write to the removable storage card. (Honeycomb changes this to require WRITE_MEDIA_STORAGE which very few, if any, 3rd party programs use.)

If you are having issues with programs writing to your storage card, this might fix it.

This uses 'sed' to make the edits. If this is installed twice, it won't re-modifying the file. (However, if you have manually edited the platform.xml file, and then run this script, it might make create duplicate, but harmless, <group> entries. Before making the modification to platform.xml, it will create a backup of the file (called platform.xml.backup) in the /system/etc/permissions directory (if the backup doesn't already exist.)

Instructions:

Download the file, and place on your sdcard. Reboot into recovery and install .zip from sdcard. Choose this file. Done..

(I've tested this with my CWM based recovery and it works. It _should_ work with the factory recovery as well, but I haven't tested... Please reply with your results.)

Support:

None. If you aren't familiar with using recovery to install updates, you should research the topic before continuing.

More info:

If you are curious, here is the sed command I'm sending, using busybox compiled from the cyanogenmod sources:
Code:
sed -e '/WRITE_EXTERNAL_STORAGE" >$/N;s/\n\(\([ \t]*\)<group gid="sdcard_rw".*$\)/\n\2<group gid="media_rw" \/>\n\1/' -i /system/etc/permissions/platform.xml
What that means is: do an "in-place" edit on /system/etc/permissions/platform.xml, and find the line containing "WRITE_EXTERNAL_STORAGE >", then if the next line contains some whitespace followed by "<group gid="sdcard_rw" />", replace that sdcard_rw line with two new lines, the first being "<group gid="media_rw" />" and the second being the exact line that contained "sdcard_rw". I purposely put the media_rw line before the sdcard_rw line to prevent this same sed command from finding the same match again. In other words, if you run this sed command 50 times on the same file, it'll only make the change the first time.

(I'm not fluent with sed, so if someone knows a better way to do that, please feel free to educate me.)

File is attached below...

UPDATED Feb 5th, 2012: the script will change the filesystem permissions of the platform.xml file before attempting to edit it. This MAY overcome issues people have been having with non-rooted devices, but I'm unable to test so I don't know. Okay, well, it appears that this won't work for a device that doesn't have CWM Recovery installed. Not sure why, but at least I've repeated it.


Take care
Gary
Attached Files
File Type: zip fix_perms_20120205.zip - [Click for QR Code] (683.7 KB, 16162 views)
The Following 26 Users Say Thank You to garyd9 For This Useful Post: [ View ] Gift garyd9 Ad-Free
 
 
22nd January 2012, 04:10 AM |#2  
Senior Member
Flag Pittsburgh
Thanks Meter: 62
 
More
I assume this is for the 6210, but will it work for all versions?

Sent from my Galaxy Tab 7 Plus
22nd January 2012, 04:11 AM |#3  
Junior Member
Thanks Meter: 0
 
More
Sweet, thinking about flashing this. Will it work on non-root systems?
22nd January 2012, 04:19 AM |#4  
garyd9's Avatar
OP Inactive Recognized Developer
Flag Pittsburgh, PA
Thanks Meter: 2,746
 
More
Quote:
Originally Posted by ringnutz

I assume this is for the 6210, but will it work for all versions?

It should, but I have no way to test. I can tell you that it won't cause any harm. Go ahead and install it, and then (using adb or a file explorer tool) copy the /system/etc/permissions/platform.xml (and platform.xml.backup) files and compare them (or send them to me and I'll compare them) to verify.
22nd January 2012, 04:21 AM |#5  
garyd9's Avatar
OP Inactive Recognized Developer
Flag Pittsburgh, PA
Thanks Meter: 2,746
 
More
Quote:
Originally Posted by pacmanftw

Sweet, thinking about flashing this. Will it work on non-root systems?

It should, but I haven't tested it. It shouldn't cause any harm, however, so feel free to try it.
22nd January 2012, 05:45 AM |#6  
Senior Member
Flag Pittsburgh
Thanks Meter: 62
 
More
Quote:
Originally Posted by garyd9

It should, but I have no way to test. I can tell you that it won't cause any harm. Go ahead and install it, and then (using adb or a file explorer tool) copy the /system/etc/permissions/platform.xml (and platform.xml.backup) files and compare them (or send them to me and I'll compare them) to verify.

I have the 6210 as well, just wanted to clarify to cut down on the inevitable questions that would follow. Thanks again

Sent from my Galaxy Tab 7 Plus
23rd January 2012, 05:18 PM |#7  
nrage23's Avatar
Senior Member
Flag Richmond, VA
Thanks Meter: 688
 
More
Worked perfectly for me.
23rd January 2012, 05:22 PM |#8  
Zadeis's Avatar
Senior Member
Thanks Meter: 98
 
More
Absolutely fine here. Before I couldn't move files to the SD card using AirDroid now I can
24th January 2012, 02:06 AM |#9  
edan1979's Avatar
Senior Member
Flag KL
Thanks Meter: 1,406
 
Donate to Me
More
Yup... its working fine with my plus...

Sent from my GT-P6200 using xda premium
24th January 2012, 02:57 PM |#10  
guags99's Avatar
Member
Thanks Meter: 4
 
More
Thanks for this. I started to script a fix for this but then I found yours. Thanks again!a
27th January 2012, 09:18 AM |#11  
Junior Member
Thanks Meter: 0
 
More
Smile
It's work for P6200
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes