[TUT][for NOOB] from ftf to cwm flashable zip

pitchblack5691

Senior Member
Jan 12, 2012
437
447
0
chennai
Hi friends of XDA,

this tutorial is for friends who want to develope a rom from ftf file but are not able to decrypt the system.sin file successfully or having
problems with creating a simple zip file of the rom to flash with clockworkmod. i know there are a hand full of tutorials for this but this is my version.
very complete and extremely noob friendly (i think).
I have attached this guide as text file at the end of this post(suitable for offline reading)(use it with notepad ++ for
proper format)

#include
/*
* I am not responsible for bricked devices, dead SD cards or
* thermonuclear war.
* do some research if you have any concerns.
* YOU are choosing to make these modifications.
* yes, i copied this disclaimer from FXP because it is cool and i am lazy! :D
*/

okay now lets get started,
This tutorial assumes that you have a copy of the ftf file of the phone for which you want to create a flashable
rom (.zip) file.

steps for extracting the system.sin and decrypting it,

1. open the appropriate ftf file with any archive extractor application (7zip recommended).

2. you will find about 11 .sin files (number of files may vary).

3. we only want the system.sin file so extract it.

4. after extracting the system.sin file (for me after extraction it was around 341 mb)(it may vary for your phone).

5. there are two ways to decrypt the system.sin file

5.1 using a simple command line program (aiup.exe)(this method is simple and one step process).

5.2 using flashtool and unyaffs tool (claimed that this always works).


5.1 using a simple command line program (aiup.exe):

5.1.1 note: many of them are reporting that this method is not working with ics system.sin files but personally it always
worked for me with both gb and ics system.sin files.

5.1.2 create a folder and put just the system.sin file inside it. it is easier to use a simple path, for eg., create a folder
"c:\system" and put system.sin in there. in my case the path for the system.sin will be "c:\system\system.sin"

5.1.3 download the attached aiup.exe program (extract it from the attached zip) and place it with the already
extracted system.sin file (in my case i extracted as "c:\system\aiup.exe")

5.1.4 open command prompt by windows+r and typing cmd and press enter.

5.1.5 type the path for the aiup.exe in the cmd window and press enter (in my case i will type as "c:\system\aiup.exe")

5.1.6 you will get the aiup window now type "system.sin 4096 c:\system\system\"
(remember the aiup.exe and system.sin should be in the same folder)

5.1.7 the above step explained:
system.sin - we are typing system.sin in the aiup command window because we want to decrypt the system.sin, for
this to work the system.sin file and aiup.exe has to be present in the same folder. if system.sin file is
present somewhere else then in aiup.exe command window instead of typing system.sin you have to
replace it with the path to system.sin file.

4096 - it defines the page size of the system.sin file where it can be anything from 2048, 4096 or 8192
(if you get a page file parameter wrong error then try with another page file size as described above).

c:\system\system\ - it defines where the files has to be extracted it can be anywhere according to your
convinience.

if it is working then you will be having a blinking cursor in the aiup command window.
wait for some time as the system.sin file is being extracted. after extraction it will say done.

now go to the extracted folder which you defined above (in my case it is "c:\system\system\") and check whether
system.sin file is extracted to a seperate "system" folder.

5.1.8 if you find nothing there or a empty folder the try the step 5.1.6 with another page file size. if all page
file sizes fail with empty folder or with page file parameter error then you will have to use the alternative
method to decrypt and extract system.sin file (see 5.2)

5.1.9 upon succesful extraction of system.sin file using aiup.exe jump to step 6.


5.2 (alternative method) creating a system dump using flashtool and extracting the dump using unyaffs tool:


note: if aiup.exe method fails then we have to use flashtool and unyaffs to decrypt and extract the system.sin
file which is supossed to be always succesful unlike the aiup.exe method.




5.2.1 download latest flashtool from here and download unyaffs from here (if the links are broken search the forum)

5.2.2 now follow steps from 1 to 4 and and 5.1.2 (extract system.sin from ftf file)

5.2.3 open flashtool and click advanced>SIN editor.

5.2.4 sin editor window gets opened, type the path to the extracted system.sin fie in appropriate box
(in my case "C:\system\system.sin")

5.2.5 now click "dump data" in the sin editor window.

5.2.6 wait for it to dump the system.sin file data.

5.2.7 After completion of the process (check the flashtool log window) you will get two files created in the folder
(in my case "C:\system\") one will be "system.partinfo" and other will be "system.yaffs2"

5.2.8 now unyaffs tool has to be used on the system.yaffs2 file. download unyaffs tool and extract the files where the
system.yaffs2 file is present (in my case "c:\system\")

5.2.9 after extracting the two files in the unyaffs archive, the folder ("c:\system\") should contain the below files
cygwin1.dll
system.yaffs2
system.partinfo (not actually requiered)
unyaffs.exe

5.2.10 open command prompt (step 5.1.4)

5.2.11 type the following command "path_to_unyaffs_program\unyaffs.exe system.yaffs2"
(in my case "c:\system\unyaffs.exe system.yaffs2") and press enter.

5.2.12 wait for some time untill the process gets completed then you will find the extracted system files
in the appropriate folder (in my case "c:\system\")

5.2.13 now create two folders, parent and child (folder inside folder) . name the main folder (parent folder) as whatever you want
(in my case "working_folder") and the folder inside it (child folder) SHOULD BE COMPULSORY NAMED as "system" (all lower case letters).

5.2.14 now select all the extracted folders and files which were extracted by the unyaffs tool
(in mycase they are present in "c:\system\") and exclude "cygwin1.dll" "system.yaffs2"
"system.partinfo" "unyaffs.exe" (exclude all the files and folders which were not exracted by the unyaffs tool)
and move all the files and folders extracted by the unyaffs tool to the "system" folder created in step 5.2.13


Now as the system folder has been created from the system.sin let us shift our focus to "META-INF" folder.

6. here you will need to use a custom rom specific for your device (i recommend using the rom claimed to be popular for your
device).

7. after downloading the custom rom (.zip file) open the rom (.zip file) and extract ONLY the "META-INF" folder from the rom.

8. move the extracted "META-INF" folder to the "working_folder" created in step 5.2.13

9. now the "working_folder" should contain only the following two folders in it
system (collection of files and folders extracted by unyaffs tool as explained before)
META-INF (extracted from custom rom (step 6 - 8))



Creating flashable zip:


note: I strongly recommend going through the updater-script (using a text editor) (notepad++ recommended) present in
"META-INF\com\google\android" before creating the flashable zip because it may contain missing file permissions and/or
unwanted junk code for files which are not present in your rom because it was not created for your rom it was created
for the custom rom (remember extracting the META-INF folder from the custom rom?). the updater-script and the
update- binary has to be from the same rom as different updater-script and update-binary may throw errors in clockworkmod.

10. now select both the "system" and "META-INF" folder inside the "working_folder" and use 7zip (recommended) or winrar
to create a .zip archive and set the compression mode to STORE (very important).

11. The above created .zip can be readily used with clockworkmod for flashing the rom or with android kitchen by dsixda for
rooting the rom and modding etc.,

HAPPY FLASHING!

CREDITS:
authors of flashtool
authors of aiup.exe
authors of unyaffs tool and adridu52 for uploading it
dsixda for his awesome noob friendly kitchen!
FXP for the disclaimer! :)
(please pm me if i have missed you out!)

please post your comments and questions below..........

PRESS THANKS IF I HAVE HELPED YOU!
 

Attachments

Last edited:

whalesplaho

Senior Member
Feb 1, 2012
10,653
2,655
253
Treasure Island
Nice tut my friend... Tha second method works I can confirm dat!! When I use tha first method den, it didn't work so I search for another method & I got tha second method & it works fine!!!

To save stress of typing path, goto tha folder created where aIUP.exe is present, hold shift key & right on blank area, yhu will see command prompt, click on it to open command prompt having tha folder path already!!! Guys if dis method works for yhu dnt hesitate to press thanks for OP.....
 
  • Like
Reactions: pitchblack5691

pitchblack5691

Senior Member
Jan 12, 2012
437
447
0
chennai
Nice tut my friend... Tha second method works I can confirm dat!! When I use tha first method den, it didn't work so I search for another method & I got tha second method & it works fine!!!

To save stress of typing path, goto tha folder created where aIUP.exe is present, hold shift key & right on blank area, yhu will see command prompt, click on it to open command prompt having tha folder path already!!! Guys if dis method works for yhu dnt hesitate to press thanks for OP.....
thanks whalesplaho!
and about the right click cmd thing, it doesn't work with win xp so i mentioned a universal method to open the command prompt :)
 
  • Like
Reactions: sandy7

ManzzaShahi

Senior Member
Nov 21, 2012
177
103
0
Help

Thanks friend :)

hit thanks if I've helped!


sent from my smultron


I made a rom using system folder and it is flashable..
The problem is when i boot my rom doesn't detects my sim card...
When i see closely in my ftf i see boot folder and boot_delivery.xml
i suspect the reason is somewhere behind this...
Do you have any idea..
Its a new ftf for sony xperia M C1905


Here is a screenshot:
 

knutlegrand

Member
Nov 23, 2010
11
0
0
Brussels
Flashtool-No "Dump data" menu

Hello,

I'm using the latest Flashtool (0.9.18.5) and Sin Editor has no "Dump data" item.
The items are: "dump header", "Dump raw", "Extract data", "Advanced" (see attached picture)
I've tried all of them and was not able to generate any yaffs2 file.

Any idea ?

Thanks