[Samsung Epic 4G Touch] crawrj:
First let me say that I am not a technical writer and I hated English in school ((#(# years ago :) That being said, I will try to do the best I can with this.

I also want to thank StrongSteve for teaching me how to Odex files on Gingerbread. I have learned a great deal from him so he deserves a lot of credit.

This is a tutorial on how to Odex your mods.

What you need. You will need the Deodexed files that you want to Odex, custom recovery, ADB (attached if needed), an Odexed rooted Rom that you want to use your mod on, busybox and the attached dexopt-wrapper.

Let me explain a little about why you Odex on specific Roms. The process of Odexing relies on signatures. It builds the signatures from the original Odexed files. In most cases all of the Roms are built from the same original release so they all contain the same signatures. However, sometimes during the development process the signatures get modified. So if you are building your mod for a specific Odexed Rom start with that Rom as your base. Once you are done and you verify that the Mod works on that rom you can test it on other roms to see if it still works. If it doesn't work you would want to build it again using that Rom as the base.

OK so let's get started. I am not positive if this is necessary but I have been doing it this way since I started Odexing. If you have multiple jar files that you are going to Odex follow the bootclass order when Odexing.

The bootclass for ICS is /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework2.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/filterfw.jar:/system/framework/sechardware.jar:/system/framework/wimax.jar. So if you are Odexing services.jar and framework.jar you would first Odex framework.jar then services.jar. If you are Odexing jar files that aren't in the bootclass do those after you Odex the bootclass jars.

The below is an example. You will replace the text marked in red with the actual jar that you want to Odex.

This is the process for ICS

What I do is make a folder called Odexed on the root of my internal storage

I keep the dexopt-wrapper file on the root of my internal storage

Copy the Deodexed files that you want to odex into the Odexed folder

Do a nandroid backup of your phone

Flash the Odexed rom that you want to use with your mod

Make sure you are rooted

Make sure your phone has usb debugging enabled

Attach your phone to your computer

Open a command prompt and go to the adb folder

Type adb shell

Type su (check your phone to see if it is asking for permission and allow it if so)

Enter the following commands

mount -oremount,rw /dev/block/mmcblk0p9 /system

cp /sdcard/dexopt-wrapper /system/xbin

cp /sdcard/odexed/core.jar /system/framework

dexopt-wrapper /system/framework/core.jar /system/framework/patched_core.odex /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework2.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/filterfw.jar:/system/framework/sechardware.jar:/system/framework/wimax.jar

chmod 777 /system/framework/core.odex

chmod 777 /system/framework/patched_core.odex

busybox dd if=/system/framework/core.odex of=/system/framework/patched_core.odex bs=1 count=20 skip=52 seek=52 conv=notrunc

cp /system/framework/patched_core.odex /sdcard/odexed/core.odex

rm /system/framework/patched_core.odex

If you are odexing other files repeat the process starting from step 16

Once all of the Jar files are done you can Odex any apk files that you have. Note: framework-res.apk was never odexed so you can just skip that file.

For apks you only need to run this command dexopt-wrapper sdcard/odexed/SystemUI.apk sdcard/odexed/SystemUI.odex replacing SystemUI with the apk name that you are Odexing

Now copy all of the files from the Odexed directory on the phone to your computer

Open each of the jar and apk files with a program like winrar and delete the classes.dex file

Create a cwm zip file and put all of the files into the zip (you can use my Odexed Hotspot Mod as a template if you don't know how to do this)

Flash the Odexed rom that you want to use again so that you are starting fresh

Flash your mod and test to see if it works

If it doesn't work verify the steps to make sure you did everything in order

This process has never failed for me before

Once you have this working you can flash other Odexed Roms and test your mod out on them to see if they work

If not you need to repeat the process for that Rom if you want your Mod to work on that Rom

The bootclass for GB is /system/framework/core.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/core-junit.jar

This is the process for Gingerbread

Everything from the ICS process is the same except for step 17

Change that line to dexopt-wrapper /system/framework/core.jar /system/framework/patched_core.odex /system/framework/core.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/core-junit.jar

If you have any questions or issues let me know and I will do my best to help you out. Good Luck!