[Android General] hikari_calyx:
#/usr/bin/env python3
from hct_principle import permission, content
print('''
Your warranty is 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 about features included in this ROM
before flashing it! 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.
''')

if content.repost('other_content_farm_website_or_tech_forum'):
if not permission:
print('Please DM me for permission')
raise Exception('RepostNotAllowedException')

Recently I got a prototype OS backup from a Nokia 5.3 engineering sample unit that contains ABL image with bootloader unlock capability.

Later I found it can be used on retail unit, but flashing it can be tough depends on Android OS version installed on your phone.

Case 1: If you already have Android 11 or 12 installed

I'm sure that's the mostly seen situation for Nokia 5.3 users. Unfortunately to do this, you'll have to open up the phone or use an EDL cable, have Qualcomm EDL driver and QPST installed, or consider to use bkerler's live DVD on your PC (prepare a spare USB drive).

1. If you want to use Bkerler's EDL script, clone and download this repository, or just boot into LiveDVD mentioned in README. Install it according to README. Skip this step if you have QPST and Qualcomm USB Driver installed.

GitHub - bkerler/edl: Inofficial Qualcomm Firehose / Sahara / Streaming / Diag Tools :)

Inofficial Qualcomm Firehose / Sahara / Streaming / Diag Tools :) - bkerler/edl

github.com

Also download prototype ABL and attached firehose programmer from here:

Click here to download Prototype ABL

SHA256 checksum of ABL image: C8021967F91908BBE30C4534AA2174B72FB18A204F73BB96561A3F8A17140F0E

If you see error code 00000101, please use industrial standard web browser like Google Chrome.

2. Power off your phone.

3. EDL cable designed for Xiaomi phones can be used to enter EDL mode (should be easy to buy online or build yourself), or follow this video to disassemble the phone, until 4:40. Make sure you have motherboard exposed and battery DISCONNECTED. Please ask an experienced technician for help if you're not familiar with phone disassembly procedure.

If you're using Windows:

4. Check Device Manager. Make sure the port is shown as "Qualcomm HS-USB QDLoader 9008" instead of "HS-USB Diagnostics 9008". If it's not QDLoader 9008, please update driver and change it into QDLoader 9008, perform force reset and enter EDL mode again.

5. Open QFIL, load the firehose programmer and rawprogram0_proto.xml (but click cancel when asking for patch*.xml) inside of CAP-3130-A01.zip attached below, and also put CAP-abl.elf you downloaded along with them. Make sure the storage type is "EMMC".

6. Click "Edit" - "Partition Manager" and confirm. After few seconds you'll be able to see Partition Manager window. Right click on abl_a and select Edit Partition, then select "Read Image". Soon the original ABL image will be placed at

C:\Users\your_user_name\AppData\Roaming\Qualcomm\QFIL\COMPORT_X

. Rename newly created file into "abl_a.bin". Then do the same for abl_b partition. Once finishes, move these 2 ABL images out and close the partition manager window.

7. Your phone may get back to EDL mode - but just for sure, I recommend you to perform a force reboot then enter EDL mode again. Click download to flash prototype ABL image into your phone, then force reboot your phone by holding all 3 buttons within 15 seconds. Your phone should boot back into Fastboot mode.

If you're using Linux:

4. (Skip this step if you're using Linux) Change EDL port driver according to README.md of edl toolkit said, and reconnect the phone after driver changed.

5. Execute these commands to backup original ABL and write prototype ABL.

:

./edl r abl_a,abl_b abl_a.bin,abl_b.bin --loader=/home/your_user_name/Download/prog_emmc_firehose_Sm6125_ddr.elf
./edl w abl_a /home/your_user_name/Download/CAP-abl.elf --loader=/home/your_user_name/Download/prog_emmc_firehose_Sm6125_ddr.elf
./edl w abl_b /home/your_user_name/Download/CAP-abl.elf --loader=/home/your_user_name/Download/prog_emmc_firehose_Sm6125_ddr.elf

After executed and waiting for connection, attach a side of your USB cable on your phone, then use a tweezer to short the test point indicated below. While shorting test point with tweezers, connect it to PC. You may need to repeat this when you execute next 2 commands.

6. Disconnect the phone, reattach the battery and reassemble the phone. Your phone should boot right into Fastboot mode.

7. Execute these commands to perform bootloader unlock:

fastboot flashing unlock_critical
(confirm unlock on your phone)
fastboot oem unlock-go
(confirm unlock on your phone again)

8. Once bootloader unlock confirmed, execute this command to check if unlock successful:

fastboot oem device-info

If both unlock state are indicated as True, you can restore the ABL back to retail (if you don't then phone will not boot to normal OS), wipe userdata and reboot:

fastboot flash abl_a abl_a.bin
fastboot flash abl_b abl_b.bin
fastboot -w reboot

9. If you don't have original ABL image backed up, or if your phone had initial release of Android 12 that bricked the phone after factory reset, unbrick the phone by following this procedure.

10. Enjoy your bootloader unlocked Nokia 5.3 and have fun for hacking.

Watch this video in case you still don't understand:

Case 2: If you know someone who can provide remote phone flash service for you

I can help when the phone has Android 10 installed, but it's pretty rare nowadays, at least it's difficult to find outside China mainland.

However in this case you don't need to disassemble the phone, you'll just need to reinstall stock firmware after bootloader unlock.

1. Grant service permission. I know how the service permission granting works under initial release of Android 10, which I can't disclose here (also how I confirmed bootloader unlock method working).

If you know someone who can flash a recent Nokia phone for you, Then it will work under Android 11 or 12. When you request such service, ask him not to reboot your phone after the procedure completes.

2. Execute these commands to perform bootloader unlock:

fastboot flash abl CAP-abl.elf
fastboot reboot-bootloader
fastboot flashing unlock_critical
(confirm unlock on your phone)
fastboot oem unlock-go
(confirm unlock on your phone again)

3. Flash stock ABL image and wipe userdata. Stock image from Android 12 release is attached below - extract it before flashing, or it will brick your phone and you'll have to use EDL method to revive it.

It may break OTA functionality, so use with care.

fastboot flash abl CAP-340A-abl.elf
fastboot -w reboot