[Recovery] Official TWRP for the Xiaomi Mi MIX (lithium)

Search This thread

jcadduono

Recognized Developer
Jan 17, 2014
1,490
6,224
31
Thunder Bay
adduono.com
Team Win Recovery Project 3.0.2-0



This is for the Xiaomi Mi MIX only, do not flash on other models!

WARNING: As of Android Marshmallow, factory boot images have dm-verity enabled, which prevents you from booting if you swipe to enable system modifications!
SOLUTION: Follow the full rooting steps below in order to allow system modifications without the risk of a boot loop!

WHAT IS TWRP?

Oh come on, you know what it is - don't try to fool me!
In case you're serious, though...

Team Win Recovery Project is a custom recovery for Android devices.
It allows you to back up and restore your data, flash custom ROMs to your device, repair broken file systems, and root your device.

Read more about TWRP here: https://twrp.me/about/

DOWNLOAD

You can find the device page here:
For official stock/dev firmware: http://teamw.in/devices/xiaomimimix.html

For (slightly newer) firmware: https://build.nethunter.com/test-builds/twrp/xiaomi/twrp-3.0.2-0-rc1-eu-lithium.img
For (the latest EU) firmware: https://build.nethunter.com/test-builds/twrp/xiaomi/twrp-3.0.2-0-rc2-eu-lithium.img
(touchscreen will not respond if not matching firmware)

You can find up to date fastboot & adb binaries here!

FULL STEPS FOR OBTAINING ROOT

Follow these instructions until someone nice comes along and makes a video from them (without ads):

  1. You must first unlock your device. To do this, follow the instructions on the MIUI forums. (tedious, I know)
    Transparent.gif
  2. Extract adb & fastboot to your computer.
    Transparent.gif
  3. Download TWRP for Xiaomi Mi MIX (lithium).
    Transparent.gif
  4. Reboot your device into fastboot mode. To do this, select reboot from the power menu and hold the [Volume Down] + [Power] buttons while your device reboots.
    Transparent.gif
  5. Once you're in fastboot mode, you're ready to flash TWRP. To do this, run these commands in order:
    fastboot flash recovery twrp.img
    fastboot boot twrp.img

    Transparent.gif
  6. At this point, you will reach the screen asking you if you want to allow system modifications.
    By swiping right, you will trigger dm-verity, and if you don't follow the next step you will be unable to boot!
    If you are going to root your device and follow the rest of these steps, then it is safe to swipe right and enable modifications.
    Transparent.gif
  7. If you want to be rooted with SuperSU:
    Download the latest SuperSU by Chainfire.
    Without exiting TWRP, transfer the SuperSU zip to your device over MTP* and flash it using [Install] in TWRP.

    If you want to be rooted with something else or just want a bootable system:
    Download the latest dm-verity and forced encryption disabler zip.
    Without exiting TWRP, transfer the no-verity-opt-encrypt zip to your device over MTP* and flash it using [Install] in TWRP.
    This will also allow you to use [Format Data] to completely disable your encryption if desired.
    Transparent.gif
  8. Go to [Reboot] -> [System].
    Transparent.gif
  9. Wait 2-5 minutes for your device to finish setting itself up. (SuperSU will reboot you a few times)
* MTP, known as Media Transfer Protocol, is the same way you transfer files from your PC to your device when booted into system.


CHANGES
  • v3.0.2-0 - Official release on twrp.me
  • v3.0.2-0-rc1 - Initial release candidate and first XDA build

FEATURES
  • MTP support
  • USB Mass Storage support
  • Micro SDcard and USB OTG storage support
  • f2fs file system support (read, write, format, backup & restore)
  • exFAT file system support (read, write, format, backup & restore)
  • NTFS file system support (read, write, format)
  • ADB root
  • Full SELinux support
  • Built in android 6.0 tree

KNOWN ISSUES
  • There's absolutely none that I know of. Rejoice. You even have working hardware encryption!

CONTACT & SUPPORT

You can find us on IRC at #twrp on chat.freenode.net.
You can also post in this thread and I will attempt to answer any questions you may have.

SOURCE CODE

TWRP: https://github.com/omnirom/android_bootable_recovery (android-6.0)
Device tree (Official): https://github.com/TeamWin/android_device_xiaomi_lithium (android-6.0)
Device tree (Development): https://github.com/jcadduono/android_device_xiaomi_lithium (android-6.0)
Kernel: Unavailable (waiting on Xiaomi source release, using MIUI stock binary for now)

CONTRIBUTIONS

Gerrit for TWRP: http://gerrit.omnirom.org/
Gerrit for officially supported devices: http://gerrit.twrp.me/

Thank you to @wolfgart for requesting device support and reporting feedback on my initial builds.
 
Last edited:

raimondomartire

Senior Member
Nov 9, 2005
3,644
4,944
Salerno
Samsung Galaxy S23 Ultra
Last edited:
  • Like
Reactions: mac231us

jcadduono

Recognized Developer
Jan 17, 2014
1,490
6,224
31
Thunder Bay
adduono.com
Looks like it won't be showing up on twrp.me until 3.0.3 or 3.1.0 depending on what's next. There's a few incompatibilities in the device tree and I'd prefer to wait it out till then. Ex. 3.0.2 doesn't support f2fs or ntfs on omnirom trees right now, but our current source does. If I made an official release neither would be supported.

Update: Official release made on newer TWRP build tree.
 
Last edited:

mega00

Senior Member
May 13, 2013
50
7
I flashed the recovery, but the touch screen was not working, I can't do anything in the recovery, anyone know what's wrong?
 

jcadduono

Recognized Developer
Jan 17, 2014
1,490
6,224
31
Thunder Bay
adduono.com
I flashed the recovery, but the touch screen was not working, I can't do anything in the recovery, anyone know what's wrong?

did you read the part about needing a different TWRP image for EU vs stock ROM? You will need to boot the ROM you want, then turn off the device completely and boot into the TWRP version that matches it. This is a kernel firmware update issue that I can't fix until Xiaomi releases sources.

Wow, a thousand thanks.
don't quote the entire thread opener.... edit your post and remove it, if you need to make adjustments use the edit button, don't make another post immediately after your own
 

mega00

Senior Member
May 13, 2013
50
7
did you read the part about needing a different TWRP image for EU vs stock ROM? You will need to boot the ROM you want, then turn off the device completely and boot into the TWRP version that matches it. This is a kernel firmware update issue that I can't fix until Xiaomi releases sources.

I am on stock rom and using the stock rom version TWRP, the touch screen just don't work.

To be more clear, I am on dev rom 6.11.10 (MIUI8), do I have to change to stable rom V8.0.8.0.MAHCNDI (MIUI8) to make it work?

Update: Yes, I changed to stable rom and it works.
 
Last edited:
  • Like
Reactions: sbatargin

wolfgart

Senior Member
Sep 14, 2007
1,915
1,214
Rome
did you read the part about needing a different TWRP image for EU vs stock ROM? You will need to boot the ROM you want, then turn off the device completely and boot into the TWRP version that matches it. This is a kernel firmware update issue that I can't fix until Xiaomi releases sources.

I am on stock rom and using the stock rom version TWRP, the touch screen just don't work.

To be more clear, I am on dev rom 6.11.10 (MIUI8), do I have to change to stable rom V8.0.8.0.MAHCNDI (MIUI8) to make it work?

you have to flash CN Stable rom V8.0.8.0.MAHCNDI (MIUI8) and use original TWRP for it and if you want Cross-Flash your CN rom with International one Here too .

When you are on International rom up&running you can flash over the EU TWRP .

As explained from @jcadduono this is the only solution for the moment until XIAOMI release his Kernel stuff officially
 
Last edited:

cultofluna

Senior Member
Nov 25, 2015
4,105
2,085
Google Pixel 6 Pro
Google Pixel 7
Thanks to the devs for such fast development on this great phone ...
I personally coming from lg so xiaomi is completely new for me ...
I understand the usual steps unlocking bootloader..flashing twrp ...and finally root ....
I don't have the phone yet but when it comes is running the same stock rom for everybody if I'm not wrong?...
What is that with the different roms?...
And how do i know wich twrp have to install?
Thanks again and sorry for the #noob# guestions....

Sent from my LG-D855 using XDA Free mobile app
 

wolfgart

Senior Member
Sep 14, 2007
1,915
1,214
Rome
Thanks to the devs for such fast development on this great phone ...
I personally coming from lg so xiaomi is completely new for me ...
I understand the usual steps unlocking bootloader..flashing twrp ...and finally root ....
I don't have the phone yet but when it comes is running the same stock rom for everybody if I'm not wrong?...
What is that with the different roms?...
And how do i know wich twrp have to install?
Thanks again and sorry for the #noob# guestions....

Sent from my LG-D855 using XDA Free mobile app

cause Stock kernel still was not relased you have to simply flash EU Rom using stock TWRP and after you done you have to change to TWRP EU to make it working again .

We are waiting official sources from Xiaomi
 
  • Like
Reactions: cultofluna

knives of ice

Senior Member
Jul 12, 2007
1,617
263
Xiaomi Mix Fold 2
just to make sure i'm understanding this correctly - there is no way to unlock this phone on the day you get it you have to apply and wait upwards of 2 weeks to be able to unlock it?
 

wolfgart

Senior Member
Sep 14, 2007
1,915
1,214
Rome
I am facing the unlock stuck at 50% issue while trying to unlock the bootloader on this phone? any ideas? Thank you.

you have to Log On with your MIUI account on device too and the retry to unlock

---------- Post added at 07:43 AM ---------- Previous post was at 07:42 AM ----------

does anyone know if using TWRP manager will work to install TWRP after you have unlocked?

it works ! I can confirm. And it works using Flashify too
 
  • Like
Reactions: vergilbt

Top Liked Posts

  • There are no posts matching your filters.
  • 24
    Team Win Recovery Project 3.0.2-0



    This is for the Xiaomi Mi MIX only, do not flash on other models!

    WARNING: As of Android Marshmallow, factory boot images have dm-verity enabled, which prevents you from booting if you swipe to enable system modifications!
    SOLUTION: Follow the full rooting steps below in order to allow system modifications without the risk of a boot loop!

    WHAT IS TWRP?

    Oh come on, you know what it is - don't try to fool me!
    In case you're serious, though...

    Team Win Recovery Project is a custom recovery for Android devices.
    It allows you to back up and restore your data, flash custom ROMs to your device, repair broken file systems, and root your device.

    Read more about TWRP here: https://twrp.me/about/

    DOWNLOAD

    You can find the device page here:
    For official stock/dev firmware: http://teamw.in/devices/xiaomimimix.html

    For (slightly newer) firmware: https://build.nethunter.com/test-builds/twrp/xiaomi/twrp-3.0.2-0-rc1-eu-lithium.img
    For (the latest EU) firmware: https://build.nethunter.com/test-builds/twrp/xiaomi/twrp-3.0.2-0-rc2-eu-lithium.img
    (touchscreen will not respond if not matching firmware)

    You can find up to date fastboot & adb binaries here!

    FULL STEPS FOR OBTAINING ROOT

    Follow these instructions until someone nice comes along and makes a video from them (without ads):

    1. You must first unlock your device. To do this, follow the instructions on the MIUI forums. (tedious, I know)
      Transparent.gif
    2. Extract adb & fastboot to your computer.
      Transparent.gif
    3. Download TWRP for Xiaomi Mi MIX (lithium).
      Transparent.gif
    4. Reboot your device into fastboot mode. To do this, select reboot from the power menu and hold the [Volume Down] + [Power] buttons while your device reboots.
      Transparent.gif
    5. Once you're in fastboot mode, you're ready to flash TWRP. To do this, run these commands in order:
      fastboot flash recovery twrp.img
      fastboot boot twrp.img

      Transparent.gif
    6. At this point, you will reach the screen asking you if you want to allow system modifications.
      By swiping right, you will trigger dm-verity, and if you don't follow the next step you will be unable to boot!
      If you are going to root your device and follow the rest of these steps, then it is safe to swipe right and enable modifications.
      Transparent.gif
    7. If you want to be rooted with SuperSU:
      Download the latest SuperSU by Chainfire.
      Without exiting TWRP, transfer the SuperSU zip to your device over MTP* and flash it using [Install] in TWRP.

      If you want to be rooted with something else or just want a bootable system:
      Download the latest dm-verity and forced encryption disabler zip.
      Without exiting TWRP, transfer the no-verity-opt-encrypt zip to your device over MTP* and flash it using [Install] in TWRP.
      This will also allow you to use [Format Data] to completely disable your encryption if desired.
      Transparent.gif
    8. Go to [Reboot] -> [System].
      Transparent.gif
    9. Wait 2-5 minutes for your device to finish setting itself up. (SuperSU will reboot you a few times)
    * MTP, known as Media Transfer Protocol, is the same way you transfer files from your PC to your device when booted into system.


    CHANGES
    • v3.0.2-0 - Official release on twrp.me
    • v3.0.2-0-rc1 - Initial release candidate and first XDA build

    FEATURES
    • MTP support
    • USB Mass Storage support
    • Micro SDcard and USB OTG storage support
    • f2fs file system support (read, write, format, backup & restore)
    • exFAT file system support (read, write, format, backup & restore)
    • NTFS file system support (read, write, format)
    • ADB root
    • Full SELinux support
    • Built in android 6.0 tree

    KNOWN ISSUES
    • There's absolutely none that I know of. Rejoice. You even have working hardware encryption!

    CONTACT & SUPPORT

    You can find us on IRC at #twrp on chat.freenode.net.
    You can also post in this thread and I will attempt to answer any questions you may have.

    SOURCE CODE

    TWRP: https://github.com/omnirom/android_bootable_recovery (android-6.0)
    Device tree (Official): https://github.com/TeamWin/android_device_xiaomi_lithium (android-6.0)
    Device tree (Development): https://github.com/jcadduono/android_device_xiaomi_lithium (android-6.0)
    Kernel: Unavailable (waiting on Xiaomi source release, using MIUI stock binary for now)

    CONTRIBUTIONS

    Gerrit for TWRP: http://gerrit.omnirom.org/
    Gerrit for officially supported devices: http://gerrit.twrp.me/

    Thank you to @wolfgart for requesting device support and reporting feedback on my initial builds.
    10
    I also have a device tree but based on gemini.

    https://github.com/blunden/android_device_xiaomi_lithium/commits/android-7.1

    It includes a prebuilt kernel with the touch firmware fix that I merged into Lineage 14.1 and 15.1 enabled.

    https://github.com/LineageOS/androi...mmit/42a64be1431033426c593c50f83a7c5586dcfcc8

    @PsyMan What's your progress so far? Any issues remaining?

    This is the modified one I'm currently using for lithium 15.1 if someone needs it.

    http://www.mediafire.com/file/03nd3n0va0ndej5/
    8
    So I've always been using the official twrp image and just creating a new img with the bootimg tools here: https://forum.xda-developers.com/mi...omi-mi-mix-t3498960/post70648774#post70648774

    I'm using Official LineageOS. And everything has always worked fine, including decrypting, is there anything I'm missing by not using the version by @raupe ?

    Hi @iNewbcake,

    if you like you can read why i've begun a dev from the scratch here and here and here.

    The goal is also to not modify a TWRP every time Xiaomi or LOS-Team changes their kernel(-settings).
    Also be aware that not every user of this forum is as skilled as you or willing to manually replace the kernel.

    In result you found a good working solution for yourself.
    ... my approach is a litte different:
    I like the idea to have a solution for the community and setup possibilities optimize the result by collaborating via github for everyone who's interested or likes to share some code snippets.
    I hope this helps to not reinvent the wheel (again) - source files and setup instructions for build environment will be published within a couple of days.

    But collaboration means also feedback - there is a little lack of that in the past days compared to the beginning of my research.
    The idea is to get more reactions once the sources are published on github. - Because of the essential weight of feedback in development and bug fixing by the community and devs.
    7
    Does this mean RIP TWRP for the mi mix? Or are there alternatives?
    No, it doesn't. Since my Mix is my daily device I'll keep it working as long as I can. I won't however make minor updates.
    7
    The main thing that really bugged me about the old TWRP version we have is that the clock was always wrong, so I've made the latest TWRP 3.3.1 for our device updated with Pie kernel. My device is not encrypted so I can't test that, but everything else works ok.
    https://www.androidfilehost.com/?fid=1899786940962579411