FORUMS

[GUIDE][INFO][PSA] Redmi Note 8 Pro - Megathread + CFW

495 posts
Thanks Meter: 5,179
 
Post Reply Email Thread
Announcement from Agent_fabulous: CFW for A11 is here! Scroll to the second reserved post to learn more.
Redmi Note 8 Pro - The Megathread


Background
Xiaomi sent many of us the Redmi Note 8 Pro (Indian variant - begoniain) back in November 2019. Development started out great, but came to an abrupt halt, when at one point all of us were bricked. A little bit of caution and a bit more of tinkering, and we're back!
Long story short, yes this device does brick, and yes there IS a method to avoid it! I request you to take out some time and read the entire post, before you proceed. Following instructions is crucial, if you want to save yourself trips to the service center.

begonia? begoniain? what's happening?
There are 2 variants of the Redmi Note 8 Pro. "begonia" is the global variant whereas "begoniain" is the Indian variant. The only difference between the 2 is NFC. The Indian Variant has no NFC. And no, it's not as if it's disabled, the hardware is just not present. The TWRP and ROM builds target both, so you do not have to worry about a thing. Irrespective of where you bought the phone, all custom software is the same, and will run on both variants.

Unlocking the bootloader and gaining root
This has been covered by other threads in the past, so I won't dive into too much detail here. You need to unlock your device using the Unlock Tool that Xiaomi provides and wait for almost a week (168 hours) to gain unlock permissions. There's no way to get around this. Please follow any other guides for installing a recovery, flashing Magisk, disabling AVB and booting up.

Custom ROMs and bricking
Regarding bricks, yes this device will get bricked if you do stupid things or don't follow instructions. Feel free to ask if you ever have a doubt. Do NOT spam on ROM threads. Ask here, and use search before you do. Chances are, someone has asked the same thing in the past.

Now, doing things like:
- Tripping AVB
- Flashing an incompatible boot and dtbo
- Flashing a weird boot image
- ???
will result in a brick. You won't have fastboot, you won't have anything in such cases. Only Boot ROM download mode, which requires a Mi Authorized Account. In such cases, you will need to visit a service center.

PLEASE NOTE: I do NOT recommend online services that promise to unbrick your device. Not only are they highly overpriced, but could result in you getting scammed, or have your data stolen. If you have a Mi Authorized Account and are willing to help us out, feel free to PM me. Any online service ads for the same will NOT be entertained.

Now, there is a way to prevent bricks entirely. However, it does not work with the MIUI 11 Android 10 China build that surfaced a few months ago. The factory firmware for begonia was leaked, @Xakep1993 discovered that the factory had a lot of security checks disabled, and compiled in engineering mode.

Before we go any further, know that there is no way for you to unbrick a phone that's already bricked and is running the MIUI preloader. (Visit a Service Center in such a case) The following applies only to devices that are in a good, working state and will prevent bricks.

Okay so how does that help?
Glad you asked. Every MediaTek device has 2 download connections. Boot ROM (aka BROM) and Preloader. Boot ROM is burnt onto the SoC and is the first program to run. Preloader is loaded after. Boot ROM implements security measures against attacks, which includes flashing improper or malicious firmwares. This is "SLA" and "DAA", that is "Serial Link Authentication" or "Download Agent Authentication". This happens server side and requires the Mi Authorized Account, that only service centers have.

What's so different with this firmware?
Preloader runs after BROM, and does not require any security verification to write partitions. MIUI's preloader has download disabled. When you brick, you have Preloader starting and rebooting constantly. (And holding volume up gets you to BROM download). There's no way to talk to the MIUI Preloader. The Factory Preloader on the other hand, has download enabled. So, if something goes wrong, as long as the Factory Preloader is present you CAN unbrick!

How to install it?
If you are on MIUI 11 - Android 10, you WILL need to downgrade to Android 9! This method will not work if you're on Android 10. Use MiFlashPro or fastboot to flash all partitions to a compatible MIUI 10 or 11 Android 9 build.
I will add a zip that can be flashed from TWRP, soon. Until then, you can flash it via Fastboot.
1. Download preloader_begonia.bin and lk.img from attachments
2. Execute
Code:
fastboot flash preloader preloader_begonia.bin
fastboot flash lk lk.img
fastboot flash lk2 lk.img
(LK = Little Kernel = Bootloader)
You can now use SP Flash Tools to restore your "bricked" phone!
This will also make the bootloader append certain debug flags to the kernel cmdline. So you may see some interesting behavior while Android is running!
You can find the full factory build here. This is a barebones MTK-Android build. We don't recommend using it xD

Where are my Custom ROMs? ETA PL0Z BRO!!!
They're almost ready now, you should see threads popping up in a few more days.

Okay, thanks for the "anti-brick" factory preloader! I'm gonna flash another MIUI build!
Hol' up, fam. You need to check whether the MIUI OTA you're installing contains Preloader and LK or not. If it does, remove it manually. Another method could be to install the OTA and then flash the factory Preloader and LK image again via fastboot.

Flashing ROMs
Once ROMs are out, the install process is very simple and much like any other device:
- Download ZIP
- Push ZIP to device
- Flash using TWRP
- Install GApps (optional)
- Reboot
- Profit!

Unbricking
Assuming you have the factory preloader installed,
- Disconnect device from PC if connected
- Load SP Flash tool
- Load firmware of choice
- Press download, SP Flash tool will now wait for the device
- Connect device and don't hold any keys
- If the device doesn't detect, hold power for a 8-10 seconds
- It should start flashing right away without any authorization prompt!

Building ROMs (Developers only)
Things are still under development. Things may be broken, may or may not boot at all. Current code can be found below:
Device Tree - branch android-10
Vendor Tree - branch android-10
Kernel - branch master
DTBO Patch
Info about the patch: many partitions of the device (including DTBO) are signed using private keys. We don't have access to these keys, and thus our generated dtbo images don't boot. I managed to strip out the certs, write a simple Python script and write custom dtbo generation rules that append the required certs.

Things may be missing here, more information will be added as necessary

XDA:DevDB Information
The go-to modding guide for the Redmi Note 8 Pro (begonia/begoniain), ROM for the Redmi Note 8 Pro

Contributors
Agent_fabulous
ROM OS Version: Android 10
ROM Kernel: Linux 4.x

Version Information
Status: Testing

Created 2020-02-24
Last Updated 2020-10-26
Attached Thumbnails
Click image for larger version

Name:	photo_2020-02-23_16-20-30.jpg
Views:	25414
Size:	159.6 KB
ID:	4957565  
The Following 124 Users Say Thank You to Agent_fabulous For This Useful Post: [ View ]
24th February 2020, 02:44 PM |#2  
Agent_fabulous's Avatar
OP Recognized Developer
Flag Bangalore
Thanks Meter: 5,179
 
Donate to Me
More
CFW and CFW builds and recoveries
CFW

What is a CFW?
The A10 Custom Firmware, or CFW for short, is a combination of multiple Xiaomi firmware packages.

Why do I need it?
You are probably aware of the leaked factory firmware for the Redmi Note 8 Pro. This firmware contains a preloader which was compiled with the download code.
Since the preloader does not need to setup platform security it allows us to unbrick without an authorized account.
Unfortunately, the MIUI bootloader do not run on the factory preloader - only the factory bootloader does, which works just fine with A9 kernels.
Furthermore, the A10 kernel source released by Xiaomi does not work with the factory bootloader/preloader, which was the reason I worked on a new kernel source based on Android 9 (A9) with several Android 10 (A10) drivers to work nicely with the A10 blobs.
In short, the CFW enables you to use the new builds without worrying about bricks while running newer proprietary vendor software.

What's special about the new builds?
New builds, tagged "[CFW]", come with their own vendor images. These builds are unified for all variants of the Redmi Note 8 Pro and have pretty much all issues fixed at this point. They ship with the new modified A10 kernel I mentioned earlier.
NOTE: While the builds are unified, the CFW is not. Please flash the correct version of CFW, for your variant
While flashing the wrong CFW is not catastrophic, it may lead to issues such as poor reception.

What really is inside this CFW?
The CFW contains firmware files from the latest A9 and latest A10 firmware image. Along with this, the CFW also installs the factory preloader and bootloader (LK) to make sure you're safe when modifying your device.

How do I install the CFW and builds?
CFW is a recovery-flashable package. You WILL HAVE TO downgrade to MIUI A9 to flash this since there are no recoveries which work nicely with MIUI A10.
Even though the CFW does install factory preloader and LK, I do highly recommend flashing preloader and LK from fastboot first and then the CFW.
Once you are sure you are running the CFW, simply flash a CFW compatible build. You may also need to update your recovery after installing CFW. See next post for full step-by-step instructions.

Recoveries? How do those work with CFW?
Since recovery images also contain their own kernel, there are also CFW compatible recovery images. After installing a CFW, reboot to fastboot and flash any CFW enabled recovery image.
Trying to run a non-CFW recovery on CFW will make it reboot to system or recovery itself after a few seconds of entering recovery. Should you find yourself in a situation like this: as soon as recovery loads, hit [reboot] > [bootloader]. If you cannot do this, flash the new recovery image from SP Flash tools (or wait for your device to drain it's battery out )
See next post for full step-by-step instructions.

Do I need to flash the CFW everytime?
Nope. If you flashed CFW once, you're good. Just make sure the ROM you're flashing does not install any firmware images. Ask your ROM developer before installing a zip.
ALL MIUI ZIPS CONTAIN FIRMWARE IMAGES. DO NOT FLASH ON TOP OF CFW

I'm on CFW and rocking a custom ROM. How do I go back to MIUI?
Flash a full MIUI Fastboot ROM, or use SP Flash tools to install the flash all MIUI partitions. Again, do not flash a recovery package for switching to MIUI.
See next post for full step-by-step instructions.

What would happen if I install a non-CFW build on CFW?
Again, nothing catastrophic. It'll make the device reboot itself a few seconds into the bootanimation. All current non-CFW builds run the A9 kernel code. The new kernel is based on the A9 kernel code as well; some drivers just don't like the new firmware images included in the CFW So, save yourself the trouble and check what you're installing. CFW supported builds are listed in the next post.

Where can I download the CFW?
Please see the next post, below.

While the whole CFW thing may seem a bit overwhelming to some, remember, it's something to protect your device in the long run! Take out a few minutes and please read through this post properly.
The Following 30 Users Say Thank You to Agent_fabulous For This Useful Post: [ View ]
24th February 2020, 02:44 PM |#3  
Agent_fabulous's Avatar
OP Recognized Developer
Flag Bangalore
Thanks Meter: 5,179
 
Donate to Me
More
Reserved
CFW Migration Steps

Coming from MIUI
Method 1
- Downgrade to MIUI Android 9 if not already, or try using Method 2
- Flash preloader and lk as mentioned in first post
- Flash any non-CFW Android 9 recovery
- Boot into recovery
- Wipe system, cache, dalvik
- Flash CFW, CFW compatible ROM (flash GApps mods later! )
- Format data (not wipe, select "Format Data", you'll lose all userdata)
- Reboot to bootloader
- Flash CFW recovery
- Reboot! You're now on CFW!

Method 2 Try at own risk!*
- Flash a non-CFW A10 recovery from fastboot (such as LR TWRP for MIUI A10)
- Boot directly into recovery by holding [Volume +] after flashing and rebooting
- (Optional) For safety sake, select Advanced option "Close AVB 2.0"
- Take a full nandroid backup (IMPORTANT! Will be helpful if lost IMEI)
- Turn off "Reboot after installing ROM" from TWRP settings
- Wipe system, dalvik and cache
- Flash CFW and a CFW compatible ROM (flash GApps and mods later! )
- Format data (not wipe, select "Format Data", you'll lose all userdata)
- Reboot to bootloader from the Reboot menu
- Flash CFW recovery
- Reboot! You're now on CFW!
*NOTE: This method has worked for each everyone who has tried it and followed correctly, so far. The idea for this method was mine, but I personally have not tried it myself. It will particularly be useful if you're using MIUI A10 and are on a limited data plan

Coming from non-CFW Custom ROMs
- Make sure preloader and LK are installed (see first post)
- Boot into recovery
- Wipe system, cache, dalvik
- Flash CFW, CFW compatible ROM (flash GApps here if necessary, flash any extra mods later! )
- Format data (not wipe, select "Format Data", you'll lose all userdata)
- Reboot to bootloader
- Flash CFW recovery

Updating CFW-enabled builds on CFW
Since you're already on CFW, just install the update and reboot like any other device:
- Remove lockscreen if any
- Reboot to recovery
- Wipe data, system, cache, dalvik
- Flash ROM (+ GApps if necessary)
- Reboot!

Going back to MIUI from CFW
- Flash full MIUI firmware from SP Flash Tools or fastboot

Android 11
Changes
- Update to MIUI 12 blobs and fw images
- Prebuilt vendor image for A11
- Fully enforced and vendor isolation enabled

Coming from A10 CFW
- Flash "CFWv3+vendor" package followed by the ROM.
Note: You don't need to flash the "CFWv3+vendor" package more than once when switching to other A11 ROMs, unless you have gone back to A10.

Coming from MIUI
- Follow instructions above to CFW, just use A11 CFW and A11 ROM instead

Going back to A10 CFW
- Flash CFWv2 along with your A10 ROM.

Going back to MIUI
- Fastboot flash full MIUI ROM

Note: Do not wipe vendor on A11. If you do, you'll have to reflash the "CFWv3+vendor" package to have a functional device.

CFW Downloads
Android 11 (CFWv3+vendor)
- begoniain: https://sourceforge.net/projects/beg...6.zip/download
- begonia: https://sourceforge.net/projects/beg...6.zip/download
Android 10 (CFWv2)
- begoniain: https://sourceforge.net/projects/beg...3.zip/download
- begonia: https://sourceforge.net/projects/beg...3.zip/download

CFW Supported Recoveries
- Unofficial TWRP
- Anything else marked with "[CFW]"

CFW Supported ROMs and kernels
- Pretty much everything active, at this point lol

The latest non-CFW Unofficial TWRP can be found on AFH, on my thread (see last line on post) and in the Telegram group as note "#twrp-non-cfw-for-roms"

Troubleshooting
IMEI lost (requires full TWRP backup of MIUI when IMEI was present!):
From a full TWRP backup, restore the following partitions:
- nvcfg
- nvdata
- nvram
- persist
- protect_f
- protect_s
Reboot and check! IMEI should be back

ROM Reboots to recovery after boot logo (no bootanimation):
Usually, this indicates that the device isn't able to setup encryption. You'll also see randomly named files and folders in TWRP. In this case, just Format Data (not wipe), and reboot.

Rescuing the device:
Since CFW is always running factory preloader and bootloader (LK), you can use SP Flash in case something should go wrong.
Assuming you're stuck in some sort of loop/brick while on factory preloader/CFW, here are the EDL modes:
There are 2 modes of "EDL":
- Preloader: Factory preloader will always advertise a download mode when the device is starting, right before the Redmi logo (You may not get a logo if you're bricked, only a blinking LED). You do not need to hold ANY buttons. Just plug in the device and it'll show up on your computer periodically. Load any Android 9 firmware in SP Flash, uncheck preloader, lk and lk2, connect your device and hit Download in SP Flash.
- BootROM: If you don't have factory preloader, you will have to flash via BootROM. This requires an authorized account. Unless you have one yourself, you will need to head to a service center to get your device fixed. If you do need to load BootROM download, hit download in SP Flash with the Authorized Account logged in, hold volume up and plug in the device while holding the key. Release the key as soon as your computer recognizes it. SP Flash will start the download.
If you are able to enter this mode yourself, and the service center quotes something like a "motherboard replacement", show them this section of the post and tell them it's a software issue. Given the nature of such a new and unique device, often even the best make mistakes! If you're a XIaoMi Service Center and a customer has showed this to you, PLEASE try this. The phone will enter BootROM if you hold the keys at the correct time. You do not need to take the phone apart to short any pins. Just login and bind to your special account, hit "Download" in SP Flash and hold the keys for 5-15 seconds with the device plugged in. The software will recognize the device and start flashing.
If you as the technician are wondering why you should trust a random person on the internet, here's why: I received the device from XiaoMi India, as part of their developer program and have been reversing things on it for the past 6+ months. I have been through 3 hard-bricks and have helped multiple service centers diagnose the device correctly and having them fix my own device too.

The following "Booting different modes" is obsolete in CFWv2! Latest CFW menus behave like MIUI.
Booting different modes:
The key combinations on factory bootloader are a little different:
- Power + Vol Up:

This loads a menu. You can change between different boot modes with volume up and select the mode with volume down.

- Power + Vol Down:

Unlike MIUI, this loads a factory testing menu. Do not open this. If you do load it by accident, hold power button to force reboot.
Use The Power + Vol Up menu for Fastboot
According to a user on Telegram, here's what the menu translates to:
Code:
The title is Factory Mode
The first is automatic testing
The second is manual test
The third is a single test
The fourth is the test report
The fifth is debugging test items
The sixth is to clear emmc
The seventh is version information
The eighth is to restart the mobile phone.
The Following 30 Users Say Thank You to Agent_fabulous For This Useful Post: [ View ]
24th February 2020, 04:04 PM |#4  
Member
Thanks Meter: 14
 
More
Wow!!! Thanks man! Does it work with custom firmware such as xiaomi.eu or miuipro based on China builds?
24th February 2020, 04:28 PM |#6  
Senior Member
Thanks Meter: 152
 
More
DAMN!

P.S: Snapdragon ftw
24th February 2020, 04:41 PM |#7  
djzero86's Avatar
Senior Member
Flag San José
Thanks Meter: 97
 
More
Oh thanks @Agent_fabulous you are the best
24th February 2020, 04:49 PM |#8  
Senior Member
Thanks Meter: 75
 
More
Great thread
24th February 2020, 05:37 PM |#9  
Junior Member
Thanks Meter: 6
 
More
Great thread. I'm super excited.
24th February 2020, 07:31 PM |#10  
Junior Member
Thanks Meter: 1
 
More
I haven't flashed any thing on my phone before, can i flash this preloader??
24th February 2020, 07:36 PM |#11  
soleali's Avatar
Senior Member
Thanks Meter: 26
 
More
This thread explains greatly. Thanks!
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes