r/AndroidTV • u/StudentIll • Oct 01 '26
Tips & Tutorials [ROOT, UNLOCK BOOTLOADER FULL GUIDE] Xiaomi Mi Box S 1st Gen (MDZ-22-AB)
I know this post should be on XDA but whatever reddit has more users so why not
WARNING: PLEASE BE EXTREMELY CAREFUL WHILE FOLLOWING THIS GUIDE, I WILL NOT BE RESPONSIBLE IF YOUR BOX GETS BRICKED. AND EVEN THOUGH THIS IS MY FIRST POST I DID DO THE STEPS MYSELF SO YOU DONT HAVE TO WORRY.
First, and foremost YOUR WIDEVINE L1 KEYS WILL NOT GET AFFECTED IF YOU UNLOCK YOUR BOOTLOADER because of a quirk in Mi's bootloader where the TEE is completely separate from the bootloader so a unlock does not destory it
- Step 1: Prepare your box and backup everything, account creds, movies etc.
- Step 2: If your box is running Android 9, (which is most of yall, can check in Settings -> About) then follow this guide to upgrade it to Android 12 (ALSO DONT DELETE THE FIRMWARE ZIP U WILL NEED IT)
Reason: Because Mi, for some reason allow the bootloader to be unlocked in Android 12's fastboot code. NOW KEEP READING
- Step 3: Now you MUST factory reset the box to clear the Android 9 cache and also so that the bootloader (with its Amlogic chipset) completely ignores unlock_ability because Mi's disables the OEM unlocking option in settings (DON'T WORY U CAN STILL UNLOCK IT JUST READ)
- Step 4: Now enable developer options by tapping the Build Number 7 times
- Step 5: Just enable USB Debugging (OEM unlocking is blocked but ignore it)
- Step 6: Connect the box to your PC (don't use wireless adb use a USB-A to USB-A (or a USB-A to (USB-C to USB-A adapter))
- Step 7: Allow the USB Debugging popup as usual and reboot it to the bootloader by typing
adb reboot bootloader - Step 8: From the bootloader, make sure you grab the necessary fastboot drivers, the normal Google ones should be fine ( If fastboot detects the box, ignore this step )
- Step 9: I think u should have the ADB and Fastboot binaries (android platform tools) if not just download them
- Step 10: Now type
fastboot flashing unlockand u should see OKAY (if it fails, just reboot back to the bootloader again) - Step 11: You can also type
fastboot flashing unlock_criticalalthough this is quite unnecessary
If you successfully reached this point, your bootloader has been successfully unlocked
ROOT STEPS:
- Step 1: From the firmware zip of Android 12, which you hopefully didnt delete, extract its boot.img
- Step 2: Use a flash drive or
adb push <source> <destination>to push that file to the Mi Box - Step 3: Grab the latest Magisk apk from here
- Step 4: Enable developer options and USB Debugging (now you can use a wireless connection)
- Step 5: Use
adb install <full path to apk>to install the Magisk APK to your Mi Box - Step 6: Since Android TVs are weird, you can't find the Magisk App on the TV dashboard, u have to go to (Settings --> Apps --> Show all apps --> Show system apps) to find the Magisk app
- Step 7: Click Magisk and then Open
- Step 8: On Magisk, click on install and then Select and patch a file
- Step 9: Select the path of the boot.img
- Step 10: U should get a file called like magisk_patched.img or smh
- Step 11: Now use a usb flash drive or
adb pull <source of the patched boot.img> <destination>to grab that patched boot.img - Step 12: Now boot back into the bootloader, for this you must use the USB connection
- Step 13: From the bootloader type
fastboot reboot fastboot(I know this is confusing but u need to boot to FastbootD mode to execute partition changes) - Step 14: Now in your PC, type
fastboot flash boot <path to your patched boot.img>to flash the Magisk boot.img - Step 15: Type
fastboot reboot
If u made this far without bootloops, voila you're rooted!! Open the Magisk app from the method i showed u earlier to see the root
NOW IF YOU DIDNT PROPERLY FOLLOW THE GUIDE FOLLOW THE TROUBLESHOOTING PART OF THIS POST
If you want to watch Netflix, Prime Video etc without L3 quality, u have to use Zygisk and its Denylist to deny root to those Apps and all Google-related processes inside the Magisk App.
Now you can override the launcher to install Projectivy Launcher and install ad-blockers.
FOR YOUTUBE, use SmartTube.
For now, Ciao
3
u/TonedCheeseburger Oct 01 '26
That sounds nice and exciting, but honestly, what would I truly gain by rooting the device?
1
u/Straight_Second6082 Oct 01 '26
Why tho?
2
u/colchyo Oct 03 '26
Thank you brother! It worked. Just in time - wanted to resurrect this device, and stubled upon your guide here.
I plan to use this box as Nuvio / Stremio (https://www.reddit.com/r/Nuvio/ - not an ad) player for videos, and also a gaming station using Moonlight / Sunshine (e.g. https://www.youtube.com/watch?v=ZEZRWjtFTyQ - not and ad). I use Samsung Freestyle projector as 'screen'.
So rooted Mi Box fits here just awesome, since setup is not using any cloud stuff - I'm 'homelab' enjoyer.
Also, to note - having root is really good for debloating, just throwed that adb connection with root to my pi + deepseek flash agent with prompt 'debloat it'
> Mi, for some reason allow the bootloader to be unlocked in Android 12's fastboot code
I really wonder why they allowed that in first place ? that's crazy opportunity
1
u/[deleted] Oct 25 '26
how is performance on it with andorid 12, still good?
also interested in setting up termux to run a small server there
1
u/[deleted] 28d ago
Hi everyone!
Very happy days and a successful weekend turning an Xiaomi Mi Box S 1st Gen (MDZ-22-AB) streaming box into a fast media center. Instead of dealing with bloated, sluggish Android TV updates on internal storage, I managed to boot LibreELEC (Kodi) natively straight from a USB pendrive, leaving the internal eMMC android untouched.
Hardware & System Specs:
*Device: Xiaomi Mi Box S (MDZ-22-AB)
*SoC: Amlogic S905X (ARMv8 4-core)
*Kernel: Custom mainline Linux 6.16.0-rc3 (aarch64)
*Partition Layout: /flash (Boot & Kernel)
/storage (Kodi config, media, overlays)
*Control: TV Remote via HDMI-CEC (no physical keyboard needed during daily use)
What Works:
Direct USB Boot: Plugs right into the port; unpluggable anytime to revert back to stock Android.
Hardware Acceleration: Smooth UI rendering and media playback via Kodi.
HDMI-CEC Integration: Seamless control using just the standard television remote.
*Connectivity: Network handled via a USB Wi-Fi/Ethernet adapter.
What Doesn't Work:
Bluetooth is currently not working.
Prerequisites:
Unlocked bootloader
USB Wi-Fi dongle adapter
USB OTG adapter with 2 ports
USB Pendrive (2GB)
PC computer
TV and its remote control
Preparing the pendrive:
[Download Source] https://drive.google.com/file/d/1-MglHZa8Wo2ZORiK_PNGxPHuZYZs3m8H/view?usp=sharing
Use Rufus on PC to make a bootable pendrive
[Rufus setup ] https://ibb.co/7N2WrtZR
Getting Started & Boot Procedure:
*Update Android first: Start with the latest possible Android version on the box. [Update Reddit Thread]
https://www.reddit.com/r/MiBox/comments/18hw7u9/noob_guide_upgrade_to_android_12_mi_box_s_mdz22ab/
*Unlock bootloader: Ensure your bootloader is unlocked. [Unlock Guide Reddit Thread]
https://www.reddit.com/r/AndroidTV/comments/1wv3qrd/root_unlock_bootloader_full_guide_xiaomi_mi_box_s/
*Boot Procedure after completing upper threads:
With Android turned on, plug in the OTG adapter with the USB pendrive and Wi-Fi dongle attached.
Connect the device to your PC via WIFI debugging and run:
bash
Do not flash any updates; this step is strictly to verify USB connection.
Wait for the recovery menu to appear and check if the pendrive is visible under Recovery Udisk.
Select reboot to system and wait patiently for a long time (5-10 minutes).
Wait patiently through two automatic console reboots when you see the libre logo.
Do not unplug anything!
Use your TV remote, not the Xiaomi RC!
Special thanks to raspberry_kan for their build https://forum.libreelec.tv/thread/30587-s905l-xiaomi-mi-box-4-community-builds/
Have fan and text me whats you watch now >>
1
u/f10945yt 25d ago
Interesting. Will be trying this later. Thanks!
1
u/[deleted] Oct 16 '26
ok but what can be the benefits of the root ? as i can debloat it without root
0
u/[deleted] Oct 17 '26
hey sir can i update my MDZ22AG(mi tv box 4k) with that update guide ????