• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[TUTORIAL] How to unpack Android ROMs on Windows

Search This thread

nikoan89

Senior Member
Sep 17, 2008
422
6
Bari
www.cellularmagazine.it
android_tutorial.jpg

As all of you well know, Android is an open source operating system and as such the development and modding are the bread and butter for devices with this OS.
In this thread I'll explain how to extract the firmware partition containing the operating system and programs with a Windows PC.
The purpose of this thread is to share knowledge, so feel free to help me to dump device such as Acer, Samsung and Sony Ericsson, expecially I need someone that help me with Acer's .bin
 
Last edited:
  • Like
Reactions: greaves

nikoan89

Senior Member
Sep 17, 2008
422
6
Bari
www.cellularmagazine.it
1. Unpack the system partition from an HTC ROM

What you need:


Download and install all the tools (Unyaffs it's a prompt executable, so it isn't installable)

Now you need an HTC ROM, download one at your pleasure from Conflipper's site: http://www.shipped-roms.com/shipped/

Once you have downloaded it, right click on the ROM executable and select Extract with UniExtract in the subfolder (v.fig1), select Isxunpack extraction and then clik on the OK button (v. fig2)

uniextract11.jpg
uniextract21.jpg


Now in the subfolder you have the various files which make up the executable, including data1.cab which is the file that we are more interested in (do not delete other files).
Open ZipScan, go to File -> Open Archive File... and browse until select the data1.cab. You should see something like this:

zipscan.jpg


Extract from the cab only the ROM.zip and open this file with any archives extraction software (eg WinRAR or the same ZipScan). Inside you have various .img files which make up the ROM, but for the purposes of this guide, we need only the system.img.

Copy in a blank folder this file, unyaffs.exe and cygwin1.dll (you'll find it in C:\Cygwin\Bin).

Now open Cygwin from Start -> All Programs to ensure that its functions are integrated to the Windows Prompt and close it.

Open the Windows Prompt (Start -> All Programs -> Accessories) and position yourself in the folder containing the files using the cd command or alternatively install this .reg which allow you to open the Windows Prompt in the chosen folder by command in the context menu (Right click on the folder -> Command Prompt Here).

Now the last thing that you have to do is to give the extraction command: unyaffs system.img

Et voilà, now you have the folders containing the extracted system.

Enjoy ;)
 
  • Like
Reactions: elfhater

ddotpatel

Senior Member
Mar 10, 2010
1,161
7
Leeds, UK
Someone once told me you can just run the .exe file, let it open, use windows to search for the rom.zip that would have been extracted into a temp folder, drag&drop to another location, then cancel the .exe again.

Haven't tried this myself though.

What else can you show us in windows?... Is it at all possible to extract ramdisc thingies from kernels so we can apply one custom kernel to other roms ourself?
... or should I bite the bullet and install/learn how to use ubuntu?
 

rpmccormick

Senior Member
Dec 1, 2008
744
105
I just used WinRAR to do everything that UniExtract and ZipScan can do.
...so basically you showed me that system.img can be unpacked using the linux command-line utility UnYaffs.exe, which can be run through CygWin. Thanks.

Why doesn't someone make a UnYaffs.exe for windows command line?

After I change things, how to I ReYaffs it to system.img? ...and when I re-zip it don't I have to sign it or something? If I modify an apk do I have to deODEX it first? Do I reODEX after?

I would love a quick tutorial on, say, how to change an icon for an app. Something that shows people who already know how to do this type of stuff a brief step-by-step guide to taking a [ROM], adding and deleting a few apks inside it, making a graphical change to an apk inside it (skinning), and then recooking those changes in to a new [ROM] to be shared with all.
 

NRGZ28

Retired Senior Mod & Senior RD
Apr 6, 2007
10,512
9,976
XDA-Developers
I just used WinRAR to do everything that UniExtract and ZipScan can do.
...so basically you showed me that system.img can be unpacked using the linux command-line utility UnYaffs.exe, which can be run through CygWin. Thanks.

Why doesn't someone make a UnYaffs.exe for windows command line?

After I change things, how to I ReYaffs it to system.img? ...and when I re-zip it don't I have to sign it or something? If I modify an apk do I have to deODEX it first? Do I reODEX after?

I would love a quick tutorial on, say, how to change an icon for an app. Something that shows people who already know how to do this type of stuff a brief step-by-step guide to taking a [ROM], adding and deleting a few apks inside it, making a graphical change to an apk inside it (skinning), and then recooking those changes in to a new [ROM] to be shared with all.

No ****... I was wondering why he's making it all so complicated with all these extra tools when I can click the file in Winrar (extract to...) and be done. All in ONE step for me.. LOL
 

rpmccormick

Senior Member
Dec 1, 2008
744
105
For me it was more than one step because using WinRAR on system.img didn't get all the files out. Using unyaffs did. But now I have a system.img from a new Android tablet and I can't get anything out of it other then the META-INF directory using WinRAR, Unyaffs, or UniExtract. Anyone have any clue how to get in to those?

...and I still want an easy tutorial on how to re-assemble a flashable system.img / update.zip once I change some stuff in there.
 

s73v3r

Member
Dec 1, 2009
27
2
I really hope one of those reserved spots is for the newer Samsung phones. What really cheeses me, though, is that I had that explained to me once, and I can't find it, and didn't write it down :(
 

fonix232

Senior Member
Jun 20, 2009
1,081
579
London
I've compiled both unyaffs.exe, mkyaffsimage and mkyaffs2image for cygwin, with the DLL you can use them on Windows too. Sadly, I don't know too much about C and C++, so I can't make it work, but maybe I will try to compile them for Windows, and with some bugfixing, MAYBE it will run.

Samsung did not use the usual yaffs image (for Galaxy S at least), but their own format, what can be easily extracted. I will post some more about it as soon as I get back to windows, recompile the executables and upload them.
 

max1919

Senior Member
Oct 25, 2010
171
14
Zagreb
I had some problems with unyaffs. This version posted on 1st page is bugy, if you have same problem try...

hmmm i have i more problem: To prevent spam to the forums, new users are not permitted to post outside links in their messages. :mad:

so sry guys i can't help you right now
 

gtrab

Senior Member
Aug 10, 2007
2,978
512
America
i just used winrar to do everything that uniextract and zipscan can do.
...so basically you showed me that system.img can be unpacked using the linux command-line utility unyaffs.exe, which can be run through cygwin. Thanks.

Why doesn't someone make a unyaffs.exe for windows command line?

After i change things, how to i reyaffs it to system.img? ...and when i re-zip it don't i have to sign it or something? If i modify an apk do i have to deodex it first? Do i reodex after?

I would love a quick tutorial on, say, how to change an icon for an app. Something that shows people who already know how to do this type of stuff a brief step-by-step guide to taking a [rom], adding and deleting a few apks inside it, making a graphical change to an apk inside it (skinning), and then recooking those changes in to a new [rom] to be shared with all.

+1000

:)

.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    android_tutorial.jpg

    As all of you well know, Android is an open source operating system and as such the development and modding are the bread and butter for devices with this OS.
    In this thread I'll explain how to extract the firmware partition containing the operating system and programs with a Windows PC.
    The purpose of this thread is to share knowledge, so feel free to help me to dump device such as Acer, Samsung and Sony Ericsson, expecially I need someone that help me with Acer's .bin
    1
    1. Unpack the system partition from an HTC ROM

    What you need:


    Download and install all the tools (Unyaffs it's a prompt executable, so it isn't installable)

    Now you need an HTC ROM, download one at your pleasure from Conflipper's site: http://www.shipped-roms.com/shipped/

    Once you have downloaded it, right click on the ROM executable and select Extract with UniExtract in the subfolder (v.fig1), select Isxunpack extraction and then clik on the OK button (v. fig2)

    uniextract11.jpg
    uniextract21.jpg


    Now in the subfolder you have the various files which make up the executable, including data1.cab which is the file that we are more interested in (do not delete other files).
    Open ZipScan, go to File -> Open Archive File... and browse until select the data1.cab. You should see something like this:

    zipscan.jpg


    Extract from the cab only the ROM.zip and open this file with any archives extraction software (eg WinRAR or the same ZipScan). Inside you have various .img files which make up the ROM, but for the purposes of this guide, we need only the system.img.

    Copy in a blank folder this file, unyaffs.exe and cygwin1.dll (you'll find it in C:\Cygwin\Bin).

    Now open Cygwin from Start -> All Programs to ensure that its functions are integrated to the Windows Prompt and close it.

    Open the Windows Prompt (Start -> All Programs -> Accessories) and position yourself in the folder containing the files using the cd command or alternatively install this .reg which allow you to open the Windows Prompt in the chosen folder by command in the context menu (Right click on the folder -> Command Prompt Here).

    Now the last thing that you have to do is to give the extraction command: unyaffs system.img

    Et voilà, now you have the folders containing the extracted system.

    Enjoy ;)
    1
    i wana extract boot.img , but i have some error

    CAN'T UNZIP A BOOT.IMG!! Either unyaffs or "mount -o loop boot.img /mnt/*folder*"

    To unmount, "umount /mnt/*folder*"

    Obviously not windows commands :p