[Galaxy S I9000 Android Development] coldflid:
Although it does seem rom cooking is difficult, in fact, it's easy to create a simple rom, with everything you want in it. There are still a few things missing which i'll add in the next few days

Here it goes....

Lets start with a bit of theory:

Needed programs:

Cygwin

7zip

Baksmali/smali

Apk manager

Text editor (notepad ++ for example)

SGS kitchen (https://github.com/rmgeren/Android-Kitchen/tree/galaxy_s)

Autosmali: http://xdaforums.com/showthread.php?t=970728

First of all, download the cwm stock deodexed rom from here http://xdaforums.com/showthread.php?t=948790

This will save a lot of time since you wont need to deodex, nor to extract /system from factoryfs.rfs

There are three folders inside:

META-INF - here is where the updater-script and updater-binary are located. This files are very important, because they are in charge of making the phone copy files from the zip, symlinking etc...

updates - here is were the kernel (zimage) and modem (modem.bin) are located

system - here are all libs, apks and things that will be copied to /system

Explanation of some directories in /system

System/app:

Here are all system apps

System/framework:

By modding files here, you'll be able to theme.

System/lib:

Here are libs needed for many things to work.

System/Build.prop:

Mod this line to change the name of the rom shown in about ro.build.display.id=

System/media -

Ringtones, bootanimations and othet things are stored here

System/etc:

Here are some files you might want to mod, like hosts ( for adfree), files for gps, and you can create an init.d folder for scripts that you want to get executed at startup (if kernel supports it)

Those are all the main directories you'll need to mod

Setting up the kitchen

Download cygwin and install it. Then download rmgeren's sgs kitchen. Create a folder called kitchen wherever you want and copy all files of rmgeren's github into it.

Create a folder inside kitchen called WORKING_111111_111111

Extract the zip of the stock deodexed rom to kitchen/WORKING_111111_111111/

In case you are having any problems with it, please do take a look at this post : http://xdaforums.com/showpost.php?p=5626300&postcount=3

Cleaning up system/app

I usually delete this apks:

Aldiko

Layar

Infoalarm

Dualclock

Protips

Samsung widgets

Minidiary

Writeandgo

Phonesetupwizard

Days

Pressreader

APK Modding:

For theming use method 1, for modding xml use method 2

Method 1 - right click on the apk and select 7zip and extract in /* (* is the name of the apk)

Open the folder, then res, then drawable-hdpi, and then mod the pngs you want.

Once yoy're finished, open the apk with 7zip and replace res/drawable-hdpi with the new one

Method 2-

Place the apk inThe apk modding folder (apk manager)

Open script, choose a project to work on (22 in windows), then decompile (for some apks you'll need dependencies).

Go to projects and the folder of your apk, then mod any xml you need to mod

Recompile it, it will ask if it is a system/app. Just answer Y or N.

You'll be asked another thing, type Y, press enter

Then it'll say something about a keep folder, go to the keep folder and look for the xmls you modded and delete them. In case you cant find one, delete the ones you can find and delete resources.arsc

Now press enter

You'll have an unsigned*.apk just rename it to the old ones name.

Theming

Same process that you use for apks, but this time you mod twframework-res.apk and framework-res.apk, you also mod systemui.apk for status bar

Some xml and pngs you might want to mod (framework-res.apk)

Xml:

Res/values/styles.xml

Res/values/bools.xml

Res/drawable/progress_horizontal (for colour of this bar View attachment 637481)

Png's (drawable-hdpi)

default_wallpaper.png - it's the default homescreen wallpaper

For overscroll glow:

overscroll_glow.png

overscroll_edge.png

For this (the bar you move) View attachment 637482:

seek_thumb_normal.png

seek_thumb_selected.png

seek_thumb_pressed.png

There are many more, but this are a few that are quite useful. You can easily find out about any, but in case you can't, you can just ask here and i'll be glad to answer :)

If you want to pre-install a theme, just copy the files of the theme into the correct places. For example system/framework to system/framework

For ctr off animation, decompile framework-res.apk, go to res/values/bools.xml

and in the line: config_animateScreenLights, turn it to false. If you want a more step by step guide, try this guide: http://xdaforums.com/showthread.php?t=977501

Using baksmali/smali

To mod classes.dex, i use baksmali/smali

I use ubuntu for this, but you can use another linux distro if you want.

This is what i do in Ubuntu:

Steps to follow:

1. Get the .jar you want to mod. framework.jar for example

2. Open it and get classes.dex

3. I usually copy it to the desktop

4. Open terminal

5. Type sudo su and then your password

6. then cd /home/Coldflid/Desktop ( type the location where you have copied it).

7. java -jar baksmali-1.2.6.jar classes.dex

8. Once you've modded it, type java -jar smali-1.2.6.jar (name of the output folder)

9. A new .dex file will be generated, just replace the old one with the new one

This is what i do in windows

1. Grab the jar you want to mod

2. Open it with 7zip and get classes.dex

3. Copy classes.dex to the same folder autosmali is in

4. Run baksmali.bat

5. Make the desired changes

6. Create AutoSmali_In folder and place the folder of the decompiled classes.dex inside

7. Run smali.bat

8. Rename AutoSmali_Out.dex to classes.dex and replace the old one in the .jar with the new one (using 7zip)

Finishing the rom

Now that you've finished with modding, theming etc... Now replace apks with new ones, add a few that you want, and copy libs if needed.

You can add ringtones from other phones to system/media, bootanimation of sgs ii etc...

Replace the kernel with the kernel you like the most, and the modem with the one that works best for you.

Now it's time to zipalign. Open cygwin, type cd c:/ * (where * is where you have the kitchen). Press enter

type ./menu, then press enter

Now you just select the zipalign option.

When it finished, select all three folders of the rom and right click, 7zip, add to file, zip, name it and then you're good to go.

Install it using cwm.

If you want to make it flashable through odin, follow darky's guide:

http://xdaforums.com/showthread.php?t=960946

If this was useful, hit the thanks button :)

Hope you like it.

If there's something wrong, tell me and i'll correct it. Also post if it was useful

Thanks

rmgeren for sgs android kitchen

[Ramad] for stock deodexed roms

creator of baksmali/smali and the creator of cygwin

Daneshm90 for apk manager

Thanks to dsixda for cygwin faq, and to gazza1988 for suggesting the idea of including it in this post

Thanks to Daneshm90 for the ctr off animation tutorial i've linked to in this thread

schmittx for autosmali: http://xdaforums.com/showthread.php?t=970728