SD Card no writing permission in FP2

I moved your topic to this one, as you will find all explainations and anwers here…

Regarding the file show in this post : SD Card no writing permission in FP2 - #40 by barney

One should not forget to include the :

<?xml version="1.0" encoding="utf-8"?>

At the begining, followed by a :

<permissions>

Opening tag, closed at the file ending by a :

</permissions>

(don’t miss the plural form).

<?xml version="1.0" encoding="utf-8"?>

<permissions>
<!-- ================================================================== -->
<!-- ================================================================== -->
<!-- ================================================================== -->

<!-- The following tags are associating low-level group IDs with
     permission names.  By specifying such a mapping, you are saying
     that any application process granted the given permission will
     also be running with the given group ID attached to its process,
     so it can perform any filesystem (read, write, execute) operations
     allowed for that group. -->

<permission name="android.permission.BLUETOOTH_ADMIN" >
    <group gid="net_bt_admin" />
</permission>

<permission name="android.permission.BLUETOOTH" >
    <group gid="net_bt" />
</permission>

<permission name="android.permission.BLUETOOTH_STACK" >
    <group gid="net_bt_stack" />
</permission>

<permission name="android.permission.NET_TUNNELING" >
    <group gid="vpn" />
</permission>

<permission name="android.permission.INTERNET" >
    <group gid="inet" />
</permission>

<permission name="android.permission.READ_LOGS" >
    <group gid="log" />
</permission>

<permission name="android.permission.READ_EXTERNAL_STORAGE" >
    <group gid="sdcard_r" />
</permission>

<permission name="android.permission.WRITE_EXTERNAL_STORAGE" >
    <group gid="sdcard_r" />
    <group gid="sdcard_rw" />
</permission>

<permission name="android.permission.ACCESS_ALL_EXTERNAL_STORAGE" >
    <group gid="sdcard_r" />
    <group gid="sdcard_rw" />
    <group gid="sdcard_all" />
</permission>

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

<permission name="android.permission.ACCESS_MTP" >
    <group gid="mtp" />
</permission>

<permission name="android.permission.NET_ADMIN" >
    <group gid="net_admin" />
</permission>

<!-- The group that /cache belongs to, linked to the permission
     set on the applications that can access /cache -->
<permission name="android.permission.ACCESS_CACHE_FILESYSTEM" >
    <group gid="cache" />
</permission>

<!-- RW permissions to any system resources owned by group 'diag'.
     This is for carrier and manufacture diagnostics tools that must be
     installable from the framework. Be careful. -->
<permission name="android.permission.DIAGNOSTIC" >
    <group gid="input" />
    <group gid="diag" />
</permission>

<!-- Group that can read detailed network usage statistics -->
<permission name="android.permission.READ_NETWORK_USAGE_HISTORY">
    <group gid="net_bw_stats" />
</permission>

<!-- Group that can modify how network statistics are accounted -->
<permission name="android.permission.MODIFY_NETWORK_ACCOUNTING">
    <group gid="net_bw_acct" />
</permission>

<permission name="android.permission.LOOP_RADIO" >
    <group gid="loop_radio" />
</permission>

<!-- Hotword training apps sometimes need a GID to talk with low-level
     hardware; give them audio for now until full HAL support is added. -->
<permission name="android.permission.MANAGE_VOICE_KEYPHRASES">
    <group gid="audio" />
</permission>

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

<!-- ================================================================== -->
<!-- ================================================================== -->
<!-- ================================================================== -->

<!-- The following tags are assigning high-level permissions to specific
     user IDs.  These are used to allow specific core system users to
     perform the given operations with the higher-level framework.  For
     example, we give a wide variety of permissions to the shell user
     since that is the user the adb shell runs under and developers and
     others should have a fairly open environment in which to
     interact with the system. -->

<assign-permission name="android.permission.MODIFY_AUDIO_SETTINGS" uid="media" />
<assign-permission name="android.permission.ACCESS_SURFACE_FLINGER" uid="media" />
<assign-permission name="android.permission.WAKE_LOCK" uid="media" />
<assign-permission name="android.permission.UPDATE_DEVICE_STATS" uid="media" />
<assign-permission name="android.permission.UPDATE_APP_OPS_STATS" uid="media" />

<assign-permission name="android.permission.ACCESS_SURFACE_FLINGER" uid="graphics" />

<!-- This is a list of all the libraries available for application
     code to link against. -->

<library name="android.test.runner"
        file="/system/framework/android.test.runner.jar" />
<library name="javax.obex"
        file="/system/framework/javax.obex.jar"/>
<library name="javax.btobex"
        file="/system/framework/javax.btobex.jar"/>

<!-- These are the standard packages that are white-listed to always have internet
     access while in power save mode, even if they aren't in the foreground. -->
<allow-in-power-save package="com.android.providers.downloads" />
</permissions>

(I’ll keep editing this post to present a correct ‘stock’ platform.xml file)

Files seem equivalent but the good way of doing it is to get a fresh one this way :

If you need the file “fresh” again (but what you show looks okay, it’s just the file without changes), you can just download the bin blob and unpack it. You will find the “fresh” file under: ./vendor/qcom/proprietary/target/product/FP2/system/etc/permissions/platform.xml

FYI: Probably the two threads No internet at all and No data connection after update to 1.4,2 and rooting were related to this thread.
I think that my unsolvable problems with internet connection were triggered by changing platform.xml in a wrong way. After I couldn’t find a solution to bring back the internet connection I sadly reflashed my phone with Open OS 16.06.

Today I have changed again platform.xml in regard to SD Card no writing permission in FP2 (but I used Ghost Explorer instead of Amaze) and I mentioned that after saving platform.xml the read permissions for group and others were missing.
So I gave back read permissions to all on platform.xml before remounting /system with RO option and rebooting and the phone is still running :slight_smile:

But I don’t know for sure if this approach is saving the phone from bricking.
Update: No, it doesn’t. Saver approach see here: SD Card no writing permission in FP2

I don’t know why @barney 's version of platform.xml got here. but I know for sure, that it is confusing everything. And @siltaar made it not better.

For all, who want write-rights to their sdcard: do only a small change in your platform.xml as shown in post 2 by @Arvil. Navigate to that file with Amaze and edit it via “open as” “Text” with “Amaze Editor”.

1 Like

:thumbsup: Thanks for pointing out the right solution.
Still I marked post #3 as the solution just now, as it’s the one most FP users can do themselves.

Sorry I think I’m annoying, but yesterday my phone was again unusable (i.e. no network at all) from changing platform.xml on running system with Amaze editor although correcting read permissions afterwards. Fortunately this time I have a two days old backup on 16.06 version.

I don’t know for what reason this happens but I have to warn about changing platform.xml on running system. There could be a remaining risk to make your phone unusable (maybe other running apps writing to remounted /system).
I recommend to start in TWRP recovery mode and copy a changed version of platform.xml
(for example prepared on ExtSDCard using Amaze editor) into /system/etc/permissions.
I had done this immediately after installing the update zip file for 16.07 and all is ok so far.

I will add my recommendation to ✏ Update Guide for a modified FP Open OS (with Gapps, Xposed and more)

Is this app trustworthy? I mean no ads and no “phoning home” ?

1 Like

If you edit your platform.xml and only insert this line:

at the right place:[quote=“Arvil, post:2, topic:11841”]
<permission name=“android.permission.WRITE_EXTERNAL_STORAGE” >
[/quote]
then you can do no harm to your operating system.

I think, rw permission should be default. It does not make sense to forbid the sdcard access.
This is an unwanted restriction for almost every user.
When editing platform.xml by hand, it does not survive OS updates. As I store my music
on the sdcard, it has the ugly effect, that all my playlists are emptied, because the music files
are not readable.

1 Like

The pop up screen is so small I need a magnifier trying to read it.
And then I don’t understand what it says.

To get my pictures out of my phone I copied them to a samba server.

Every time an update for FP Open rolls up, it overrides the write permissions on my sdcard1, making it read only. I can’t be bothered to go bit-shifting on my phone, editing configuration files by hand, so I do what every standard user does - I use an app for that.

I fix this problem every time with an SD Card Permission Fixer. I guess it shifts whatever bits it needs to make the SD card useable as intended for you.

This is what I use. It works with FP Open Marshmallow. Choose whatever floats your boat. Play Store is chock full of them apps, found nothing in F-Droid.

At least I don’t have to do this a lot, since updates don’t happen very often. The last FP Open security update was two and a half months ago (05.12.2016), so that’s not too much of a hassle.

EDIT 20170313 - Works on FP open 17.02.0

1 Like

Hello Avril. Could you please correct the last line of your guideline from “adb push permissions.xml …” to “adb push platform.xml …” because I have linked to your guideline from ✏ Update Guide for a modified FP Open OS (with Gapps, Xposed and more) and therfore its better that there is no mistake in the guideline. Thanks.

1 Like

Hi I am on my phone and don’t see the edit button maybe a moderator could do it for me please?

Cheers

1 Like

Done. :slight_smile:

I admit, this thread is beyond me. Could someone, in simple words, explain how to solve this on a non-rooted phone without Google Play Store installed?

-) Amaze has the app permission “modify or delete the contents of your SD card”
-) I can create folders via “mount SD card” from the PC, so physically, writing is possible
-) The new folder has permissions “rwx”, yet Amaze cannot write inside it

It’s not possible without root.

2 Likes

That is bitter. Is this nowadays the norm for Android phones? But thanks for an answer that probably saved me another hour of online research.

I recently installed FP OOS (thanks again to those who helped me getting it to run) and now want to install my first update. As suggested here, I want to do a Titanium Backup first. This, in turn, I want to save onto my external SD card, but in the relevant setting inside Titanium Backup (correct me if I’m wrong: Preferences - Backup folder location - Storage provider: Filesystem (click to change) - Filesystem storage) it says “This folder is not writable” when I choose a folder on the external SD card. It does say it’s writable when I’m in a folder on the device itself.

I thought the reason might be the external SD card writing permissions, even though I’m on Android 6 (shouldn’t this be fixed in Android 6?). So I pulled platform.xml with adb, but it doesn’t have the same code as in the 2nd post in this thread (the permission WRITE_EXTERNAL_STORAGE). I assume this is due to Android 6 not being 5. In the only relevant part it says:

(permission name=“android.permission.WRITE_MEDIA_STORAGE” )
(group gid=“media_rw” /)
(group gid=“sdcard_rw” /)
(/permission)

(had to change the triangular brackets to round ones because otherwise you have to use some formatting voodoo for them to show up on this forum)

So it does have the media_rw permission. Does anyone know where the problem lies?

I have found a bit of a makeshift solution here:

“There is an elegant way of giving TitaniumBackup write access to the external sdcard, without having to forfeit security (as in method 3 below). Since the time of Android 4.3, Google uses a very clean security-solution by giving apps that request write access to external SD, permission only to their own folder – not to the entire card! In order to get TitaniumBackup to work without compromising security, you can simply create a folder on the external sdcard,using the following folder-structure: /storage/extSdCard/Android/data/com.keramidas.TitaniumBackup/
If you already have existing backups, move them with a file-explorer from their current place to: /storage/extSdCard/Android/data/com.keramidas.TitaniumBackup/ Lastly, go to the preferences of TitaniumBackup, choose “Backup folder location” and choose the above specified folder.”

So it seems like in Android 6 Google has continued the idiocy of not making the external SD card fully writable. With this solution one can at least make TB backups directly to the external SD card.

Any help on what exactly to write into which file (permissions.xml? platform.xml?) to make the card fully writable would be appreciated.

2 Likes

(Sorry for the 3rd reply in a row, but it seems some users are actually interested in my progress in trying to solve this issue under Android 6)

It seems like the above method hasn’t exactly done the trick. I want OpenCamera to save photos it takes on the external SD card, so I have used the above method, that is, created a folder named “net.sourceforge.opencamera” in external_sd_card\Android\data\ and directed OpenCamera to this folder in its settings. “net.sourceforge.opencamera” is the “Google Play Store codename” for the app (I don’t know the proper term for this, but it shows up in the URL when you access it in the Play Store and should be the right name for the folder). However, OpenCamera instantly tells me it can’t write to this location and no “select external SD card” dialog pops up. So I’m back to square one for now.

@paulakreuzer I would like to suggest to remove the “solved” mark of post #3. It seems like this solution worked on Android 5, but not on 6 anymore, and 6 is where both FP OSes are currently.

2 Likes