yashsingh1/xdaforums huggingface dataset:
[Redmi Note 8 Pro Guides, News, & Discussion] u8ububu:
If you mean an Android dev, no, I'm not (and if you mean rom developer, nope, I never built one, too much waste of space). Otherwise, I've done some desktop and server development for Windows and Linux (plus some embedded projects).

Regarding the TWRP info, I think some is either on the TWRP site or on the forums here, but much of it is figuring out on my own (I've figured the brightness thing on my own, and spotted it some time later in the forums too).

The thing with linux systems is that there are de facto standards for a lot of things. For example, if you're interested in things that light up on your device, /sys/class/leds/ is pretty much the place to look for, regardless if you're using a desktop, laptop, phone, watch, car, bus station display, SBC, or anything else using linux. The trick is to search everything through google and read the documentation or the code wherever possible. Standard linux interfaces are usually very well documented, which makes figuring this out very easy. Android-related info can also be found on forums or through mailing lists, though it's not as easy to come by. Unfortunately the mtk source is hard to find (except for the code that they are legally bound to publish, and I think they are not even publishing all of that) and any documentation is nearly impossible to find (there's an occasional leak on some chinese websites, but I haven't learnt chinese and google translate is not always doing a good job on it).

There's also *a lot* of trial-and-error. For example, it took me about a week to build a compatible kernel and boot an archlinuxarm image on it and run some GNU/Linux desktop environment (I went back to lineage after that since I couldn't even get wireless working, but I think I know why now, so I might try that again in the future). That's also the reason I'm posting this info on the threads here - it takes time to figure it out.
[Redmi Note 8 Pro Guides, News, & Discussion] bandos23:
hello guys

I have a European firmware 11.0.3.0 (PGGEUXM) android 9

I flashed the factory preloader and lk and lk2 files but when I try to flash the phone in SP Flash Tool it still throws a '' BROM '' error

what is the problem?

Hi

so everything works as it should, the problem was in the DA file

the original with SP Flash Tool did not work.

so the preloader works perfectly and yesterday I flashed TWRP + ROOT (magisk) And ??? they work smoothly. finally: D

it was my 2 attempt to flash TWRP and ROOT, the first one ended up in a service center. here in the Czech Republic they replaced my motherboard, flashlight, and back cover: D as a reason for the complaint, I stated that the phone went out during the update and did not turn on: D the service did not come to the software at all! I had to take the phone to a service center after a failed TWRP flash.

I prepared for the second attempt and for me:

TWRP OFFICIAL- inoperative (black screen)

TWRP ORANGE FOX- inoperative (black screen)

TWRP AGENT FABULOUS- inoperative (black screen)

TWRP wzsx150] [P / Q] TWRP- ONLY FUNCTIONAL FOR ME

it worked on android 9, miui 11 firm-europe

so far guys: D
[Redmi Note 8 Pro Guides, News, & Discussion] mentoser:
you need to flash via fastboot command
[Redmi Note 8 Pro Guides, News, & Discussion] bandos23:
of course i made a flash using fastboot? but it preloader doesn't work for me ..
[Redmi Note 8 Pro Guides, News, & Discussion] u8ububu:
Which operating system? What error message? Give us more information to work with.

If you're on windows, did you install the vcom drivers? Does it show up in device manager? If on linux, does is show up in lsusb? Does spft have permissions on the usb device?
[Redmi Note 8 Pro Guides, News, & Discussion] Photopuppet:
Maybe to avoid confusion it would be better for the custom ROMs that need to use the Indian vendor to only be labelled as Begoniain and not use Begonia name until there are ROMs using global vendor and all features?
[Redmi Note 8 Pro Guides, News, & Discussion] hassan_eldhraawy:
I've unlocked bootloader and flashed the files successfully ..

Now I want to flash TWRP and root ..

the procedure is to flash twrp and disable AVB and flash magisk ? that's it ?

Is there any other precautions before/during/after flashing TWRP?
[Redmi Note 8 Pro Guides, News, & Discussion] BayjelMan:
After flash service preloader i got issues with fingerprint sensor. Its to slow and buggy. What can i do to solve this issue?

Thanks)
[Redmi Note 8 Pro Guides, News, & Discussion] dft601:
Hi,

I was on Android 9 and some weeks ago I flashed the files from this thread…. all worked well….

Today I flashed V11.0.2.0.QGGEUXM Android 10 from Twrp , I deleted compatibility.zip, lk.img and preloader.img before…. In the update script there was no preloader.img

After flashing I tried to boot, but it did not work....

So I startet from preloader menu the fastboot.

There I only flashed a recovery for Android 10 and rebooted…

Device still does not start… But now when I am in preloader menu neither recovery nor fastboot does work. I have a bootloop whatever I choose. How could this be ?

Is there any solution or also bricked as many others ? :(

Mike
[Redmi Note 8 Pro Guides, News, & Discussion] deBricker:
installed the preloader and lk a while back. Decided that I wanted to flash Pixel Exprience, but had some issues with LRTWRP so I tried different recoveries.... until I flashed Orange Recovery. I couldn't get back into the preloader menu after that and I can't get into fastboot either. I've tried VOL Up + VOL Down + Power to reboot then switching to Vol Up + Power (didn't work) and tried it with Vol Down + Power (also didn't work). At this point, I am stumped. The phone seems to be looping between the bootloader and the preloader (passing se blow: success). Anyone have any clue what I should do from here? Should I just let it run out of battery and then try plugging it in? Just a footnote, I was able to get into the preloader menu before all of this.
[Redmi Note 8 Pro Guides, News, & Discussion] killerlearner:
Android 10

So I am just asking, when the preloader and lk file will be available for Android 10. Because in android 10 everyone got brick their device due to flashing some files like magisk or android 9 preloader or lk file. So it's humble request to developers can you please do something for Android 10 also.
[Redmi Note 8 Pro Guides, News, & Discussion] u8ububu:
Yeah, it bootloops easily. LK is brittle AF, I don't know what monkeys coded it, but if you look at it the wrong way, it'll crash. I wouldn't be surprised if it's so **** the phone reboots from the watchdog. I'd so wish some kind xiaomi/mtk engineer would publish the code for at least lk, if not the preloader, so we could fix their ****.

Anyway, I think you confuse the preloader menu with the lk menu. The Vol Up menu is in lk, not preloader. (Source, and I'm not expecting this to change between SoCs)

I think you should flash through SPFT now (preferably an official Xiaomi image, until you get fastboot working).
[Redmi Note 8 Pro Guides, News, & Discussion] killerlearner:
Preoader and lk files is for Android 9 and it brick android 10 and if you flash it. It will overwrite system so in my opinion if you have a lk menu then you have flashed safety files preloader and lk so you can flash anything from sp flash tool without any authentication error. Just download a fastboot android 9 rom and flash it using sp flash tool or mi flash tool if your pc still detect your device in fastboot mode. And then your device will be fix. I just hard brick my device by forcefully installing android 10 indian in android 9 rom global. You can't install indian rom in global rom it gives you error but I made by changing some files in rom but now my device got hard brick.

Hope your will be fine.
[Redmi Note 8 Pro Guides, News, & Discussion] dft601:
Yes, thats what I have tried… But also doesn´t work….. it does not detect the device. Only if i press the volume up button, but then I Need an authorized account….

Very very strange… while testing again I now see sometimes "Redmi by Xiaomi" boot logo.... that did not happen the last days.

EDIT: Now I have fastboot again from menu…. The only explanation I have: Maybe the battery of the phone was empty and the power from my Laptop was not enough… ( I now have it on the charger) But I still do not understand how to get to MIUI with Android 10 from MIUI with Android 9 with modified preloader and LK.
[Redmi Note 8 Pro Guides, News, & Discussion] killerlearner:
if you have fastboot than you can easily unbrick your device. Just download miui fasboot rom. Any version which you want and flash every image by fastboot. Just like recovery. e.g, for system fastboot flash system system.img and for cust fastboot flash cust cust.img ... similarly you can flash anything.
[Redmi Note 8 Pro Guides, News, & Discussion] dft601:
Yes thanks…. That´s what I tried… But I did not make it better in deleting the Flash commands for preloader and lk ( and also the files) from Flash_all.bat

Does not want to boot or anything at all.... Grrrrrrrrrrrrrrrrrrrrrr

Attached log..... I think I have enough and send it to Xiaomi..... Flashed over 10 different Phones over the years and that more than once a month…. But never had such Troubles
[Redmi Note 8 Pro Guides, News, & Discussion] u8ububu:
The "Redmi by Xiaomi" logo is stored in logo.bin and loaded by lk. From the logs, I believe you are running Windows, right? If so, to use SPFT, you'll need the vcom drivers for this chipset (unlike linux, where this stuff just works). Unless you've flashed a wrong preloader (or possibly lk), you should be able to detect the phone. As long as the charging light shows up, I'm pretty sure you should be able to use SPFT, regardless of how hard it bootloops.

That said, I think that Android 10 firmware versions have changed the usual mtk boot chain (I'm seeing multiple preloaders). So it might be trickier flashing those roms... (I don't know, try flashing just boot, dtbo, cust, system and vendor with avb disabled?)

EDIT: If you're *very* determined, you can read about the boot process on this phone from the following sources:

http://www.lieberbiber.de/2015/07/05/mediatek-details-little-kernel/ and the 2 previous articles

https://wiki.postmarketos.org/wiki/Mediatek and also search McBitter's work on MTK devices

In case you want to figure out what the preloader's doing, note that (according to my own research into this) the Android 9 preloader has a slightly different header format from the one described by McBitter; also the code seems to be Thumb 32 (which is kinda weird, because linux boots in AArch64, and you can't switch 32->64 when switching to higher EL levels according to ARM manuals).

You'll also want to look at the addresses of the preloader & lk for both Android 9 and 10 in SPFT (given by the scatter file, they're also shown in the flashing gui).

Good luck.
[Redmi Note 8 Pro Guides, News, & Discussion] Bhavi307:
Try to reflash stock rom using mi flash with pc.
[Redmi Note 8 Pro Guides, News, & Discussion] Khep:
Thanks for the instructions.

But I would suggest adding 3 things:

*First, mention that Turn OFF from Android behavior no longer works after the Preloader is flashed.

*That there is a Preloader Menu now, and that you have to use vol UP + POWER to access it, and that's the way to access FASTBOOT now.

*That if you use vol DOWN + POWER, you enter into a CHINESE menu. And explain what to do there.

Didn't know any of this, so I entered into the Chinese menu, and did *something* to the phone, trying to reboot again.

Not sure if that will be bad down the road, since don't even know what happened.

Hopefully, we can prevent this to happen to other persons.
[Redmi Note 8 Pro Guides, News, & Discussion] goziedrew:
If i rollback from MIUI 11 A10 to MIUI 11 A9, would i need to wipe my data

?
[Redmi Note 8 Pro Guides, News, & Discussion] u8ububu:
1) I think turning off still works. But it does turn on automatically on connecting a charger.

2) Vol Up + Power is in lk, not preloader; I've mentioned this 2 days ago on this very thread.

3) That chinese menu is a service menu; it's been posted and translated on this forum.

LMGTFY: https://xdaforums.com/search/forum/9291?query=chinese menu#posts, see the answer to TinMan's post. Edit: and no, not my answer, I don't know chinese. The other one.

You should read the goddamn threads before doing anything to your phone. But AFAIK there's not much damage that can be done from the service menu. The only really damaging things you can do to the phone is flashing a bad preloader (where cheapest option atm would likely be a board replacement) and maybe bad lk, but this one's much less likely (I still wouldn't recommend risking it).
[Redmi Note 8 Pro Guides, News, & Discussion] KIIIPro:
Hey guys,

I wanna rollback from a custom rom to MIUI but keep the TWRP, preloader and lks installed.

Would it be safe, to:

1) Download the MIUI Rom V11.0.6.0.PGGMIXM "Type Recovery" from Xiaomi Firmware updater (link)

2) Open the ZIP file and delete the following files:

preloader.img

preloader_emmc.img

preloader_ufs.img

lk.img

3) Flash the ZIP file via TWRP

would that be a bad idea or is there an easier way to do this?

thanks.
[Redmi Note 8 Pro Guides, News, & Discussion] hassan_eldhraawy:
Now the android 10 is officially here.. How to update with keeping the anti brick files?

Anyone tried?
[Redmi Note 8 Pro Guides, News, & Discussion] u8ububu:
Try flashing the update manually via fastboot, skipping preloader and lk (including the other preloader images). I'm expecting it to work. If not, tell us at which step it breaks:

- Xiaomi logo shows up (the first variant, which is in logo.bin)

- charging light turns off

- second logo / boot animation shows up

If it's the second or third, upload /sys/fs/pstore/console-ramoops (from TWRP, immediately after a broken boot).

Also, if it's the third, check if adb logcat shows anything during booting. If so, upload the log.
[Redmi Note 8 Pro Guides, News, & Discussion] hassan_eldhraawy:
I appreciate your rapid response but I don't thick I can do this :D

D
[Redmi Note 8 Pro Guides, News, & Discussion] wang1chung:
Mismatching partitions is how you hard brick this phone. It says on the first page, only compatible with Android 9. Unless you have an authorized mi account....
[Redmi Note 8 Pro Guides, News, & Discussion] u8ububu:
That's what factory preloader is for, to get you out of hard bricks...

Edit: I guess I should state this since I did suggest updating:

Beware of flashing anything other than official Xiaomi Pie with SPFT if keeping factory preloader is desired. If anyone's willing to check, look up the flash offsets/lengths in the official Pie and Q on SPFT. Very important are preloader and lk/lk2. Particularly preloader, if that gets overwritten, you can almost throw away the phone (you'd need to talk to the BROM directly, most likely using a mediatek private key, which probably doesn't leave the oem's factory, at least according to some leaked mediatek pdfs I've seen floating around). That's why sticking to fastboot is so important. Even TWRP updates might be unsafe depending on what the update script does.
[Redmi Note 8 Pro Guides, News, & Discussion] wang1chung:
First post, I missed it too, that's why I know you can't mismatch the partitions, I tested it and failed. The issue isn't that the image offsets changed, the issue is certain partitions have to match other partitions version.
[Redmi Note 8 Pro Guides, News, & Discussion] u8ububu:
On one hand, from what I've uncovered, preloader might be signed (the preloader header according to McBitter supports that, but his info is about 6 years old, so there's a few flags that are not explained). LK seems to have a simpler header, so I'm not sure if there's any signature on it.

LK does something weird when loading the partitions from flash. I think it has some checks and signatures, but I'm not entirely sure of what nature. From what I've uncovered, using a user-compiled kernel with stock dtbo results in a hard brick. User-compiled dtbo with stock kernel also results in a hard brick. If I remember correctly, these happen before showing the menu. I've also tried using the Logo Builder and that results in a different kind of brick - the lk menu shows up, but when it needs to load the images from logo.bin it stops. Whether that's a check built-in on lk or just lk being unable to parse a slightly different logo.bin is something I don't know.

Maybe if I'll have time and decent tools, I'll try looking more closely into what preloader and lk are really doing (and maybe build one that's more robust). For now, I don't have either.

Also, according to the sources and articles I've found, the mediatek tools that build preloader and lk use some ****ty spreadsheet to generate the partition offsets. In particular, preloader and lk know nothing about partitions. They simply get a mt_partitions.h with the offsets included (which is generated by said tools). They probably can't parse the GPT header.
[Redmi Note 8 Pro Guides, News, & Discussion] LimWilliam65:
View attachment 5027945

Hi, I just brought my new phone yesterday. It is a China version, 8GB ram and 128GB Rom, I am currently in China Rom, MIUI 10.4, android 9 (see above screenshot attached). If i wanted to flash the preloader and ik file, is it safe to do so? I just wanted to confirm. Once again it is a China Rom, MIUI 10.4, android 9.
[Redmi Note 8 Pro Guides, News, & Discussion] lankks:
Flashed as per instructions (but with fastboot from platform-tools) and now I can't get into either recovery or fastboot - either option will bootloop until MIUI 11 (V11.0.6.0.PGGMIXM) comes back - guess I'm stuck with stock now.
[Redmi Note 8 Pro Guides, News, & Discussion] iamshadow2008:
After I downgrade to Android 9 and flash these, would it be safe to install the OTA to Android 10?
[Redmi Note 8 Pro Guides, News, & Discussion] alexcroos:
reset factory hard reset?

Good morning, what is the correct way to factory reset, hard reset with twrp ?. Thank you
[Redmi Note 8 Pro Guides, News, & Discussion] thisis.manu:
i have an account where i do unlock and etc. my phone.

now i have to flash over brom mtk and it is written " Login succesfully

Unauthorized for this Operation"

Did somebody have the same problem ?
[Redmi Note 8 Pro Guides, News, & Discussion] bandos23:
well buddy, I think it looks like a walk to the service center ... what did you do?
[Redmi Note 8 Pro Guides, News, & Discussion] Saadbinaamer:
Well, Xiaomi has released A10 based source code, can we expect anti brick for a10?
[Redmi Note 8 Pro Guides, News, & Discussion] u8ububu:
By A10 based source code, do you mean the kernel? Honestly, to me it didn't look all that useful so far for anything. I should do a diff between the kernels though.

They never opened up the preloader/little kernel. Some OEMs did that (fairphone mostly), and there are some leaks from other phones too. Nothing for this one. And the anti-brick is in preloader/lk. So you shouldn't. And you can use A10 with A9 preloader - you just need to not use Xiaomi images.

I'm not sure what Xiaomi pulled so that their official images are incompatible with factory preloader/lk (preloader shouldn't care at all about android versions; lk normally shouldn't, but it's a bit more exposed), but the kernel sources for Q don't help out.

What might work is writing an lk using the upstream lk and the SoC map from kernel sources (you'd need to understand WDT, PMIC, and UFS). You'd need to figure out what the lk header should look like. I think their X20 SoC has a pretty similar preloader/lk and the sources are available, so that would also help.
[Redmi Note 8 Pro Guides, News, & Discussion] Agent_fabulous:
It is not possible to run MIUI A10 with the factory preloader/antibrick files. The new A10 ROMs however have new instructions for running against factory firmware. Please see here.
[Redmi Note 8 Pro Guides, News, & Discussion] hassan_eldhraawy:
Man.. You are legend :good::good:
[Redmi Note 8 Pro Guides, News, & Discussion] pmesolution:
MI fastboot vs other (linux) fastboot program

My Redmi Note 8 Pro is making me a bit paranoid about the usual way of rooting and flashing :D As I just got mine back to life with external help, I want to make sure I don't mess it once again!!!

Can someone confirm if we can use any fastboot program or we should stick to Mi Fastboot. As I'm on Linux, I'd prefer working my way from there.
[Redmi Note 8 Pro Guides, News, & Discussion] Photopuppet:
Can new ROMs only be marked Begonia and stable only if they support all the Begonia features such as NFC?

It is confusing as there some custom ones saying they are now stable but actually still have broken features like NFC. If they don't have working NFC yet, I think it should only be marked for Begoniain and also not stable...
[Redmi Note 8 Pro Guides, News, & Discussion] cyberz2:
My Phone is HARDBRICK and haven't installed preloader lk on A9

Please anyone... Can you help me with my phone is got the HARDBRICK, only LED when I plug usb cable, in my place, the service center going to be closed because lockdown area... Can you give me another idea without going to service center, and haven't xiaomi account auth...???
[Redmi Note 8 Pro Guides, News, & Discussion] CzokoPL:
I can confirm that using fastboot on Linux is fine. Everything went as expected during flashing.
[Redmi Note 8 Pro Guides, News, & Discussion] kristian.sueta:
Hello. Can you boot into fastboot? Is your phone detected when you plug into a PC?
[Redmi Note 8 Pro Guides, News, & Discussion] Agent_fabulous:
My unit is the Indian version (begoniain) and it does not come with NFC hardware. It's rather tedious for me to try and fix NFC, so I didn't bother. Other developers with the global unit are working on it. The builds are marked stable as most other issues are fixed, the builds run MIUI A10 blobs and are all inclusive (no need to switch between any vendor images :D). Moving forward, development should be a lot simpler for us and installation a lot easier for you as a user.
[Redmi Note 8 Pro Guides, News, & Discussion] hassan_eldhraawy:
I saw the updated thread with cfw custom ROMs... That's great..

Now about the official Miui 10, how to flash it with the new cfw?
[Redmi Note 8 Pro Guides, News, & Discussion] Agent_fabulous:
You cannot run MIUI on cfw. Again, cfw is basically A9 firmware with a few images from A10 and a few images from factory firmware that enables us to run the Android 9 kernel with new Android 10 blobs and factory/antibrick preloader + bootloader. Steps for migration to and from MIUI are mentioned in the reserved posts.
[Redmi Note 8 Pro Guides, News, & Discussion] BLUEPOP:
is there a guide on how to downgrade and maybe a file with the version we need to downgrade to? im running latest miui and i want to start downloading roms
[Redmi Note 8 Pro Guides, News, & Discussion] cociuba:
Can you post the steps that you followed for unlocking the bootloader and installing the recovery on Linux?
[Redmi Note 8 Pro Guides, News, & Discussion] CzokoPL:
At the time of unlocking my bootloader I was on Windows and used the Mi Unlock tool, so I can't help you there. But for installing the recovery on Linux here's what I did:

I installed "android-tools-adb" and "android-tools-fastboot" packages

Enabled USB debugging, booted the phone into fastboot mode and connected it to my PC

I ran "fastboot flash recovery twrp-CFW-3.3.1-0-begonia_UNOFFICIAL_0506.img" command and waited for it to finish

And finally I ran "fastboot reboot" command
[Redmi Note 8 Pro Guides, News, & Discussion] cociuba:
Did anyone unlocked the bootloader in Linux? Any tips will be appreciated.
[Redmi Note 8 Pro Guides, News, & Discussion] cyberz2:
No... My phone is No Fastboot and No Recovery

Only detected notification light, when I connect charger or usb to laptop, and that is only about 5 second to detect as " Mediatek USB" on device manager.. and than gone, only about 5 second I think.
[Redmi Note 8 Pro Guides, News, & Discussion] u8ububu:
There was an open-source app written by some guy for unlocking Xiaomi bootloaders under Linux. Search on google, it's easy to find. I remember using it successfully.