After closing the official EMUI website, which allowed you to retrieve the code to unlock the bootloader of Huawei/Honor phones, here is a python script to test many possible codes.
It uses a bruteforce method, based on the IMEI identifier to generate unlocking codes.
This will most likely only work on European versions, because these only use numbers in the bootloader unlock code.
I've only had the opportunity to test it on European versions:
Connect your device to the computer and launch the script.
Windows:
C:\WINDOWS\system32> python unlock.py
Linux:
$ python3 unlock.py
The device is going to ask for authorisation, which you'll have to allow.
Please also check the checkbox "Always allow from this computer".
- The application doesn't work. Is there anything I should have installed?
Yes, it was developed in python so it needs it to run, version 3. You can install the latest version from here or by using Windows Store.
- The app on Windows doesn't detect my device even though it's connected and USB debugging is enabled. What could be the issue?
Windows most likely doesn't recognise your device in ADB mode. Install the universal ADB drivers from here, reboot your PC and try again.
- My phone reboots every 5 failed attempts
We are aware of this and have implemented an automatic intentional reboot after 4 attempts.
You can manually enable this feature in the code.
The script will also automatically detect this behaviour. For this to work reliably, please check the checkbox "Always allow from this computer" in the adb dialogue.
- The script displays "command invalid"
Huawei has removed the unlock command in EMUI 10.
Downgrade your software and try again.