[Android Software/Hacking General [Developers Only]] ramzidjoudi:
[TUTO] How to deodex stock rom for galaxy S DUOS S7562

In the world of Android, a lot of themes, tweaks and tricks require the need of a Custom Deodexed rom. Deodexed roms are firmwares where the .APK files of the System Software itself are packaged in a way so that they can be modified easily without causing any harm to the framework or the Android Environment.

This tutorial will cover all the steps required to deodex stock rom for galaxy s duos s7562, so that you don’t need to install a Custom Rom yourself!

Disclaimer: Follow all the instructions carefully mentioned in this article, I should not be held responsible in any manner if your Android Device doesn’t boot up or gets bricked due to not following the instructions.

Required :

1.	Your device should already be rooted.

2.	You should already have Android ADB in your computer and should have basic ADB knowledge.

3.	JDK already installed in you’re PC (http://www.oracle.com/technetwork/java/javase/downloads/jdk7u9-downloads-1859576.html)

4.	7zip installed (http://www.7-zip.org/download.html)

5.	Cygwin installed (http://www.cygwin.com/)

6.	dsixda's Android Kitchen installed (http://xdaforums.com/showthread.php?t=633246)

7.	Busybox should already be installed in your device.

8.	CWM already in you’re phone

9.	Make nandroid backup (just in case).

10.	sgs2toext4.jar ((created by drphrozen) attached

11.	DiskInternals LinuxReader (http://www.diskinternals.com/download/Linux_Reader.exe)

Tutorial :

1. Download you’re favorite stock rom

2. Use 7zip to extract it (ignore errors)

You will have these files, we need only system.img.ext4

3. We have to convert it to ext4 format with sgs2toext4.jar

Open a command window and set the directory where you have sgs2toext4.jar file.

Now type sgs2toext4.jar and press enter

The .jar will run in a new window & will ask you to drag & drop the system.img.ext4 file there.

Do the same and wait till the process completes

4.Open the results file with DiskInternals LinuxReader an extract all files in new folder named system

5.Compress the system folder with 7zip (tar and store format) named system.img.ext4.tar

6.Put the file in kitchen folder (in original_update)

7.Lunch Cygwin terminal an cd to kitchen folder and load the menu (./menu)

You have to modify the API from 10 to 15

Look the file in C:\cygwin\home\user\kitchen\tools\deodex_files (api_level.txt)

8.Choose option (1) and do like these :

9.Choose option (0) ADVANCED OPTIONS

10.And then option (11) deodex files in your ROM

Then (b) deodex both folders and then (y)

Take a caffe and be patient, the operation take a time to finish, if all operation finish without problem you will have this :

However, some apks failed to deodex, see the screenshot, for me only one apk failed it’s not very important

To resolve this, go to :

C:\cygwin\home\user\kitchen\WORKING_xxxxxx_xxxxxx\system\app\

and delete the odex apks (you can recognize them by their respective .odex files present in the same folder)

Make sure to delete both apk as well as its respective .odex file.

you can close the kitchen now if you do not want to add more MODs

THATS IT ! you have successfully deodexed both /system/app as well as /system/framework/.

Now to port the deodexed rom do the following :

11.Copy both app and framework folders to your sdcard, from :

C:\cygwin\home\user\kitchen\WORKING_xxxxxx_xxxxxx\system\

12.Connect your phone to computer.(Make sure you have select USB debugging in Settings>Developer options>USB debugging

13.Open Command prompt, Goto folder where android sdk installed. Then goto platform-tools folder in it. Right click on free space in folder while pressing shift key.Select open command prompt here.

Now enter commands. )

14.Enter following codes:

adb shell
su
stop
mount -o rw,remount /system/ /system/
cp /sdcard/app/* /system/app/
rm /system/app/*.odex
cp /sdcard/framework/* /system/framework/
rm /system/framework/*.odex
mount -o ro,remount /system/ /system/
reboot

(if you are using adb shell in su for the first time, keep phone screen on. After entering "su" code, super user request prompt in phone. Press allow )

who look for my cygwin i used in this tuto

https://docs.google.com/folder/d/0B7VA567j483ubnBUMXBvamswN3M/edit?pli=1

just extract it in c:\ lunch Cygwin.bat it will creat your user folder in c:\cygwin\home

then move kitchen folder in cygwin\home to your user folder created

cheers

all credits goes to devs from this great forum