摘自How to Root Pixel 2 and 2 XL running Android 11 without TWRP
1、解锁bootloader,摘自How to Unlock Bootloader Of Google Pixel Devices。准备工作:
a、开发者模式打开
b、usb调试打开
c、OEM Unlocking打开
d、adb reboot bootloader
e、音量上下键切换到Fastboot Mode,命令行执行fastboot flashing unlock
f、确认页面音量上下键切换到Unlock the Bootloader,命令行执行fastboot reboot重启设备
2、设备重启后,继续打开开发者模式,并开启usb调试
a、解压出 boot.img,官方下载设备上对应版本的ota包并解压得到payload.bin,解压payload.bin获取boot.img,具体参考How to Extract payload.bin and get stock boot image file
I、安装python
II、下载Payload Dumper,解压文件至python安装目录
III、解压Payload.Bin,将文件复制到python安装目录
IV、python安装目录下执行命令行python -m pip install -r requirements.txt,成功后接着执行python payload_dumper.py payload.bin,执行完后会在output文件夹下发现boot.img system.img vendor.img等文件,将boot.img复制到手机存储空间备用
3、下载MagiskManager并复制到手机存储空间,安装后打开,在页面中点击安装Magisk并选择安装补丁boot.img,详见Patch Stock Boot Image via Magisk and Flash it using Fastboot,执行完会在手机的Downloads目录下生成一文件magisk_patched.img,将该文件复制到pc的platform-tools目录下
4、pc上进入platform-tools目录,命令行下依次执行adb reboot bootloader,fastboot flash boot magisk_patched.img(设备有A/B分区的话,需要执行fastboot flash boot_a magisk_patched.img,fastboot flash boot_b magisk_patched.img),最后执行fastboot reboot重启设备。
网友评论