Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,736,443 Members 50,129 Now Online
XDA Developers Android and Mobile Development Forum

[TOOL] Huawei Update Extractor [UPDATED: v0.9.8.0]

Tip us?
 
worstenbrood
Old
(Last edited by worstenbrood; 28th June 2014 at 09:22 PM.)
#1  
worstenbrood's Avatar
Senior Member - OP
Thanks Meter 191
Posts: 557
Join Date: May 2008

 
DONATE TO ME
Post [TOOL] Huawei Update Extractor [UPDATED: v0.9.8.0]

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

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)

Download

- v0.9.8.0: Setup - Zip

Mirror

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

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

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

Name:	settings.png
Views:	1281
Size:	18.8 KB
ID:	2628915  
Attached Files
File Type: zip HuaweiUpdateExtractor_0.9.7.9.zip - [Click for QR Code] (1.26 MB, 3440 views)
File Type: zip HuaweiUpdateExtractor_0.9.7.9_Setup.zip - [Click for QR Code] (2.24 MB, 5134 views)
File Type: zip HuaweiUpdateExtractor_0.9.8.0.zip - [Click for QR Code] (1.26 MB, 705 views)
File Type: zip HuaweiUpdateExtractor_0.9.8.0_Setup.zip - [Click for QR Code] (2.24 MB, 1784 views)
The Following 57 Users Say Thank You to worstenbrood For This Useful Post: [ Click to Expand ]
 
xan
Old
#2  
xan's Avatar
Recognized Developer
Thanks Meter 455
Posts: 1,399
Join Date: May 2006
Location: Crack-ow

 
DONATE TO ME
Is it possible to repack update.app?

If so, could you implemet such feature?
Feeling like translating something? here you go
Voltage Control Lite/Extreme 4.9.8 *Siyah support + Profiles + Widget + CPU history*: -> Take control of your OC/UV for Galaxy S OC kernels. Android Market / YAAM
ExTweaks / ExTweaks Plus 0.20 *Universal Tweaks Interface frontend for Siyah kernel*

14apr: [Froyo]Insane OC/UV kernel K13E
What is your OC result?
 
worstenbrood
Old
#3  
worstenbrood's Avatar
Senior Member - OP
Thanks Meter 191
Posts: 557
Join Date: May 2008

 
DONATE TO ME
Quote:
Originally Posted by xan View Post
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 4 Users Say Thank You to worstenbrood For This Useful Post: [ Click to Expand ]
 
S34Qu4K3
Old
#4  
S34Qu4K3's Avatar
Senior Member
Thanks Meter 89
Posts: 262
Join Date: Jun 2012

 
DONATE TO ME
The problem is sign the app, not repack it

Sent from my HUAWEI P6-U06 using xda app-developers app
 
worstenbrood
Old
#5  
worstenbrood's Avatar
Senior Member - OP
Thanks Meter 191
Posts: 557
Join Date: May 2008

 
DONATE TO ME
Quote:
Originally Posted by S34Qu4K3 View Post
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: [ Click to Expand ]
 
S34Qu4K3
Old
#6  
S34Qu4K3's Avatar
Senior Member
Thanks Meter 89
Posts: 262
Join Date: Jun 2012

 
DONATE TO ME
Quote:
Originally Posted by worstenbrood View Post
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)
 
worstenbrood
Old
#7  
worstenbrood's Avatar
Senior Member - OP
Thanks Meter 191
Posts: 557
Join Date: May 2008

 
DONATE TO ME
Quote:
Originally Posted by S34Qu4K3 View Post
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: [ Click to Expand ]
 
S34Qu4K3
Old
#8  
S34Qu4K3's Avatar
Senior Member
Thanks Meter 89
Posts: 262
Join Date: Jun 2012

 
DONATE TO ME
Quote:
Originally Posted by worstenbrood View Post
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
 
Carlos Varella
Old
#9  
Junior Member
Thanks Meter 0
Posts: 2
Join Date: May 2010
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
 
worstenbrood
Old
#10  
worstenbrood's Avatar
Senior Member - OP
Thanks Meter 191
Posts: 557
Join Date: May 2008

 
DONATE TO ME
Quote:
Originally Posted by Carlos Varella View Post
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: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes