Android Screwed up my phone, need help.

ch@ts

Herald
I have a spare MI A2, and I'm planning on using it for an exchange for a tablet. So, I wanted to get it running a stock ROM again. But I messed up.

I was running Calyx OS, and wanted to get back to stock. Calyx OS was Android 11 based.
So, I flashed

jasmine_global_images_V9.6.17.0.ODIMIFE_20181108.0000.00_8.1_1c60295d1c.tgz, - which is Android 8.

It flashed without errors, and boots up. But I have no network, no wifi.

I tried to flash
jasmine_global_images_V11.0.28.0.QDIMIXM_20210702.0000.00_10.0_d88fa668a6.tgz, but that gets stuck at the first step - sending bluetooth_a.


I tried to do a temp boot into the pixel experience and lineage os recoveries, but the phone stays on Fastboot.

When I try to install Pixel Experience, I get this error -
warning: skip copying boot_b image avb footer (boot_b partition size: 0, boot_b image size: 26750976).
Sending 'boot_b' (26124 KB)

same thing with partition a.

Also there is no MAC address. No IMEI.

When I do fastboot getvar-all I get

(bootloader) crc:1
(bootloader) anti:2
(bootloader) token:S2spCs4umGG0MHXIHFNwCp5vSP0=
(bootloader) unlocked:yes
(bootloader) off-mode-charge:1
(bootloader) charger-screen-enabled:1
(bootloader) battery-soc-ok:yes
(bootloader) battery-voltage:3944
(bootloader) version-baseband:
(bootloader) version-bootloader:
(bootloader) variant:SDM EMMC
(bootloader) partition-type:cache:ext4
(bootloader) partition-size:cache: 0x10000000
(bootloader) partition-type:userdata:ext4
(bootloader) partition-size:userdata: 0xBB77F7E00
(bootloader) partition-type:system_a:ext4
(bootloader) partition-size:system_a: 0xC0000000
(bootloader) has-slot:modem:yes
(bootloader) has-slot:system:yes
(bootloader) current-slot:a
(bootloader) has-slot:boot:yes
(bootloader) slot-retry-count:b:7
(bootloader) slot-unbootable:b:no
(bootloader) slot-successful:b:no
(bootloader) slot-retry-count:a:5
(bootloader) slot-unbootable:a:no
(bootloader) slot-successful:a:yes
(bootloader) slot-count:2
(bootloader) secure:yes
(bootloader) serialno:a523cc19
(bootloader) product:jasmine
(bootloader) max-download-size:536870912
(bootloader) kernel:uefi
all:
Finished. Total time: 0.003s
What do I do?? Please help.
I've posted this on XDA, but those forums - for my phone, at least - are dead.
 
You would probably get better answers at xda forums or telegram group for mi a2.

If you are not able to boot into recovery, it might be due to firmware issues. The stock os image generally have firmware included. Try installing the correct firmware and then boot into some custom recovery.
 
Thanks for reintroducing me to AI.
I've only used chatgpt a couple of times before today, but having a conversation with it about how to fix my phone was a revelation. It walked me through all the steps, suggested alternatives when things didn't work, and told me if different file extensions were compatible. By about 4am I'd figured that I'd have to enter EDL to get started fixing my phone, and it took me 2 hours of googling to figure out how it's done - but the steps didn't work for me because I'm on Linux, and don't have access to a Windows machine. I tried getting the flashing tools working in Wine, but wasn't having much success. I had a conversation with ChatGPT a while back, and it directed me to all the tools and files I needed, clarified my doubts, and made me realise just how far the internet has come. I'll try flashing the ROM in EDL mode later this evening, but first I will try doing an ADB update from a USB OTG drive. Have called for an adapter, and will wait for it to be delivered.

You would probably get better answers at xda forums or telegram group for mi a2.

If you are not able to boot into recovery, it might be due to firmware issues. The stock os image generally have firmware included. Try installing the correct firmware and then boot into some custom recovery.
Thanks for the reply. I posted on XDA before I posted here, but so far there are no replies to my query on XDA. I also went through the forums, and though people have had similar issues, their threads have died without leaving behind any helpful information.

Also, I can boot into stock recovery, I can't get temp recovery to work. When I run
Code:
fastboot boot boot.img
nothing happens. I should be able to get into LineageOS or PixelExperience recovery, without flashing them, but nothing happens.
 
  • Like
Reactions: Simar
I'm missing some info on which point you are stuck.

Are you able to boot into stock os that you flashed? Have you tried factory reset?

Are you stuck in fastboot, with no access to recovery? There's a good chance it is because of older firmware that got flashed alongside the stock os. Try flashing the latest stable firmware. You can do that from the fastboot. And then try to flash twrp or ofox.

This script (flash_firmware.sh) here helped me to flash firmware on my device using fastboot:

You can adapt it for your use case.
 
  • Like
Reactions: ch@ts
use Xiaomi Flash tool and there is difference in modem in global and indian roms. If A2 has indian stock rom try to flash that. And I repeat don't lock BL until everything is fixed!!
 
  • Like
Reactions: ch@ts
I'm missing some info on which point you are stuck.

Are you able to boot into stock os that you flashed? Have you tried factory reset?

Are you stuck in fastboot, with no access to recovery? There's a good chance it is because of older firmware that got flashed alongside the stock os. Try flashing the latest stable firmware. You can do that from the fastboot. And then try to flash twrp or ofox.

This script (flash_firmware.sh) here helped me to flash firmware on my device using fastboot:

You can adapt it for your use case.
I was on Android 11, which has dynamic partitions, and I stupidly flashed Android 8, which screwed up the storage.
I can boot into the OS - Android 8, but theres no IMEI, and no Wifi MAC.

I have stock recovery, but there's no space on the phone, because the partitions are screwed up, so I can't adb sideload update.
I can't flash anything in fastboot. It gives an error, and stops.
There's an install script in the ROM package, but it doesn't work because my fastboot can't flash anything.
I've tried manually flashing images, but nothing works.

@deadbynight queried ChatGPT and the solution seems to be to enter EDL mode, and use a custom Linux tool to flash the ROM. It's a bit of a time consuming process, so I'm going to do it later tonight.

there used to be xiaomi flashing tool , some even in native chineese languages which would completely recover the phones and install stock images




Thanks. Tried that, but couldn't get it to work on Linux. Ran the commands manually, but no luck.

Check roll back guide for your phone. Usually, you’ll have to flash full stock rom/firmware. Sometimes correct recovery also needed.
Can't roll back, because I was stupid. I flashed the full stock ROM, just one that my phone could no longer fully support because the partitioning had changed. Trying to flash the latest stock ROM doesn't work, nor does trying to flash any other recovery.
 
If memory serves right, you will need to fix the partition map before flashing the stock OS. Also this should fix the EFS issue you are facing - loss of wifi and imei.

i may know someone with an A2, let me see if I can help out.

Finally, chatgpt is not perfect, check and do the steps. like once it told someone to run sudo rm -rf, and we all know what happened.
 
I guess for me, I'll try to get back to your custom rom that was working again. And check if everything is working fine.

Then see roll back guide, and start from there. Sometimes there is a unbrick guide. Some use fastboot mode and the other edl mode.

But there is no way back if imei partition is wiped. Nothing you can do there.
 
  • Like
Reactions: ch@ts
Finally managed to fix it...and chatgpt helped a lot.
I used this program -

EDL Flasher

and ran this command -

Code:
sudo python3 edl qfil rawprogram0.xml patch0.xml /path/to/images/folder/ --loader=prog_emmc_firehose_Sdm660_ddr.elf

ChatGPT helped a lot, but it wasn't always right. And when it was wrong, it kept insisting it was right, until I proved it wrong, citing other sources, or showing it the output of incorrect commands. And when that happened, it would say that I had typed in the wrong syntax, and it was my fault, and then it would finally give me the correct command to run.
It explained what every option was, what each command would do, and how to run them correctly. Progress is wonderful!