1 Introduction
In the 9.0 system rom customization development, the recovery mode function is also a very important part of the system. In the native system, for the products in the debug mode, you can enter the recovery mode through the power button and the volume + button, but for the products in the user mode, for products in the user mode, this method is restricted to enter the recovery mode, preventing users from doing nothing. For product safety, it is not allowed to enter the recovery mode. The needs of some special products require that products in the user mode also need to enter the recovery mode, so it needs to be analyzed. The following system enters the process of recovery mode to analyze the
function
realization
2. The core class that removes the restriction of the system from entering the recovery function in the user mode customized by the system rom
bootable/recovery/recovery.cpp
bootable/recovery/recovery.h
3. The core function analysis and implementation of the system rom customization in the user mode to remove the restriction of the system entering the recovery function
In the system, when we enter the recovery mode through buttons or applications, the essence is to load recovery.img after the kernel, and the first process executed after the kernel is up is init, which will read init.rc to start the corresponding services. In the recovery mode, the service started is to execute the recovery executable file, which is
generated by the bootable/recovery/recovery.cpp file
. Before realizing the function, it is necessary to analyze the relevant execution process of the system entering the recovery mode, and then analyze the relevant code. When we enter the recovery mode through buttons or commands, the essence is that the system loads recovery.img after the kernel is loaded. The first process executed after the kernel is up is init, which will read in init.rc starts the corresponding service
. In recovery mode&#x