Android刷机Magisk

663 阅读1分钟

1、下载最新版(Magisk-v29.0.apk) github.com/topjohnwu/M… 并安装。

2、提取 boot.img

adb shell
su
dd if=/dev/block/by-name/boot_b of=/sdcard/boot.img

3、修补 boot.img: a. 打开 Magisk App → 安装 → 选择并修补文件 → 选择 boot.img。 b. 生成 magisk_patched.img,路径通常在 /sdcard/Download/

adb pull /sdcard/Download/magisk_patched.img .

  1. 刷入修补后的 boot 镜像, 刷入当前激活的 slot(例如 slot_b),通过 fastboot重启到 bootloader.
adb shell
su
mv /sdcard/Download/magisk_patched.img  /sdcard/magisk_patched.img
dd if=/sdcard/magisk_patched.img of=/dev/block/by-name/boot_b 

adb reboot bootloader
fastboot flash boot_b magisk_patched.img
fastboot reboot

注意:

1、查看当前slot

getprop ro.boot.slot_suffix

2、如果刷入失败,可以通过切换 slot 恢复。

fastboot --set-active=a  # 切换到备用 slot
fastboot reboot