下载LineageOS

由于官网已停止维护,推荐在xdaforums站寻找资源

18.1版本非官方

21.0版本非官方 *我这里演示与用的是这个

官方源我找不到捏( ̄▽ ̄)*

❗注意事项

❗小米手机自行解锁 + ROOT,小破站那边教程挺多了,就不多说了

设备上启用USB调试

刷机

官方文档

安装ADB

各系统各版本可以看Github

Windows推荐Scoop包管理
scoop install main/adb

快速启动模式

手机USB连接电脑

1
adb -d reboot bootloader 

或通过组合键启动到快速启动模式

  • 在设备关机情况下,按住Volume Down + Power(音量减小键+开机键)。

关于小米手机在fastboot模式下无法连接ADB

原因:

  • 缺少驱动

解决方案:

解压压缩包在fastboot模式下运行MiUsbDriver.exe

正在安装驱动

验证电脑能否找到设备

1
fastboot devices

如果未收到任何输出或错误:

  • on Windows: make sure the device appears in the device manager without a triangle. Try other drivers until the command above works!

  • on Linux or macOS: If you see no permissions fastboot try running fastboot as root. When the output is empty, check your USB cable (preferably use a USB Type-A 2.0 one or a USB hub) and port!

    linux 与 macOs 运行 sudo fastboot devices 命令

先刷TWRP或者LOS,推荐直接LOS。

TWRP官网

推荐直接用LOS.img

1
2
3
4
5
6
[到下载目录]
cd C:\Users\用户名\Downloads
[LOS]
fastboot flash recovery lineage-21.0-platina-recovery.img

fastboot flash recovery '.\twrp-3.7.0_12-0-platina.img'

成功

  • 关机或许会一直重启,按住Volume Up + Power(提高音量键+开机键)。继续按住两个按钮,直到屏幕上出现“MI”标志,然后松开。

从恢复安装 LineageOS

相信你已下载或构建了LineageOS.zip

记得提前备份重要文件

点击 Factory Reset 回复出厂设置。

然后点击Format data / factory reset格式化数据/恢复出厂设置并继续格式化过程。这将删除加密并删除存储在内部存储中的所有文件,以及格式化缓存分区(如果有的话)。

f2fsext4 这两个格式自行选择,默认f2fs。

选择时长按开机键。
格式化用户数据 Format data格式化数据,推荐选择格式化数据。

返回根界面,点击 Apply Update应用更新 > Apply from ADB从 ADB 应用以开始旁加载。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
cd C:\Users\用户名\Downloads
adb -d sideload lineage-21.0-20240405-UNOFFICIAL-platina.zip


推荐

adb -d sideload lineage-21.0-20240619-UNOFFICIAL-platina-signed.zip

最新版
adb -d sideload lineage-21.0-20240622-UNOFFICIAL-platina.zip

# Wrp

Wipe"清除" Format Data 格式化Data分区 yes - Back 返回

Wipe - Adevanced Wipe 高级清除

通常会报告
Total xfer: 1.00x

adb devices

如果要安装谷歌套件,暂时不要重启进入系统,先回到

Apply update - Apply from ADB

https://wiki.lineageos.org/gapps/

安装谷歌

adb -d sideload .\MindTheGapps-14.0.0-arm64-20240612_135921.zip

Reboot system now

安装面具

adb install .\Magisk-v27.0.apk

将下载的zip文件夹解压,接着将boot文件通过usb传输到手机上

修补boot后会得到一个 magisk_patched-27000_Dmjk0.img

一般情况下在下载Download目录下

adb -d reboot bootloader

fastboot flash boot magisk_patched-27000_Dmjk0.img

重启手机

Apatch

超级密钥 这里不要输入弱密码,必须强密码,还要记住
https://apatch.top/zh_CN/install.html

密钥较弱或已泄露可能会导致对设备进行未经授权的控制

安装谷歌套件后,他会显示你没有网络,这边建议先跳过

先在离线状态下设置,

https://github.com/MetaCubeX/ClashMetaForAndroid
https://f-droid.org/packages/com.github.metacubex.clash.meta/

将修补文件放到电脑文件夹内

adb reboot bootloader

fastboot flash boot boot.img

将解压,将boot.img文件复制粘贴到手机文件夹内

fastboot flash boot apatch_patched_10763_0.10.7_llfm.img

fastboot reboot

重启

https://f-droid.org/en/packages/com.aurora.store/

https://f-droid.org/packages/org.billthefarmer.editor/

https://f-droid.org/packages/com.termux/

https://f-droid.org/packages/dev.imranr.obtainium.fdroid/

https://f-droid.org/packages/org.fcitx.fcitx5.android/