This article was last revised 584 days ago, and some of the information may be outdated.If you need to update urgently, please leave a message in the comment area below.
Android has made great contributions to the popularity of smart phones, but the "fragmentation" problem caused by open source has always been a pain in Google's heart that cannot be concealed.In order to change this situation, Google has made many attempts. For example, the "A/B (seamless) system update" introduced in Android 7.0 and the "Project Treble" launched in Android 8.0 are all designed to pave the way for barrier free system update and reduce the risk of device failure caused by update failure, so that manufacturers can more easily push system updates.
And inAndroid 11In version 5, Google used a new partition called "virtual A/B", and took the lead in using it on Google Pixel 5.Virtual A/B updates the system in a similar way to A/B, and its core functions are the same.When the system performs OTA update, if the update fails, it will automatically roll back to the previous system. The new data will not be written to the system until it is successfully powered on.And the system update can be completed in standby mode without restarting to wait for new data to be written, which can be said to greatly improve the user experience when updating the system.However, "A/B" needs to prepare two identical partitions, which will occupy more storage space. "Virtual A/B" deletes the "cache" and "recovery" partitions, and "system" partitions only reserve one to solve the above space occupation problem.one
Xiaomi 11It also uses "virtual A/B", but this is not good news for me.Because the "recovery" partition is deleted by "virtual A/B", the third-party "recovery" cannot be flushed in without the "recovery" partition.Therefore, before TWRP officially solves the problem of flushing this new partition mode into third-party recovery, I can only use other methods to flush Xiaomi 11.
However, this is not a brush machine for me. I just install a Magisk.This article will also be updated when TWRP is available.
There is a risk of machine brushing, so you need to be careful when operating the machine. Please prepare the spare machine and be prepared for brick changing.After confirming that Xiaomi Home is available for after-sales maintenance, brush the machine.
The following is a complete brush record.
Unlock
The mobile phone in hand is still the factory system. Update the system to the latest version first.I use the stable version of MIUI 12.0.22.0, and the experience is not bad.Of course, it's OK not to update.
1. Enable developer mode
For the newly acquired mobile phone, first log in to your Xiaomi account, and then open the "Developer Mode」。
MIUI 12 System Enable 「Developer ModeThe steps are: Set → My Device → All Parameters, clickMIUI Version"Seven times, a prompt pops up"Developer mode is enabled」。
Set "Developer ModeThe entry of "" is at Settings>More Settings>Developer Options.Check "OEM unlock」、「USB debugging」。On the "Device unlocking status", bind the account and the device.
In order to avoid various unpredictable dangers when unlocking or brushing the machine, first update the drive.Unzip the downloaded compressed package and clickmiflash_unlock.exeOpen the unlocking tool.
Click Settings in the upper right corner.
Before connecting the phone to the computer, be sure to select the "Developer Mode", open the"USB debugging", similar to"Allow this PC to debug using USB", and then click"Drive detectionUpdate the driver.
4. Unlock
Then you can unlock it.Note that unlocking will erase all phone data, so don't rush to transfer data to a new phone.The unlocking tool will be prompted during the unlocking process, so it will be skipped.
However, it has been said that if a new phone is unlocked, it needs to be bound to a Xiaomi account for a period of time (about seven days), but my phone was unlocked as soon as I got it
After unlocking, it will automatically restart and the data will be cleared.
extractboot.img
At present, the purpose of machine brushing is only toBrush in Magisk, Magisk can repair the systemboot.imgIt does not need to use TWRP or other third-party REC tools.
So you need to extract the original of the current systemboot.imgFile.
Extract with wire brush package
stayXiaomi CommunitySee if there is a wire brush package of the current system version of the mobile phone. Download it and unzip itboot.img, can be used directly.Only the MIUI 12 stable version of the wire brush package is available at present.
Extract with card swiping package (mobile system update package)
If Xiaomi Community has not provided the current version of the card swiping package, you can also download the complete card swiping package in the mobile system update.First, enter the system update and click to download the complete update package. After the download starts, close the background completely. Enter the download management and continue to download manually. Otherwise, the update package will be automatically unpacked and updated to the system.
However, this kind of update package is encrypted and needs to be decrypted with tools.
Mobile terminal
The decryption method on the mobile phone side refers to thecourse(Brush in the Magisk patchboot.imgStill need a computer), the steps are as follows:
Because onlyboot.img, so there is no need to wait for the whole journeyboot.imgDecompress it to close the program
Brush in Magisk
1. Install Magisk
Download Magisk Manager(GitHub/backups)Install and open. The relevant information may not be loaded normally due to network reasons.
You can open the settings in the upper right corner, click "Update Channel" to modify it to custom, and then search for "Magisk Custom Channel" on the Internet to find one that can be used and fill it in the custom channel.You can use my, which is currently a stable versiontwenty-three, but continuous updates are not guaranteed.(Don't bother to maintain the ready-made online search.)
After setting, it should be able to load normally.
2. Repairboot.img
Then click Install next to Magisk.
Select Select and patch a file.
Find what was just decryptedboot.imgSelect it and click Start.
Magisk patchedboot.imgPut on/DownloadFolder.
3. Brush inboot.img
To be repairedmagisk_patched_xxxxx.imgCopy to PC, ready to start painting Magisk, refer toKu'an Tutorial。You need to use adb tools to brush the machine(Portal), pay attention to decompression.
Connect the phone to the computer when the phone is switched on.Double click theOpen CMD command line.bat。
The following commands need to be enabled on the phoneUSB debugging", the meaning of the command is explained in the figure above, and will not be explained any more.
adb devices
You need to list the adb devices successfully. If you fail, check the drivers, data cables, and computer interfaces one by one.
adb reboot bootloader
After restarting to the fastboot mode, the phone displays a rice rabbit of the maintenance robot.Then you can apply the patchedboot.imgHas.Due to the repairedmagisk_patched_xxxxx.imgThe name is different every time. It is recommended to drag it directly. You can refer to the moving picture I made earlier.Note the spaces in the command.
fastboot flash boot_ab magisk_patched_xxxxx.img
After successful flushing, enterfastboot rebootRestart the device. If there is no accident, you can see the Magisk that has been successfully activated.
4. Subsequent system updates
The later update system does not need to be extracted as cumbersome as the first timeboot.imgThe patch was applied and then applied to the system.You just need to select "Download the full update package" when updating the new version.
Then wait for the update package to be written to the system, and when prompted "Restart to complete the update", do not rush to update. At this time, open Magisk, select "Install to an unused slot (after OTA)", and click OK.
Wait for the completion of brushing.
Restart the system, and the update is complete.
Or,You don't need to download the full package。Before downloading the incremental package, click "Uninstall Magisk" in the magisk and select "Restore the original factory image".
Then update incrementally.After the update is completed, do not restart. As above, install Magisk, select "Install to an unused slot (after OTA)", and then restart the system.
Brush in TWRP
The official TWRP has been officially launched, and the brushing method is almost the same as that of Magisk.However, since there is no usable package for Xiaomi 11, TWRP is not recommended here.
The brushing method is to brush in the command line in adb.
adb reboot bootloaderfastboot boot twrp.img
It's really good to patch the magisk.
Some questions
1. SafetyNet cannot pass
After using Magisk, SafetyNet cannot pass the detection.If it fails, the Google Play guarantee mechanism will fail, and some games will fail to download.
Brush in the magisk and restart it.You can cheat the system to pass this detection and make the proof pass.(The test system version is the development version MIUI 12.5 21.3.25)
In the Play store, clear the data.
Be careful to turn on the magic hide.
2. The mobile phone is stuck due to problems with the Magisk module
Deactivate all modules.
Connect the mobile phone to the computer, open the adb tool, enteradb shell, the prompt will appear after successful connectionvenus:/", and then enter"magisk --remove-modulesThe phone will automatically restart. If the card cannot restart, long press the power button to force the restart.
Then check one by one to see which module has the problem.
Be sure to turn on USB debugging, otherwise it can only be solved by brushing back the original image.For details, please refer to: MagiskFrequently Asked Questions。
MIUI13(Android12)
The MIUI13 based on Android 12 can also directly use Magisk to patch the boot, but Magisk needs to use theCanaryedition.
You can clickhereDownload the GitHub real-time build version, or visithereDownload my archived backup.
If it is still usedv23Version, installation completedCanaryAfter version of the app, the app will prompt for updatesMagisk, select "direct installation (recommended)" during installation, restart, and then update to MIUI13.
The above concept of "virtual A/B" partition is based on the idea of "autumn leaves with the wind"Ku'an DynamicIn a simple summary, there may be some omissions or errors. Please forgive me.↩
Copyright notice:Unless otherwise stated, all articles are my own creation. Please contact the author for reprinting and quotation, and indicate the source (author, original link, etc.).
• Please fill in the real email when commenting so that you can receive the reply reminder. • Initial comments need to be reviewed, and comments irrelevant to the article should be posted on the message page.
Whether the command of fast boot flash boot_ab magisk_patched_xxxxx.img is different from the previous one. I remember that at the earliest, boot_a and boot_b need to be flushed respectively. Is it OK to flush this time?MIUI13, Android 12
I am now a v23 magisk, and the miui version is 12.5. Can I upgrade to Miui13 by downloading a complete update package and installing it in an unused slot
Has miui13 pushed the stable version?Since miui13 is Android 12, it is recommended to install the canary version of magisk before updating, which is provided at the end of the article, and then update to miui13
At first, I updated the full package, and then I did not install the option to another slot. I did not restart the phone, and then restored the original image in the mask. Then, after updating the incomplete package of ota, I still did not. Finally, I found a solution in station b and solved it!Because of SELinux
Ku'an has a script that can smuggle directly,delivery This is how I directly upgraded from the unclear data of miui 12.5 stable version to miui 13.After the update is completed, you can directly install it to another slot in the magisk before restarting, without restoring the image.
After nearly a month, I'm sorry, brother; I have just entered the machine pit, and recently I encountered the problem you mentioned. Look, you finally said that you found a solution on station B. I wonder if you can still find the original video now??I also want to see the solution given in the video, but I don't know how to turn off selinuxφ( ̄∇ ̄o)
Wuwuwu-X, it's been more than a month and a half. You haven't replied to the comment and question I sent you at the beginning of last month...I wonder if my brother was too busy to see my comments and questions upstairs??Or??
Please, brother, when you see my comment push notice, please reply to my question message upstairs in early February as soon as possible
The latest version of the European version of the system can not be started after the magisk is used to repair the boot, and the original version of the boot is used to restore,
The command fastboot flash boot_a magisk_patched_xxxxx.img is successfully flashed. How can the command fastboot flash boot_b magisk_patched_xxxxx.img not be flashed? Is there only one system A now?Please ask the teacher to explain
So I don't know what's wrong. Is there only one partition in my phone that has a system?Can I give you a moving picture of these two commands?Let me see if there's something wrong