realdtn2/xiaomi-unlocking-rooting-guide
关于
Guide on Bootloader Unlock and Root for Xiaomi devices (HyperOS / HyperOS 2.0 / HyperOS 3.0) (Non-Mainland China Devices) | Hide Root / Play Integrity / Spoof Bootloader Status as Locked (Key Attestation) for most Android devices [2026]
学习与教育实测星标增长
- 24小时
- 更新延迟
- 7天
- +4
- 15天
- +7
- 1个月
- 更新延迟
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文
Bootloader Unlock and Root for Xiaomi devices (HyperOS / HyperOS 2.0 / HyperOS 3.0) (Non-Mainland China Devices)
&
Hide Root / Play Integrity / Spoof Bootloader Status as Locked (Key Attestation) for most Android devices
Bootloader Unlock
Warning
- BACK UP ANY DATA YOU MAY HAVE ON YOUR PHONE
- ALL OF YOUR DATA WILL BE WIPED
Requirements
- Your Xiaomi account must be over 30 days old
- Enable Find device in Xiaomi Cloud in Settings (might not be necessary, but enable for certainty)
Step 1: Enable OEM Unlocking
- In Settings, press About phone and tap OS version 5 times to unlock Developer Options
- In Developer Options, enable OEM Unlocking
Step 2: Reinstall Xiaomi Community
- Uninstall Xiaomi Community and reboot
- Install the latest version of Xiaomi Community on the Play Store
Step 3: Account Region
- Sign in with your Xiaomi account in Xiaomi Community
- In the Me tab, find Set up and press it
- Press Change region and choose Global
Step 4: Apply for unlocking
- Press "Apply for unlocking" at exactly 12:00 AM GMT+8 (pressing it too late will cause the "application quota limit reached" error. Use this website to check the time)
- "Account Error" might show up. If that happens, retry after 10 days
- Tip: If it keeps failing, try another method using this Python automation script
Step 5: Bootloader Unlock Preparation
- Logout of your Xiaomi account in Settings
- Reboot
- Login again with your Xiaomi account in Settings
Step 6: Add account to Mi Unlock
- Turn off Wi-Fi and make sure a working mobile data connection is available
- In Developer Options, find Mi Unlock status and press it
- Press Add account and device
Step 7: Mi Unlock tool
- Download the latest version of it from here
Step 8: Sign in to your Xiaomi account
- After download, extract and navigate to its folder
- Open miflash_unlock.exe, you will be prompted to sign in
- After signing in, agree to the disclaimer
Step 9: ADB and Fastboot
- Enter this site and select the one for Windows
- After download, extract and navigate to its folder
- Click on the address bar of the folder and replace everything with cmd
- Press enter and a CMD window should pop up
Step 10: USB Debugging
- In Developer Options, enable USB Debugging
Step 11: Bootloader Unlock
- Plug in your phone and press allow computer when prompted on the phone
- In the CMD window opened in Step 9, type
adb.exe reboot fastbootand press enter - Your phone should reboot and display FASTBOOT
- In the Mi Unlock app, it should display phone connected
- Press unlock and then press unlock anyway
- It might say couldn't unlock; wait for the amount of time displayed (during this time, DO NOT log out of your Xiaomi account on the phone or in Xiaomi Community)
- When enough time has passed, repeat this Step and your phone should be unlocked
Root
Disclaimer: init_boot is for newer devices. Older devices do not have init_boot, so only use boot on those
Tip: Disable auto-update in the Settings to prevent losing root
KernelSU (recommended — install to check if your phone is supported) (Android 12+)
Step 1: Obtain ROM Files
- Navigate to About phone on your device
- Download the firmware (Fastboot ROM) from miuirom.org that matches your device and OS version
Step 2: Extract Firmware
- After download, extract and navigate to its folder
Step 3: Locate the
imagesFolder
- Find the
imagesfolder and enter itStep 4: Backup
init_boot.img
- In the folder, copy
init_boot.imgto theplatform-toolsfolder in Step 9 of unlocking the bootloader- Rename the copied file to
init_boot_stock.img(DO NOT DELETE IN CASE OF A BRICK)Step 5: Transfer to Phone
- Transfer the
init_boot_stock.imgfile to your phoneStep 6: Install KernelSU
- Download and install the latest APK from their releases
https://github.com/tiann/KernelSU/releasesStep 7: Check KernelSU compatibility
- Open KernelSU
- If the app shows Not installed, then your device is officially supported by KernelSU
If the app shows Unsupported, it means that you should compile the kernel yourself, KernelSU won't and never provide files for you to flashStep 8: Patch the
init_boot_stock.img
- Open KernelSU
- Click on Not installed - Tap to install -> Select a file.
- Choose
init_boot_stock.img- Click on Next and choose the option with This device KMI
- Press Confirm
- The patched file should be something like
kernelsu_patched_20260605_045957.imgin the Download folder of your phoneStep 9: Transfer Patched File to PC
- Move the patched file (
kernelsu_patched_20260605_045957.img) toplatform-toolsStep 10: Reboot to Fastboot
- Plug in your phone
- Navigate to
platform-tools, click on the address bar of the folder and replace everything with cmd- Press enter and a CMD window should pop up
- Run the following command in CMD:
adb.exe reboot fastbootStep 11: Flash Patched
init_boot
In the same CMD window, execute the following commands using it as an example:
fastboot.exe flash init_boot_a kernelsu_patched_20260605_045957.img fastboot.exe flash init_boot_b kernelsu_patched_20260605_045957.img fastboot.exe rebootYour device should reboot into the system and be rooted
Magisk Alpha
Step 1: Obtain ROM Files
- Navigate to About phone on your device
- Download the firmware (Fastboot ROM) from miuirom.org that matches your device and OS version
Step 2: Extract Firmware
- After download, extract and navigate to its folder
Step 3: Locate the
imagesFolder
- Find the
imagesfolder and enter itStep 4: Backup
init_boot.img
- In the folder, copy
init_boot.imgto theplatform-toolsfolder in Step 9 of unlocking the bootloader.- Rename the copied file to
init_boot_stock.img(DO NOT DELETE IN CASE OF A BRICK)Step 5: Transfer to Phone
- Transfer the
init_boot_stock.imgfile to your phoneStep 6: Install Magisk Alpha
- Download and install the latest version of Magisk Alpha from their Telegram Channel
Step 7: Patch the
init_boot_stock.img
- Open Magisk Alpha
- Tap Install -> Select and Patch a File
- Choose
init_boot_stock.img- The patched file should be something like
magisk_patched-XXXXX_xxxxx.imgin the Download folder of your phoneStep 8: Transfer Patched File to PC
- Move the patched file (
magisk_patched-XXXXX_xxxxx.img) toplatform-toolsStep 9: Reboot to Fastboot
- Plug in your phone
- Navigate to
platform-tools, click on the address bar of the folder and replace everything with cmd- Press enter and a CMD window should pop up
- Run the following command in CMD
adb.exe reboot fastbootStep 10: Flash Patched
init_boot
In the same CMD window, execute the following commands
fastboot.exe flash init_boot_a magisk_patched-28001_xxxxx.img (e.g., fastboot.exe flash init_boot_a magisk_patched-28001_p5r8c.img) fastboot.exe flash init_boot_b magisk_patched-28001_xxxxx.img (e.g., fastboot.exe flash init_boot_b magisk_patched-28001_p5r8c.img) fastboot.exe rebootOnly for OLD DEVICES without
init_boot(DO NOT FOLLOW IF YOUR DEVICE HAVEinit_boot)fastboot.exe flash boot_a magisk_patched-28001_xxxxx.img (e.g., fastboot.exe flash boot_a magisk_patched-28001_p5r8c.img) fastboot.exe flash boot_b magisk_patched-28001_xxxxx.img (e.g., fastboot.exe flash boot_b magisk_patched-28001_p5r8c.img) fastboot.exe rebootOnly for OLD DEVICES without
init_boot, if there's an error, try running this command (DO NOT FOLLOW IF YOUR DEVICE HAVEinit_boot)fastboot.exe --disable-verity --disable-verification flash vbmeta vbmeta.img (vbmeta.img is from the firmware you downloaded)Your device should reboot into the system and be rooted
Hide Root / Play Integrity Fix / Spoof Bootloader Status as Locked (Key Attestation)
Requirements
KernelSU
Step 1: Install Required Magisk / KernelSU Modules
Install the latest release version of the following modules in this order:
- Hybrid Mount (reboot your phone)
https://github.com/Hybrid-Mount/meta-hybrid_mount/releases- Zygisk Next (reboot your phone)
https://github.com/Dr-TSNG/ZygiskNext/releases- TEESimulator-RS (Way Better Alternative to Tricky Store)
https://github.com/Enginex0/TEESimulator-RS/releases- Tricky Addon Enhanced (auto-fetch keyboxes)
https://github.com/Enginex0/tricky-addon-enhanced/releases (press Vol+ when asked)- Vector (LSPosed fork)
https://github.com/JingMatrix/Vector/releases- PlayIntegrityFix (inject-s)
https://github.com/KOWX712/PlayIntegrityFix/releasesStep 2: Reboot
Magisk Alpha
Step 1: Install Required Magisk Modules
Install the release version of the following modules in this order:
- Zygisk Next (reboot your phone)
https://github.com/Dr-TSNG/ZygiskNext/releases- TEESimulator-RS (Way Better Alternative to Tricky Store)
https://github.com/Enginex0/TEESimulator-RS/releases- Tricky Addon Enhanced (auto-fetch keyboxes)
https://github.com/Enginex0/tricky-addon-enhanced/releases (press Vol+ when asked)- Vector (LSPosed fork)
https://github.com/JingMatrix/Vector/releases- PlayIntegrityFix (inject-s)
https://github.com/KOWX712/PlayIntegrityFix/releases- Shamiko
https://github.com/LSPosed/LSPosed.github.io/releasesStep 2: Reboot
Hide Root (should be compatible with most Android devices like Xiaomi, Samsung, etc.)
KernelSU
Step 1: Install KsuWebUI
- Download and install the latest version of KsuWebUI from
https://github.com/5ec1cff/KsuWebUIStandalone/releasesStep 2: Set up KernelSU
- Open KernelSU
- Go to Settings → Turn off Kernel unmount
Step 3: Configure Zygisk Next
- Open KsuWebUI
- Click on the Zygisk Next module
- Set Denylist Policy to Unmount Only
- Turn on Use anonymous memory
Step 4: Install Hide My Applist
- Install Open Source HMA-OSS
https://github.com/frknkrc44/HMA-OSS/releases- Enable it in the LSPosed Manager notification, select Recommended
- Reboot
Step 5: Configure "Manage templates"
- Open HMA-OSS
- Go to Manage templates
- Create a blacklist template
- Name it anything
- Edit list of 0 apps invisible, add:
- HMA-OSS
- KernelSU
- All LSPosed modules installed
- If new LSPosed modules are installed later, update this template again
Step 6: Configure "Manage apps"
- Open HMA-OSS
- Go to Manage apps
- Select the app(s) detecting root
- Turn on Enable hide
- Press Template config
- Make sure Work mode is Blacklist
- Press Using 0 templates and select your blacklist template
- Confirm
Magisk Alpha
Step 1: Install KsuWebUI
- Download and install the latest version of KsuWebUI from
https://github.com/5ec1cff/KsuWebUIStandalone/releasesStep 2: Hide Magisk App
- Open Magisk Alpha
- Go to Settings → Hide Magisk App (you can name it anything, e.g.,
Settings)- Disable Zygisk
- Turn Enforce Denylist OFF
Step 3: Configure DenyList
- Navigate to Configure DenyList
- Select the app(s) you want to hide root from (tap app first, then checkbox)
Step 4: Configure Zygisk Next
- Open KsuWebUI
- Click on Zygisk Next module
- Set Denylist Policy to Enforced
- Turn on Use anonymous memory
Step 5: Install Hide My Applist
- Install Open Source HMA-OSS
https://github.com/frknkrc44/HMA-OSS/releases- Enable it in the LSPosed Manager notification, select Recommended
- Reboot
Step 6: Configure "Manage templates"
- Open HMA-OSS
- Go to Manage templates
- Create a blacklist template
- Name it anything
- Edit list of 0 apps invisible, add:
- HMA-OSS
- Settings (hidden Magisk app or renamed one)
- All LSPosed modules installed
- If new modules are installed later, update this template again
Step 7: Configure "Manage apps"
- Open HMA-OSS
- Go to Manage apps
- Select the app(s) detecting root
- Turn on Enable hide
- Press Template config
- Make sure Work mode is Blacklist
- Press Using 0 templates and select your blacklist template
- Confirm
Step 8: Make sure Shamiko is toggled ON
Play Integrity Fix
Step 1: Configure PlayIntegrityFix
- Open the KsuWebUI app.
- Click on the Play Integrity Fix [INJECT] module.
- Make sure Spoof Build and Spoof Build (Play Store) is enabled
- Click on Fetch and choose GitHub to get the latest one
Step 2: Check the Integrity
- Use this app to check it
Note: If you suddenly fail to pass Play Integrity, do Step 1 again
Some old custom ROMS spoof old fingerprints (PIF's) by default, you'd need to disable that functionality if your ROM has it built in, I can't help much for this part
Spoof Bootloader Status as Locked (Key Attestation)
Step 1: Keybox Automation
- Open KsuWebUI
- Click on the TEESimulator-RS module
- Click on the 3 dots on the top right corner
- Press Keybox Automation
- You can set Fetch Interval to your liking or just leave it as it is
- Find Manual Actions and click on Fetch Key
Step 2: Select your app(s)
Search for the app(s) you want to spoof bootloader status as locked, then click on the checkbox for it
探索相关项目
加载中…