Poco X4 GT insert magisk into ROM

下载并使用magisk刷写boot.img

首先下载对应版本的线刷包(Fastboot),下载网址:https://xiaomifirmwareupdater.com/miui/xaga/

我是全球版本的ROM,因此选择Global版本:

image-20231117013552213

之后将压缩包中的boot.img文件提取出来:

image-20231117013714839

image-20231117013736077

然后导入手机,打开magisk选择install(Magisk旁的install):

image-20231117014224668

选择boot.img之后点击let’s go:

image-20231117014218823

最后等待刷写完成:

image-20231117014359917

使用adb将boot.img重新刷写入系统

首先确保fastboot是否能够检测到设别,如果不能的话,需要先使用MiUsbDriver打好驱动:

image-20231117014642200

之后使用

1
fastboot devices

查看连接到电脑上的手机设备是否已经被识别到:

image-20231117014813735

如果被成功识别,会显示上述文本

之后使用如下命令刷写boot.img分区:

1
fastboot flash boot_ab {your_magisk_boot.img}

image-20231117015153873

(该命令源自于刷机包中的 flash_all.bat文件)

image-20231117015333584

至此,刷写完成。(但我现在的状况是magisk内显示没有root但lsposed可以正常工作,很迷)

提取系统中的boot.img(需要root权限)

使用termux命令行

1
2
3
su                       # get superuser right otherwise cannot access to location below
cd /dev/block/by-name # to find the location of boot.img
ls -l boot_a # check boot.img location (ls -l boot_b is also OK)

it shows as below:

1
2
boot_a -> /dev/block/sdc43
boot_b -> /dev/block/sdc72

使用dd将整个img分区拷贝下来

1
2
dd if=/dev/block/sdc43 of=/sdcard/boot_a.img
dd if=/dev/block/sdc72 of=/sdcard/boot_b.img

使用windows cmd计算各个镜像的md5,可以发现两个分区的md5是一样的,就连我刷magisk前后md5都一样,但是magisk还是显示没有root权限,而lsposed却可以正常工作,就很迷。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
certutil -hashfile magisk_patched-26400_sQ8kK.img md5
MD5 hash of magisk_patched-26400_sQ8kK.img:
6e0117983a8df1ed946b09e7ac1de741
CertUtil: -hashfile command completed successfully.

certutil -hashfile boot_a.img md5
MD5 hash of boot_a.img:
6e0117983a8df1ed946b09e7ac1de741
CertUtil: -hashfile command completed successfully.

certutil -hashfile boot_b.img md5
MD5 hash of boot_a.img:
6e0117983a8df1ed946b09e7ac1de741
CertUtil: -hashfile command completed successfully.

Poco X4 GT insert magisk into ROM
http://example.com/2023/11/17/Poco-X4-GT-insert-magisk-into-ROM/
Author
iMusic
Posted on
November 17, 2023
Licensed under