Writing

·2 min read·android

Magisk

Notes on how to install and use Magisk with MIUI on Xiaomi and Redmi phones.

Redmi Note 12 Pro (ruby)

Updating the ROM version

Reboot into fastboot mode

adb reboot bootloader

To flash a new update, make sure you are in FASTBOOT mode, not in FASTBOOTD — notice the ‘D’ at the end.

Then, flash with

./flash_all_except_storage.sh

Updating the boot image for Magisk

Download this: https://github.com/tobyxdd/android-ota-payload-extractor

[!NOTE] If your Mac computer uses Apple silicon, download the android-ota-extractor-v1.1-darwin-arm64.tar.gz.

Download the recovery ROM from https://miuirom.org/phones/redmi-note-12-pro#EEA.

The boot image can be directly extracted from the ROM’s ZIP with:

./android-ota-extractor miui_RUBYEEAGlobal_OS1.0.3.0.UMOEUXM_bd54bd38dc_14.0.zip boot

[!NOTE] If on a macOS, you may need to right-click the executable, select Open, and then the Open button.

Alternatively, unzip the ROM’s ZIP and extract the boot.img from the payload.bin with:

unzip miui_RUBYEEAGlobal_OS1.0.4.0.UMOEUXM_686c61a682_14.0.zip -d miui_RUBYEEAGlobal_OS1.0.4.0.UMOEUXM_686c61a682_14.0

To extract only the boot.img from the Recovery ROM’s payload.bin, run

./android-ota-extractor ~/miui/payload.bin boot

Push it to your Downloads folder:

adb push ./boot.img /sdcard/Download/

Now, using your phone:

  1. Open the Magisk app
  2. Press Install (the 1st one, not the 2nd one)
  3. Check the ‘Select and Patch a File’
  4. Choose the boot.img in your Downloads folder
  5. Press ‘Let’s Go’ and wait for the patching to finish

Now, back to your laptop, pull the modified boot.img with

adb pull /sdcard/Download/magisk_patched-27006_EvbvP.img

Reboot into fastboot mode

adb reboot bootloader

Flash the patched boot.img with

fastboot flash boot magisk_patched-27006_EvbvP.img

Finally, reboot with

fastboot reboot

And that should be all!

Upgrading from MIUI to HyperOS

HyperOS – Rename Trick 2.0 https://techmukul.net/update-hyperos-now-using-rename-trick-2-0-in-xiaomi-devices/

Redmi Note 5 Pro (whyred)

“[ROM][13][UNOFFICIAL] Pixel Experience Plus for Xiaomi Redmi Note 5 Pro [Whyred][2024-02-04]” https://xdaforums.com/t/rom-13-unofficial-pixel-experience-plus-for-xiaomi-redmi-note-5-pro-whyred-2024-02-04.4583589/

Reboot into the bootloader:

adb reboot bootloader

Flash pixel experience recovery:

fastboot flash recovery PixelExperience_Plus_whyred-13.0-20240204-0825-UNOFFICIAL.img

Reboot to the Recovery menu:

fastboot reboot recovery

Wipe the data, cache, and system through the recovery menu.

Install the Pixel Experience ROM by navigating to ‘Apply Update’ > ‘Apply from ADB’, and then:

adb sideload PixelExperience_Plus_whyred-13.0-20240204-0825-UNOFFICIAL.zip