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

Search This thread

tkalfaoglu

Senior Member
Btw, WHICH partitions are necessary to install a stock image?
I had an 8.1 image but I wanted to get back to 8.0, and I flashed system,recovery_ramdisk, ramdisk, vendor, system, kernel partitions.
But the device would not boot. I must be missing some partitions!
Any idea what's missing? Thanks!
 
Last edited:

glorymyrrh

Member
Jun 18, 2013
15
0
NICE... but i need to know if it is possible to modify recovery.img original to twrp renamed as recovery.img and repack in update.app because i can't unlock my bootloader?
 

culiacanazo

Senior Member
Btw, WHICH partitions are necessary to install a stock image?
I had an 8.1 image but I wanted to get back to 8.0, and I flashed system,recovery_ramdisk, ramdisk, vendor, system, kernel partitions.
But the device would not boot. I must be missing some partitions!
Any idea what's missing? Thanks!
SYSTEM, RECOVERY_RAMDISK, RAMDISK, and the one you were missing was CUST, although i as well keep USERDATA and KERNEL handy, they don't hurt anything

Sent from my Huawei Mate 10 Pro using XDA Labs
 

Top Liked Posts

  • There are no posts matching your filters.
  • 21
    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!iZQDI4ti6ERmQJC6afgUGTSvHHKcm9KFz9okmwwez3I
    Source: https://github.com/marcominetti/split_updata.pl/tree/f5f415262be3487de28321b49dcb69d947897bf1
    (Or my 'special' version https://mega.nz/#!NS4VnL7Q!5GMn-soCf_WMW6fZANd-TDzxjQkZW2LynEQtJ_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:
    cV9BEYr.png

    BLA-L29 8.0.0.132(C636) (Replace 8.0.0. with C636 and add a B infront of 132 :eek:)
    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.
    ykxgVa1.png


    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.
    RaVSqO6.png



    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)
    jUYtPv6.png


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


    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://xdaforums.com/showthread.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)
    1
    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.
    1
    My phone was bricked because of Lineage OS, and i unbricked with this guide. Read my post first.

    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 ?
    1
    It should say your current firmware (besides Lineage) in Settings -> (System?) -> About.



    It's better to use:
    https://xdaforums.com/mate-10/how-to/guide-mate-10-flash-oreo-update-package-t3716814

    I'm not sure if symlinks will be set up correctly if you flash images directly. And some partitions can't be flashed from fastboot (like the erecovery ones)

    @ante0

    This man is a legend.........
    I would like to express my gratitude in you answering my pms and assisting to get the device up and running.
    If ever am in Sweden:silly: ill definitely buy you beeeeeeeeeeeeeeeeeeeeeeers
    Thanks for the patience and the help you bring to us noobs bricking these bloody Mate 9's
    1
    Im now on lineage os. I didnt flash twrp and magisk. Can i only flash stock system.img to get fully stock. Or i have to flash ramdisk and boot first before system.img

    System.img is enough, as that's all you flashed with lineage