yashsingh1/xdaforums huggingface dataset:
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
Greetings readers!

I've build a new version today that contains some different en-/decryption libraries.

Please give it a shot and as always: Feedback is very welcome ;)

Download: https://www.nextgen-networks.de/de/downloads/category/15-xiaomi-mi-mix-2.html

For those with touchscreen issues:

There have been made no kernel changes so dont expect any changes here.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] ShawnLukeLee:
is it suit for oreo cause my mix2 already update to 8.0, developer edition
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] Mackay53:
Will be fine
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
Jipp, should work with 8.0/8.1 - sources used for building are 8.1 based.

I can give more detailed feedback if I'm selected for XIAOMI Android 8 global dev ROM next week.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] sergtot:
I've restored a backup made by the last version of your TWRP. At the end of the process I saw something like "can't mount /cust". Is it OK?

The phone booted up successfully after restore by the way.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
This could happen if you restored the vendor_image partition and had the cust partition mounted the same time.

Nothing to worry about. :)
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] sergtot:
Got it :)

So, what partitions should I restore only to roll back let's say to the morning state in case I didn't change anything except some new apps installation ? System, data, cache?
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
Jepp exactly that combination :)

Alternative selection:

Restore only system and data and delete/format cache before reboot.

Cache will be build at next boot again.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] sergtot:
Thank you. Everything is clear now :)
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
Recovery is updated with latest changes.

... read more on page 1 -> https://xdaforums.com/mi-mix-2/development/recovery-twrp-3-2-1-0-recovery-t3730030
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] sergtot:
Excellent work :) I can reboot to TWRP with working touch right from MIUI.

System and Data are backing up in 2-3 times slower than with your previous TWRP build. Is it OK?
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] Ritonz:
Is aroma opengapps working with this one?
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] sergtot:
I made 2 screenshots for 2 your TWRP versions.

twrp-3.2.1-0-chiron-raupe-20180423-2319-OMNI_v8:

twrp-3.2.1-0-chiron-raupe-20180504-0024-OMNI_v8:

340 seconds for 20180423 version.

690 seconds for 20180504 version.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
Yes backup spreed is decreased due of changes in kernel/common ibraries introduced between April 22nd and 30th.

I decided to keep using these slower version to stay in line with future updates made by other developers and keep compatibility to OmniRom/AOSP.

My plans are to keep my eyes for speed improvements of the official available repos within the next 2 month.

If available i'll update my release - if not i'll start investigation by my own.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] sergtot:
So, is it OK to use the older version for MIUI? I mean, no hidden issues?
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
I've no infomation about any aroma problems.

If you fear any problems just make a backup first and install your aroma based stuff afterwards.

Happy flashing!
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
Yes it should be ok for now.

Older versions contain Qualcomm HW-Crypto libraries that may lead to decryption problems in future releases.

This is the perfect moment to change to more recent TWRP release for you. :)
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] sergtot:
Hmmm... The older version is OK for now, but it's better to switch to the fresh version to avoid possible decryption problems in a future?
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
No, no - you only need to change if these problems occur.

They maybe occur never.

If you or other people face a decryption error "volume could not be decrypted" in future you'll simply update to a more recent TWRP version and your volumes will be decrypted instant.

So nothing to worry about.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] sergtot:
Nice. I like to backup fast.

Thank you for the clear answer and your perfect job :)
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] Ritonz:
Aroma opengapps used to work on your old unofficial twrp. The new official twrp crashes and reboots to recovery when attempting to use aroma. Is this bug present on your twrp too?
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
A written in my answer i've no information about any problems with my TWRP build.

Just give the aroma installer a try and choose another custom package if aroma fails.

I personally don't use aroma installer but should not too complicated for you to test this for your setup and maybe leave a feedback here for other users.

Happy GAPPS flashing!
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] TylerDurdenK:
I've got an issue where I cannot read any files in TWRP, all storage read 0mb.

I understand this is something to do with encryption but TWRP doesn't give me an option to input my password.

Can anyone help?

**EDIT** I updated TWRP to the newest version and it's solved the issue.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] candiduslynx:
Don't save your choices

I know of 1 issue with aroma package - just don't save your choices. It actually works this way when I reflash.

Possibly because of the encryption mistakes? IDK.

But aroma definitely works)
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] Dado11:
Hi boys, i would tell you my problem. I've tried to install a custom rom (omnirom and also lineageos) with this TWRP and official TWRP. But my phone after installing the rom, root and gapps go into TWRP bootloop. Instead of the start of system I have TWRP start. I tried anything : fastboot command to erase cache and userdata, fastboot continue restart the recovery and clean install of anything. The curious thing is that i was able to install once the omnirom but after the first update i had this problem. From then i' m not able to update or install any system. The only thing i was able to do is the installation of lineage os (after fastboot command erase userdata) without root or gapps but system crash on start. And it is not configurable. I had to reinstall miui in fastboot mode. Can someone help me? Is a boot problem? A partition problem? Thank you
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
pls no double postings. Mackay53 had an answer for you already.

see: https://xdaforums.com/mi-mix-2/development/recovery-twrp-3-2-1-0-xiaomi-mi-mix-2-t3780525/page4
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] Dado11:
Yes but i've tried with both TWRP and i didn't know what are the differences. Sorry and thanks
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] Mackay53:
Did u format it 3-4 times in a row? If that didn't work then wipe system and format then flash
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] Ritonz:
So I've tried your twrp and can confirm that aroma gapps work fine (including loading and saving choices). But nandroid restoration crashes horribly! I tried restoring one backup that I made by using this twrp itself and the process stopped while restoring 'data', giving some error. I rebooted to recovery and all the data saved on my phone was gone (like what you get while formatting data by typing"yes")! ROM installation through the twrp went fine but after setting up the fresh ROM and rebooting to recovery, the twrp had reset itself and all the saved files (including the ROM.zip) were gone again!
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
Hi [MENTION=5740379]Ritonz[/MENTION]!

Thanks for your report!

The first behavior you described could be an problem caused by TWRP recovery or at least by an backup that was made with an other/older TWRP version than the one you used for restore.

I never faced this on one of my devices but read about it in forums for other devices.

@ ALL: Did somebody else got that behaivior?

The second one is possibly caused by the ROM installer script itself.

This does happen very often if you start with an unencrypted data partition and install a ROM that encrypts this storage by default or if your device is booted in an "no OS installed" / system partition empty/formatted condition.

It has happen to me when playing with LineageOS & OmniRom in the past.

The internal storage has been reset and the .twrp config file was gone because of this action.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
sources & recovery has been updated

see changelog in first post for new & updated features -> https://xdaforums.com/mi-mix-2/development/recovery-twrp-3-2-1-0-recovery-t3730030
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
short update:

I've discovered that my TWRP recovery survives official MIUI Global/CN installs when used with latest magisk beta.

More instructions how to in first post: https://xdaforums.com/mi-mix-2/development/recovery-twrp-3-2-1-0-recovery-t3730030
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] kancrutt:
hi [MENTION=496297]raupe[/MENTION] is this also will Disable Forced-Encryption?
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
Hi kancrutt,

yes this should be an side effect - encryption could then be enabled by hand later.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] kancrutt:
so if I remove lockscreen password before flashing new ROM, let say from MIUI Global Beta to LOS, I just need to "Wipe" all without Format Data and then flash no-verity zip?
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
That *may* work...

... *may* because of the differences in OS-Version and possible encryption that has been applied already to your storage by MIUI Global ROM.

Just use as many backup possibilities as possible :) to be prepared if something does not work as intended.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] kancrutt:
it works! but after booting to system and set lockscreen password then reboot to recovery I've got password failed in TWRP.

any idea?
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
Hmmm - then your storage is encrypted (and was before i suppose).

If this encryption was made by a ROM released before April 20th you may have to format your storage (sorry for those sad news).

Many ROMs that used storage encryption had an basic implementation error that was discovered and solved by April 19th/20th.

OK - what exact TWRP version do you use? (build number/creation date)

If it is not the latest then please update.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] kancrutt:
I was on Dirty Unicorn latest build (20180612) using latest official TWRP 3.2.10, and then after flashing MIUI 10 Global Beta I tried flashing your latest TWRP using Flashify but still ended up with password failed.

edit: but if I removed lockscreen password, it is boot fine on TWRP
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
OK - when & and before what ROM version was the last time you completely formatted your internal storage with the command that required the "yes" acknowledge?

... and also a important question: Do you used the opt-encrypt_dm-verity script also with the ROM installs you mentioned in last post?

And last "ProTip" ;)

Better not use flashify - i ran in trouble with it regularly and people posting here had trouble with it too.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
OK the removal thing is "interesting".

Please test steps as followed:

remove lockscreen pattern/pin

remove fingerprint

remove face id (if setup)

reboot to TWRP - everything OK?

boot into system

set lockscreen pattern/pin

set fingerprint

boot to twrp - does it decrypt?

please share your results - thanks!

(will read next messages tomorrow)
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] kancrutt:
the last time typing "yes" is about 2 weeks ago when I flash AndiYan's RR ROM (May build) from Dirty Unicorn (also May build).

Yes I flash no-encrypt zip with last ROM (MIUI 10 Global Beta)

FYI, I use flashify after password failed login to TWRP with flash recovery via bootloader method (fastboot flash recovery command)

---------- Post added at 05:36 PM ---------- Previous post was at 05:34 PM ----------

yes I did your suggested steps before and ended up with password failed (encrypted)
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] Aadeep:
Decryption doesn't work with MIUI based ROMs, LOS based Roms are fine
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
Hmm i've used MIUI 9 up to 8.5.8 and now use MIUI 10 Global Beta 8.6.14 - both with encryption and the TWRP modified by me.

Are you whure you are using the latest TWRP modded by me?

What exact ROM are you using that leads to decryption problems?

... and can you describe a bit more detailed the case that let the problems occur?

Thanks mate!
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
That sounds really weird :-/

The chances to get that solved without an deep dive into that matter are very low.

To have an clean starting point and to avoid any remains of older ROM installations I would suggest to backup all your data and flash the latest available global dev ROM from XIAOMI with thair flashtool.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] Aadeep:
The decryption problem i faced is with MIUI 8.4.19, MIUI 10 China rom and MIUI 8.6.14 Global rom. With LOS and ABC rom decryption with password works fine.

With MIUI I have to remove password and then use the recovery.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
Thanks for your explanation.

I suppose you faced the decryption algorithm problem that is mentioned some pages before.

All ROMs even those from major vendors seemed to have used FDE encryption until 2018-04-19/20.

Dated by 2018-04-21 there was a coordinated change by many ROM creators/vendors to use FBE instead.

This method is adviced to use by google since Android 7 but was not implemnted by many.

Therefore many ROMs include the legacy code for en- / decryption to not bother their customers while the TWRP codebase has got removed the code by this date.

You now may ask why...

... we had massive decryption problems in the past with FDE and FBE code and the correct automatic selection by TWRP in the past.

This seems to lead the decision made by TWRP team and device tree owners to remove the old legacy code.

You may be successful in decryption when using an older TWRP version (3.1.x-x) that uses Android 7 codebase.

Long description - short answer:

-> Please format your storage with the yes funtion within TWRP to use recent FBE based encryption or continue to use an older TWRP (that may lead to compatibility problems in future).
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] Aadeep:
I tried formatting the data when i switched from LOS to MIUI, problem persists.

I even tried flashing fastboot rom and then flash TWRP, problem persist with MIUI rom.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] Andddyy:
Hi i got problem too when ı flash latest Miui cant change my country even ı flashed back the official twrp.

My country stcked on chinese.

I tried reflash official twrp and with fastboot but got nothing still cant change my country.

And when ı try flash something my files are encrypted can ı reverse it back?

Can you help me pls? [MENTION=496297]raupe[/MENTION]

Im on latest Global beta 8.6.21.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
Hey [MENTION=8694235]Andddyy[/MENTION],

you are asking two complete new questions ;)

first:

You have a chinese device and want to change it to global?

-> fist flash a global rom with MiFlash Tool (you need a fastboot rom for this)

-> instructions in how to use MiFlash: http://en.miui.com/a-234.html

-> latest official global fastboot rom: http://en.miui.com/thread-2955303-1-1.html

-> then install/flash TWRP-Recovery again

-> wipe/format your device with the "yes" answered-option in TWRP

-> flash the latest available Global DEV rom

You should now have all countries selectable (a.k.a. you now have an globla device)

second:

It's not known to me that an encrypted android partition can be reverted to unencrypted state without loosing data.

-> As mentioned above you can wipe/format your device with the "yes" answered-option in TWRP

-> direct afterwards you can flash a script called somewhat like "no-opt-encrypt-....zip" - search for it here in the Mi MIX2 forum section.

This script prevents a new encryption but has to be flashed every time again when you update your current rom or make a fresh installation.

Second option is to use the xiaomi.eu ROM for Mi MIX2 - they have disabled encryption by default.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
Hi [MENTION=5131232]Aadeep[/MENTION],

I'm sorry but im out here - have no more idea how to solve your situation :-/
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] Andddyy:
Thanks for your answer.

İ have global device and i flashed this custom twrp because miui recovery was overwriting over official twrp.when i was on official twrp i can choose my country but when i got this twrp and no-opt-encrypt cant choose my country on beginning and even in my options when i click option on country its sending me back its stucked on chinese.Do you have any idea about that?Loosing data is doesnt matter for me about unencrypted.why its changed after flashed this twrp and cant going back with official thats im wondering.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
Ahh sorry - misunderstood you (thougt you mean country selection in MIUI).

To get rid of twrp problems simply delete the .twrp file that is located in the TWRP folder of your internal storage.

Then reboot and make your settings again.

Just give a short ping if this does not help and then please also mention, what language/country you had selected.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] Andddyy:
No you understand me right i cant change my country cant even select it when i make even clean flash.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
Hmm - the country selection in MIUI is absolutely independet from TWRP that is installed - it's managed by the ROM only.

This said the known way by me to fix the country selection in MIUI was the tutorial 2 posts before ;)

If this does not help I would advice you to get in contact with the original manufacturer Xiaomi (http://en.miui.com).
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
modified TWRP 3.2.2-0 beta available

Download & changelog in first post.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
Please leave feedback the beta in this thread :)

Does it work well?

Did you encounter any problems?

Thanks for your support!
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] Jellyfish Gun:
I have installed the 3.2.2.0 and flash rr.No bugs have been encountered so far.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] maNiaoH:
Work perfect for me with Omni, ABC, DU, RR, AEX
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] immerzu:
I need this beta to.

Upload again!

thx.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] HaxxorHardy:
please reup beta. Thank you!
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
[MENTION=1106290]immerzu[/MENTION] [MENTION=8415921]HaxxorHardy[/MENTION]

I've found 2 issues (crash with wrong decryption pattern, power issue if display is turned off) in the beta.

Please use latest 3.2.1-0 final until the i got those bugs fixed (not before next week ;)).
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
TWRP 3.2.3-0 recovery is released.

Bugs introduced in TWRP 3.2.2-0 beta have been fixed.

Download in first post.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] HaxxorHardy:
Thank you!
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] udo 240:
I own first day a Mi Mix 2 and just installed TWRP 3.2.3.0 (original from TWRP website) and Omni... Two probs: First I need the password to decrypt my data-partition and I can not backup my partitions like Boot, System and Data.... It always end in: Can not create ´/data/media/0/TWRP7BACKUPS/..... Failed to make backup folder.´ What is the problem? Is it recommended to flash unofficial TWRP? Thx for your help in beforehand ;)
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] thefireofwar:
The problem you are facing is because you where on the encrypted ROM, to egg TWRP working you need to format Data from TWRP.

If you have any files you can boot into the OS and copy them into your PC because everything will be DELETED.

Hope this helped :)
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] udo 240:
Ok. Thx a lot. Until now i´ll use https://xdaforums.com/showpost.php?p=76351395&postcount=247 wich allows to use roms unencrypted.

Greets Udo
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
Important changes in latest 3.2.3-0 build: 20180815-2003

based on fresh MIX 2 OmniRom base files and new msm8998 common sources - speed seems to be upgraded a little

Download as always in first post: https://xdaforums.com/mi-mix-2/development/recovery-twrp-3-2-1-0-recovery-t3730030
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] trapntan:
Will this recovery flash miui incremental ota's? I get error 7 every time with official twrp and inc. ota, but full rom flashes fine.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
added some info & download link to TiPatch in first post
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
It "may" work - but patch routine is based on official TWRP with minor changes.

Please test and leave feedback here.

As always: make backup before trying the magic ;)
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] kancrutt:
internal storage backup works with TiPatch? so we can do format data "yes" and still have backup of internal storage?
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
... this is what TiPatch is written for :)
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
... ohh sh*** we'll have to tinker with encryption again when updating to Pie based TWRP ...

(src: https://github.com/omnirom/android_bootable_recovery/commit/e9afc3de0fe1df795cc2f8cfab489177252812be)

Will build an beta within this week to check what has to be changed.

I'll publish it here if the beta is stable enough for public testing.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] ShawnLukeLee:
thanks very much
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] Valaran:
Same here. Using "twrp-3.2.1-0-chiron_raupe-20180105-1642.img" over "chiron_global_images_V9.1.1.0.NDEMIEI_20171102.0000.00_7.1_global_cf48355d5b"

Got another strange issue: i fastboot flash, reboot on recovery. I see recovery but sdcard is encrypted, if i reboot to system then go back to recovery, i'm back to stock recovery. :confused:
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] hillolp:
Do i need to remove encryption before flashing
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] DaCoolX:
Oh great, will test it straight away.

Any news on the USB MTP/ADB front?

Edit: Tested it with latest LineageOS from the other thread:

It now detects the encryption and prompts me for a password, though the mounting still fails.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] hawst:
Test it ytd, still has issues with sdcard. Was using Xiaomi.eu 7.12.21 and TWRP 3.1.1. Flashed this new TWRP and it cannot see sdcard content, then flash back 3.1.1 one - and it can see.