I'm trying to write files to the / system / priv-app directory. I start in recovery (TWRP) and launch adb shell.
~ # mount / system ~ # mount rootfs on / type rootfs (rw, seclabel) ... / dev / block / mmcblkXXXX on / ext4 system type (rw, seclabel, relatime, data = order)
I can then run:
~ # mkdir / system / tmp ~ # touch / system / tmp / test
It works fine: I have no problem to modify / system. (I can also delete elements from / system / priv-app.) But if I try to to write to / system / priv-app I get the following:
~ # mkdir / system / priv-app / test mkdir: unable to create directory & system / priv-app / test: read-only file system ~ # mount rootfs on / type rootfs (rw, seclabel) ... / dev / block / mmcblkXXXX on / ext4 system type (ro, seclabel, relatime, data = order)
Now the system is suddenly mounted read-only! The permissions and property are the same in / system and / system / priv-app and I am running as root.
~ # ls -al / ... drwxr-xr-x 18 root root 4096 25 November 07:32 system ~ # ls -al / system ... drwxr-xr-x 59 root root 4096 August 5, 1972 priv-app
In TWRP, SELinux is set to permissive:
~ # getenforce Permissive
I'm using Lineage OS 14.1 (Android Nougat) on a 2015 Moto G (aka Moto G3). It is rooted in the official addon of Lineage su. I've also tried Magisk and I've got the same result.
Ideas fail me and I can not find the right search terms because I tried a lot of things and did not reveal anything.
How can I enable write to / system / priv-app?