Modification of Android 10.0 SystemServer process read and write sdcard permissions

1 Introduction


  In the system development of 10.0, in some system processes, that is, in the process of SystemServer, some functions of reading and writing Sdcard will be required in the system service, and then there is no permission to read sdcard by default, but you can apply for it in the
app The sdcard read and write permission cannot apply for permission in the system service. Next, let’s see how to authorize the sdcard authorization

As shown in the picture:

 

2. The modified core class of the SystemServer process to read and write sdcard permissions

kernel-4.14\fs\namei.c
frameworks\base\core\java\com\android\internal\os\ZygoteInit.java
frameworks\base\services\core\java\com\android\server\policy\PhoneWindowManager.java

3. The core function analysis and implementation of the modification of the read and write sdcard permissions of the SystemServer process
3.1 Analysis of the relevant permissions of ZygoteInit.java

SystemServer is the entry point used by the system to start the service.
When the Android system starts, two important processes are started, one is the Zygote process
and the other is the system_server process forked from the zygote process;
SystemServer will start a series of services we need in the system

SystemServer is an important process in the Android system, where the main services in the system reside:
common ones such as WindowManagerServer (WMS), ActivityManagerService (AMS),

Guess you like

Origin blog.csdn.net/baidu_41666295/article/details/132383443