小米手机刷机&ROOT原理

本文介绍了小米手机国际版稳定版进行ROOT的操作步骤,包括解锁Bootloader、刷入TWRP、安装SuperSU等,并提到了所需工具如XiaoMiFlash、ADB工具和Android Image Kitchen等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

原因及工具

想使用原生的Google服务并且需要Root,中国版的开发版里边提供了Root功能,但是安装Google套装之后感觉不是很稳定(可能是我找的包不好);国际版中有原生的Google服务,但是没有提供Root功能(无论开发板还是稳定版)。
加上中国版的广告太多,所以就以国际版的稳定版为基础,自己进行了Root。

刷机&ROOT涉及到的工具有:

  • 原版线刷包 (fastboot包)
  • SuperSU
  • TWRP(一个三方的Recovery Image, 注意选对型号)
  • Android Image Kitchen
  • XiaoMiFlash(其实是adb&fastboot的一个GUI外挂)
  • MiFlash Unlock(小米手机bootloader解锁工具)
  • ADB tools(Android SDK中的一部分)

刷机&ROOT过程

解锁Bootloader

解锁的方法没有什么好多说的,按照官方的教程/指示进行即可。

这里会用到MiFlash Unlock,它其实调用的就是标准的fastboot oem lock & u

My original intent was to have this package dependency-free, but as you can see, I did have to include Cygwin. Initially just for mkbootimg since the huaixzk standalone version wouldn't work (it wasn't loading the kernel as binary, thanks trevd); then I discovered that using the GNUWin32 cpio to unpack somehow didn't play nice with repacking the ramdisk in a usable state, so at that point I decided I might as well go Cygwin across the board. As it is, I've included the latest Cygwin-dependent executables and required libraries from their repos and built my own custom Cygwin image and ramdisk utilities built from the latest sources. Originally only for Google Pixel/Nexus/AOSP standard boot.img files, built-in support has now expanded to Android Verified Boot (AVBv1)/ChromeOS/SignBlob signed boot.img files, Barnes & Noble Nook "Green Loader" signed boot.img files, Samsung/Spreadtrum DHTB header signed boot.img files, the Samsung/Marvell PXA1088/1908 board boot.img variant (AOSP-PXA), Loki patched boot.img files, Sony SIN signed/packaged kernel.elf extraction, Sony ELF kernel.elf files, Intel OSIP Android image files, DENX U-Boot uImage files, Rockchip KRNL signed ramdisk image files, MTK headers for zImage/ramdisk, and LG Bump/Samsung SEAndroid footers for boot.img. The main advantage here is you don't need Cygwin shell or PERL scripts. Other guides exist but none of them are universal for target device, compression and/or developed for Windows, Android ARM/x86/MIPS + ARM64/x86_64/MIPS64, and now macOS. With this universality in mind I've automated the whole process with batch/shell scripts. My development work on my many projects comes out of my free time, so if you enjoy this project or anything else I've done on xda, please do hit the donate link from my profile. Thank you for your support!
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值