SD Card no writing permission in FP2

Ok, I tried:

since I couldn’t see “cp” in the entered string after execution I entered the command again and executed again. Is that a critical mistake?

After that I did a reboot and launched K9 trying again to store an attachement on my sdcard1.
But it didn’t work: “Anhang konnte nicht auf die sd-Karte gespeichert werden”.

Also I had a few error-messages saying that youtube, google-play dienste an google maps were terminated and so Threema isn’t working any more too!

Now I try to push back the originally pulled platform.xml (I am so glad that I stored it for security reasons…) in order to have my phone working again…

Maybe I try that busybox thing afterwards but I couldn’t find it at the end of the topic that you have mentioned.
Do you mean that app ???
Can my phone install such a file? I don’t use google play any more.

Thanks very much for helping me!

I see. I guess the problem with that approach also was that - what we are trying to solve - you have no rights to write to the SD.

However, if you still have the mail in K9, just save it to the default directory, which for me is /storage/sdcard0/Download - which is just the regular Download folder on the internal storage. Then you could take the file from there (or wherever else K9 is saving your file to; you would then just need to change the file location in the cp command below).

So after storing the file there, the steps would be:

E:\ProgrammeAuf_E\Kommunikation\Minimal ADB and Fastboot>adb shell
shell@FP2: su
root@FP2: mount -o rw,remount /system
root@FP2: cp /storage/sdcard0/Download/platform.xml /system/etc/permissions/platform.xml

About busy box: there are several apps that provide busy box. I currently use this one.
Many apps that need root rights actually also need a busy box installed. Basically it brings many features from a linux terminal (small programs, like vi, wget etc.) onto an Android device. In this case, vi is the key fetaure (a simple text editor for the terminal).
This would work like this:

adb shell
mount -o rw,remount /system
vi /system/etc/permissions/platform.xml

edit the file as suggested above and exit vi by typing


and exit su & shell.

First of all I want my phone to work again.
Therefore I tried to repush the originally pulled platform.xml like this:

So that didn’t work. I thought to manually erase the platform-file on my sdcard hoping that the push would work afterwards. But there insn’t any any more! Also amaze doesn’t show sdcard0 any more. Giving root to amaze it shows me at least the root.
So how do I get my phone working again ak how do I get back the original platform.xml?

ah, ok, now I understand your advice- ok I try!

  • as expected K9 can’t receive mails any more. So I should try a push to the root-folder, I guess?

Are you sure the original platform.xml is gone from the phone?
The adb pull command should only have copied the file to the computer, but not cut it.
In any way, we’ll get the modified version to the right place :slightly_smiling:

I am just not sure what happens if the platform.xml is missing, i.e. where else you could push the file to, since I think it contains necessary information on how to mount some drives.

Actually, I just figured out that with Amaze it is possible to edit the files in place :grinning:

So the easiest thing would be to point Amaze to /system/etc/permissions, mark the platform.xml, click “open with”, and choose the Amaze text editor. Then you can edit the file easily there!

In case you have lost the file, you can also point Amaze to /system/etc/permissions and create a new platform.xml file (You can copy the content from the platform.xml you have edited).

Haven’t figured that earlier, but I guess that it might be the simplest solution. Just make sure that you have granted superuser rights to Amaze.


This worked for me while the push command did not go through either.

Thanks for still searching a solution for me!
OK, I did open it with amaze and I am surprised:

Seems like the edited file is actually there where we tried to send it. Was my editing correct? Because my phone is still not properly working…

I’d say the file is corrupt that way. You probably used an editor that tried to be clever and substituted (at least) < and> with escape notation.

Sounds like an explanation. I still got the original not modified file on my pc. So I should try to get that back again?

You could also try to use mine. I made it available here:

Either copying it to right location, or replace the contents of the file in amaze text editor.

Yes, one of those two possibilities. Only make sure editing will be done with a “real” text editor. Amaze editor should do the trick, I guess

Thanks again!
The editors don’t have a search and replace function so I have to do that by hand :frowning:
And I couln’t push your file…

If the screenshot above shows the content of the file in /system/etc/permissions then you’ll anyway need to replace the whole file :slightly_smiling:
In that case, just mark all, delete, copy all from my file and paste it. That should be sufficient.

I’d really like to do that. But I got no idea how to get your file into my phone. Tomorrow I’ll try the push for the last time. If that doesn’t work again I’ll try a factory reset. Will that make my phone work again?

If you use the amaze editor you won’t need to copy the file to the phone - that is, if you still can use your web browser. You only would need to be able to open the file and copy it’s content to replace the content of the corrupted file.

I am not sure though if a factory reset would do it, since to my understanding it only clears the /data partition, but the corrupted file sits in the /system partition.

Thanks for the information. Unfortunately the tint browser doesn’t work any more since the google services don’t run any more. So my only chance would be to write the file manually using your file that I downloaded.

Yes, it seems to be a bit tricky, but there are still a couple of possibilities.

Writing the file by hand would be one, but it’s quite some text to copy by hand, with the risk of making mistakes. However, if you’d just write enough by hand to mount one sdcard, you could push the file there and copy it into the right location.

Are any apps still running, or what apps do not run?

I was just thinking that if basically some apps can still run, it might be worth trying to install busy box via adb, which gives you the possibility to use either wget to download files from the internet (right to the location you want them to be), as well as vi to edit files through the terminal.

I would send the text of the originally pulled and “working” platform.xml via sms in small pieces.
Will that work?
What about the greater space between parts of strings. Is it important how much space there is?
I’ll upload the whole file so that you can see it.
Could you tell me, which parts are not necessary? So I don’t need 30 sms…
OK, upload impossible. So here is the content:

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

<!-- 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 name="android.permission.BLUETOOTH" >
    <group gid="net_bt" />

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

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

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

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

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

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

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

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

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

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

<!-- 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" />

<!-- 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" />

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

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

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

<!-- 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 name="android.permission.ACCESS_FM_RADIO" >
    <group gid="media" />

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

<!-- 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"
<library name="javax.btobex"

<!-- 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="" />

Everything between the two arrows is <!-- NOT CODE --> so it can be skipped.