[Captivate Android Development] crt60:
***I added some minor reliability improvements, by including more error checking, seems to run pretty smooth***

I've been playing around with making a deodexer script and having some issues, did a google search and came across these two posts.

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

http://xdaforums.com/showpost.php?p=5775540&postcount=57

So I merged what I had with theirs and modified it to work on the Captivate ROM's.

I thought it would be a useful tool to have and thought I would share with anyone interested in deodexing their own stock ROM.

Why would you want to deodex your own ROM when you could download somebody elses? Something to do I guess.

It deodexes the app and framework folders in three passes, the first pass does the files that don't require a specific boot class path, the second pass deodexes the files that do require a boot class path and the third does a check for any files the for-do loop may have skipped.

It takes approximately 10 to 30 minutes to complete, depending on your computer, but considering that it took me almost a day to deodexed a ROM manually, , thats not so bad.

It can pull a stock ROM from your phone and deodex it, using adb or you can extract a factoryfs.rfs file and place app and framework folder into the app and framework folders for the script.

It also has a batch zipalign tool for when its done deodexing.

You have the option to select boot class paths for Captivate i897 (gingerbread or froyo), or you can input a custom boot class path string.

Extract the Deodexer_i897.zip to a folder that does not have spaces in the name.

Pull the system from your phone or add your app and framework folders to the extracted folder for the deodexer.

Then just doubleclick on deoall.bat and your off and running.

I included a Readme file with instructions.

You have to have the Java sdk and samsung usb drivers installed on your computer for it to work.

The script is a windows batch file and was modified on Windows 7. I assume it will work on XP as well, but haven't tested it.

I've tested it on:

i897 - KB1, KF1, KH3, KI1, KI2, KJ1, KJ2, KJ3, KK1 and KK2

Rogers - KH2

i9000 - JVO, JVR and JVS stock ROMs.

I've flashed and tested KF1, KH3, KI2, KJ1, KJ2 and KJ3 on my phone with no problems.

(Remember, stock KH3 - KJ3 do not have any ringtones so you will have to copy them to the media/audio folder from another ROM)

Note: Remember to check the app and framework folders for files that got skipped. If there is, try running the deodexer again just to make sure it just wasn't a glitch.

Thanks and credits goes out to Daneshm90 and crzyruski for the deodexer scripts and JesusFreke for giving us baksmali-smali and not to forget, Igor Pavlov for 7zip.

UPDATE- I'm adding a basic clockworkmod flashable script template that you can pop your system into. It includes redbend_ua, wipe, busybox, su and superuser.apk for root. You will have to add a kernel (zImage) and the appropriate modem (modem.bin) to the updates folder.

You will have to flash an update.zip (Froyo) http://xdaforums.com/showthread.php?t=734163

or flash a kernel tar using odin, that has clockwork mod baked in (Gingerbread), and will need to add a cwm modded kernel to the update folder in the template if you want to keep clockwork mod recovery (Gingerbread). The template will not work with special kernels that have scripting included such as init.d, you will have to flash special MOD kernels that contain scripts, afterwards.

*****CAUTION:This is a full wipe template so be careful and know what you are doing.*****

***Fixed the Core_ROM.zip so it will install the modem and kernel, plus added the wipe script.***

It is beyond the scope of my talents and time to completely teach someone how to do all of this, but google is your friend when it comes to learning this stuff. There are allot of resources out there to help you accomplish your task. I'm just merely supplying some basic tools for you.

TOOLS

Notepad++ works great at editing the updater-script in the META-INF folder.

And the smali and xmls in the apks and jars.

http://notepad-plus-plus.org/

And Apkmanager is great to decompile and compile apk and jar files - Thanks raziel23x

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

Just add .apk to the end of the .jar, do your modding, change it back to jar when you're done, works great.

Plus raziel23x has a new apk multi tool that is still in beta but is worth watching http://apkmultitool.com/

Also for those that want a free alternative to Photoshop to modify your graphics, there is a great program called Paint.Net http://paintnet.org/

If you are serious about MODDING here is another valuable tool, Beyond Compare available here $$ http://www.scootersoftware.com/

And this is a valuable reference for those interested in Modding

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

KERNELS

For KF1 I found this link for the cog5-beta2-kernel.tar, thanks to designgears. http://ftp.captivate.org.ua/samsung/captivate/2.3.x/2.3.3/ROM/cognition_5/

And of course, for KH3 and KI1-KI2 use Boogs kernel available here http://xdaforums.com/showthread.php?t=1242533

For KJ1, KJ2 and KJ3 use Boogs kernel here http://xdaforums.com/showthread.php?t=1294849

***The script has been updated to include the boot class path as an option, instead of having to copy and paste the whole thing, so the Bootclass_path.txt file is no longer needed... Thanks to ralphreyes ***

**NOTICE: due to the nature of DOS (Windows) environmental variables, the deodexer needs to be extracted to the root folder, or any folder it resides in, can't have a space in its name. e.g. Android SDK as opposed to Android_SDK***

As always, I am not responsible if it messes up your phone.

I hope someone finds this useful.

***NOW ITS FINAL***