FORUMS
Remove All Ads from XDA

[Guide]Extracting Stock firmware files using Huawei Update Extractor/splitupdate

3,008 posts
Thanks Meter: 1,447
 
By ante0, Senior Member on 28th February 2018, 09:55 AM
Post Reply Email Thread
There seems to be a little confusion on how to do this and I've written down how to in many posts now so I figure I'd just write it down in a little guide.

What you need:
Firmware update.zip from http://pro-teammt.ru/firmware-database/

Windows only: Huawei Update Extractor

Linux/Mac(?)/(Windows too): splitupdate perl script (requires perl)
Direct link: https://mega.nz/#!4PBknJrK!iZQDI4ti6...9KFz9okmwwez3I
Source: https://github.com/marcominetti/spli...cb69d947897bf1
(Or my 'special' version https://mega.nz/#!NS4VnL7Q!5GMn-soCf...2LynEQtJ_TlUdU which extracts
to the same folder as 'splitupdate' instead of 'output/', and includes a mount script (Linux only, maybe Mac?) for extraction of files of the different images)


Archive extractor of your choice (7zip, winrar, winzip and so on.)


Firmware build
First you need to determine what your current firmware is, this can be done by going to 'Settings -> System -> About Phone' on your phone. Check 'Build Number'.
Mine says:

BLA-L29 8.0.0.132(C636) (Replace 8.0.0. with C636 and add a B infront of 132 )
This can be translated into BLA-L29C636B132.
Now we have our current firmware!


Info on Nougat -> Oreo
As of Oreo the partitions changed a little.
'Boot' partition was split into 'ramdisk' and 'kernel'.
'Recovery' partition was split into 'recovery_ramdisk', 'recovery_vendor' and 'recovery_vbmeta', and shares the 'kernel' partition with 'ramdisk'.
The one's you probably want to flash are 'ramdisk' and 'recovery_ramdisk'. (Ramdisk is where Magisk/SuperSU goes, recovery_ramdisk is where TWRP goes)


Firmware update.zip
In this example I will be using my firmware, BLA-L29C636B132.
First start by going to http://pro-teammt.ru/firmware-database/ and enter your full firmware in the 'Enter model', click on Find Model.


This is what it will look like after you have searched. Locate the row that says FullOTA-MF and click on the 'update' link in that row.
When it's downloaded, open update.zip in your choice of archive manager and extract UPDATE.app to your desktop or somewhere easy to find.



Huawei Update Extractor:
Download Huawei Update Extractor from the link above, it's attached to first post in that thread I linked to (v0.9.9.5).
Extract the zip to your desktop (Or Downloads folder).
Enter the newly created folder that should be named 'HuaweiUpdateExtractor_0.9.9.5', and run HuaweiUpdateExtractor.exe.
Start by going to the 'Settings' tab and uncheck 'Verify header checksum'.
(Something is wrong with the header of erecovery_ramdisk, also it's mispelled to erecovery_ramdis, or maybe character limit? The partition on phone is named correctly. This does not need to be unchecked on Nougat firmware)


Then go back to the 'Extract' tab and click on the button that says '...' and open your UPDATE.APP


Rightclick on the file you want to extract and click on 'Extract Selected', this will bring up a dialog where you choose where to extract to.

After this you can flash the file using fastboot. Take 'ramdisk' for example.
Make sure you have adb & fastboot installed (https://forum.xda-developers.com/sho....php?t=2317790)
Open up a command prompt and connect phone, reboot to fastboot mode using: usb plugged in, power + vol down, release power when phone vibrates.
Or you can use the command 'adb reboot bootloader'.
Make sure phone is recognized in fastboot mode with the command: 'fastboot devices', it should show up as a fastboot device.
Next we can flash RAMDISK.img using: 'fastboot flash ramdisk RAMDISK.img'.

On Nougat you would extract 'BOOT' from UPDATE.APP and flash using:
'fastboot flash boot BOOT.img'


Linux/Mac(?)(and Windows with perl installed, I use Strawberry Perl)
First download the splitupdate zip from above.
Extract it and enter the extracted 'split' folder, open a terminal and:
'chmod +x splitupdate'
'chmod +x crc'

Now put your UPDATE.APP in the 'split' folder and open a terminal and use the following command:
'./splitupdate UPDATE.APP file_to_extract'. If you write 'file_to_extract' or anything that is or is not in the UPDATE.APP it will list all images in it.
Typing './splitupdate UPDATE.APP' will extract all files in UPDATE.APP
It will output files to the newly created 'output' folder. The filtering is not perfect. If you use './splitupdate UPDATE.APP RAMDISK', it will extract all images with RAMDISK in its name, so you will get RAMDISK.img and RECOVERY_RAMDISK.img. This is fine for me as the original script extracted everything, which takes long for the larger images.

And if you use the 'special' version:
'chmod +x simg2img'
'chmod +x mount.sh'
I edited the splitupdate script for the 'special' version just to make it easier for me as I like to check SYSTEM, VENDOR, PROCDUCT and those images for changes.
So it made it easier if it extracted directly to the root of 'split' folder instead of 'output', then I could run the mount.sh script directly.
To use mount.sh, first edit the script and replace YOUR_SUDO_PASSWORD_HERE with your password or remove 'echo YOUR_SUDO_PASSWORD_HERE | ' and input password manually when it asks.
Then simply extract SYSTEM.img (or Product, vendor, odm whichever you like) and './mount.sh SYSTEM' (yes, no extension).
This will convert SYSTEM.img to SYSTEM.raw and mount it to 'split_folder/SYSTEM/' as a loop device, it will also chmod 777 everything in SYSTEM/.



Linux ADB and Fastboot
Use google for this one. ADB usually works fine right away, Fastboot might get 'no permissions' and need to be run as sudo if it's missing udev permissions/entries.
You can make fastboot work without sudo but it's easier to google it as it might get lengthy and there are a lot of different distros of linux (I use Ubuntu)
The Following 19 Users Say Thank You to ante0 For This Useful Post: [ View ] Gift ante0 Ad-Free
 
 
3rd March 2018, 03:49 PM |#2  
lingarajug's Avatar
Senior Member
Flag Roanoke, VA
Thanks Meter: 71
 
More
Hi ante0, i have downloaded the bla a09 8.0.0.109 c567 which is the recent update for my US mate 10 pro version, i was using hisuite to update my phone which is failing but i was able to grab the update which it down loaded and it has the following files in it, bla-a09_hw_usa( which contains update_full_BLA-A09_hw_usa, public( which contains update_data_full_public), update.zip which contains update.app and other xml files, i have already bl unlocked and rooted with supersu but i wanted to install magisk and i installed twrp and tried sideloading magisk but it fails stating boot image already modified and advised flask stock boot, so which files do i need to flash and what are the fastboot commands to do so and i was also thinking about complete bl lock just to make it look like new phone and how do i do that, please direct me, thank you.
3rd March 2018, 04:25 PM |#3  
oslo83's Avatar
Senior Member
Thanks Meter: 242
 
Donate to Me
More
I think to update you'll need to:
A) Unroot your supersu.
B) Restore stock boot and restore your stock recovery with guide in OP and with the firmware files actually installed on your phone.

Then you could root oreo with magisk.
The Following User Says Thank You to oslo83 For This Useful Post: [ View ] Gift oslo83 Ad-Free
3rd March 2018, 05:31 PM |#4  
lingarajug's Avatar
Senior Member
Flag Roanoke, VA
Thanks Meter: 71
 
More
Quote:
Originally Posted by oslo83

I think to update you'll need to:
A) Unroot your supersu.
B) Restore stock boot and restore your stock recovery with guide in OP and with the firmware files actually installed on your phone.

Then you could root oreo with magisk.

there lies my problem, i am trying to flash an updated stock firmware than the one that came with my phone, i have unrooted supersu and deleted supersu app and dont have root anymore confirmed by rootcheck apps, since my boot is already patched once magisk wont flash and advising me to flash stock boot image but i dont know which to flash as with oreo there seems to be different partitions and i dont know commands other than basic fastbbot commands to flash stuff.
4th March 2018, 02:36 AM |#5  
lingarajug's Avatar
Senior Member
Flag Roanoke, VA
Thanks Meter: 71
 
More
ok so i was able to flash ramdisk, recovery and system and boot back to OS ( i have earlier erased system by mistake) and i have flashed system.img from updated firmware but version still shows old one, and i am trying to use funkyhuawei erecovery method to flash the updated firmware and when i boot to erecovery to update but the update button is missing and i just have rebbot, wipe date/fr and wipe cache, so what do i need to flash and commands for it in order to make erecovery work and i have update button enabled, thank you.
4th March 2018, 04:30 PM |#6  
OP Senior Member
Flag Stockholm
Thanks Meter: 1,447
 
Donate to Me
More
Quote:
Originally Posted by lingarajug

ok so i was able to flash ramdisk, recovery and system and boot back to OS ( i have earlier erased system by mistake) and i have flashed system.img from updated firmware but version still shows old one, and i am trying to use funkyhuawei erecovery method to flash the updated firmware and when i boot to erecovery to update but the update button is missing and i just have rebbot, wipe date/fr and wipe cache, so what do i need to flash and commands for it in order to make erecovery work and i have update button enabled, thank you.

If you can, use the HWOTA method instead. It's free and found: https://forum.xda-developers.com/mat...ckage-t3716814
If you can't use HWOTA and have to use Funky:
You seem to be in normal Recovery. You should see a button that says 'Download latest firmware', the one you're describing is showing buttons that are in normal Recovery.
Are you booting using Usb plugged in + vol up + power?
4th March 2018, 09:56 PM |#7  
lingarajug's Avatar
Senior Member
Flag Roanoke, VA
Thanks Meter: 71
 
More
For some reason my phone would only boot to revovery and not erecocery, anyway i used hisuite method and was able to flash new firmware. Thank you.
5th March 2018, 12:54 PM |#8  
Junior Member
Flag Vienna
Thanks Meter: 3
 
More
I've just unbricked my Mate 10 pro via this method. Thank you Sir.
5th March 2018, 01:19 PM |#9  
Junior Member
Thanks Meter: 0
 
More
Not sure if this is the right place but where can I find the original Huawei OS it was shipped with? I installed Lineage and want to go back to Factory.

I just want to .img file. I have only unlocked the bootloader not rooted the phone.
Lack of camera and other features means I need to get back.

Any ideas?
5th March 2018, 03:48 PM |#10  
Pretoriano80's Avatar
Senior Member
Thanks Meter: 2,631
 
Donate to Me
More
Quote:
Originally Posted by elviss0812345

I've just unbricked my Mate 10 pro via this method. Thank you Sir.

You bricked your device because you don't know what you are doing,not because of this guide.Oh,and i thought KangRom was responsible for bricking you device....anyone else to blame ?
5th March 2018, 03:52 PM |#11  
Junior Member
Flag Vienna
Thanks Meter: 3
 
More
My phone was bricked because of Lineage OS, and i unbricked with this guide. Read my post first.

Quote:
Originally Posted by Pretoriano80

You bricked your device because you don't know what you are doing,not because of this guide.Oh,and i thought KangRom was responsible for bricking you device....anyone else to blame ?

The Following User Says Thank You to elviss0812345 For This Useful Post: [ View ] Gift elviss0812345 Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes