[HOW-TO][TUTORIAL]ROOT, DEODEX, BUILD KERNEL, BUILD CUSTOM ROM and MORE

Is this thread useful and want it to be sticky?


  • Total voters
    365
Search This thread

superatmos

Retired Recognized Developer
Mar 29, 2011
493
1,202
Bangalore
Hi all,

In this thread, I will try to share the knowledge I have on deodexing, making custom ROMs, modifying initramfs, building kernel and much more.

Please check the below posts for each of these tutorials.

Hope this opens doors to many new ROM and Kernel developers.

NOTE: THESE TUTORIALS ARE WRITTEN FOR I9100G. WILL NOT WORK ON OTHER DEVICES. I DON'T TAKE ANY RESPONSIBILITY IF YOU MESS UP AND BRICK YOUR DEVICE OR ANYTHING ELSE. USE AT YOUR OWN RISK.
 
Last edited:

superatmos

Retired Recognized Developer
Mar 29, 2011
493
1,202
Bangalore
Deodexing Stock Rom

For GINGERBREAD ROMS:

What you need to have:

  • xUltimate v2.3.3 - you can download it HERE (Thanks and Credits to Xeudoxus for this awesome app)
  • Rooted kernel with busybox
  • JDK installed on your Windows system
  • If adb is not available in your windows PC, in xUltimate folder open "jar" folder. You'll find adb there. :)
Extract stock app & framework folders and Deodex:

  • Connect your device to computer.
  • Start xUltimate (double-click on Main.exe)
  • Select option 1. (Pull /system/app)
  • Once option is done, select option 2. (Pull /system/framework)
  • In the same folder, now you'll see two new folders (origi_app, origi_frame)
  • For I9100G, go to origi_app folder and delete apk and odex files of Maps, PhoneSky and VoiceSearch.
  • Select option 3 in Main menu (Deodex /system/app)
  • Once its done, select option 4 in Main menu (Deodex /system/framework)
  • DONE!!
Now you'll see two new folders done_app and done_frame.

Push deodexed app and framework to device:

  • Connect your device to PC in USB debugging mode.
  • Copy done_app and done_frame folders to root of sdcard (/sdcard).
  • Open Windows command prompt and type the below commands.

Code:
[LIST]
[*]adb shell
[*]su
[*]stop
[*]mount -o remount,rw /dev/block/mmcblk0p9 /system
[*]rm /system/app/*.odex
[*]rm /system/framework/*.odex
[*]busybox cp /sdcard/done_app/* /system/app/
[*]busybox cp /sdcard/done_frame/* /system/framework/
[*]chmod 644 /system/app/*
[*]chmod 644 /system/framework/*
[*]mount -o remount,ro /dev/block/mmcblk0p9 /system
[*]sync
[*]reboot recovery
[/LIST]

In Recovery, Wipe Cache and Wipe Data/Factory reset.
Reboot.

Now you've deodexed app and framework. :)

For ICS ROMS:

For ICS Roms, the process is quite easy. (Thanks and Credits to jaydvn.)




  • Download the attached zip file.
  • Extract it on your windows PC.
  • Copy your /system/app to _app folder
  • Copy your /system/framework to _framework folder.
  • Run AutoDEOToolMain.bat
  • Follow the instructions.
  • deodexed jars and apks will be found in deodexed_APK and deodexed_JAR.
Push deodexed app and framework to device:

  • Connect your device to PC in USB debugging mode.
  • Copy deodexed_APK and deodexed_JAR folders to root of sdcard (/sdcard).
  • Open Windows command prompt and type the below commands.

Code:
[LIST]
[*]adb shell
[*]su
[*]stop
[*]mount -o remount,rw /dev/block/mmcblk0p9 /system
[*]rm /system/app/*.odex
[*]rm /system/framework/*.odex
[*]busybox cp /sdcard/deodexed_APK/* /system/app/
[*]busybox cp /sdcard/deodexed_JAR/* /system/framework/
[*]chmod 644 /system/app/*
[*]chmod 644 /system/framework/*
[*]mount -o remount,ro /dev/block/mmcblk0p9 /system
[*]sync
[*]reboot recovery
[/LIST]


In Recovery, Wipe Cache and Wipe Data/Factory reset.
Reboot.

Done. :)

Other references:

How to deodex ICS roms by samyam2002000

Enjoy. :)
 

Attachments

  • DeodexTool_AutoDEOTool_JDmod.zip
    7.2 MB · Views: 5,141
Last edited:

superatmos

Retired Recognized Developer
Mar 29, 2011
493
1,202
Bangalore
Building Kernel

Okay. Let's learn how to build kernel for our I9100G. There are many ways to build. I am just presenting here the way I build and make kernel.

NOTE 1: Follow the instructions exactly.
NOTE 2: Kernel is opensource. If you make any changes to it, you're expected to share your source. (Usually people share it over github :))
NOTE 3: FLASHING KERNEL IS RISKY AND DANGEROUS. BE CAREFUL. BUILD AND FLASH ON YOUR OWN RISK.

What you need to have:

  • Ubuntu 10.04 and above (I use 10.04 :))
  • ARM tool chain (Download HERE. Click on IA32 GNU/Linux TAR under Advanced Packages)
  • Samsung's opensource kernel for I9100G (Download HERE. Go to Mobile->Mobile Phone-> Select I9100G and download the zip)

Setting up toolchain:

  • Extract the tar you downloaded(Suggestion: Extract to one folder where you can have everything. In my case /home/superatmos/build_kernel).
  • After extracting, you'll see a folder named arm-2010q1. Inside there will be many folders (ex. bin, lib and so on.)

Folder structure will be: /home/<your_name>/build_kernel/arm-2010q1

Setting up kernel:

  • Extract the zip you've downloaded from samsung's opensource.
  • You'll find two zips.
  • Extract GT-I9100G_Kernel.tar.gz to /home/<your_name>/build_kernel/

Folder structure: /home/<your_name>/build_kernel/GT-I9100G_Kernel

Setting up initramfs:

Samsung's zImage is divided into two parts: Opensource kernel (which you downloaded from samsung's website) and initramfs (which is root file system to boot up the device).

  • I am providing my initramfs HERE. (You can use it as it is or modify it. But give credits to me. :))
  • Extract the downloaded zip and copy it to /home/<your_name>/build_kernel/

Folder structure: /home/<your_name>/build_kernel/initramfs

Now the entire setup is ready. Let's start modifying kernel configuration. :)

Setting up kernel config:

  • Go to /home/<your_name>/build_kernel/GT-I9100G_Kernel/arch/arm/configs folder.
  • Copy t1_defconfig file and paste it in kernel root folder (/home/<your_name>/build_kernel/GT-I9100G_Kernel/).
  • Rename t1_defconfig to .config in kernel root folder.
  • Now open Makefile which is in your kernel root folder(/home/<your_name>/build_kernel/GT-I9100G_Kernel/).
  • Modify the below lines (I guess line 195 and 196).

Code:
ARCH            ?= arm
CROSS_COMPILE   ?= /home/<your_name>/build_kernel/arm-2010q1/bin/arm-none-linux-gnueabi-

  • Save and close.

Modifying kernel configuration:

Now open .config file(which you renamed). If its not seen, it might be hidden. ;) Go to View->Show hidden files and there you go. :)

Do the below things:

Adding local version:

Change CONFIG_LOCALVERSION=" " to anything you like. I add this way:

CONFIG_LOCALVERSION="-I9100G-superatmos" :cool:

Adding initramfs path:

You need to let kernel know the path from which it needs to take initramfs.

Change CONFIG_INITRAMFS_SOURCE=" " to ../initramfs (In this tutorial it's the path. If you had copied anywhere else, give the path properly).

Enough for now. Once you get experience, you can modify many configurations as per your liking and save. This configuration can be changed by GUI too with the command make menuconfig.

The Important part: Building the kernel: :)

  • Open terminal.
  • Go to path /home/<your_name>/build_kernel/GT-I9100G_Kernel/
  • Type make.

THAT'S ALL. YOUR zImage is ready and is available in /home/<your_name>/build_kernel/GT-I9100G_Kernel/arch/arm/boot/zImage. :)

Install the zImage on the device:
Go to the path where zImage is present and type the below line in command line.

Code:
tar cvf I9100G_kernel.tar zImage

Flash the tar using odin.


DONE. CONGRATULATIONS. NOW YOU'VE YOUR OWN KERNEL. :)

Other references:

Building Kernel by bedalus

How to compile your first Nexus Kernel by djjonastybe

Give me your feedback so that I can improve this tutorial. And post here about how your build went. All the best. :)
 
Last edited:

superatmos

Retired Recognized Developer
Mar 29, 2011
493
1,202
Bangalore
Making custom ROM

Let's move on to make a custom ROM. :)

Inputs/Feedback/Suggestions are more than welcome. Lets improve this tutorial together for the betterment of the android community. :)

Steps involved in making a custom ROM:

  • Getting the system dump from the device.
  • Deodexing app and framework folders.
  • Creating various mods by modifying framework and system files.
  • Modifying build.prop and adding tweaks.
  • Making META-INF folder and writing an updater-script (edify scripting).
  • Signing the ROM and making a flashable zip.
Folder Structure:
Before going forward, let's follow the below structure folder to make the tutorial more understandable. :)

Let our ROM name be CustomROM. The folder structure will be C:\Users\<your name>\CustomROM.

Let's move step by step. Are you ready??


<b>
Getting the system dump from the device:


</b>

  • Make sure USB debugging is ON and connect your device to the PC.
  • Open command prompt on your windows PC and go to CustomROM folder path.
  • Type adb devices. You should be able to see the device detected. (If not check environmental variables whether adb is in system path or not. If not present, add the adb path.)
  • Type the below command to get the dump of system folder.
Code:
adb pull /system system/

Now inside the folder CustomROM, you should be able to see system folder with many folders like app, etc, framework etc inside.

Done with first step. :)


<b>
Deodexing app and framework folders:


</b>

Look HERE how to deodex app and framework folders. Copy the app and framework folders to xUltimate folder, rename them to origi_app and origi_frame and follow the given link to deodex.

NOTE: After deodexing, merge origi_app folder with app folder under C:\Users\<your name>\CustomROM\system\app and origi_frame with framework folder under C:\Users\<your name>\CustomROM\system\framework.


<b>
Creating various mods by modifying framework and system files


</b>

Okay. This the section where your hardwork, innovation and talent comes in. :) You can use the mods available already, create your own mods, port various mods from other devices and so on.

Below is a list of various mods which can be ported on to I9100G. All the credits go these respective thread owners. Thanks to them. :)

NOTE: Let me know more mods with links so that I can add here. :)


<b>
Modifying build.prop and adding tweaks


</b>

Okay. This is one of those files where you name your ROM(to be visible in settings. ;)) and add many tweaks.

To name your ROM (to be visible in settings), change the below code.

Code:
ro.build.display.id=CustomROM v1.0

Check the below links for many other tweaks. All credits go to respective thread owners. Thanks to them.

<b>
Making META-INF folder and writing an updater-script (edify scripting)


</b>

Once you're done with all the modifications, mods and additions, its time to create META-INF folder and make the updater script. Once the user flashes the ROM zip, this is the script that runs and does everything written inside the script. PLEASE BE CAREFUL WITH THIS. TAKE REFERENCE FROM OTHER (SAME DEVICE) ROMS' UPDATER-SCRIPT. (In this case, take reference from other GT-I9100G roms.)

Check the below links for tutorial and how-to on writing edify script and making updater script. All credits go to respective owners of the threads. Thanks to them.

Edify Scripting, Making Flashable ZIPs, ZIP Signing & Key Creation
Edify Scripting Notes
How to Write an Updater-Script with Edify Code
Edify Installation Script Syntax's

NOTE: system folders path, boot/kernel partition path, modem partition path and so on are COMPLETELY DIFFERENT for DIFFERENT DEVICES. Check the partitions for your device properly, carefully and then work on updater-script. TAKE HELP OR REFERENCE FROM OTHER ROM DEVELOPERS FOR YOUR DEVICE.

Lets move on to last step. Making a signing and making a flashable zip. :)


<b>
Signing the ROM and making a flashable zip


</b>

Make sure, now you should be able to find two folders (META-INF and system) inside C:\Users\<your name>\CustomROM.

Check in THIS thread for test signing your ROM. It WORKS with GT-I9100G. TESTED. :)

or Check THIS thread to create your own signing key and certificate.


Now you're done with making a custom ROM. Hope to see more custom ROMs from many users. :)

For porting ROMs, refer THIS tutorial. (thanks and credits to ayushrox)

Give me your feedback so that I can improve this tutorial. And post here about how your custom ROM making went. All the best. :)
 
Last edited:

nitinvaid

Senior Member
GOt error wHILE DEODEXING USING XULTIMATE

galaxy sl STOCK ROMS ARE MUCH BETTER THAN g

Starting Email.odex
*****************************************
* Deodexing... *


Error occured while loading boot class path files. Aborting.
org.jf.dexlib.Code.Analysis.ClassPath$ClassNotFoundException: Could not find sup
erclass Ljava/awt/Component;
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.loadSuperclass(ClassPa
th.java:784)
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.<init>(ClassPath.java:
668)
at org.jf.dexlib.Code.Analysis.ClassPath.loadClassDef(ClassPath.java:280
)
at org.jf.dexlib.Code.Analysis.ClassPath.initClassPath(ClassPath.java:16
3)
at org.jf.dexlib.Code.Analysis.ClassPath.InitializeClassPath(ClassPath.j
ava:131)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:105)
at org.jf.baksmali.main.main(main.java:278)
Error while loading class Lgnu/activation/viewers/ImageViewer; from file .\origi
_app\Email.odex
Error while loading ClassPath class Lgnu/activation/viewers/ImageViewer;

Press any key to continue . . .
 

superatmos

Retired Recognized Developer
Mar 29, 2011
493
1,202
Bangalore
GOt error wHILE DEODEXING USING XULTIMATE

galaxy sl STOCK ROMS ARE MUCH BETTER THAN g

Starting Email.odex
*****************************************
* Deodexing... *


Error occured while loading boot class path files. Aborting.
org.jf.dexlib.Code.Analysis.ClassPath$ClassNotFoundException: Could not find sup
erclass Ljava/awt/Component;
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.loadSuperclass(ClassPa
th.java:784)
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.<init>(ClassPath.java:
668)
at org.jf.dexlib.Code.Analysis.ClassPath.loadClassDef(ClassPath.java:280
)
at org.jf.dexlib.Code.Analysis.ClassPath.initClassPath(ClassPath.java:16
3)
at org.jf.dexlib.Code.Analysis.ClassPath.InitializeClassPath(ClassPath.j
ava:131)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:105)
at org.jf.baksmali.main.main(main.java:278)
Error while loading class Lgnu/activation/viewers/ImageViewer; from file .\origi
_app\Email.odex
Error while loading ClassPath class Lgnu/activation/viewers/ImageViewer;

Press any key to continue . . .

Which version of xUltimate you're using? only x2.3.3 supports GT-I9100G. Please follow the steps I mentioned above and you should be able to deodex.
 

nitinvaid

Senior Member
Always Got Error
Starting Maps.odex
*****************************************
* Deodexing... *


Error occured while loading boot class path files. Aborting.
org.jf.dexlib.Code.Analysis.ClassPath$ClassNotFoundException: Could not find int
erface Landroid/view/MenuItem$OnActionExpandListener;
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.loadAllImplementedInte
rfaces(ClassPath.java:823)
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.<init>(ClassPath.java:
683)
at org.jf.dexlib.Code.Analysis.ClassPath.loadClassDef(ClassPath.java:280
)
at org.jf.dexlib.Code.Analysis.ClassPath.initClassPath(ClassPath.java:16
3)
at org.jf.dexlib.Code.Analysis.ClassPath.InitializeClassPath(ClassPath.j
ava:131)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:111)
at org.jf.baksmali.main.main(main.java:282)
Error while loading class Lcom/google/googlenav/actionbar/d; from file .\origi_a
pp\Maps.odex
Error while loading ClassPath class Lcom/google/googlenav/actionbar/d;

Press any key to continue . . .
 

superatmos

Retired Recognized Developer
Mar 29, 2011
493
1,202
Bangalore
Always Got Error
Starting Maps.odex
*****************************************
* Deodexing... *


Error occured while loading boot class path files. Aborting.
org.jf.dexlib.Code.Analysis.ClassPath$ClassNotFoundException: Could not find int
erface Landroid/view/MenuItem$OnActionExpandListener;
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.loadAllImplementedInte
rfaces(ClassPath.java:823)
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.<init>(ClassPath.java:
683)
at org.jf.dexlib.Code.Analysis.ClassPath.loadClassDef(ClassPath.java:280
)
at org.jf.dexlib.Code.Analysis.ClassPath.initClassPath(ClassPath.java:16
3)
at org.jf.dexlib.Code.Analysis.ClassPath.InitializeClassPath(ClassPath.j
ava:131)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:111)
at org.jf.baksmali.main.main(main.java:282)
Error while loading class Lcom/google/googlenav/actionbar/d; from file .\origi_a
pp\Maps.odex
Error while loading ClassPath class Lcom/google/googlenav/actionbar/d;

Press any key to continue . . .

Please read the instructions. I mentioned to remove (Maps.apk, Maps.odex, PhoneSky.apk, PhoneSky.odex, VoiceSearch.apk and VoiceSearch.odex). These files give issue while deodexing I9100G.
 
  • Like
Reactions: fauzi_91

Top Liked Posts

  • There are no posts matching your filters.
  • 57
    Hi all,

    In this thread, I will try to share the knowledge I have on deodexing, making custom ROMs, modifying initramfs, building kernel and much more.

    Please check the below posts for each of these tutorials.

    Hope this opens doors to many new ROM and Kernel developers.

    NOTE: THESE TUTORIALS ARE WRITTEN FOR I9100G. WILL NOT WORK ON OTHER DEVICES. I DON'T TAKE ANY RESPONSIBILITY IF YOU MESS UP AND BRICK YOUR DEVICE OR ANYTHING ELSE. USE AT YOUR OWN RISK.
    33
    Building Kernel

    Okay. Let's learn how to build kernel for our I9100G. There are many ways to build. I am just presenting here the way I build and make kernel.

    NOTE 1: Follow the instructions exactly.
    NOTE 2: Kernel is opensource. If you make any changes to it, you're expected to share your source. (Usually people share it over github :))
    NOTE 3: FLASHING KERNEL IS RISKY AND DANGEROUS. BE CAREFUL. BUILD AND FLASH ON YOUR OWN RISK.

    What you need to have:

    • Ubuntu 10.04 and above (I use 10.04 :))
    • ARM tool chain (Download HERE. Click on IA32 GNU/Linux TAR under Advanced Packages)
    • Samsung's opensource kernel for I9100G (Download HERE. Go to Mobile->Mobile Phone-> Select I9100G and download the zip)

    Setting up toolchain:

    • Extract the tar you downloaded(Suggestion: Extract to one folder where you can have everything. In my case /home/superatmos/build_kernel).
    • After extracting, you'll see a folder named arm-2010q1. Inside there will be many folders (ex. bin, lib and so on.)

    Folder structure will be: /home/<your_name>/build_kernel/arm-2010q1

    Setting up kernel:

    • Extract the zip you've downloaded from samsung's opensource.
    • You'll find two zips.
    • Extract GT-I9100G_Kernel.tar.gz to /home/<your_name>/build_kernel/

    Folder structure: /home/<your_name>/build_kernel/GT-I9100G_Kernel

    Setting up initramfs:

    Samsung's zImage is divided into two parts: Opensource kernel (which you downloaded from samsung's website) and initramfs (which is root file system to boot up the device).

    • I am providing my initramfs HERE. (You can use it as it is or modify it. But give credits to me. :))
    • Extract the downloaded zip and copy it to /home/<your_name>/build_kernel/

    Folder structure: /home/<your_name>/build_kernel/initramfs

    Now the entire setup is ready. Let's start modifying kernel configuration. :)

    Setting up kernel config:

    • Go to /home/<your_name>/build_kernel/GT-I9100G_Kernel/arch/arm/configs folder.
    • Copy t1_defconfig file and paste it in kernel root folder (/home/<your_name>/build_kernel/GT-I9100G_Kernel/).
    • Rename t1_defconfig to .config in kernel root folder.
    • Now open Makefile which is in your kernel root folder(/home/<your_name>/build_kernel/GT-I9100G_Kernel/).
    • Modify the below lines (I guess line 195 and 196).

    Code:
    ARCH            ?= arm
    CROSS_COMPILE   ?= /home/<your_name>/build_kernel/arm-2010q1/bin/arm-none-linux-gnueabi-

    • Save and close.

    Modifying kernel configuration:

    Now open .config file(which you renamed). If its not seen, it might be hidden. ;) Go to View->Show hidden files and there you go. :)

    Do the below things:

    Adding local version:

    Change CONFIG_LOCALVERSION=" " to anything you like. I add this way:

    CONFIG_LOCALVERSION="-I9100G-superatmos" :cool:

    Adding initramfs path:

    You need to let kernel know the path from which it needs to take initramfs.

    Change CONFIG_INITRAMFS_SOURCE=" " to ../initramfs (In this tutorial it's the path. If you had copied anywhere else, give the path properly).

    Enough for now. Once you get experience, you can modify many configurations as per your liking and save. This configuration can be changed by GUI too with the command make menuconfig.

    The Important part: Building the kernel: :)

    • Open terminal.
    • Go to path /home/<your_name>/build_kernel/GT-I9100G_Kernel/
    • Type make.

    THAT'S ALL. YOUR zImage is ready and is available in /home/<your_name>/build_kernel/GT-I9100G_Kernel/arch/arm/boot/zImage. :)

    Install the zImage on the device:
    Go to the path where zImage is present and type the below line in command line.

    Code:
    tar cvf I9100G_kernel.tar zImage

    Flash the tar using odin.


    DONE. CONGRATULATIONS. NOW YOU'VE YOUR OWN KERNEL. :)

    Other references:

    Building Kernel by bedalus

    How to compile your first Nexus Kernel by djjonastybe

    Give me your feedback so that I can improve this tutorial. And post here about how your build went. All the best. :)
    31
    Deodexing Stock Rom

    For GINGERBREAD ROMS:

    What you need to have:

    • xUltimate v2.3.3 - you can download it HERE (Thanks and Credits to Xeudoxus for this awesome app)
    • Rooted kernel with busybox
    • JDK installed on your Windows system
    • If adb is not available in your windows PC, in xUltimate folder open "jar" folder. You'll find adb there. :)
    Extract stock app & framework folders and Deodex:

    • Connect your device to computer.
    • Start xUltimate (double-click on Main.exe)
    • Select option 1. (Pull /system/app)
    • Once option is done, select option 2. (Pull /system/framework)
    • In the same folder, now you'll see two new folders (origi_app, origi_frame)
    • For I9100G, go to origi_app folder and delete apk and odex files of Maps, PhoneSky and VoiceSearch.
    • Select option 3 in Main menu (Deodex /system/app)
    • Once its done, select option 4 in Main menu (Deodex /system/framework)
    • DONE!!
    Now you'll see two new folders done_app and done_frame.

    Push deodexed app and framework to device:

    • Connect your device to PC in USB debugging mode.
    • Copy done_app and done_frame folders to root of sdcard (/sdcard).
    • Open Windows command prompt and type the below commands.

    Code:
    [LIST]
    [*]adb shell
    [*]su
    [*]stop
    [*]mount -o remount,rw /dev/block/mmcblk0p9 /system
    [*]rm /system/app/*.odex
    [*]rm /system/framework/*.odex
    [*]busybox cp /sdcard/done_app/* /system/app/
    [*]busybox cp /sdcard/done_frame/* /system/framework/
    [*]chmod 644 /system/app/*
    [*]chmod 644 /system/framework/*
    [*]mount -o remount,ro /dev/block/mmcblk0p9 /system
    [*]sync
    [*]reboot recovery
    [/LIST]

    In Recovery, Wipe Cache and Wipe Data/Factory reset.
    Reboot.

    Now you've deodexed app and framework. :)

    For ICS ROMS:

    For ICS Roms, the process is quite easy. (Thanks and Credits to jaydvn.)




    • Download the attached zip file.
    • Extract it on your windows PC.
    • Copy your /system/app to _app folder
    • Copy your /system/framework to _framework folder.
    • Run AutoDEOToolMain.bat
    • Follow the instructions.
    • deodexed jars and apks will be found in deodexed_APK and deodexed_JAR.
    Push deodexed app and framework to device:

    • Connect your device to PC in USB debugging mode.
    • Copy deodexed_APK and deodexed_JAR folders to root of sdcard (/sdcard).
    • Open Windows command prompt and type the below commands.

    Code:
    [LIST]
    [*]adb shell
    [*]su
    [*]stop
    [*]mount -o remount,rw /dev/block/mmcblk0p9 /system
    [*]rm /system/app/*.odex
    [*]rm /system/framework/*.odex
    [*]busybox cp /sdcard/deodexed_APK/* /system/app/
    [*]busybox cp /sdcard/deodexed_JAR/* /system/framework/
    [*]chmod 644 /system/app/*
    [*]chmod 644 /system/framework/*
    [*]mount -o remount,ro /dev/block/mmcblk0p9 /system
    [*]sync
    [*]reboot recovery
    [/LIST]


    In Recovery, Wipe Cache and Wipe Data/Factory reset.
    Reboot.

    Done. :)

    Other references:

    How to deodex ICS roms by samyam2002000

    Enjoy. :)
    25
    Making custom ROM

    Let's move on to make a custom ROM. :)

    Inputs/Feedback/Suggestions are more than welcome. Lets improve this tutorial together for the betterment of the android community. :)

    Steps involved in making a custom ROM:

    • Getting the system dump from the device.
    • Deodexing app and framework folders.
    • Creating various mods by modifying framework and system files.
    • Modifying build.prop and adding tweaks.
    • Making META-INF folder and writing an updater-script (edify scripting).
    • Signing the ROM and making a flashable zip.
    Folder Structure:
    Before going forward, let's follow the below structure folder to make the tutorial more understandable. :)

    Let our ROM name be CustomROM. The folder structure will be C:\Users\<your name>\CustomROM.

    Let's move step by step. Are you ready??


    <b>
    Getting the system dump from the device:


    </b>

    • Make sure USB debugging is ON and connect your device to the PC.
    • Open command prompt on your windows PC and go to CustomROM folder path.
    • Type adb devices. You should be able to see the device detected. (If not check environmental variables whether adb is in system path or not. If not present, add the adb path.)
    • Type the below command to get the dump of system folder.
    Code:
    adb pull /system system/

    Now inside the folder CustomROM, you should be able to see system folder with many folders like app, etc, framework etc inside.

    Done with first step. :)


    <b>
    Deodexing app and framework folders:


    </b>

    Look HERE how to deodex app and framework folders. Copy the app and framework folders to xUltimate folder, rename them to origi_app and origi_frame and follow the given link to deodex.

    NOTE: After deodexing, merge origi_app folder with app folder under C:\Users\<your name>\CustomROM\system\app and origi_frame with framework folder under C:\Users\<your name>\CustomROM\system\framework.


    <b>
    Creating various mods by modifying framework and system files


    </b>

    Okay. This the section where your hardwork, innovation and talent comes in. :) You can use the mods available already, create your own mods, port various mods from other devices and so on.

    Below is a list of various mods which can be ported on to I9100G. All the credits go these respective thread owners. Thanks to them. :)

    NOTE: Let me know more mods with links so that I can add here. :)


    <b>
    Modifying build.prop and adding tweaks


    </b>

    Okay. This is one of those files where you name your ROM(to be visible in settings. ;)) and add many tweaks.

    To name your ROM (to be visible in settings), change the below code.

    Code:
    ro.build.display.id=CustomROM v1.0

    Check the below links for many other tweaks. All credits go to respective thread owners. Thanks to them.

    <b>
    Making META-INF folder and writing an updater-script (edify scripting)


    </b>

    Once you're done with all the modifications, mods and additions, its time to create META-INF folder and make the updater script. Once the user flashes the ROM zip, this is the script that runs and does everything written inside the script. PLEASE BE CAREFUL WITH THIS. TAKE REFERENCE FROM OTHER (SAME DEVICE) ROMS' UPDATER-SCRIPT. (In this case, take reference from other GT-I9100G roms.)

    Check the below links for tutorial and how-to on writing edify script and making updater script. All credits go to respective owners of the threads. Thanks to them.

    Edify Scripting, Making Flashable ZIPs, ZIP Signing & Key Creation
    Edify Scripting Notes
    How to Write an Updater-Script with Edify Code
    Edify Installation Script Syntax's

    NOTE: system folders path, boot/kernel partition path, modem partition path and so on are COMPLETELY DIFFERENT for DIFFERENT DEVICES. Check the partitions for your device properly, carefully and then work on updater-script. TAKE HELP OR REFERENCE FROM OTHER ROM DEVELOPERS FOR YOUR DEVICE.

    Lets move on to last step. Making a signing and making a flashable zip. :)


    <b>
    Signing the ROM and making a flashable zip


    </b>

    Make sure, now you should be able to find two folders (META-INF and system) inside C:\Users\<your name>\CustomROM.

    Check in THIS thread for test signing your ROM. It WORKS with GT-I9100G. TESTED. :)

    or Check THIS thread to create your own signing key and certificate.


    Now you're done with making a custom ROM. Hope to see more custom ROMs from many users. :)

    For porting ROMs, refer THIS tutorial. (thanks and credits to ayushrox)

    Give me your feedback so that I can improve this tutorial. And post here about how your custom ROM making went. All the best. :)
    8
    Root and busybox

    If you don't want to modify anything else except to have root and busybox for the stock rom, Check the below link.

    How to ROOT/UNROOT your I9100G via Stock Recovery (Credits: Ryuinferno)