Unbrick Unlocked Huawei P10 - SOLVED


Question



I messed around with my phone (Huawei P10 VTR-L29) and unfortunately bricked it.

what happened


To give you the whole story, I tried to root it, but during the root process I found out that the device is encrypted so I had to "rollback". That worked fine and my phone was working ok with one issue - I wasn't able to update firmware via regular system updates. I saw the update, but wasn't able to download and install - it always ended up with some error.


That made me decide to reinstall the firmware from scratch. I followed general steps but yeah, I messed up.


current status


The only thing I can see now is


Emui Recovery


When I click on download latest version and recovery


Downloading


But after a while it fails:


Failure


And I am stuck :( I can't get any further .. I tried to connect via ADB (but since I cannot get in the phone to enable USB Debugging (which might be the problem) I am unable to connect (nor ADB neither FASTBOOT can see the device).


I tried to create this file:


/etc/udev/rules.d/51-android.rules 

But when I run


sudo adb kill-server
sudo adb start-server
adb devices

It's still empty ... I can't even get to the "FACTORY RESET" by pressing and holding POWER + VOL:DOWN for some time; it always brings me back to the Huawei eRecovery


Do you guys have any idea how to fix this?

Or is that phone dead for good?


I don't care about the data inside.. I would only love to make it work again


EDIT


with the help of alecxs I made it to the fastboot&rescue mode


Fastboot and recovery mode


however this


sudo fastboot boot [img]

ends up with


downloading 'boot.img'...
OKAY [ 1.052s]
booting...
FAILED (remote: Command not allowed)
finished. total time: 1.056s

similar for


sudo fastboot flash recovery [img]

ends up with


target reported max download size of 471859200 bytes
sending 'recovery' (32040 KB)...
OKAY [ 0.995s]
writing 'recovery'...
FAILED (remote: Command not allowed)
finished. total time: 1.001s

EDIT2:


I asked as well one of my friends and we moved on a bit more ...


I tried to unlock the bootloader


sudo fastboot oem unlock [unlock_code]

Then I got this screen:


bootloader_Unlock


I went with the option (2) and that brought me to the first screen mentioned in this article "Huawei eRecovery"


but when I repeated the VOL:DOWN + USB:CABLE:PLUG trick :) I got this


Unlocked_phone


I tried a different TWRP (for P10 specifically) from this link: XDA Devs - P10 TWRP


Flashing worked fine:


sudo fastboot flash recovery_ramdisk twrp_p10_0.1.img

I got:


target reported max download size of 471859200 bytes
sending 'recovery_ramdisk' (24954 KB)...
OKAY [ 0.771s]
writing 'recovery_ramdisk'...
OKAY [ 0.232s]
finished. total time: 1.003s

after


sudo fastboot reboot

right after this command, I need to unplug the USB cable and hold VOLUME:UP to be able to get to TWRP (swipe.d to allow modifications) ... am there already


TWRP


now I am looking for any ROM for my P10 to flash it. I want to try this one: TheUpgradeGuide.com - Pixel Experience


I downloaded the gApps and ROM ... uploaded it to the "Internal Storage" of the phone (there was a folder TWRP so I put it next to it)


.
..
/TWRP
rom.7z
gapps.zip

Went on wiping -> WIPE -> ADVANCED -> checked these



  • Dalvik Cache

  • System

  • Cache

  • Data


swiped to wipe (uplugged USB) .. but got this error:


Updating partition details ...
Failed to mount '/odm' (Invalid argument)
...done
Failed to unmount '/system' (Device or resource busy)
Full SELinux support is present
MTP Enabled
Failed to unmount '/system' (Device or resource busy)
Wiping Dalvik Cache Directories...
--Dalvik Cache Directories Wipe Complete!
Formatting Cache using make-ext4fs...
Wiping data without wiping /data/media ...
Done.
Failed to unmount '/system' (Device or resource busy)
Unable to wipe /system.
Updating partition details...
Failed to mount '/odm' (Invalid argument)
...done

EDIT 3


in the adb shell


~ # mount
rootfs on / type rootfs (rw,seclabel,size=1457112k,nr_inodes=364278)
tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,mode=755)
devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600)
proc on /proc type proc (rw,relatime,gid=3009,hidepid=2)
sysfs on /sys type sysfs (rw,seclabel,relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
none on /acct type cgroup (rw,relatime,cpuacct)
tmpfs on /mnt type tmpfs (rw,seclabel,relatime,mode=755,gid=1000)
none on /config type configfs (rw,relatime)
/dev/block/bootdevice/by-name/secure_storage on /sec_storage type ext4 (rw,context=u:object_r:teecd_data_file:s0,nosuid,nodev,noatime,discard,noauto_da_alloc,data=ordered)
adb on /dev/usb-ffs/adb type functionfs (rw,relatime)
hdb on /dev/usb-ffs/hdb type functionfs (rw,relatime)
/dev/block/bootdevice/by-name/system on /system type ext4 (ro,seclabel,relatime,data=ordered)
/dev/block/bootdevice/by-name/vendor on /vendor type ext4 (ro,seclabel,relatime,data=ordered)
tmpfs on /storage type tmpfs (rw,seclabel,relatime,mode=755,gid=1000)
/dev/block/sdd46 on /data type f2fs (rw,seclabel,relatime,background_gc=on,user_xattr,inline_xattr,acl,inline_data,inline_dentry,extent_cache,mode=adaptive,verify_encrypt,active_logs=6)
/dev/block/sdd46 on /sdcard type f2fs (rw,seclabel,relatime,background_gc=on,user_xattr,inline_xattr,acl,inline_data,inline_dentry,extent_cache,mode=adaptive,verify_encrypt,active_logs=6)
/dev/block/sdd13 on /cache type ext4 (rw,seclabel,relatime,data=ordered)

plus the ls output


~ # ls -ld $(find /dev/block -name by-name)/*
drwxr-xr-x 2 root root 1020 Jan 4 18:02 /dev/block/bootdevice/by-name
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/boot_a -> /dev/block/sdd32
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/bootfail_info -> /dev/block/sdd14
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/cache -> /dev/block/sdd13
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/cust_a -> /dev/block/sdd43
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/dfx -> /dev/block/sdd19
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/dts_a -> /dev/block/sdd34
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/fastboot_a -> /dev/block/sdd24
lrwxrwxrwx 1 root root 15 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/frp -> /dev/block/sdc1
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/fw_hifi_a -> /dev/block/sdd28
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/fw_lpm3_a -> /dev/block/sdd21
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/hisee_fs -> /dev/block/sdd18
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/hisee_img_a -> /dev/block/sdd23
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/isp_boot_a -> /dev/block/sdd26
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/isp_firmware_a -> /dev/block/sdd27
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/misc -> /dev/block/sdd15
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/modem_fw_a -> /dev/block/sdd36
lrwxrwxrwx 1 root root 15 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/modem_om -> /dev/block/sdd7
lrwxrwxrwx 1 root root 15 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/modem_secure -> /dev/block/sdd3
lrwxrwxrwx 1 root root 15 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/modemnvm_backup -> /dev/block/sdd9
lrwxrwxrwx 1 root root 15 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/modemnvm_factory -> /dev/block/sdd8
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/modemnvm_img -> /dev/block/sdd10
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/modemnvm_system -> /dev/block/sdd11
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/modemnvm_update_a -> /dev/block/sdd38
lrwxrwxrwx 1 root root 15 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/nvme -> /dev/block/sdd4
lrwxrwxrwx 1 root root 15 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/oeminfo -> /dev/block/sdd5
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/patch_a -> /dev/block/sdd39
lrwxrwxrwx 1 root root 15 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/persist -> /dev/block/sdc2
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/product_a -> /dev/block/sdd42
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/recovery2_a -> /dev/block/sdd30
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/recovery_a -> /dev/block/sdd33
lrwxrwxrwx 1 root root 15 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/reserved1 -> /dev/block/sdc3
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/reserved10 -> /dev/block/sdd17
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/reserved2 -> /dev/block/sdd16
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/reserved3_a -> /dev/block/sdd22
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/reserved4_a -> /dev/block/sdd37
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/reserved5 -> /dev/block/sdd45
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/rrecord -> /dev/block/sdd20
lrwxrwxrwx 1 root root 15 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/secure_storage -> /dev/block/sdd6
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/sensorhub_a -> /dev/block/sdd31
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/splash2 -> /dev/block/sdd12
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/system_a -> /dev/block/sdd44
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/teeos_a -> /dev/block/sdd29
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/trustfirmware_a -> /dev/block/sdd35
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/userdata -> /dev/block/sdd46
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/vector_a -> /dev/block/sdd25
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/vendor_a -> /dev/block/sdd41
lrwxrwxrwx 1 root root 16 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/version_a -> /dev/block/sdd40
lrwxrwxrwx 1 root root 15 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/vrl -> /dev/block/sdd1
lrwxrwxrwx 1 root root 15 Jan 4 18:02 /dev/block/platform/ff3b0000.ufs/by-name/vrl_backup -> /dev/block/sdd2

Ok, with the help of alecxs I managed to get a bit further (see the chat) but it seems like the TWRP is faulty (the one from the link above -> XDA).. nonetheless, any other TWRP is not working at all and I am landing on this screen instead :(


Invalid TWRP


EDIT 4:


output of fastboot getvar all is here:


getvar:all FAILED (remote: Command not allowed)

EDIT 5:


see the output of the fastboot commands requested in the chat


#sudo fastboot oem get-bootinfo
...
(bootloader) unlocked
OKAY [ 0.006s]
finished. total time: 0.006s

$ sudo fastboot getvar vendorcountry
vendorcountry: hw/eu
finished. total time: 0.007s

$ sudo fastboot oem get-build-number
...
(bootloader) :VTR-L29C432B151
OKAY [ 0.007s]
finished. total time: 0.007s

$ sudo fastboot oem oeminforead-SYSTEM_VERSION
...
(bootloader) :VTR-L29C432B151
OKAY [ 0.008s]
finished. total time: 0.008s

SOLVED


Finally, I made it and the phone is up and running :)


I downloaded Huru Updated (v0.3)
and these files
https://huaweidl.com/download/huawei-p10/vtr-l29/b151/


Followed these steps:
https://www.getdroidtips.com/hurupdater-tool/


and yaaaay, it works :) after months of playing around ... big thx to alecxs for his immense help !!! this guys is a genius !!!


the only question now is to get from Android 7 (the stock I flashed) to 9.1 (the most updated one provided to p10) ... bec the native system update does not offer me an update :D but that's minor ..


EDIT:
ok, following this manual xda-developers - Jannomag I was able to upgrade to 8.0 (with a little hiccup - just had to manually restart it multiple times) and then to 9.0 (no problem at all this time) and right after 9.0 it offered me (via system update) automatically the newest 9.1.0.263


Answer

SOLUTION


Here is what I have done to make it work ...


I downloaded HuRu Updater (v0.3) and these files https://huaweidl.com/download/huawei-p10/vtr-l29/b151/


Followed these steps: https://www.getdroidtips.com/hurupdater-tool/


and yaaaay, it works :) after months of playing around ... big thx to alecxs for his immense help !!! this guy is a genius !!!


the only question was to get from Android 7 / EMUI 5.1 (the stock I flashed) to 9.1 (the most updated one provided to p10) ... bec the native system update did not offer me an update


but by following this manual xda-developers - Jannomag I was able to upgrade to 8.0 (with a little hiccup - just had to manually restart it multiple times because the phone was not rebooting as expected and somehow got "stock") and then to 9.0 (no problem at all this time; smooth) and right after 9.0 it offered me (via system update) automatically the newest 9.1.0.263


The only thing left is that I have an unlocked bootloader and cannot seem to be able to lock it again with


fastboot oem lock [unlock_code]
FAILED (remote: Command not allowed)

fastboot oem relock [unlock_code]
FAILED (remote: root type is risk)

but that's minor ... I will try to look for a way to do that .. and if successful, I will update this answer with the final steps to get back to "stock"


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes