Skip to content

Instantly share code, notes, and snippets.

@danpawlik
Last active March 9, 2024 16:58
Show Gist options
  • Save danpawlik/5e08fc5368c0faa3bfb210423b8fa9dc to your computer and use it in GitHub Desktop.
Save danpawlik/5e08fc5368c0faa3bfb210423b8fa9dc to your computer and use it in GitHub Desktop.
Huawei fix "Your device has failed verification and may not work property." on Huawei P20 Pro

How to restore back Huawei P20 Pro after downgrade and "Your device has failed verification and may not work property."

This manual was created using my own example how to resurrect Huawei P20 Pro. I am not responsible for your device. The following description was made for scientific and passion purposes.

NOTE: This guide require to unlock the phone via testpoint. NOTE: Some part of that guide require to do steps on Windows, some other on Linux (I did not test script on Windows)

Preparation

  1. Download the unlock tool https://github.com/werasik2aa/Huawei-Unlock-Tool/releases and unpack
  2. Download the testpoint driver https://github.com/mashed-potatoes/PotatoNV?tab=readme-ov-file#unlocking-the-bootloader
  3. Download the Hisuite DO NOT INSTALL IT - https://github.com/ProfessorJTJ/HISuite-Proxy/wiki/Complete-Guide - (url is in step 2)
  4. Download the latest (it is important to be last, due Huawei blocks downgrades) - in my case it is https://huaweistockrom.com/huawei-p20-pro-clt-l29 (it will redirect you to https://firmwaredrive.com/index.php?a=downloads&b=file&id=43990)
  5. Download application, to extract img from .APP ROM - https://github.com/superr/splituapp
  6. Download Android SDK platform tools - https://developer.android.com/tools/releases/platform-tools
  7. Extract the platform tools to easy location like: C:/Platform-tools and add the new dir to the PATH:, howto: https://www.java.com/en/download/help/path.html

Here is extracted UPDATE.APP for Huawei P20 Pro + shell script (will share it later) Huawei_P20_Pro_Charlotte-L29C_HW_RU_10.0.0.180_C10E3R1P3_Firmware_EMUI10.0.0_05015BAD_Dload - https://mega.nz/file/itxSSLBJ#_Ughaskk1zUIAs37NokAuhsMF0ISoleo7iHmW2hcLjg

Unpack the .APP ROM file

When you download the ROM,

  • Unzip it and if it is a dload version, in Firmware/dload/ you will find: update_sd_base.zip.
  • Extract the zip file and then you will have UPDATE.APP file.
  • Now run: splituapp -f UPDATE.APP and you should have output directory there

Unlock (once again)

  1. If you already have installed HiSuite - you need to uninstall it!
  2. Install testpoint driver
  3. Open your phone, unplug the battery connection to the main board - you need to unscrew a few screws on the top, no need to unscrew screws on the bottom - see attached pictures
  4. Disconnect USB cable if you have
  5. Touch the test point - as it is in the exaple: https://www.youtube.com/watch?v=YkGugQ019ZY - tl;dr touch test point + plug USB cable
  6. If all is fine, open the Huawei Unlock Tool program
  7. For P20 Pro:
    • COM PORT: choose your device, e.g. COM3, COM4
    • SELECTED CPU: Kirin 970
  8. Now go to UNLOCK KIRIN: - Write factory bootloader - when you click, plug the battery cable to the main board and wait. Phone will reboot, so you need to do same step as earlier: disconnect battery from mainboard, disconnect USB cable, make test point, plug cable and go to next step - Write unlock key to the device - as earlier: when you click, plug the battery cable to the main board and wait. Phone will reboot, so you need to do same step as earlier: disconnect battery from mainboard, disconnect USB cable, make test point, plug cable and go to next step - Unlock FRP - when you click on that, plug the battery cable to the main board and wait. The phone would be BLACK, but when you type: fastboot devices - it will show you a device NOTE: The applicatiom was raising an Exception during FRP ulock. Do not click on "close", just continue (and ignore error)
  9. (NOTE: Here I run the script on Linux) Run the flash script and wait - some partition might fail - I create the script base on: https://github.com/LineageOS/android_kernel_huawei_kirin970/blob/b8f2dd993aa2f67ceefd98b5475fec29c6032f6b/include/linux/hisi/libra_partition.h https://github.com/cpumask/huawei_NOH_AN00_kernel/blob/48b104b9093b9819f24693b65b57d0b399b5c6a3/include/linux/hisi/hisi_partition.h

NOTE: the script was done for Linux system. Below would be a Windows script - but I did not test it.

Linux (install package that contains Android tools; WARNING: remember, that SELinux/AppArmor might block some fastboot commands)

Script:

#!/bin/bash

sudo fastboot flash cache cache.img
sudo fastboot flash crc crc.img
sudo fastboot flash dtoimage dto.img
sudo fastboot flash dtimage dts.img
sudo fastboot flash eng_system eng_system.img
sudo fastboot flash eng_vendor eng_vendor.img
sudo fastboot flash erecovery_kernel erecovery_kernel.img
sudo fastboot flash erecovery_ramdisk erecovery_ramdis.img
sudo fastboot flash erecovery_vbmeta_a erecovery_vbmeta.img
sudo fastboot flash erecovery_vendor erecovery_vendor.img
sudo fastboot flash fastboot fastboot.img
sudo fastboot flash hifi fw_hifi.img
sudo fastboot flash mcuimage fw_lpm3.img
sudo fastboot flash hdcp hdcp.img
sudo fastboot flash PART_HHEE_A hhee.img
sudo fastboot flash hisee_fs hisee_fs.img
sudo fastboot flash part_hisee_img_a hisee_img.img
sudo fastboot flash isp_firmware isp_firmware.img
sudo fastboot flash kernel kernel.img
sudo fastboot flash modem_fw modem_fw.img
sudo fastboot flash modemnvm_cust modemnvm_cust.img
sudo fastboot flash modemnvm_update modemnvm_update.img
sudo fastboot flash package_type package_type.img
sudo fastboot flash patch patch.img
sudo fastboot flash preas preas.img
sudo fastboot flash preavs preavs.img
sudo fastboot flash preload_a preload.img
sudo fastboot flash prets prets.img
sudo fastboot flash pretvs pretvs.img
sudo fastboot flash ramdisk ramdisk.img
sudo fastboot flash recovery_ramdisk recovery_ramdisk.img
sudo fastboot flash recovery_vbmeta_a recovery_vbmeta.img
sudo fastboot flash recovery_vendor recovery_vendor.img
sudo fastboot flash sensorhub sensorhub.img
sudo fastboot flash sha256rsa sha256rsa.img
sudo fastboot flash super super.img
sudo fastboot flash teeos teeos.img
sudo fastboot flash trustfirmware trustfirmware.img
sudo fastboot flash ufsfw ufsfw.img
sudo fastboot flash userdata userdata.img
sudo fastboot flash vbmeta_cust vbmeta_cust.img
sudo fastboot flash vbmeta_hw_product vbmeta_hw_produc.img
sudo fastboot flash vbmeta vbmeta.img
sudo fastboot flash vbmeta_odm vbmeta_odm.img
sudo fastboot flash vbmeta_system vbmeta_system.img
sudo fastboot flash vbmeta_vendor vbmeta_vendor.img
sudo fastboot flash vector vector.img
sudo fastboot flash version version.img
sudo fastboot flash xloader xloader.img

Windows:

fastboot flash cache cache.img
fastboot flash crc crc.img
fastboot flash dtoimage dto.img
fastboot flash dtimage dts.img
fastboot flash eng_system eng_system.img
fastboot flash eng_vendor eng_vendor.img
fastboot flash erecovery_kernel erecovery_kernel.img
fastboot flash erecovery_ramdisk erecovery_ramdis.img
fastboot flash erecovery_vbmeta_a erecovery_vbmeta.img
fastboot flash erecovery_vendor erecovery_vendor.img
fastboot flash fastboot fastboot.img
fastboot flash hifi fw_hifi.img
fastboot flash mcuimage fw_lpm3.img
fastboot flash hdcp hdcp.img
fastboot flash PART_HHEE_A hhee.img
fastboot flash hisee_fs hisee_fs.img
fastboot flash part_hisee_img_a hisee_img.img
fastboot flash isp_firmware isp_firmware.img
fastboot flash kernel kernel.img
fastboot flash modem_fw modem_fw.img
fastboot flash modemnvm_cust modemnvm_cust.img
fastboot flash modemnvm_update modemnvm_update.img
fastboot flash package_type package_type.img
fastboot flash patch patch.img
fastboot flash preas preas.img
fastboot flash preavs preavs.img
fastboot flash preload_a preload.img
fastboot flash prets prets.img
fastboot flash pretvs pretvs.img
fastboot flash ramdisk ramdisk.img
fastboot flash recovery_ramdisk recovery_ramdisk.img
fastboot flash recovery_vbmeta_a recovery_vbmeta.img
fastboot flash recovery_vendor recovery_vendor.img
fastboot flash sensorhub sensorhub.img
fastboot flash sha256rsa sha256rsa.img
fastboot flash super super.img
fastboot flash teeos teeos.img
fastboot flash trustfirmware trustfirmware.img
fastboot flash ufsfw ufsfw.img
fastboot flash userdata userdata.img
fastboot flash vbmeta_cust vbmeta_cust.img
fastboot flash vbmeta_hw_product vbmeta_hw_produc.img
fastboot flash vbmeta vbmeta.img
fastboot flash vbmeta_odm vbmeta_odm.img
fastboot flash vbmeta_system vbmeta_system.img
fastboot flash vbmeta_vendor vbmeta_vendor.img
fastboot flash vector vector.img
fastboot flash version version.img
fastboot flash xloader xloader.img
  1. Reboot the host by typing: fastboot reboot
  2. Your phone should be back alive!

Optionally, go to the HiSuite and try to reinstall the phone to make sure that all partition are flashed correctly.

first second third

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment