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

Search This thread

reyocio

Senior Member
Feb 11, 2010
457
282
Tagum City
Hello I am Chinese, recently found that you can not use mi pay because Union Pay upgrade security policy, so from miui9 7.0 update to 8.0 found that the twrp on the xda forum can not decrypt the data, and do not want to format the data, research and modify it now can be used normally Control and decrypt data, no need to enter a password to unlock, but the pie did not try to use it to share now

https://drive.google.com/file/d/1yWmgOXD5Rps3K4WUuUD2FEg_ZK9YAsVL/view?usp=drivesdk



File from

https://forum.xda-developers.com/mi-mix/development/rom-resurrection-remix-t3751314

I will try it later thanks a lot sir
EDIT:
it work!! Thank yo sir!
 
Last edited:

hazorea

New member
Jan 2, 2019
2
0
I installed TWRP on MI MIX

I installed TWRP on MI MIX
Can not move the bar at all
Remain stuck on the screen of TWRP
 

Marcelocohenarg

Senior Member
Oct 9, 2009
82
8

Hi, we don't have a working TWRP for Mi Mix with OTA upgrade support, right? I'm in official chinese MIUI 10.0.1.0, unlocked bootloader, rooted and installed TWRP 3.2.1 working fine; and now have received an OTA notification for MIUI 10.2.1.0 that would like to install, but I understand I cannot do it with a custom recovery right? Any suggestion (other than to wait for MIUI to have a ZIP TWRP flashable version)? Many thanks!
 

Super_SU01

Senior Member
Jan 14, 2018
431
35
I'm on miui 9 which twrp do i need to install via fastboot? As soon as I get twrp going I'm gonna root and flash a custom rom. I flashed the updated blunden twrp img via fastboot and it flashed but when I type in fastboot boot recovery.img it says no such file or directory...

Maybe I installed the wrong TWRP?
 

Super_SU01

Senior Member
Jan 14, 2018
431
35
I w as running miui 9 Nougant 7.0. The only twrp I could get to boot was mrrains after I got twrp to boot using fastboot commands I got error 7. Any suggestions on which twrp I can flash. The other twrps I flashed failed to boot using fastboot.

If anyone could maybe point me in the right direction on what I need to do to fix this I would really appreciate it.
 
Last edited:

cobben

Senior Member
Nov 13, 2016
317
86
I w as running miui 9 Nougant 7.0. The only twrp I could get to boot was mrrains after I got twrp to boot using fastboot commands I got error 7. Any suggestions on which twrp I can flash. The other twrps I flashed failed to boot using fastboot.

If anyone could maybe point me in the right direction on what I need to do to fix this I would really appreciate it.

I think you have to flash a ROM / firmware and a TWRP that fit each other, otherwise touch won't work in TWRP.

I would do it like this:

Fastboot flash the latest official developer ROM from Xiaomi, Global or China, boot into that at least once.

Then fastboot flash the latest raupe-blunden TWRP linked to earlier in this thread.

Official TWRP is abandoned, there is no other TWRP that works as far as I know.

Boot into it (not into the system, it will restore the official recovery), format data to get rid of encryption, boot again into TWRP, and then flash the EU ROM or custom ROM you want. You should be able to copy it from your Windows PC via USB
 
Last edited:

Super_SU01

Senior Member
Jan 14, 2018
431
35
I done exactly that yesterday and for some reason it just wouldn't work! I got home awhile ago sat down at my lap top and done the commands again and it worked the very first flash. I didn't have a OS installed after I flashed twrp. After I installed the blunden update img I got on my other phone and downloaded RR rom along with Gapps +firmware saved it to my mini SD card reader then plugged my reader into mi mix and flashed the rom, Gapps and firmware. I don't even know why I couldn't flash blunden twrp yesterday blows my mind lol. Im just Glade I got it working. Thanks for your advice I really do appreciate it!
I think you have to flash a ROM / firmware and a TWRP that fit each other, otherwise touch won't work in TWRP.

I would do it like this:

Fastboot flash the latest official developer ROM from Xiaomi, Global or China, boot into that at least once.

Then fastboot flash the latest raupe-blunden TWRP linked to earlier in this thread.

Official TWRP is abandoned, there is no other TWRP that works as far as I know.

Boot into it (not into the system, it will restore the official recovery), format data to get rid of encryption, boot again into TWRP, and then flash the EU ROM or custom ROM you want. You should be able to copy it from your Windows PC via USB

Sent from my SM-G955U using Tapatalk

---------- Post added at 12:33 AM ---------- Previous post was at 12:19 AM ----------

Sheeew feels good to be back up and running.

Sent from my MI MIX using Tapatalk
 
  • Like
Reactions: cobben

cobben

Senior Member
Nov 13, 2016
317
86
I done exactly that yesterday and for some reason it just wouldn't work! I got home awhile ago sat down at my lap top and done the commands again and it worked the very first flash. I didn't have a OS installed after I flashed twrp. After I installed the blunden update img I got on my other phone and downloaded RR rom along with Gapps +firmware saved it to my mini SD card reader then plugged my reader into mi mix and flashed the rom, Gapps and firmware. I don't even know why I couldn't flash blunden twrp yesterday blows my mind lol. Im just Glade I got it working. Thanks for your advice I really do appreciate it!

Sent from my SM-G955U using Tapatalk

---------- Post added at 12:33 AM ---------- Previous post was at 12:19 AM ----------

Sheeew feels good to be back up and running.

Good you got it working.

A lot of people have various problems with their Windoze boxes, which have nothing to do with the Mix1.
 
  • Like
Reactions: Super_SU01

Marcelocohenarg

Senior Member
Oct 9, 2009
82
8
Hi, we don't have a working TWRP for Mi Mix with OTA upgrade support, right? I'm in official chinese MIUI 10.0.1.0, unlocked bootloader, rooted and installed TWRP 3.2.1 working fine; and now have received an OTA notification for MIUI 10.2.1.0 that would like to install, but I understand I cannot do it with a custom recovery right? Any suggestion (other than to wait for MIUI to have a ZIP TWRP flashable version)? Many thanks!

Hi, at the beggiging of this thread Mr Blunden comments that his TWRP version has OTA support. I'm trying to upgrade from chinese oficial MIUI 10.0.1.0 to 10.2.1.0. I've located the OTA ZIP file in /downloaded_roms and tried to flash it with TWRP but I'm getting a ZIP encryption error. Is there any other way to do this using TWRP (I mean, without fastboot flashing the official recovery)? Many thanks.
 

cobben

Senior Member
Nov 13, 2016
317
86
Hi, at the beggiging of this thread Mr Blunden comments that his TWRP version has OTA support. I'm trying to upgrade from chinese oficial MIUI 10.0.1.0 to 10.2.1.0. I've located the OTA ZIP file in /downloaded_roms and tried to flash it with TWRP but I'm getting a ZIP encryption error. Is there any other way to do this using TWRP (I mean, without fastboot flashing the official recovery)? Many thanks.

On page 66 in this thread a Chinese individual seems to have posted a modified ( by him) version of Blunden-Raupes latest TWRP that even supports encryption.

I have not tried it, I use Xiaomi.eu with no encryption.
 

Super_SU01

Senior Member
Jan 14, 2018
431
35
Had to update firmware so twrp error 7 would go away.. Dang I'm Glade I got that fixed.
 
Last edited:

blunden

Senior Member
Jun 11, 2009
979
301
Hi, at the beggiging of this thread Mr Blunden comments that his TWRP version has OTA support. I'm trying to upgrade from chinese oficial MIUI 10.0.1.0 to 10.2.1.0. I've located the OTA ZIP file in /downloaded_roms and tried to flash it with TWRP but I'm getting a ZIP encryption error. Is there any other way to do this using TWRP (I mean, without fastboot flashing the official recovery)? Many thanks.
By OTA support I'm talking about LineageOS OTAs, not official MIUI OTA updates. :) That has been broken in earlier versions.

Hello I am Chinese, recently found that you can not use mi pay because Union Pay upgrade security policy, so from miui9 7.0 update to 8.0 found that the twrp on the xda forum can not decrypt the data, and do not want to format the data, research and modify it now can be used normally Control and decrypt data, no need to enter a password to unlock, but the pie did not try to use it to share now

https://drive.google.com/file/d/1yWmgOXD5Rps3K4WUuUD2FEg_ZK9YAsVL/view?usp=drivesdk

File from

https://forum.xda-developers.com/mi-mix/development/rom-resurrection-remix-t3751314
It looks like the TWRP you modified was mine. It's the one they have apparently rehosted there. I'd be curious to know what you had to change to make it compatible with MIUI? :)
 
Last edited:

mingyucheng692

New member
Jul 9, 2017
3
10
ChongQing
Intent.me
By OTA support I'm talking about LineageOS OTAs, not official MIUI OTA updates. :) That has been broken in earlier versions.

It looks like the TWRP you modified was mine. It's the one they have apparently rehosted there. I'd be curious to know what you had to change to make it compatible with MIUI? :)

Hello friends, I modified this TWRP keystore(so)file
from the official MIUI to get data decryption support.
Then I think the startup page is too complicated, so I removed the extra text. Consider the unknown problem that TWRP may have. I left my contact email on the homepage.
Finally, thank you for sharing the TWRP file.
 

blunden

Senior Member
Jun 11, 2009
979
301
Hello friends, I modified this TWRP keystore(so)file
from the official MIUI to get data decryption support.
Then I think the startup page is too complicated, so I removed the extra text. Consider the unknown problem that TWRP may have. I left my contact email on the homepage.
Finally, thank you for sharing the TWRP file.
I see. Thanks for letting me know. :)
 
Nov 11, 2017
25
5
Hello friends, I modified this TWRP keystore(so)file
from the official MIUI to get data decryption support.
Then I think the startup page is too complicated, so I removed the extra text. Consider the unknown problem that TWRP may have. I left my contact email on the homepage.
Finally, thank you for sharing the TWRP file.

Hello mingyucheng692 my friend! :highfive:
I want to give you my greatest thanks! I was suffering from not being able to decrypt my data partition since I flashed LineageOS over a year ago. Your modified TWRP based on Raupe and Blunden's version is the first recovery that is able to decrypt my data partition again. Now I can use TWRP again and flash updates without sideloading. You helped me and many others a lot with this and I am very thankful! :victory:

@blunden: Are you able to reproduce what mingyucheng692 did and will you merge his changes to your future custom TWRP releases? AFAIK there should be no downsides. If anything the TWRP should become useful to not only LineageOS but also MIUI users if you do so. :good:
 

herien

Member
Jul 30, 2018
6
0
Sorry for the dumb question, but my Mi Mix just started bootlooping. I am wondering if I can save all my data. I'd really like to just duplicate the phone because I have lots of app data & pictures etc. I want to save.

history:
-Mi Mix 256gb/6gb version
-unlocked, and installed TWRP & AICP rom around 6-12 months ago. working fine since then.
-yesterday I turned my phone on & it just bootloops. I can get into recovery fine
-I think I got TWRP to successfully backup to USB OTG (I selected everything in TWRP backup: boot, recovery, system, system image, vendor, data(excl. storage), cache, efs, firmware), and the folder it created is ~15gb.
-I had taken out the sim just before this, and about a week or two ago I replaced the screen. I don't know if that had anything to do with it.
-I can try unplugging the battery if that might help.

I don't know what to do now. If you could tell me what options I have & what to search for I would really appreciate it. I think I want to duplicate the system image- ideally I want to get my phone back to the exact state it was in before the boot loop. I would be willing to buy a 2nd Mi Mix if necessary. Thank you very much for any advice.
 

cobben

Senior Member
Nov 13, 2016
317
86
TWRP backup will not backup your personal files like pictures.

In the file manager in TWRP these are in the folder /sdcard.

If you can copy your files to an external memory via the file manager, I don't know, never tried.
Or connect to a PC if that works.
 
Nov 11, 2017
25
5
Sorry for the dumb question,

That is not a dumb question. First of all I am very sorry because I have bad news for you. It is very likely that you won't be able to fully restore your phone to the state it was before the bootloop. Still I will try to help you salvage as much as possible and tell you how you can prevent data loss in future. You need some basic knowledge about Android and TWRP usage because I won't cover every little step. However you seem to have this knowledge so you should be fine.

Salvaging:
1. Do a full nandroid backup off all partitions minus the boot partition. If you are offered "Images" use those instead. Example: If you are offered "System" and "System Image" only backup the System Image. When restoring later you can decide which partitions you want to restore. So you can start with everything minus the boot partition if you suspect that this is the culprit for your boot loops.

2. Copy the Nandroid Backup to you PC. This should be possible by connecting your phone via USB to your PC and activating MTP mode in TWRP. It's in the advanced section afaik. ATTENTION: It is VERY important that you copy your whole TWRP folder. If you only copy the backup folder you won't be able to restore your backup! There is a number coded folder inside and TWRP needs the full path for restoring backups.

3. Copy all other files you can reach on your (virtual) SD-Card to your PC since those are not part of the nandroid backup. This is usually the folder where you find your "Downloads" and "TWRP" folder in.

That's it. Now fix your boot loop, restore your nandroid backup minus the boot partition, and if you lost your sdcard contents by fixing your phone, copy in those as well. You will however have some data loss with lots of apps you used and you will lose most of your system settings.

For the future:
Ok, so how do you avoid data loss in future? With regular backups of course. On Android you have to do two backups, though!
1. Do regular nandroid backups as described above via TWRP and copy those to your PC.
2. Get (or better BUY!) Titanium Backup: https://play.google.com/store/apps/details?id=com.keramidas.TitaniumBackup&hl=en This little wonder boy does regular backups of all your apps and the data within. Copy those backups to your PC as well!
3. Create a flashable zip with Titanium Backup. This way you can install Titanium Backup via TWRP!
4. Ifyou ever have to fully wipe your Phone you can begin with restoring nandroid backups. Then flash the Titanium Zip and copy over your Titanium backup to your phone. Boot your phone and run Titanium Backup. Select RESTORE EVERYTHING and reboot afterwards.
5. Everything is back to normal as if your phone was never broken.
6. ATTENTION: The nandroid backup and titanium backup should match for best results. So when you copy your nandroid backup to your PC also copy your titanium backup as well.


I hope this was useful to you. Sorry for your data loss but if you make regular backups in future you will be fine from now one.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 23
    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