[TOOL] Huawei Update Extractor [UPDATED: v0.9.9.5] | OPEN-SOURCE LIBRARY

chuatevutru

New member
Mar 16, 2015
2
0
0
repack update.app

Huawei Update Extractor

After messing around a bit with the perl tools available for extracting Huawei update.app files,
i got the idea to create an own (windows) tool.

Requirements

.Net Framework 3.5

Install

Extract the content of the zip to a folder somewhere on your system.
Execute HuaweiUpdateExtractor.exe
I'm planning to create an installer sometime.

Usage

Press the browse (...) button and select an update.app file. Select a device or unknown and press on the open button.
You'll see the content of the update.app file in the listview.

Select one or more files and right click. Choose Extract selected from the context menu.
Choose the ouput folder and press ok.
Or just right click on the list and select Extract all, choose the output folder again and press ok.
Press close on the extract window.

You can sort the list on sequence, filename and size. Just press on the desired column header.

Command line:

HuaweiUpdateExtractor extract input output [profile]
HuaweiUpdateExtractor repack input output profile

Profile

The profiles.xml file is used to identify the files in the update.app file. Every file in the update.app has a sequence or type, which is also
shown in the list. Those sequences or types are used to identify the file/device partition.

Example:

Code:
<?xml version="1.0"?>
<Profiles>
    <Profile name="Unknown" author="worstenbrood">
        <Files/>
    </Profile>
    <Profile name="Huawei G510-0100" author="worstenbrood">
        <Files>
            <File sequence="00000000" partition="/dev/block/mmcblk0p17">system.img</File>
            <File sequence="40000000" partition="/dev/block/mmcblk0p13">recovery.img</File>
            <File sequence="80000000" partition="/dev/block/mmcblk0p03">baseband.img</File>
            <File sequence="EC000000">version.txt</File>
            <File sequence="E4000000">splash.raw565</File>
            <File sequence="FC000000" partition="/dev/block/mmcblk0p12">boot.img</File>
            <File sequence="70000000" partition="/dev/block/mmcblk0p16">cust.img</File>
            <File sequence="30000000" partition="/dev/block/mmcblk0p18">userdata.img</File>
            <File sequence="FE000000" filetype="signature">signature</File>
            <File sequence="FF000000" filetype="checksum">crc</File>
        </Files>
    </Profile>
    <Profile name="Huawei P6" author="worstenbrood">
        <Files>
            <File type="system" partition="/dev/block/mmcblk0p16">system.img</File>
            <File type="cache" partition="/dev/block/mmcblk0p17">cache.img</File>
            <File type="cust" partition="/dev/block/mmcblk0p18">cust.img</File>
            <File type="userdata" partition="/dev/block/mmcblk0p19">userdata.img</File>
            <File type="modemimage" partition="/dev/block/mmcblk0p13">modemimage.img</File>
            <File type="boot" partition="/dev/block/mmcblk0p12">boot.img</File>
            <File type="recovery" partition="/dev/block/mmcblk0p11">recovery.img</File>
            <File type="md5rsa" filetype="signature">signature</File>
            <File type="crc" filetype="checksum">crc</File>
        </Files>
    </Profile>
</Profiles>
<Profiles>
- Root tag of the xml file.

<Profile>
- Identifies a device
- attribute name: name of the device
- attribute author: author of the device

<Files>
- File root tag

<File>
- Identifies a file
- attribute sequence: sequence of the file in update.app
- attribute type: type of the file in the update.app
- attribute partition: destination partition on the device
- attribute filetype: can be one of the following values:
* signature: used to identify the signature file
* checksum: used to identify the checksum file
- value: file name

You can add or edit devices. If you want them to integrate in newer version, pm 'em to me.
I'm gonna make some auto update for the device file somewhere in the future :)

To add your devices profile you'll have to identify your device partitions and map them against the files inside the update.app.
Thread about identifying partitions: http://forum.xda-developers.com/showthread.php?t=1959445

Roadmap

- You tell me ...

Credits

ZeBadger ([email protected]) for figuring out the file headers
S34Qu4K3 for the P6 partition layout
ngamyarthar for adding ALOT of devices!

Changelog

v0.9.1.0
- Create update zip works now, this requires to have a PERFECT device entry in the devices file. The sequence is used to identify the file AND partition. Only files that have these two will be included in the zip. USE WITH CAUTION, MAKE SURE THE PARTITION IS CORRECT OR YOU'LL END UP FLASHING THE WRONG IMAGES TO THE WRONG PARTITION !! I'M NOT RESPONSABLE FOR BRICKING YOUR DEVICE! IF YOU DON'T KNOW WHAT YOU'RE DOING, THEN DON'T USE IT!

v0.9.1.1
- Added Type to the filelist (shows INPUT for g510 roms, but shows some useful info on P6 roms)

v0.9.2.0
- Files now can also be identified by the type attribute in devices.xml
- Added P6 device

v0.9.3.0
- Crc check during extract
- Crc check during creating flashable zip
- Added row to see file is flashable

v0.9.5.0
- Added repack
- Added icons and tooltip
- Added settings
- Experimental, no signing on repack, crc file gets generated
- Alot of stuff i forgot

v0.9.6.0
- Added command line options

v0.9.7.0
- Added G300 profile (thx ZeBadger)
- Added detailed info about the file (libmagic) in the tooltip on the extract list. This way it is easier to identify files inside the update.
(see screenshot). It will detect ext/fat/... partitions.

v0.9.7.1
- Alot of devices added in profiles (Credits to ngamyarthar, thanks alot dude!)
- Added android boot/recovery image recognition in magic.mgc

v0.9.7.2
- Made setup

-v0.9.7.4
- App will now remember last used profile.
- Fixed bug in repack code (remainder writing)
- Added signing options (During repack, once set, it will use the selected keyfile (PEM format) and algorithm to create the signature file. If there is no file selected or the file doesn't exist, it will use the existing signature file.)

Example of keyfile content:

Code:
-----BEGIN RSA PRIVATE KEY-----
MIICXgIBAAKBgQDU9GF9tdk59edEXWX4MEJNjMqGce/CqqGZSDBwnAzHITZYBm+y
ZEVkaOGGdPY7rmmWO6w3P/+nPVHO0kxA1/J+FY+sbUF7uz0kzVDxuW6t5KDc9Qr4
NRAE1ZzX0eB0aYpLImlqI7yigih6ds+Yp83mTbF+BiaFTLLtMVdWS7wQiwIDAQAB
AoGBAMok2E4+Sl9sfwU0K1E2bhmzJaQNj2wYEKGyFtkuKCr16eIQ6gJKkFxJ+ppp
eDsaynujVUx04bbczEUo9t0un603s5HAGq6USO5flERco0TlNw7xnTornPPrNxfU
sXOtIGzb0FlRuC129JqZJ9QsfvOyt3KIWwmJqc0R/k0xB8uRAkEA9+v1ohNXB8CL
plhQOtq0ueWrf9CCCeiqhf6ijg7UEegMLGKZ2gFMvMNwuojz/pbQmHdWTU9eC0k1
3yiAwHtcLQJBANvkvjXdzCYHO6nWOH1vf8DRLwCnwEteyxJ2qnrqKLS3fxCjWN4h
4vSNqgC9uoLEb/6T/72XTdG9gS8GsuoAupcCQBZ4eIb8IcM+HGozTvJGqGLBAk5P
Y7nqMKp8bddaWLZWxeOv/CnaPE5PmIQPra3BlZ58EoJnUyrKs+tKDIFlrPECQQC9
Ie0cxc4e81+0/+WMtkdq4EGOTbsO2NTP57NQj3E9pwqqk+UPApSEBgkwJAB1E2LE
1CVGvAoaGeYwPZHLxZ63AkEAugR+cC+5/BtTeMeXEcijnU0qkgkwLCMgTB1DIoMm
X0/wRGPPmZpGmMStHd+87ZxQSOiq5nAyZ4riFXLziUNOlA==
-----END RSA PRIVATE KEY-----
-v0.9.7.5
- Default sorting on filename
- Small changes in structure of profiles.xml

-v0.9.7.6
- Added progress for signing and checksum generation
- Extract/CreateZip order by offset
- Repack order by Signature, Checksum, Files

-v0.9.7.7
- Doubleclick on item in extract files listview copies tooltip text to clipboard
- Added detailed android boot/recovery image detection to magic.mgc
- Added SecVRL header (the 2048 byte header in front of fastboot/boot/recovery image) detection

-v0.9.7.8
- Added timestamp options in settings
- Added tooltips in settings
- Some ui changes (which hopefully fix the missing "..." button issue)

-v0.9.7.9
- Some small ui fixes
- When saved location of the app is on a monitor that isn't attached anymore, app location is restored to center of primary screen.

-v0.9.8.0
- Some small ui changes
- Sort profiles by name
- Remember last used directory
- Added profile for Huawei G526 (Credits Roman Dmitriev)

-v0.9.9.0
- Added compatibility for wine/mono
- Fixed bug in settings (Verify header checksum)
- Made the app localizable (Download the Resources_EN example, if you make a translation, make sure that your assembly start with "Resources_" and ends with the TwoLetterISOLanguageName (eg. EN for english) of your culture and put the assembly in the same directory as the application)
- Added profile for Huawei Ascend Mate 7 (Thanks to sketchykingy)

-v0.9.9.1
- Added missing translatable resources (updated Resources_EN)
- Added profile for Huawei MediaPad X1 7.0 (7D-503L) (Credits ElectroMyStyle)

Download

- v0.9.9.1: Setup - Zip

Mirror

Donate if you like my work.
you can help me creat profile.xml for huawei mediapad T1 8.0 (s8-701u).
 

Attachments

nebulac

Member
Aug 14, 2014
7
2
0
What does that mean, error during extracting the system.img from the update.app, or extracting the system.img ? This tool doesn't extract .img files ...
Ah... All img files extracted well from UPDATE.APP, except 'system.img' file.
Error Message is "non-negative number required. parameter name: count"
 

persona78

Senior Member
Apr 12, 2013
2,384
1,203
113
Huawei Ascend G6 - L11 Profile

Huawei Update Extractor

After messing around a bit with the perl tools available for extracting Huawei update.app files,
i got the idea to create an own (windows) tool.

Requirements

.Net Framework 3.5

Install

Extract the content of the zip to a folder somewhere on your system.
Execute HuaweiUpdateExtractor.exe
I'm planning to create an installer sometime.

Usage

Press the browse (...) button and select an update.app file. Select a device or unknown and press on the open button.
You'll see the content of the update.app file in the listview.

Select one or more files and right click. Choose Extract selected from the context menu.
Choose the ouput folder and press ok.
Or just right click on the list and select Extract all, choose the output folder again and press ok.
Press close on the extract window.

You can sort the list on sequence, filename and size. Just press on the desired column header.

Command line:

HuaweiUpdateExtractor extract input output [profile]
HuaweiUpdateExtractor repack input output profile

Profile

The profiles.xml file is used to identify the files in the update.app file. Every file in the update.app has a sequence or type, which is also
shown in the list. Those sequences or types are used to identify the file/device partition.

Example:

Code:
<?xml version="1.0"?>
<Profiles>
    <Profile name="Unknown" author="worstenbrood">
        <Files/>
    </Profile>
    <Profile name="Huawei G510-0100" author="worstenbrood">
        <Files>
            <File sequence="00000000" partition="/dev/block/mmcblk0p17">system.img</File>
            <File sequence="40000000" partition="/dev/block/mmcblk0p13">recovery.img</File>
            <File sequence="80000000" partition="/dev/block/mmcblk0p03">baseband.img</File>
            <File sequence="EC000000">version.txt</File>
            <File sequence="E4000000">splash.raw565</File>
            <File sequence="FC000000" partition="/dev/block/mmcblk0p12">boot.img</File>
            <File sequence="70000000" partition="/dev/block/mmcblk0p16">cust.img</File>
            <File sequence="30000000" partition="/dev/block/mmcblk0p18">userdata.img</File>
            <File sequence="FE000000" filetype="signature">signature</File>
            <File sequence="FF000000" filetype="checksum">crc</File>
        </Files>
    </Profile>
    <Profile name="Huawei P6" author="worstenbrood">
        <Files>
            <File type="system" partition="/dev/block/mmcblk0p16">system.img</File>
            <File type="cache" partition="/dev/block/mmcblk0p17">cache.img</File>
            <File type="cust" partition="/dev/block/mmcblk0p18">cust.img</File>
            <File type="userdata" partition="/dev/block/mmcblk0p19">userdata.img</File>
            <File type="modemimage" partition="/dev/block/mmcblk0p13">modemimage.img</File>
            <File type="boot" partition="/dev/block/mmcblk0p12">boot.img</File>
            <File type="recovery" partition="/dev/block/mmcblk0p11">recovery.img</File>
            <File type="md5rsa" filetype="signature">signature</File>
            <File type="crc" filetype="checksum">crc</File>
        </Files>
    </Profile>
</Profiles>
<Profiles>
- Root tag of the xml file.

<Profile>
- Identifies a device
- attribute name: name of the device
- attribute author: author of the device

<Files>
- File root tag

<File>
- Identifies a file
- attribute sequence: sequence of the file in update.app
- attribute type: type of the file in the update.app
- attribute partition: destination partition on the device
- attribute filetype: can be one of the following values:
* signature: used to identify the signature file
* checksum: used to identify the checksum file
- value: file name

You can add or edit devices. If you want them to integrate in newer version, pm 'em to me.
I'm gonna make some auto update for the device file somewhere in the future :)

To add your devices profile you'll have to identify your device partitions and map them against the files inside the update.app.
Thread about identifying partitions: http://forum.xda-developers.com/showthread.php?t=1959445

Roadmap

- You tell me ...

Credits

ZeBadger ([email protected]) for figuring out the file headers
S34Qu4K3 for the P6 partition layout
ngamyarthar for adding ALOT of devices!

Changelog

v0.9.1.0
- Create update zip works now, this requires to have a PERFECT device entry in the devices file. The sequence is used to identify the file AND partition. Only files that have these two will be included in the zip. USE WITH CAUTION, MAKE SURE THE PARTITION IS CORRECT OR YOU'LL END UP FLASHING THE WRONG IMAGES TO THE WRONG PARTITION !! I'M NOT RESPONSABLE FOR BRICKING YOUR DEVICE! IF YOU DON'T KNOW WHAT YOU'RE DOING, THEN DON'T USE IT!

v0.9.1.1
- Added Type to the filelist (shows INPUT for g510 roms, but shows some useful info on P6 roms)

v0.9.2.0
- Files now can also be identified by the type attribute in devices.xml
- Added P6 device

v0.9.3.0
- Crc check during extract
- Crc check during creating flashable zip
- Added row to see file is flashable

v0.9.5.0
- Added repack
- Added icons and tooltip
- Added settings
- Experimental, no signing on repack, crc file gets generated
- Alot of stuff i forgot

v0.9.6.0
- Added command line options

v0.9.7.0
- Added G300 profile (thx ZeBadger)
- Added detailed info about the file (libmagic) in the tooltip on the extract list. This way it is easier to identify files inside the update.
(see screenshot). It will detect ext/fat/... partitions.

v0.9.7.1
- Alot of devices added in profiles (Credits to ngamyarthar, thanks alot dude!)
- Added android boot/recovery image recognition in magic.mgc

v0.9.7.2
- Made setup

-v0.9.7.4
- App will now remember last used profile.
- Fixed bug in repack code (remainder writing)
- Added signing options (During repack, once set, it will use the selected keyfile (PEM format) and algorithm to create the signature file. If there is no file selected or the file doesn't exist, it will use the existing signature file.)

Example of keyfile content:

Code:
-----BEGIN RSA PRIVATE KEY-----
MIICXgIBAAKBgQDU9GF9tdk59edEXWX4MEJNjMqGce/CqqGZSDBwnAzHITZYBm+y
ZEVkaOGGdPY7rmmWO6w3P/+nPVHO0kxA1/J+FY+sbUF7uz0kzVDxuW6t5KDc9Qr4
NRAE1ZzX0eB0aYpLImlqI7yigih6ds+Yp83mTbF+BiaFTLLtMVdWS7wQiwIDAQAB
AoGBAMok2E4+Sl9sfwU0K1E2bhmzJaQNj2wYEKGyFtkuKCr16eIQ6gJKkFxJ+ppp
eDsaynujVUx04bbczEUo9t0un603s5HAGq6USO5flERco0TlNw7xnTornPPrNxfU
sXOtIGzb0FlRuC129JqZJ9QsfvOyt3KIWwmJqc0R/k0xB8uRAkEA9+v1ohNXB8CL
plhQOtq0ueWrf9CCCeiqhf6ijg7UEegMLGKZ2gFMvMNwuojz/pbQmHdWTU9eC0k1
3yiAwHtcLQJBANvkvjXdzCYHO6nWOH1vf8DRLwCnwEteyxJ2qnrqKLS3fxCjWN4h
4vSNqgC9uoLEb/6T/72XTdG9gS8GsuoAupcCQBZ4eIb8IcM+HGozTvJGqGLBAk5P
Y7nqMKp8bddaWLZWxeOv/CnaPE5PmIQPra3BlZ58EoJnUyrKs+tKDIFlrPECQQC9
Ie0cxc4e81+0/+WMtkdq4EGOTbsO2NTP57NQj3E9pwqqk+UPApSEBgkwJAB1E2LE
1CVGvAoaGeYwPZHLxZ63AkEAugR+cC+5/BtTeMeXEcijnU0qkgkwLCMgTB1DIoMm
X0/wRGPPmZpGmMStHd+87ZxQSOiq5nAyZ4riFXLziUNOlA==
-----END RSA PRIVATE KEY-----
-v0.9.7.5
- Default sorting on filename
- Small changes in structure of profiles.xml

-v0.9.7.6
- Added progress for signing and checksum generation
- Extract/CreateZip order by offset
- Repack order by Signature, Checksum, Files

-v0.9.7.7
- Doubleclick on item in extract files listview copies tooltip text to clipboard
- Added detailed android boot/recovery image detection to magic.mgc
- Added SecVRL header (the 2048 byte header in front of fastboot/boot/recovery image) detection

-v0.9.7.8
- Added timestamp options in settings
- Added tooltips in settings
- Some ui changes (which hopefully fix the missing "..." button issue)

-v0.9.7.9
- Some small ui fixes
- When saved location of the app is on a monitor that isn't attached anymore, app location is restored to center of primary screen.

-v0.9.8.0
- Some small ui changes
- Sort profiles by name
- Remember last used directory
- Added profile for Huawei G526 (Credits Roman Dmitriev)

-v0.9.9.0
- Added compatibility for wine/mono
- Fixed bug in settings (Verify header checksum)
- Made the app localizable (Download the Resources_EN example, if you make a translation, make sure that your assembly start with "Resources_" and ends with the TwoLetterISOLanguageName (eg. EN for english) of your culture and put the assembly in the same directory as the application)
- Added profile for Huawei Ascend Mate 7 (Thanks to sketchykingy)

-v0.9.9.1
- Added missing translatable resources (updated Resources_EN)
- Added profile for Huawei MediaPad X1 7.0 (7D-503L) (Credits ElectroMyStyle)

-v0.9.9.2
- Fixed int overflow (extracting big files)

-v0.9.9.3
- Added drag/drop for files and folders.

Download

- v0.9.9.3: Setup - Zip

Mirror

Donate if you like my work.
Hi!
Congratulations on this software, with his help I could develop a way to update my smartphone.
I had only to create a profile for it.

Here is :

</Profile>
<Profile name="Huawei Ascend G6-L11" author="Humberto José">
<Files>
<File type="md5rsa" filetype="signature">MD5RSA.img</File>
<File type="crc" filetype="checksum">CRC.img</File>
<File type="oemsbl_verlist">OEMSBL_VERLIST.img</File>
<File type="oemsbl_ver" >OEMSBL_VER.img</File>
<File type="amss_ver">AMSS_VER.img</File>
<File type="amss_verlist">AMSS_VERLIST.img</File>
<File type="gpt">GPT.img</File>
<File type="rpm" partition="/dev/block/mmcblk0p4">RPM.img</File>
<File type="tz" partition="/dev/block/mmcblk0p5">TZ.img</File>
<File type="sbl1" partition="/dev/block/mmcblk0p1">SBL1.img</File>
<File type="modem" partition="/dev/block/mmcblk0p11">MODEM.img</File>
<File type="modemst1" partition="/dev/block/mmcblk0p9">MODEMST1.img</File>
<File type="modemst2" partition="/dev/block/mmcblk0p10">MODEMST2.img</File>
<File type="sdi" partition="/dev/block/mmcblk0p2" >SDI.img</File>
<File type="aboot" partition="/dev/block/mmcblk0p6">ABOOT.img</File>
<File type="recovery" partition="/dev/block/mmcblk0p19">RECOVERY.img</File>
<File type="system" partition="/dev/block/mmcblk0p23">SYSTEM.img</File>
<File type="boot" partition="/dev/block/mmcblk0p18">BOOT.img</File>
<File type="userdata" partition="/dev/block/mmcblk0p24">USERDATA.img</File>
<File type="cache" partition="/dev/block/mmcblk0p21">CACHE.img</File>
<File type="cust" partition="/dev/block/mmcblk0p20">CUST.img</File>
<File type="fsg" partition="/dev/block/mmcblk0p12">FSG.img</File>
<File type="persist" partition="/dev/block/mmcblk0p17">PERSIST.img</File>
</Files>

Hi only need to change a litle the script of flash zip.

And this is the final job:
http://forum.xda-developers.com/ascend-g6/general/g6-l11-b127-rom-how-to-upgrade-to-kit-t3079179

I tried to mount the Update.app but I could not , the only way was by zip .

Again , congratulations on the software.:good::)
 
  • Like
Reactions: worstenbrood

yfqm

New member
Apr 30, 2015
2
0
0
Non-negative number required.
Parameter name: count

ROM:
download-c.huawei.com/download/downloadCenter?downloadId=40981&version=73796&siteCode=cn
 

worstenbrood

Senior Member
May 14, 2008
1,063
1,401
0
Non-negative number required.
Parameter name: count

ROM:
download-c.huawei.com/download/downloadCenter?downloadId=40981&version=73796&siteCode=cn
Which version ?

Edit: No mirror ? Takes 5 days to download ... Same bug as posted before, already fixed in latest version. RTFM
 
Last edited:
  • Like
Reactions: yfqm

HamidZaeri

Senior Member
Sep 21, 2014
90
13
0
Hi
I found two ROM types for Huawei phones.
First with an UPDATE.APP file and other with some files containing system, boot, scatter,....

So what's the difference between them and how could i convert "one file" to "multi file"?
 

blueIBI

Senior Member
Jun 9, 2012
478
106
0
usually the update.app as a single file is a full firmware..

the one with many files is most of the time a small software update (contains only necessary files for the update routine and the files for update purpose)..

i'm not a dev so i don't know how to convert..
 

worstenbrood

Senior Member
May 14, 2008
1,063
1,401
0
Hi
I found two ROM types for Huawei phones.
First with an UPDATE.APP file and other with some files containing system, boot, scatter,....

So what's the difference between them and how could i convert "one file" to "multi file"?
update.app = official update, the one with the scatter is to use flash tool, there is some info on the forum here on how to convert
 
  • Like
Reactions: HamidZaeri