Remove the system_ext partition in boot.img of Android (such as Sony Xpeira 5II) firmware.
The Magisk v25 is already compatible with Sony Xperia, just need to patch boot.img normally.
If your Android (especially Android 11) bootloop after patched
magisk, as described in Issue #3752 · topjohnwu/Magisk, it may be caused by thesystem_extpartition inboot.img. Try the script to fix bootloop.
-
Clone this repo:
git clone --recurse-submodules https://github.com/entr0pia/XPatch.git
-
Get the
boot.imgfile from wherever you can getboot.img. For Sony Xperia firmware, it's possibly named asboot_X-FLASH-ALL-xxxx.sin. -
Connect Android device with adb enabled.
-
Use this script to modify the stock
boot.img, both Sony Xperia's.sinand regular.imgfiles supported:- Linux
sudo ./run.sh path_to_boot_img_file
- Windows
.\run.bat path_to_boot_img_file
- Outs:
image-new.img
-
Diasble all Magisk modules -- Optional but recommended
-
Flash Magisk:
Reboot your phone to the
bootloader, usefastbootto flash theimage-new.imginto thebootpartition, then reboot.Fix: Sometimes, such as after an OTA update, you must use the stock
boot.imgto boot system regularly before flashing theimage-new.img.