小米10 刷机LineageOS 17.1的详细教程

1,准备

  1. platform-tools
  2. Mac/Linux/windows
  3. 会简单的命令行命令

2,解锁你的小米设备

http://en.miui.com/unlock/
按照小米官方说明的步骤进行解锁你的小米设备。

3,Installing a custom recovery using fastboot

注意,下面的步骤请在你解锁你的小米设备后才能进行。

  1. Download a custom recovery - you can download TWRP. Simply download the latest recovery file, named something like twrp-x.x.x-x-gemini.img.
  2. Connect your device to your PC via USB.
  3. On the computer, open a command prompt (on Windows) or terminal (on Linux or macOS) window, and type:
gaoshiweideMacBook-Pro:~ gaoshiwei$ adb devices
List of devices attached
289dedcc    device
// 如果成功的话会列出你的设备
// 继续进行下面的步骤
gaoshiweideMacBook-Pro:~ gaoshiwei$ adb reboot bootloader
gaoshiweideMacBook-Pro:~ gaoshiwei$ fastboot devices
289dedcc    fastboot
// 注意下面的命令,/Users/gaoshiwei/Downloads/是我Mac上存放img的路径。(用过命令行的都懂哈)
gaoshiweideMacBook-Pro:~ gaoshiwei$ fastboot flash recovery /Users/gaoshiwei/Downloads/twrp-3.1.1-0-gemini.img 
target reported max download size of 536870912 bytes
sending 'recovery' (20200 KB)...
OKAY [  0.601s]
writing 'recovery'...
OKAY [  0.127s]
finished. total time: 0.727s
// 上面的一条命令成功后进行下面的。
gaoshiweideMacBook-Pro:~ gaoshiwei$ fastboot boot /Users/gaoshiwei/Downloads/twrp-3.1.1-0-gemini.img 
downloading 'boot.img'...
OKAY [  0.517s]
booting...
OKAY [  0.427s]
finished. total time: 0.945s

// finished 后,等下一下,一会就能看到图像界面了。可以操作哦,英文一般的可以选择语言哦,有简体中文。

// 把电脑上下载好的系统push到手机里面去,记得push到 /sdcard/ 下
gaoshiweideMacBook-Pro:~ gaoshiwei$ adb push /Users/gaoshiwei/Downloads/lineage-17.1-nightly-gemini-signed.zip /sdcard/
/Users/gaoshiwei/Downloads/lineage-14.1-20171128-nightly-gemini...gned.zip: 1 file pushed. 12.6 MB/s (552332426 bytes in 41.791s)

// 到达这一步,我们的刷机前戏工作基本已经完成的差不多了。

4,开始刷机

  1. 选择清除,然后进入高级清除
  2. 选择Cache,System,Data分区,然后滑动下面的滑动图标进行清除。
  3. 返回主菜单界面,然后选择安装。
  4. 导航到/sdcard,然后选择 LineageOS系统的.zip包
  5. 先不要勾选验证和安装后重启
  6. 开始安装,如果没有出现错误的话,等他安装吧。(出现错误的话看下面的备注)
  7. 等待安装完成后,返回主菜单,选择重启,然后选择系统。

5,备注:解决LineageOS刷机 错误7 问题

如果当你选择好zip,开始安装的时候,出现错误,出现error 7. 出现验相关的问题,那么高潮来了。

  1. 先在你的电脑找你下载的LineageOS.zip的文件,用压缩软件解压。
  2. 找到这个文件 META-INF/com/google/updater-script
  3. 用记事本之类的文本编辑器打开(我用的sublime)
  4. 选择前面几行的中的所有assert的行,进行删除,包括空行也删除。删除后保存文件。
  5. 重新打包,把你之前解压的所有文件,重新打进一个压缩包,用zip的压缩方式,包名起什么都无所谓,尽量简单点,我就起了个mi5.zip
// 再次把系统包push到我们手机中
gaoshiweideMacBook-Pro:~ gaoshiwei$ adb push /Users/gaoshiwei/Downloads/mi5.zip /sdcard/
/Users/gaoshiwei/Downloads/mi5.zip: 1 file pushed. 16.1 MB/s (552345568 bytes in 32.774s)

push进去之后,下面就是开始刷机了。那就看前面的刷机步骤喽。



 
 
 

链接:https://www.jianshu.com/p/1cdd45b3343d

 
 
 
posted @ 2020-05-06 17:57  ls1519🎈  阅读(6039)  评论(0编辑  收藏  举报