The principle of rooting Android, the role of mobile phone rooting

What is the principle of obtaining root permissions on Android phones?

The principle of ROOT permission is to put an executable file "su" in the /system/bin/ or /system/xbin/ directory of the Android phone. This "su" file is equivalent to a "Trojan horse file" su, but it is a binary file and will not cause any damage to the phone. This su file can be used by any user, but only the shell or root is allowed to use su in the native Android system, and ordinary users cannot use the su file, which is the essential difference between root users and ordinary users.

The root su file can be swiped in by swiping the card, that is, the mobile phone enters the recovery mode to flash in. The recovery mode refers to a mode that can modify the internal data or system of the Android phone (similar to windowsPE or DOS). In this mode, the data of the mobile phone can be changed, which is equivalent to the administrator level. You can clear and increase data at will, and even erase the entire system, so it is still possible to put in a su file.

What is the principle of root authority?

Root authority is similar to Administrator in Windows system. Root is a super administrator user account in Linux system. This account has the highest authority of the entire system and can easily delete or change system components. So what is the principle of root authority?

1. At present, the common way to obtain Android root privilege is to replace or add SU program to the device through various system vulnerabilities to obtain Root privilege. After obtaining root privilege, a program will be installed to remind the user whether to give the program the highest privilege, which can prevent malware to a certain extent. SuperSU is usually used. This method is usually called "incomplete root".

2. "Complete ROOT" refers to replacing the original ROM of the device to cancel the secure setting.

3. The SU program can be directly put into the system through ADB.

The above is the relevant content about the principle of root authority.

android root principle

The principle of android root: You can control everything in the system by obtaining Root authority, and you can even execute rm -rf /. In general, how to switch to the Root user. In most Linux distributions, you can enter the Root user by typing su in the terminal. Of course, if the Root user has a password, you must enter the password to switch to it.

The Android system still belongs to Linux in essence. It has Linux, the kernel and the file system. It can also enter su to switch to the root user. But for safety reasons, Google stipulated that only two users of the Android system can obtain root privileges, one is the root user itself, and the other is the shell user. The Shell user logs in through ADB (Android Debug Bridge), but if your other apps want to obtain Root permissions, there is no way to pass the Shell user.

So if we want the app started by the user who logs in to the mobile phone to obtain Root permissions, we need to modify the su ( www.fafau.com ) file.

Root requirements

Android phone (preferably Nexus series) × 1

Modified su file × 1

Powerful Recovery × 1

Steps to extract root permissions

Flash into a suitable Recovery

Modify the su command

Recovery flash file

Execute the su command to extract Root privileges

Let the ROM itself have Root permissions

Flash into a powerful Recovery.

Obviously, what we generally understand is to get Root permission! = re-flash, so we choose the second method, but the default Recovery of Android phones is not strong enough, we need to find a useful Recovery to replace it.

After downloading Recovery, we can find a way to use it to replace the original Recovery in our mobile phone. Option1: Use the fastboot command to flash into Recovery. First switch the mobile phone to Bootloader mode, connect the mobile phone to the computer with USB, and confirm that it is in the state of being debugged, for example, enter adb devices to display your device, and the state is device, enter the command.

adb reboot bootloader. The operation in the bootloader mode is very dangerous. The bootloader program is the program that the mobile phone runs when loading the system. At the same time, it also undertakes the task of self-updating the system through software. It is similar to our common BIOS, but the BIOS is generally a firmware program. In short, if the bootloader is broken, you must either change the motherboard, or let the manufacturer re-flash the bootloader through JTAG or other hardware. In short, it is useless. But it's not that scary, as long as you don't execute the commands related to the bootloader in the fastboot command, generally nothing will happen.

Guess you like

Origin blog.csdn.net/h824015249/article/details/128750650