This was a long process with lots of side problems coming up. Somethings I don't know why they worked or did not work. I will give a recount of what did work in hopes the information will be useful in the future.
At a high level the idea is to backup the data partition, reflash firmware and ROM to fix the bootloop, reload the backed up data partition. ...
Searching a lot over the web I saw this question and by reading the entire post, and in particularly this answer https://android.stackexchange.com/a/176124/77853 I brought back my phone to life and without losing anything !
What I had to do was (as suggested in the answer) repair the /data partition plus the /system partition !
I downloaded Android's SDK Platform-Tools, extracted the platform-tools folder and ran a terminal in side that directory. When I executed ./fastboot reboot fastboot it did boot into fastbootd successfully. What's weird is that I installed platform-tools, put it in my /etc/ folder, and added it to my PATHS only 2 days ago. I'm not sure why exactly this worked....
The way I did it was a little different.. I made a full twrp backup. Wiped everyhing. Flashed the stock rom. Copied the DocumentsUI.apk from twrp. Wiped again. Restored the backup. Placed the copied apk into /system/priv-app/DocumentsUI. Everything worked perfectly!
This answer was before the edit but holds
Flashing /Data would result in:
Losing your user data.
Worse, it's not going to solve your problem.
Dirty flash the ROM ( flash /system without wiping /Data)
As suggested by Irfan in comments,
Extract the file from ROM's zip file and put in proper place with proper permissions.
Second option requires ...
The problem was with the boot image.
I searched for exact POCO X3 NFC rom .TGZ file, and found it here:
I downloaded the following file:
Extracted the "boot.img" file
I fixed it* by letting the phone bootloop until fully discharged. I then plugged the phone into the computer and turned the phone on as soon as it charged enough to allow me this. At that point there is a brief window where full ADB access is possible, but only because I did have USB debugging enabled after all, but the bootloop was too fast to allow full ...
Removing com.miui.securitycenter was the cause of the bootloop.
As described in this article the reason for a boot loop is corrupted software/corrupted ROM
Not really. Nothing was corrupted. You just removed a system app needed for boot. I agree this package shouldn't be a boot dependency but this unfortunately is the case.
Honestly, with a Xiaomi Redmi 4X,...
I reset my phone to factory settings by pressing the power and volume keys together which solved the problem of the boot loop, though it resulted in full data loss(obviously).
As described in this article the reason for a boot loop is corrupted software/corrupted ROM. Hence the best way to deal with this issue is to either reset to factory settings or ...
If you don't need the data download the stock fastboot rom for your device and flash it.
From your comments above it looks like you've already wiped your data.
So I would suggest that you download the stock fastboot rom. Do a clean all flash. Don't do the clean all and lock flash, as it will lock your phone.
Once it's finished, you can flash twrp but don't ...
Did it suddenly started to do weird things? Can you specify the cause.
As per the mentioned details, you need to flash stock firmware from SPFlash Tool(as you have a MTK device). You can google for your firmware. And flash it while your phone is in download mode.
I too have faced many bootlops while flashing roms. So I flash stock firmware and all good.
Use this temp bootloader to sideload twrp from a PC via fastboot. Can confirm this will work with K013!
Get an SD card format it too EXT2, not anything else. Then use the link below. Now u can back up and thusly manipulate your system partition thru twrp or pull a backup via sdcard and do some magic on the pc with the resulting zip file, repack it ans load ...
As a complement to the answer above, you can perform a backup of the three files (jobs.xml, packages.xml and packages.list) with the following shell script:
watch -n60 "cat $dir/packages.list > $dir/packages.list.bak" > /dev/null &
watch -n60 "cat $dir/packages.xml > $dir/packages.xml.bak" &...