requirements:
- java
- python
- fastboot
-
Unloack Developers tools in your phone.
-
download miui from here
-
unzip miui zip to this catalog (replace all file).
-
use MiUnlockTool
java -jar MiUnlockTool/bin/MiUnlockTool.jar 'user-email' 'user-password'
-
chmod a+x upload.sh
-
./upload.sh
-Go to "Wipe".
-Go to "Advanced Wipe".
-Choose "Cache / Data".
-Go to "Repair or Change Filesystem".
-Press "Change Filesystem".
-Press "EXT4".
recovery.img -> https://twrp.me/Devices/
new version of sdat2img.py -> https://github.com/xpirt/sdat2img
MiUnlockTool -> http://xiaomitool.com/MiUnlockTool