• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[Guide] Flash MIUI OTA/Stock/Any MIUI based ROM from recovery without bricking device

Search This thread

the_weird_aquarian

Senior Member
Nov 13, 2016
396
207
Code:
/*
 * Your warranty is now void.
 * I am not responsible for bricked devices, dead SD cards,
 * thermonuclear war, or you getting fired because the alarm app failed. 
 * Please do some research if you have any concerns.
 * YOU are choosing to make these modifications, and if
 * you point the finger at me for messing up your device, I will laugh at you.
 */

A guide to flash MIUI OTA/Stock/Any MIUI based rom from recovery without any bootloops or bricking device.

First things first, if you haven't done any modifications to your device (not even unlocked bootloader), then this guide is probably not for you. Just update via the Updater app. If you want to unlock bootloader and root read this guide first then come back. :)

Now if you have unlocked bootloader with TWRP installed and encrypted device then you can flash full ROM from TWRP without any issues.
Staying on an encrypted device is recommend for better security.

To check if your device is encrypted or not go to Phone Settings > Passwords & security > Privacy > Encryption & credentials > check if it shows encrypted or not.

To decrypt your internal storage (Not recommended):
Make sure you have a backup of your data copied in PC.
- In TWRP go to Wipe and select Format Data(don't go to advanced). Type yes and format data. [This process will format all your data so make sure your data is backed up].
- Go back to TWRP home and Reboot > Recovery.
- Reboot > System.

Now if you check again in Phone settings it'll show "Phone not encrypted".

If you have a decrypted device and want to flash MIUI rom or OTA through recovery you'll face bootloop.
Then there are two solutions to overcome this issue:

1. After flashing full MIUI rom through TWRP you need to format data again. But you will have to backup your data to PC everytime as your internal will be formatted. And then you would have to go through the hassle of setting up your phone which takes atleast 15 mins.

2. A better solution is to use another recovery like OrangeFox recovery. It has a special MIUI OTA support. So you can flash MIUI OTA and any MIUI based rom from recovery without bootloop, formatting data or bricking device in any way.

Here's how to use OrangeFox recovery:
Make sure you have a backup of your data copied in PC.
These steps work for both encrypted and non-encrypted devices
- Download the stock MIUI Recovery ROM for your region or any other MIUI based custom rom of your choice, and copy it to your phone’s storage.
- Download the OrangeFox recovery zip from here.
- If you don't have any recovery installed right now then extract the recovery.img file from the zip and follow the "Flashing TWRP" steps from here
- If you already have TWRP then go to Install > flash zip normally. Your device will boot into OrangeFox recovery automatically in 5 seconds.
- Go to the Menu > tap on OrangeFox settings icon in top right corner, and enable these under MIUI OTA settings :
1. Support MIUI incremental OTA
2. Include system in OTA survival
3. Incremental OTA signature verification
4. Prevent auto reboot after installing OTA
5. Disable DM-Verity
6. Disable Forced Encryption (Don't enable this if you have an encrypted device already and want to stay encrypted)
7. Aggressive stock recovery deactivation
- Now go to the “Wipe” menu :
1. If already on a MIUI based rom and flashing your current MIUI rom zip then select data, cache, and dalvik.
2. If coming from a non MIUI based rom to MIUI based one or if switching from current MIUI based rom to completely different MIUI based one then select data, cache, dalvik, system, vendor.
- Now go to "Install" and flash your MIUI ROM. (This is just a one time process.)
- After the ROM is flashed, OrangeFox will start the "OTA_BAK" process, which will backup your system and boot partitions into the /sdcard/Fox/OTA directory. You must NOT delete any of the files in the /sdcard/Fox/OTA directory. If you do, then incremental OTA updates will most definitely fail.
- Reboot > system.

Now when MIUI notifies you that there is an update:
- Download the update, using the MIUI updater app/official website.
- If on an encrypted device allow it to reboot automatically to OrangeFox. If decrypted, boot to recovery manually and under miui OTA settings enable the Disable Forced Encryption option first and then flash OTA from recovery.
- OrangeFox will install the update automatically (this might take several minutes).
- Your phone will reboot automatically upon completion of the installation of the MIUI OTA update (If it doesn't then reboot manually).
- After this, you will not need to flash a full rom any more.
- Enjoy your updated MIUI :)

Links
1. OrangeFox Recovery
2. Stock MIUI Recovery ROM


If this helped you then hit the Thanks Button. Good Luck. :)
 
Last edited:

SbAgOoTs

Member
Jul 6, 2010
26
2
Hi,

do you think this procedure could work for willow (Redmi Note 8T) too?
I'm mainly concerned about OrangeFox package indicating ginkgo only...

Another question: when you suggest to backup data, you mean that everything (including installed apps and their settings) would be lost?

Thanks

Bye
 

the_weird_aquarian

Senior Member
Nov 13, 2016
396
207
Mentioned in the post read it carefully :)

Hi,

do you think this procedure could work for willow (Redmi Note 8T) too?
I'm mainly concerned about OrangeFox package indicating ginkgo only...

Another question: when you suggest to backup data, you mean that everything (including installed apps and their settings) would be lost?

Thanks

Bye
Well the only reason I didn't mention willow is I'm not sure if orangefox supports willow or not... although I think willow support was added after 10.1 stable version and it's the same file as of ginkgo....

Yes you need to backup your internal storage and every app as you will lose all data/apps/internal storage files.
 
Last edited:

DailyRoutine

Member
Aug 14, 2018
27
0
1. Can I use this to flash Custom MIUI like eu, pro or custom MIUI step is different?
2. Do I need to follow this stock rom step if I already have a full backup of the ROM?
 

the_weird_aquarian

Senior Member
Nov 13, 2016
396
207
1. Can I use this to flash Custom MIUI like eu, pro or custom MIUI step is different?
2. Do I need to follow this stock rom step if I already have a full backup of the ROM?
1. Yes just wipe dalvic, cache,data,system,vendor...rest process is same.
2. If you're already on stock rom then whole process is same....if you're coming back to stock rom from custom rom then wipe dalvic, cache,data,system,vendor...rest process is same.

Dude,, u r guardian of this redmi note 8 forum.. thank you so much for :cowboy:
Just helping out others and sharing the knowledge... Thanks though. :)
 
  • Like
Reactions: Mozar3lla

LuisElListo

Member
Aug 19, 2017
29
5
Hello, i am on miui 11 eu, (thanks to you, great room honestly), i want to know if i can root with the EU ROM and still update when weekly update is come? or need to unistall the root first and then root?
Thanks
 

the_weird_aquarian

Senior Member
Nov 13, 2016
396
207
Hello, i am on miui 11 eu, (thanks to you, great room honestly), i want to know if i can root with the EU ROM and still update when weekly update is come? or need to unistall the root first and then root?
Thanks
Yes you can root eu.. I'm using rooted eu without any issues....you will still receive updates, no need to uninstall root...but when you install the update you have to flash magisk zip again as after updating you will lose root...so after updating rom, flash magisk and everything will be back to normal. :)
 

Superraju

Senior Member
May 29, 2016
118
11
Kolkata
Is that orangefox method same for encrypted version? I mean my data is encrypted and I'm okay with that but want to flash Orangefox also want MIUI ota/update... Do i need to follow the steps (formatting data/cach etc, flashing recovery miui for create sdcard/fox/ota folder) ?
 

the_weird_aquarian

Senior Member
Nov 13, 2016
396
207
Is that orangefox method same for encrypted version? I mean my data is encrypted and I'm okay with that but want to flash Orangefox also want MIUI ota/update... Do i need to follow the steps (formatting data/cach etc, flashing recovery miui for create sdcard/fox/ota folder) ?
yes it'll also work in encrypted devices but under miui ota settings don't check disable encryption option so that you can still have an encrypted internal.. Yes you need to flash your current miui recovery rom once you flash orangefox. It's just a one time process for your current rom. Just wipe data,cache,dalvik nothing else.
 
Last edited:
  • Like
Reactions: Superraju

Superraju

Senior Member
May 29, 2016
118
11
Kolkata
yes it'll also work in encrypted devices but under miui ota settings don't check disable encryption option so that you can still have an encrypted internal.. Yes you need to flash your current miui recovery rom once you flash orangefox. It's just a one time process for your current rom. Just wipe data,cache,dalvik nothing else.

Thanks for your fast reply. The Fox/Ota now taking almost 5gb of internal storage. Can u pls help that...
1. Now if i flash Magisk, do i need to flash Universal DM-Verity and ForceEncrypt disabler zip? or OF will take care of it
2. if i want to flash others custom rom and after that change my mind and restore MIUI back, will ota still work from there? Or i need to repeat the whole process again?
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 12
    Code:
    /*
     * Your warranty is now void.
     * I am not responsible for bricked devices, dead SD cards,
     * thermonuclear war, or you getting fired because the alarm app failed. 
     * Please do some research if you have any concerns.
     * YOU are choosing to make these modifications, and if
     * you point the finger at me for messing up your device, I will laugh at you.
     */

    A guide to flash MIUI OTA/Stock/Any MIUI based rom from recovery without any bootloops or bricking device.

    First things first, if you haven't done any modifications to your device (not even unlocked bootloader), then this guide is probably not for you. Just update via the Updater app. If you want to unlock bootloader and root read this guide first then come back. :)

    Now if you have unlocked bootloader with TWRP installed and encrypted device then you can flash full ROM from TWRP without any issues.
    Staying on an encrypted device is recommend for better security.

    To check if your device is encrypted or not go to Phone Settings > Passwords & security > Privacy > Encryption & credentials > check if it shows encrypted or not.

    To decrypt your internal storage (Not recommended):
    Make sure you have a backup of your data copied in PC.
    - In TWRP go to Wipe and select Format Data(don't go to advanced). Type yes and format data. [This process will format all your data so make sure your data is backed up].
    - Go back to TWRP home and Reboot > Recovery.
    - Reboot > System.

    Now if you check again in Phone settings it'll show "Phone not encrypted".

    If you have a decrypted device and want to flash MIUI rom or OTA through recovery you'll face bootloop.
    Then there are two solutions to overcome this issue:

    1. After flashing full MIUI rom through TWRP you need to format data again. But you will have to backup your data to PC everytime as your internal will be formatted. And then you would have to go through the hassle of setting up your phone which takes atleast 15 mins.

    2. A better solution is to use another recovery like OrangeFox recovery. It has a special MIUI OTA support. So you can flash MIUI OTA and any MIUI based rom from recovery without bootloop, formatting data or bricking device in any way.

    Here's how to use OrangeFox recovery:
    Make sure you have a backup of your data copied in PC.
    These steps work for both encrypted and non-encrypted devices
    - Download the stock MIUI Recovery ROM for your region or any other MIUI based custom rom of your choice, and copy it to your phone’s storage.
    - Download the OrangeFox recovery zip from here.
    - If you don't have any recovery installed right now then extract the recovery.img file from the zip and follow the "Flashing TWRP" steps from here
    - If you already have TWRP then go to Install > flash zip normally. Your device will boot into OrangeFox recovery automatically in 5 seconds.
    - Go to the Menu > tap on OrangeFox settings icon in top right corner, and enable these under MIUI OTA settings :
    1. Support MIUI incremental OTA
    2. Include system in OTA survival
    3. Incremental OTA signature verification
    4. Prevent auto reboot after installing OTA
    5. Disable DM-Verity
    6. Disable Forced Encryption (Don't enable this if you have an encrypted device already and want to stay encrypted)
    7. Aggressive stock recovery deactivation
    - Now go to the “Wipe” menu :
    1. If already on a MIUI based rom and flashing your current MIUI rom zip then select data, cache, and dalvik.
    2. If coming from a non MIUI based rom to MIUI based one or if switching from current MIUI based rom to completely different MIUI based one then select data, cache, dalvik, system, vendor.
    - Now go to "Install" and flash your MIUI ROM. (This is just a one time process.)
    - After the ROM is flashed, OrangeFox will start the "OTA_BAK" process, which will backup your system and boot partitions into the /sdcard/Fox/OTA directory. You must NOT delete any of the files in the /sdcard/Fox/OTA directory. If you do, then incremental OTA updates will most definitely fail.
    - Reboot > system.

    Now when MIUI notifies you that there is an update:
    - Download the update, using the MIUI updater app/official website.
    - If on an encrypted device allow it to reboot automatically to OrangeFox. If decrypted, boot to recovery manually and under miui OTA settings enable the Disable Forced Encryption option first and then flash OTA from recovery.
    - OrangeFox will install the update automatically (this might take several minutes).
    - Your phone will reboot automatically upon completion of the installation of the MIUI OTA update (If it doesn't then reboot manually).
    - After this, you will not need to flash a full rom any more.
    - Enjoy your updated MIUI :)

    Links
    1. OrangeFox Recovery
    2. Stock MIUI Recovery ROM


    If this helped you then hit the Thanks Button. Good Luck. :)
    2
    thanks
    Can u pls tell me that, as my data is encrypted so every time i put password to decrypt it in OF recovery.. but i found in Miui OTA>Disable DM-Verity is unchecked. Is that okay or i should check mark that every time when flash any zip etc?
    Disable dm-verity is used to stop the stock mi recovery from coming back. Disable force encryption is required to stop the encryption. Now in OF, "Disable DM-Verity" and "Disable Force Encryption" options are always unchecked automatically everytime you reboot.
    If you're encrypted and you're flashing the miui zip again(like updating maybe or something) only then check the disable dm verity option(so that stock mi recovery doesn't come back)...for other zips like magisk, gapps whatever no need to do anything just flash....
    1
    im using android 10 syberia project and wanted to go back stock rom, will it work the same way?

    Yes absolutely :) just make sure to wipe dalvic,cache,data,system,vendor...rest procedure is same
    1
    Hello
    Can I flash Global Stable 11.0.4.0 rom via orange fox recovery over India stable rom??
    What's the process
    Plz reply...
    Yes you can...in wipe select dalvic,cache,data,system, vendor...rest process is same. :)
    1
    Hello! I have Redmi Note 8 (simple, gingko, 4/64). Immediately after the purchase, I installed Indonesia software (for non-Google caller, call recorder, sms). I was extremely pleased ... until I upgraded it to 12.0.1, OTA, officially! Now the battery drops seeing with my eyes .. before it lasted 5-6 days, now 3, maximum 4. I would like to put back MIUI 11 that I had (with MiFlash, obviously). From what you know, is there a danger of brick ??? Is the operation possible? Note: the phone has the bootloader unlocked (otherwise I couldn't have made the switch from EU to Indonesia) Thanks in advance for any response!
    you can flash the recovery rom too without any issues.. If you want to flash via miFlash then yes you can do that too... however make sure not to lock the bootloader while flashing another region rom with miflash .. select "clean_all" and NOT "clean_all_and_lock". 🙂