FORUMS
Remove All Ads from XDA

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

1,035 posts
Thanks Meter: 1,315
 
By worstenbrood, Senior Member on 5th September 2013, 02:53 PM
Post Reply Email Thread
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

(All versions <= v0.9.9.3 need .Net Framework 3.5)
Latest version uses .Net Framework 4.6.1

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/show....php?t=1959445

Roadmap

- You tell me ...

Credits

ZeBadger (zebadger@hotmail.com) 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.

-v0.9.9.5 - 12/12/2016
- Upgraded to .Net Framework 4.6.1
- Fixed libmagic calling convention
- Huawei Mediapad M2 8.0 (M2-802L) profile by @beast.in.black
- Huawei Ascend P8 (GRA-L09) profile by @nexolight
- Huawei Mate S profile by @philipp900
- Huawei P8 lite profile by @linus2014
- Huawei Honor 5x (Kiwi-L2X) profile by @deadman96385

26122015

Created an opensource c# library to work with update.app files:
https://github.com/worstenbrood/HuaweiUpdateLibrary

Enjoy

Download

- v0.9.9.3: Setup - Zip
- v0.9.9.5: Zip

Mirror

Donate if you like my work.
Attached Thumbnails
Click image for larger version

Name:	extract.png
Views:	64310
Size:	41.7 KB
ID:	2628913   Click image for larger version

Name:	repack.png
Views:	60536
Size:	40.1 KB
ID:	2628914   Click image for larger version

Name:	settings.png
Views:	59626
Size:	18.8 KB
ID:	2628915  
Attached Files
File Type: zip Resources_EN_v2.zip - [Click for QR Code] (7.8 KB, 35684 views)
File Type: zip HuaweiUpdateExtractor_0.9.9.3.zip - [Click for QR Code] (1.26 MB, 147930 views)
File Type: zip HuaweiUpdateExtractor_0.9.9.3_Setup.zip - [Click for QR Code] (2.24 MB, 297926 views)
File Type: zip HuaweiUpdateExtractor_0.9.9.5.zip - [Click for QR Code] (1.26 MB, 118242 views)
The Following 205 Users Say Thank You to worstenbrood For This Useful Post: [ View ] Gift worstenbrood Ad-Free
 
 
5th September 2013, 10:03 PM |#2  
xan's Avatar
Retired Recognized Developer
Flag Crack-ow
Thanks Meter: 459
 
Donate to Me
More
Is it possible to repack update.app?

If so, could you implemet such feature?
The Following User Says Thank You to xan For This Useful Post: [ View ] Gift xan Ad-Free
5th September 2013, 10:07 PM |#3  
worstenbrood's Avatar
OP Senior Member
Thanks Meter: 1,315
 
Donate to Me
More
Quote:
Originally Posted by xan

Is it possible to repack update.app?

If so, could you implemet such feature?

Since i almost finished update zip creation (new version tomorrow), i have put it on the roadmap (already thought about it anyway )
The Following 5 Users Say Thank You to worstenbrood For This Useful Post: [ View ] Gift worstenbrood Ad-Free
6th September 2013, 12:54 AM |#4  
S34Qu4K3's Avatar
Senior Member
Thanks Meter: 96
 
Donate to Me
More
The problem is sign the app, not repack it

Sent from my HUAWEI P6-U06 using xda app-developers app
The Following User Says Thank You to S34Qu4K3 For This Useful Post: [ View ] Gift S34Qu4K3 Ad-Free
6th September 2013, 04:34 PM |#5  
worstenbrood's Avatar
OP Senior Member
Thanks Meter: 1,315
 
Donate to Me
More
Quote:
Originally Posted by S34Qu4K3

The problem is sign the app, not repack it

Sent from my HUAWEI P6-U06 using xda app-developers app

I dont think its signed, but it has a per file per block checksum which should be correct...
The Following User Says Thank You to worstenbrood For This Useful Post: [ View ] Gift worstenbrood Ad-Free
6th September 2013, 04:37 PM |#6  
S34Qu4K3's Avatar
Senior Member
Thanks Meter: 96
 
Donate to Me
More
Quote:
Originally Posted by worstenbrood

I dont think its signed, but it has a per file per block checksum which should be correct...

So, repack is useless, i tried it, you need to resign the app to make the new checksums match or it will give you an error when you flash it via default recovery.
Don't missunderstand me, is a great tool, and simplifies the unpack/repack for more unexperienced users, but without the sign, you can't flash it, that's what i say that is a bit useless (like the other scripts to unpack and repack)
6th September 2013, 04:41 PM |#7  
worstenbrood's Avatar
OP Senior Member
Thanks Meter: 1,315
 
Donate to Me
More
Quote:
Originally Posted by S34Qu4K3

So, repack is useless, i tried it, you need to resign the app to make the new checksums match or it will give you an error when you flash it via default recovery.
Don't missunderstand me, is a great tool, and simplifies the unpack/repack for more unexperienced users, but without the sign, you can't flash it, that's what i say that is a bit useless (like the other scripts to unpack and repack)

I'll investigate some more when i have the time. Also the signing part is why i actually made a function to create a flashable zip from it, this way you CAN flash it with a custom recovery (ok you need an unlocked bootloader, but why would'nt you do that anyway )
The Following User Says Thank You to worstenbrood For This Useful Post: [ View ] Gift worstenbrood Ad-Free
6th September 2013, 04:43 PM |#8  
S34Qu4K3's Avatar
Senior Member
Thanks Meter: 96
 
Donate to Me
More
Quote:
Originally Posted by worstenbrood

I'll investigate some more when i have the time. Also the signing part is why i actually made a function to create a flashable zip from it, this way you CAN flash it with a custom recovery (ok you need an unlocked bootloader, but why would'nt you do that anyway )

That's great
7th September 2013, 07:19 AM |#9  
Junior Member
Thanks Meter: 0
 
More
Quote:

Huawei Update Extractor

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

Please add Ascend P2

Thanks
9th September 2013, 01:35 PM |#10  
worstenbrood's Avatar
OP Senior Member
Thanks Meter: 1,315
 
Donate to Me
More
Quote:
Originally Posted by Carlos Varella

Please add Ascend P2

Thanks

S34Qu4K3 made a nice post on how to identify the partitions on your phone, after identifying them you have to map them to the files inside the update.app. Since i don't have access to an P2 i'm counting on you guys to complete the devices.xml file.

http://forum.xda-developers.com/show....php?t=2398404
The Following User Says Thank You to worstenbrood For This Useful Post: [ View ] Gift worstenbrood Ad-Free
9th September 2013, 07:35 PM |#11  
Member
Thanks Meter: 88
 
More
Excellent work Worstenbrood!

The tool is very good. I've tried with several Update.app and all OK.

It would be very interesting to get to repack the file Update.app because still do not have a custom recovery bootable. With the current cwm recovery can not extract files. Img a partition.

May you work on the file repack Update.app

The author Genokolar the custom recovery of Honor 2 miui port and a large majority of Huawei moblies have to pack and repack the file Update.app (over 4 months ago):

https://github.com/genokolar/unpacke...ter/unpack.php

That really says there that forked from tewilove / unpacker_huawei

Best Regards
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