前言
最近发现KernelSU提示升级,我目前使用的KernelSU版本是12081在撰写这篇文章时,最新版本为22084
另外,手机型号是OnePlus Ace5 Pro,版本号为PKR110_15.0.0.505(CN01)内核版本是6.6.30-android15-8-*-4k
更新前准备
获取init_boot.img
本想直接去大侠阿木的云盘直接下载的, 然后发现没有 (其实是有的) ,就去酷安上找了,发现也没有,最后在这里找到了,但是需要支付3元巨款,因为找不到别的,所以只好买了一个,放出提取出来的init_boot.img
下载
密码:3r0s
当然你也可以自行提取init_boot.img,最好是没有被修补过的
下载后保存到正常应用可以访问的位置,这里我保存在/storage/emulated/0/Download/
备份init_boot.img
下载好init_boot.img后,记得备份当前挂载分区的init_boot.img,这边我的挂载分区是a,打开可以访问根目录的文件浏览器
可以提前将手机进入fastboot模式
输入fastboot getvar current-slot命令来获取当前挂载分区
如果返回false,那么代表手机不采用a/b分区模式
否则返回a或者b
访问根目录需要设备持有并赋予对应文件管理器Root权限
- 进入MT管理器
- 访问
/dev/block/bootdevice/by-name/ - 复制目录下的
init_boot_a与init_boot_b到其他存储介质上
这里我直接使用adb来pull到我的电脑上面
$ adb shell
OnePlus:/ $ su #提权
OnePlus:/ $ cp -v /dev/block/by-name/init_boot_a /sdcard/Download/ #复制到临时文件夹
cp '/dev/block/by-name/init_boot_a'
OnePlus:/ $ cp -v /dev/block/by-name/init_boot_b /sdcard/Download/
cp '/dev/block/by-name/init_boot_b'
OnePlus:/ $ exit #退出Root
OnePlus:/ $ exit #退出Shell
$ adb pull /sdcard/Download/init_boot_a /home/charity/Download #发送到此电脑
/sdcard/Download/init_boot_a: 1 file pulled, 0 skipped. 28.1 MB/s (8388608 bytes in 0.284s)
$ adb pull /sdcard/Download/init_boot_b /home/charity/Download
/sdcard/Download/init_boot_b: 1 file pulled, 0 skipped. 27.9 MB/s (8388608 bytes in 0.287s)
$ adb shell
OnePlus:/ $ rm -v /sdcard/Download/init_boot_* #删除临时保存的内容
rm '/sdcard/Download/init_boot_a'
rm '/sdcard/Download/init_boot_b'
OnePlus:/ $ exit更新KernelSU
终于可以开始更新了!
首先,下载22084版本的KernelSU,安装以后像这样:
修补保存到/storage/emulated/0/Download/的init_boot.img
导入到电脑并重命名为init_boot.img
$ adb pull /storage/emulated/0/Download/kernelsu_patched_20251122_112711.img ~/Download
/storage/emulated/0/Download/kernelsu_patched_20251122_112711.img: 1 file pulled, 0 skipped. 28.4 MB/s (8388608 bytes in 0.282s)
$ mv kernelsu_patched_20251122_112711.img init_boot.img #重命名重启手机到FastBoot
$ adb reboot fastboot刷入修补过的init_boot.img并重启
#挂载分区为a
$ fastboot flash init_boot init_boot.img #刷入init_boot
$ fastboot reboot #重启系统
#挂载分区为b
$ fastboot flash init_boot_b init_boot.img #刷入init_boot
$ fastboot reboot #重启系统
更新成功