1. Download our Official Android App: Forums for Android!

Root [How To] unyaffs for decompiling nandroid (and other) .img files

Discussion in 'Android Devices' started by AndroidKris, Jul 20, 2011.

  1. AndroidKris

    AndroidKris Android Enthusiast
    Thread Starter
    Rank:
    None
    Points:
    53
    Posts:
    385
    Joined:
    Dec 20, 2010

    Dec 20, 2010
    385
    75
    53
    I'm posting this here because I don't know where else to post it. I've googled all over the interwebz and found not one single "guide" to unyaffs. It's nothing fancy, just bare bones, step by step instructions based on my experience. Please feel free to correct or add to my guide and I will edit this post with the info.

    These directions are only for "unyaffs" since I have had no reason to use "yaffs". If anyone has info on "yaffs" post it here and I'll check into it...possibly add it to this guide.

    One more thing before I start. These instructions are for linux users, since I did it running Xubuntu 10.10, and I have no clue how to make it work for windows (I haven't touched windows in quite a while). If someone has useful input for windows instructions, post away.

    Here goes.
    1) go to unyaffs - unyaffs is a program to extract files from a yaffs image - Google Project Hosting
    2) click the "download" link at the top
    3) download all three "unyaffs", "unyaffs.c", and "unyaffs.h"
    4) I put them in my /android-sdk-linux/tools directory, but you can put them wherever you want.
    5)now open a terminal and cd to your directory containing the three "unyaffs" files
    6) type "gcc -o unyaffs unyaffs.c"
    7)once it's done doing it's thing, type "sudo chmod +x /complete/directory/path/to/unyaffs"
    Now comes the tricky part
    8)In terminal type "cd /complete/drectory/path/to/unyaffs"
    9)Minimize your terminal and open your preferred file manager and browse to where your "unyaffs" file is, then copy and paste it in the same directory as your nandroid .img files
    (Now "unyaffs" and your .img files are located in the same folder)
    10)bring up the terminal again and (since you've already cd'd to the correct directory) type "./unyaffs system.img" (or data.img, or cache.img)


    Notes:
    1) this will decompile everything within the .img file directly to the same directory that unyaffs and the .img file are located.
    2) This will only work on system.img, data.img, and cache.img. It will tell you "broken image file" if you try to use it on a recovery.img, and I have no idea what it will do to a boot.img.
    3) You MUST make sure that your .img file and a copy of the unyaffs file are in the EXACT SAME directory.

    Thank you for reading. Your feedback is most welcome and greatly appreciated. As I have said above, feel free to post additions, corrections, or alternatives. Hell, you can even let me know if I spelled something incorrectly or wrote a sentence grammatically incorrect.

    Have a nice day.​
     

    Advertisement

  2. savoxis

    savoxis Android Expert
    Rank:
    None
    Points:
    163
    Posts:
    812
    Joined:
    Aug 10, 2010

    Aug 10, 2010
    812
    708
    163
    ODOT Field Services Tech
    Pacific NW
    Awesome guide, I feel this deserves a bump.

    I have been using unyaffs for a few months now and it makes things SO much easier.


    Here is another little gem to add:

    After you compile unyaffs with gcc you can copy it to your bin directory like so
    Code (Text):
    1. [FONT="Fixedsys"][SIZE="4"][COLOR="Red"]sudo cp unyaffs /usr/bin/ && sudo chmod 777 /usr/bin/unyaffs[/COLOR][/SIZE][/FONT]
    If for some reason your version of linux doesn't have a usr/bin you can cp it to /bin/ just change the command accordingly


    After doing this you can run unyaffs from ANYWHERE in the terminal without typing the whole path, I do this all the time with little scripts I write for signing apks, building, etc I put them in a folder than symlink them to /usr/bin/ makes life much easier
     
  3. ninadchaudhari

    ninadchaudhari What's up !
    Rank:
    None
    Points:
    233
    Posts:
    1,800
    Joined:
    Nov 17, 2011

    Nov 17, 2011
    1,800
    526
    233
    Male
    F.Y B.E
    127.0.0.1
    Guys anyway to recompile it ?
     
  4. getitnowmarketing

    getitnowmarketing Android Enthusiast
    Rank:
    None
    Points:
    138
    Posts:
    477
    Joined:
    Apr 27, 2010

    Apr 27, 2010
    477
    788
    138
Tags:

Share This Page

Loading...