[Samsung Galaxy S II Plus] panda00:
GALAXY S II PLUS ROM COOKING

​

This tutorial should allow you to attain a base ROM so you can work on making a custom ROM for the our device.

PREREQUISITES:

GUIDE:

A) Getting yourself ready

There are two ways you can set up your working environment. If you use Windows, you must first install Cygwin, if you use Linux then you can use kitchen directly without cygwin. You can also install linux alongside Windows using this guide.

The windows way

Download Cygwin set up from here.

Download Cygwin packages from here.

Start Cygwin set up, press "Next" then choose "Install from Local Directory"

Next you will be asked where you want to install cygwin, I prefer to install it in the root of my drive, in a directory C:\Cygwin

Next, minimize the Cygwin installation and extract the Cygwin packages you downloaded in step 2 in a suitable folder.

Go back to the Cygwin installation and choose the directory which you extracted the Cygwin packages in step 5, so the blank will contain something like "C:\Users\Laptop\Desktop\cygwin_packages\http%3a%2f%2fmirror.its.uidaho.edu%2fpub%2fcygwin%2f".

Proceed with the installation, when you see a list that says select packages... Click on the circle arrows beside "All", you should then see all the elements of the list have "Install" written aside of them.

Press next and next until the installation starts.

When the installation finishes, close the installation window and go to the Cygwin directory you chose in step 4.

Open up Cygwin to allow it to set up the categories.

Download kitchen from here.

Extract it to /cygwin/home/user

"user" here can be anything according to your PC/Laptop username.

Rename the folder "Android-kitchen..." to "kitchen".

The linux way

Download kitchen from here.

Extract it to any directory.

Open up Linux Terminal and navigate to the directory in which you extracted kitchen using cd directory command.

Continue with the tutorial in section B.

B) Extracting a base ROM to work on

Now, I am going to assume you set up cygwin and kitchen successfully... Now you need to add device compatibility..

Download this file(for I9105P) or this file(I9105 - Thanks yashuperia for testing it) credits to k2wl for the compatibility file. Copy this file to this directory ( .\home\user\kitchen\tools\edify_defs ) in the cygwin folder. Now I9105/P is officially compatible with kitchen... woohoo :victory:.

Now take your device, boot to CWM (I suppose you know how :eek:) and make a backup.

Reboot your device.

Now plugin your device to your computer and open Clockworkmod folder in external sd card. You will find a system.ext4.tar.a folder of size about 700mb ( I think... anyway it's a big file ). Take that file and place it in your desktop or wherever you want.

Rename it to system.ext4.tar (remove .a)

Move it to the this directory ( .\home\user\kitchen\original_update ) in the cygwin folder. Then go to cygwin and enter kitchen mode from cygwin using the following.

Kitchen will load up. When it's fully loaded up, press 1 and choose system.ext4.tar option...

Congratulations you have a base ROM.

C) Work on the ROM

It is not possible for me to show you every possible mod and change you can do to a ROM, but here are a few things:

DEODEX

Deodexing is important in ROM cooking before you can modify any APK, you can find the deodexing option in the Advanced Options of kitchen. You need to choose to deodex both folders and make sure the API is set to 16.

BOOTANIMATIONS

You can enable custom bootanimation support using this (credits to smokin1337). Place it in the working folder of your ROM and then add a bootanimation.zip file to your /system/media directory in your working folder. Here are some bootanimations compatible with our device.

APK MODIFICATIONS

I have made a separate thread for some APK modifications you can make to add some functionality that the device natively has disabled. Check out the modding tutorials here. You can test separate APK files you have modded using the Generic flashable zip available in the resources section below

DEBLOAT

Debloating can increase the level of performance of a device by a considerable amount. Here are some applications that you can remove from the /system/app folder of your ROM: (credits to k2wl for the list)

You can also replace the stock launcher with any launcher you like. Sec2Launcher.apk is the stock launcher, you simply need to delete it and replace it with any other, I've made a small list of my favorite launchers:

RESOURCES:

How to decompile and recompile an APK

To do any modding to stock Samsung based ROM, you would first need to decompile the relevant APK and edit the relevant files, there are many guides all over XDA for XML and SMALI editing

A tool for decompiling .jar files

Unfortunately, decompiling .jar files to edit its SMALI codes is a bit more complicated, and apktool does not support it by default, so you need to get this tool, and extract classes.dex from the .jar file and decompile it using the tool, then recompile it and replace the classes.dex in the original file with the modded one.

Generic flashable zip

Use this to test individual APK files after you mod them, quite a convenient way to test a modded APK, just make sure you have a backup

IMPORTANT NOTES:

Always have a stock firmware flashable with Odin ready, or a backup ready, because sometimes, you might get bootloops.

This will not make you a developer, at all.

I am not responsible if your device explodes, bursts into flames, corrodes or worse, becomes a Galaxy Pocket.