[How To] Converting/Creating CWM2 & CWM3 Files Step by Step

Paul627g

AC Moderator All-Star
Moderator
Nov 25, 2010
15,963
2,752
0
Visit site
[note]
Here is a bit more help to you future devs or others that like to do things themselves. Making your own flashable zip files or converting an existing flashable from CWM2.x.x.x to CWM3.x.x.x or the opposite. I also want to thank our AC Adviser, Droidxcon from the Samsung Fascinate section for looking over this step by step tutorial. He is also well known around here lately in the Epic section for helping out many of our visitors in a jam with Odin.

Ragnarokx and I always get questions asking "Hey can you convert something from CWM2 to CWM3 or vise-versa..." or " I need to flash something from this ROM into that ROM can you make this?" Ragnarokx and I don't mind doing this, its what we live for around here and is the easiest of our daily tasks or requests. So for those of you who want to understand and learn the process of what it is we do, you can take a look below and follow the step by step instructions.

*** NOTE: I WILL NOT BE HELD RESPONSIBLE FOR ANY MISTAKES YOU MAKE ATTEMPTING THIS PROCESS ***
[/note][info]
Download the following two zip files.

Blank Flashable CWM2 (This is used in CWM2.x.x.x format or RFS filesystem with Amend scripting)
Blank Flashable CWM3 (This is used in CWM3.x.x.x format or EXT4 filesystem with Edify scripting)

A brief rundown without getting technical, RFS filesystem with Amend scripting is what your Samsung Epic 4g device comes formatted to run. Its gets the job done but its not without its faults. A few months ago, shortly after Froyo DK28 was "leaked" the dev's over at XDA came up with a more efficient and reliable file system and scripting that also provided a performance boost, for our purposes CWM3.x.x.x, EXT4 file system with Edify scripting was brought into use on the Samsung Epic 4g and incorporated in use on all the newest ROMs at the time.

Now those two files are "Blank" flashable zip files that we use to flash themes\apps\add ons in CWM. You would need the correct corresponding zip file to work with your version of CWM, and they work for DK28 Froyo or EB13 Froyo so there's no conflicts to worry about. Save these, they will be used later in the example. You may also want to make copies of these files to have as "blanks" to use again and again.

Here are the links to download either 7zip or WinRAR, these are required tools.

7zip
WinRAR

To start I will be using 7zip throughout this process, WinRAR is very similar in looks and operation.

Now in the screenshot below we will be opening and using the file "GTalk Restore_CWM3006" as our example. If you right click on the file, you will see the following below and it shows the proper path to "opening" the archive. DO NOT EXTRACT THE FILE.

Flashable10pic.JPG



Once you click on "Open archive" you will see the following screen shot below. The directory or folder your interested in is "system". Go ahead and open that directory. Note: The "META-INF" folder should be left alone, this is what contains the scripting and other instructions needed to tell CWM what to do with the file.

Flashable1pic.JPG


Now in the screen shot below you will see the folder called "app". Go ahead and open that directory.

Flashable2pic.JPG


Now in the screen shot below you see "Talk.apk", that is your "Google GTalk" file. That file is what will install Google GTalk to your device when flashed. Remember this example file we are looking in is a CWM3.x.x.x version. Leave this window below open or minimize it as you will need to refer back to it in a few more steps...

Flashable3pic.JPG



Now say you want to take that file or another file (example Email.apk) and be able to flash it on your device that is running CWM2.x.x.x setup.

You would find your "Blank Flashable CWM2.zip" file that your downloaded in the beginning and "Open archive" just as we did before when we opened the "GTalk Restore_CWM3006" file above. The screen shot below is the first directory you will see when you open "Blank Flashable CWM2.zip". Next go ahead and open the "system" folder.

Flashable4pic.JPG


The screenshot below shows the "/system/" directory inside the "Blank Flashable CWM2.zip" file. You will notice 4 main folders I placed in there that are most commonly dealt with. The directory folder paths or tree needs to remain as I provided so the file will flash to the correct locations, you can leave the unused folders alone. In you case for this example you want the "app" folder, go ahead and open it.

Flashable5pic.JPG


The screenshot below is the "/system/app/" folder inside the "Blank Flashable CWM2.zip" currently it is empty. This is where you will be placing the "Talk.apk" from the other zip file you have open in a separate 7zip/WinRAR window.

Flashable6pic.JPG



Okay now the screenshot below is an example of what you should look like with both zip file windows opened. The left is the "Restore GTalk_CWM3006" file opened to the "/system/app/" directory showing the file "Talk.apk". The window on the right is the "Blank Flashable CWM2" file opened to the "/system/app/" directory where you will be placing the "Talk.apk".

This is how you normally would be doing this because you can't just copy and paste from one window to another, you have to "drag and drop" the file from one window into the other. There are other ways of performing this but this is the most simple and efficient way of doing this.

Go ahead and click on the "Talk.apk" in the left window and drag and drop it to the right window.


Flashable7pic.JPG


You will be asked as you see in the screen shot below if you want to copy the file to archive, blah blah.. Select Yes to this question.

Flashable8pic.JPG
Flashable8pic.JPG


The screenshot below shows you have successfully "dragged and dropped" the "Talk.apk" file from one file/window to the other.
Flashable9pic.JPG

Flashable9pic.JPG



You have successfully transfered Google GTalk (Talk.apk) from a CWM3 flashable to a CWM2 flashable zip file. You are done with the conversion process. You can now close the file(s)/windows(s). You can rename the "Blank Flashable CWM2" file to suit your needs, usually a easily descriptive file name if your sharing it with others. Next you can take this file and place it on your sdcard and boot into CWM and flash away!


You can also use the same step by step process to convert a theme or add on by opening a flashable zip file you want to convert, look and see what folders are in use inside the "/system/" directory and then drag and drop those folders & files to the same location on the CWM flashable version you wish to convert it to. Our example above we transfered from a CWM3.x.x.x version to a CWM2.x.x.x. The same can be done going from CWM2.x.x.x to a CWM3.x.x.x. This is how we have converted many themes and add ons for visitors in the past that found an old theme from an old CWM 2.x.x.x/RFS system ROM and wanted to use it on a new CWM3.x.x.x/EXT4 version ROM.

Additional Notes:

You may have noticed inside the "/system/" folder of both Blank Flashable CWM2/CWM3 files additional folders. This is a bit more advanced, these start to get into more delicate and easily damaged areas of your devices file system. At this moment I will briefly touch on what they are.

/system/app This is where you place all your applications, Email.apk, Talk.apk, Phone.apk, Vending.apk

/system/framework This is the most sensitive area. It holds the files like "framework-res.apk" and "twframework.apk" which are basically the template for your OS. This is the most commonly "themed" two files that devs or themers modify to change things like the status bar colors, text colors, battery mods, etc... There are other files in this folder which should be left alone unless you fully understand what they are and what your doing.

/system/fonts Self explanatory, this is your font folder. If you want to change fonts, flash new fonts, etc. they would be placed inside this folder. Again, be careful because a corrupt font or a font that isn't supported can crash your device or start a flood of FC's.

/system/media This folder is where you will find things like ringers, ringtones, your bootup animation and other media related system files. They are in separate folders marked appropriately inside the /media/ folder.


META-INF folder, I mentioned this before. In this location is a series of other folders, one which contains a certain named file depending on the version of CWM. updater-script (CWM3.x.x.x) and update-script (CWM2.x.x.x). These files are the script files which gives instructions to CWM on what to do with the flashable file you are creating. It may also contain setup information on flashing the ROM, modem, kernel, file permissions and many other important commands again depending on the type of flashable. I would leave these scripts and the META-INF folder alone. They can be modified to do certain things but until you understand how to write the scripts properly you can really mess things up bad or simply the flash just won't install and you will get a "failed installation error". This I can go over another time, another day...

That is about all I will go into at this point concerning the above locations. I put them there to show examples of what you may see inside zips as you open them depending on what type of flashable file your dealing with. A better way to get a idea of what I'm talking about for files located inside these folders is to take a ROM that you have downloaded and open the ROM file up and look around inside those folders and you can see and understand more of what I'm talking about. Alot of things in Android files are easy to understand because they all use a basic descriptive file name/pattern for all the system files. So the file name most of the time tells you what it is and gives you a good idea of what it does without going into the more advanced, technical areas of the file system where even I get lost at times.. LOL.[/info]
 
Last edited:

robomav

Well-known member
Feb 8, 2011
204
13
0
Visit site
sticky agreed. i will play around with this over the weekend.

paul would it be possible to bring the stock sms app from the new gingerbread alpha via this method to my ace?

thank you!
 

Paul627g

AC Moderator All-Star
Moderator
Nov 25, 2010
15,963
2,752
0
Visit site
sticky agreed. i will play around with this over the weekend.

paul would it be possible to bring the stock sms app from the new gingerbread alpha via this method to my ace?

thank you!

Creating the flashable, is not a problem.. I'm not positive if the sms app will work, it should but no promises.
 

robomav

Well-known member
Feb 8, 2011
204
13
0
Visit site
would i follow these same steps to "copy" over the sms apk to your blank cwm file and just flash?

or would it be better in theory to bring the sms apk into your ace zip and reflash the whole rom?

i probably wont try anything until the weekend when have some free time

but thank you in advance for your advice
 

Paul627g

AC Moderator All-Star
Moderator
Nov 25, 2010
15,963
2,752
0
Visit site
would i follow these same steps to "copy" over the sms apk to your blank cwm file and just flash?

or would it be better in theory to bring the sms apk into your ace zip and reflash the whole rom?

i probably wont try anything until the weekend when have some free time

but thank you in advance for your advice

You can do it either way...

One other habit I always make is if I'm changing something from "stock" I always create a "stock" version of the thing I'm changing so if something goes wrong I have a restore/revert flashable.

That is why I always keep a copy of the deodexed stock version of Froyo EB13 handy. I can always pull the stock apps right from there to create restore/revert flashables for myself or others.

As you could imagine my hard drive is loaded with flashables... Keeping them organized is the hard part... I suggest making a setup like this on your hard drive.

Restores & Converts Flashables

Then inside that folder I have 2 more folders.

Flashables CWM2

Flashables CWM3

Then in each one I have my "blanks" ready to go so I can create zips very fast without having to search around or delete stuff out of an existing flashable file to create a new one...


This is just my method of doing things but it keeps things fairly organized that way...
 
  • Like
Reactions: robomav

robomav

Well-known member
Feb 8, 2011
204
13
0
Visit site
with doing this, i think it would be best to organize my phone files because they will pile up quickly.

i think creating a flashable stock sms one as well is a great idea in case i mess something up. i probably wont try until saturday but i will let you know how it goes.

do you know the name of the apk for messaging?
 

makeotapackage-j4

Well-known member
Jan 22, 2011
51
31
0
Visit site
Paul,
This is a great post. Thank you so much for taking the time to do this! I've gone through SO many stages of learning over the past 3(+/-) months, and I've done all of it, ultimately with the goal of development in mind, from the very beginning.
Your & Ragnarokx's posts have had me learning from the beginning. When I decided to learn about hacking/development, I gave up my BB Bold,along with the Crackberry-Nation ;) and I moved on to a phone I could experiment with, and in turn, learn from. All the how-to's have brought me to where I am now, and I'm quite confident from all I've learned so quickly. The first night of rooting was the hardest. Then I moved to ext4 conversions, then flashing custom ROMs, and all the little details you learn in between all that trial+error. I told myself that if I could just learn how to root,convert and flash etc.. then I would move on and learn to grasp the bigger picture.
I've learned those things, and much more- and now I'm ready to challenge myself again. I don't have many posts on here..and the reason for that is the same reason I know as much as I do now- I always observe, try-fail-try again, and if I still don't get it, I keep searching. I've probably only asked one question over all this tedious exploration..and if recall correctly, I believe I found my answer right after, and never went back to see if anyone had responded to me :)
So here's to new mistakes, and to the lessons that come out of them. I'm gonna start on this how-to tonight. I already dropped my political science major two years into it, and I'm enrolled in my college's computer program. This guide you made looks incredible,and what makes it so appreciated, is the fact that you get nothing out of it- yet you still do it..just to be helpful! So thanks again for the time you dedicate-It truly does make a difference-at least in my life. Because from what I've learned with your help, it's given me the confidence I desperately needed to completely change direction in my career path. So Paul/Ragnarokx, I raise my glass to you both-Cheers!
*Oh and Paul-Don't bull****. Just admit it: Ace ROM-Gingerbread Edition is totally on your radar,and I know I speak for everyone when I say that, when you're ready to do it, we're all looking forward to it! :p hahaha
 
  • Like
Reactions: Paul627g

Paul627g

AC Moderator All-Star
Moderator
Nov 25, 2010
15,963
2,752
0
Visit site
with doing this, i think it would be best to organize my phone files because they will pile up quickly.

i think creating a flashable stock sms one as well is a great idea in case i mess something up. i probably wont try until saturday but i will let you know how it goes.

do you know the name of the apk for messaging?

Mms.apk
 
  • Like
Reactions: robomav

robomav

Well-known member
Feb 8, 2011
204
13
0
Visit site
update: the cm7 sms app did not work. i was able to successfully flash back the stock froyo app so i dont think it was the way i did it that caused it to fail.

paul - with your rom experience do you know of any other eb13 froyo roms that have a modified version of the sms app?

again thanks in advance for your help
 

Paul627g

AC Moderator All-Star
Moderator
Nov 25, 2010
15,963
2,752
0
Visit site
Check the XDA themes section. There is a thread there that's only couple days old that has a few themed messaging apps to flash.
 

EpicTornado4g

Member
Feb 26, 2011
7
0
0
Visit site
Thanks for the great post Paul. I've been searching for this info for awhile now. I've loaded your stockeb13 bat mod you created and it works great on my deodexedeb13 stock rom. I found some other battery icons over on xda. Can I use other icons and drag them into the zip you created with 7zip using the same drag ad drop in this thread? I'm assuming it can be done as long as the filenames are the same as the ones being replaced and the pixel sizes are the same. Or is that a whole new can of worms? I understand if adding completely new images I have to modify the xmls and do some weird compiling and stuff.
 

Paul627g

AC Moderator All-Star
Moderator
Nov 25, 2010
15,963
2,752
0
Visit site
Thanks for the great post Paul. I've been searching for this info for awhile now. I've loaded your stockeb13 bat mod you created and it works great on my deodexedeb13 stock rom. I found some other battery icons over on xda. Can I use other icons and drag them into the zip you created with 7zip using the same drag ad drop in this thread? I'm assuming it can be done as long as the filenames are the same as the ones being replaced and the pixel sizes are the same. Or is that a whole new can of worms? I understand if adding completely new images I have to modify the xmls and do some weird compiling and stuff.

Replacing icons/graphics or ".pngs" can be done by taking the .apk file and opening archive in 7zip/WinRAR and simply replacing the .pngs you want inside the file. Drag and drop.

A little heads up on changing icons/graphics etc.. They will be located in the following directories/folders in any ".apk".

Example file we will use Talk.apk

Open to "/res/drawable/" there will also be the following directories or more.

"drawable-hdpi"
"drawable-mdpi"

Look for any "drawable-xxxxxx" combinations.. Those will hold all your .png files.

Everything else will hold XML's and other script files which you can't change without de compiling and re compiling the .apk's and don't pertain to changing pngs.

Once you have changed what it is you want then just use my step by step and place the .apk in the proper place in the flashable zip and flash it.

A little word of advice, be prepared for the occasional bad flash or FC's being caused by a .png file you change not working well with other files. It does happen.. Icons are fairly straight forward and don't cause troubles but the deeper you go into changing things it can produce problems eventually.

Before I forget your original question. If I understand your intentions, you are interested in using different battery icons in the battery mod I used? If so be prepared there are 125 pngs total used in the 1% battery mods.. LOL! If you weren't talking about doing this then disregard.
 

EpicTornado4g

Member
Feb 26, 2011
7
0
0
Visit site
Before I forget your original question. If I understand your intentions, you are interested in using different battery icons in the battery mod I used? If so be prepared there are 125 pngs total used in the 1% battery mods.. LOL! If you weren't talking about doing this then disregard.

Yes. Thats what i was thinking about trying. Here's the link with all the icons I was looking at: [MOD][3rd-Mar] ★ Super Circle Battery with % ★ Version A-P & Z (Custom) ★ - xda-developers. They have a ton of them, all 1%. It looks pretty simple to add them to the battery mod. The directions on the thread said you must decompile then recompile them in the thread, but most of the icons are named the same as in the battery mod. They have them all in a zip and my intention was to unzip the icons and drag and drop them into the framework-res.apk\res\drawable-hdpi through 7zip. They also have a kitchen for it to upload your own framework-res, but i figured the above route would work as well. Thanks again for your great insight paul!!
 

Paul627g

AC Moderator All-Star
Moderator
Nov 25, 2010
15,963
2,752
0
Visit site
Yes. Thats what i was thinking about trying. Here's the link with all the icons I was looking at: [MOD][3rd-Mar] ★ Super Circle Battery with % ★ Version A-P & Z (Custom) ★ - xda-developers. They have a ton of them, all 1%. It looks pretty simple to add them to the battery mod. The directions on the thread said you must decompile then recompile them in the thread, but most of the icons are named the same as in the battery mod. They have them all in a zip and my intention was to unzip the icons and drag and drop them into the framework-res.apk\res\drawable-hdpi through 7zip. They also have a kitchen for it to upload your own framework-res, but i figured the above route would work as well. Thanks again for your great insight paul!!
Yes the battery mods I would stay away from with changing pngs. Battery mods are tricky and do involve de compiling and re compiling because you have to add in 3 XML files which control the 1% readings, since stock is only in 10% increments. Your welcome to try and follow their directions, I personally know how to do it but its something at this moment I don't have time to write up a tutorial on here. But I may be able to help with a question or two if you decide to take the challenge. First the program you would need is APK Manager 4.9. Google it, you can find it on XDA.

Note: I am not positive if the mod your looking at will work on the Epic since your in the HTC thread. Graphics yes, the XML's could be different for the HTC over the Epic.
 

EpicTornado4g

Member
Feb 26, 2011
7
0
0
Visit site
Thanks Paul. Thats what i was worried about with just dragging and dropping those pngs without checking the xml code. I'll try the challenge and drop ya a line if I have problems. Thanks again!! Much appreciated.
 

traumahawk

Well-known member
Jan 12, 2011
303
19
0
Visit site
so i figured out how to do this. THANK YOU for the guide. only catch is now im having a new problem. i want THIS keyboard to work on my Epic. it was designed for the Vibrant. i want the orange one. i got it to flash. but now i get an error saying swipe wont function properly on my device. attaching pic. any way to make it work??? please?

snap20110317192415.png

By traumahawk64 at 2011-03-17
 

Trending Posts

Forum statistics

Threads
943,177
Messages
6,917,647
Members
3,158,862
Latest member
danishpeer