Flash xiaomi.eu for Redmi K40

envirnment

首先是环境准备,我用的是 MacOS,这里都是 MacOS 适用。

1
2
3
4
5
6
brew install android-platform-tools
# brew install android-file-transfer
brew install openjdk@11
sudo ln -sfn /usr/local/opt/openjdk@11/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-11.jdk
echo 'export PATH="/usr/local/opt/openjdk@11/bin:$PATH"' >> ~/.zshrc
export PATH="/usr/local/opt/openjdk@11/bin:$PATH"'

unlook the bootloader

官方工具只支持 windows,而我用的是 MacOS,所以我就用了一个叫 XiaoMiToolV2 的东西。因为其 release 的版本过老,需要重新自己编译,具体使用步骤如下:

1
2
3
4
5
6
git clone https://github.com/francescotescari/XiaoMiToolV2
cd XiaoMiToolV2
cp /usr/local/bin/adb res/tools/
cp /usr/local/bin/fastboot res/tools/
sudo ./gradlew build
sudo ./gradlew run

flash rom via fastboot

1
2
3
4
5
adb reboot fastboot
mkdir temp
cd temp
unzip unzip ../xiaomi.eu_multi_HMK40_POCOF3_V13.0.3.0.SKHCNXM_v13-12-fastboot.zip -d .
./macos_fastboot_first_install_with_data_format.sh