yashsingh1/xdaforums huggingface dataset:
[Galaxy S II I9100G Android Development] superatmos:
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.

[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.

[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. :)
[Galaxy S II I9100G Android Development] superatmos:
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)
[Galaxy S II I9100G Android Development] nitinvaid:
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 . . .
[Galaxy S II I9100G Android Development] superatmos:
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.
[Galaxy S II I9100G Android Development] nitinvaid:
ok will try that version also
[Galaxy S II I9100G Android Development] zylor:
Does this script work for ICS odexed apk's? :D
[Galaxy S II I9100G Android Development] superatmos:
I am not sure about it since I never tested myself on ICS since its not yet released for I9100G.
[Galaxy S II I9100G Android Development] superatmos:
Did you try? Were you able to deodex using this tutorial?
[Galaxy S II I9100G Android Development] H15@M:
next action

manage to deodex using above step. :D

once deodex what is the next action?
[Galaxy S II I9100G Android Development] superatmos:
After deodexing, did you push deodexed app and framework folder back onto device? (third section of deodex post). If done, then you can apply themes to it, use apks of other roms and so on.

Enjoy. :)
[Galaxy S II I9100G Android Development] samyam2002000:
hey superatmos have u tried the dsiXDA kitchen with our phone
[Galaxy S II I9100G Android Development] superatmos:
No. Not yet. Will try it and check whether it works with I9100G.
[Galaxy S II I9100G Android Development] samyam2002000:
waiting for the rest of it patiently. hope u get time quite soon :)
[Galaxy S II I9100G Android Development] superatmos:
Yes. Very soon. Keep your linux environment ready to build your own kernel. :)
[Galaxy S II I9100G Android Development] nitinvaid:
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 . . .
[Galaxy S II I9100G Android Development] superatmos:
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.
[Galaxy S II I9100G Android Development] superatmos:
Building kernel section updated

Hi,

Building kernel updated in 3rd post. Start building your own kernel. :)
[Galaxy S II I9100G Android Development] Valinorian:
Awesome, I was allready searching for info on building roms. Perfect timing :D
[Galaxy S II I9100G Android Development] superatmos:
This is for I9100G. Your signature says you use I9100. Its NOT for I9100.
[Galaxy S II I9100G Android Development] samyam2002000:
I personally think it is easier through gui as u can modify many things easily through there. Well its just an opinion...:)
[Galaxy S II I9100G Android Development] superatmos:
Yes. I did mention about it in the instructions.

After their first successful build, people can start modifying config file through the command make menuconfig. :)
[Galaxy S II I9100G Android Development] superatmos:
Vote for the poll and rate the thread

Hi,

For this thread, I added a poll for making it a sticky thread so that many people can utilize and try to deodex stock rom on their own and make their own kernels and much more in the coming days.

Please vote and rate the thread.

Thanks,

superatmos.

LINK: http://xdaforums.com/showthread.php?t=1587482
[Galaxy S II I9100G Android Development] fauzi_91:
i'm the 1st person vote!! =D
[Galaxy S II I9100G Android Development] punjprateek:
Wat shld i do with t1_deconfig file when copied shld i create a new folder nd renamme it to as mentioned above in steps ??
[Galaxy S II I9100G Android Development] superatmos:
Please read the instructions. copy t1_defconfig from configs folder and paste it in kernel root folder and rename it to .config there (in kernel root folder).
[Galaxy S II I9100G Android Development] punjprateek:
Dude which kernal root folder ?? Im confused
[Galaxy S II I9100G Android Development] superatmos:
Please read the instructions.. I mentioned it there clearly.
[Galaxy S II I9100G Android Development] Street79:
hi,

thanks for the good tutorial! i successfully build a kernel, but i can't get wifi and vibration working. the only solutions i found on the web are like 'flashing another kernel', but that's not the general idea. maybe you can give me a hint to solve this...
[Galaxy S II I9100G Android Development] punjprateek:
Street can u tell.me where.do u.placed the t1 config.nd which root folder
[Galaxy S II I9100G Android Development] Street79:
you have to place t1_defconfig in /home/<your_name>/build_kernel/GT-I9100G_Kernel/ and then rename t1_defconfig to .config

(btw: kernel root folder is /home/<your_name>/build_kernel/GT-I9100G_Kernel/)

superatmos described it here:

if you use the same folder structure as superatmos in his tutorial, you can do it also by typing the following command in a terminal:

cp ~/build_kernel/GT-I9100G_Kernel/arch/arm/configs/t1_defconfig ~/build_kernel/GT-I9100G_Kernel/.config

then continue the tutorial below the red lines:

good luck
[Galaxy S II I9100G Android Development] superatmos:
Which initramfs did you use? The one which I had included?
[Galaxy S II I9100G Android Development] Street79:
No, I used an initramfs that I've extracted from an untouched stock kernel. Could you tell me what differences there are, that make wifi and vibrations work or not?

(I want to understand and not only modify the hard work of other people.)
[Galaxy S II I9100G Android Development] superatmos:
That's really good to hear mate!! Just download my initramfs I attached and compare to the initramfs you have. Leave .ko files. They'll be different. See all the other things. You'll be able to understand. I wrote comments too in my initramfs where ever I had modified.

Good luck. :)
[Galaxy S II I9100G Android Development] nh5:
Thank you so much for the tutorial on kernel building. Helped me out with some of the basics. Left you a thanks! will be attempting a kernel for the I777 the AT&T OGSGSII
[Galaxy S II I9100G Android Development] PoorCollegeGuy:
Hey!

Just wanted to let you know that this thread has been featured on the XDA Portal :)

http://www.xda-developers.com/android/learn-to-build-kernels-and-roms-for-the-galaxy-s-ii/

btw, i voted "yes" on making this thread a sticky. If I had an SGSII I'd be using it actually lol.

Awesome work!
[Galaxy S II I9100G Android Development] xK1LLSW1TCHx127:
THANKS!!!

I'm using an i777 instead of the i9000, but this is still extremely helpful, thank you! One question, you said to work with ubuntu for the kernel development, which is what I am most interested in. Is Ubuntu a requirement, or is any Linux Distro good? I ask because I'm more of an OpenSuSe and Mint type guy =) Thank you again!:)
[Galaxy S II I9100G Android Development] skyhew:
Please make the same tutorial for Galaxy Note... :)
[Galaxy S II I9100G Android Development] anshmiester78900:
I think you should make the same for the normal I9100 also as it will be usefull for the other users :)
[Galaxy S II I9100G Android Development] Street79:
Last night I've tried a lot...

I've tried your initramfs without further modifications ->

wifi and vibrations don't work for me

I've tried several extracted initramfs' from other custom kernels which worked when I flashed them ->

wifi and vibrations don't work for me

Then I tried to figure out, WHY wifi doesn't work (flashed a not working kernel, creating logfiles, ...) ->

the wifi-driver has problems loading the dhd.ko

After reading about 300 posts or more I figured out, that some people have had exactly the same problem with their 'Epic 4G Touch' and solved it by using only the .ko-files which are created during the build process. They wrote a script to automate this (make modules, copy .ko-files to initramfs, build kernel, ...) that I've modified for my use ->

wifi works, vibrations don't work

At least a step in the right direction...

Has anyone the same problems?

Any ideas why all the other .ko-files don't work for me? Why are your .ko-files different? How do you got them?

Maybe it could be up to any settings in the .config-file (I only changed CONFIG_LOCALVERSION=" " and CONFIG_INITRAMFS_SOURCE=" " yet) or maybe my build environment (I'm using Debian-6.0.4-amd64 on a virtual machine) or whatever...

I think I will first try to get vibrations working for me and then figure out what's the problem when I use any other .ko-files...
[Galaxy S II I9100G Android Development] dmp450:
This is a great tutorial, thanks so much for making this. I have few questions though: First, how do I extract my own initramfs file from my phone to use(or where would I get it for the I9100 anyway) and second, if I wanted to do something like make a kernel that gives overclocking capability, how would I do that? I have looked through my .config file, but haven't seen anything that would suggest that. Finally, how would I go about creating CWM flashable .zip kernel? Thanks again so much for making this guide!
[Galaxy S II I9100G Android Development] superatmos:
This tutorial deals with basic concepts of kernel building and things like over-clocking are little advanced and needs modification of kernel files. I suggest once you're able to successfully build your own kernel, you can take guidance from advanced kernel developers or go through their source they've shared.

I am trying to make a similar tutorial for I9100 too. Will provide more details with respect to I9100 there. :)
[Galaxy S II I9100G Android Development] paxChristos:
(found this on the front page of xda & thought i'd throw in my $.02 :p)

If you type in

ARCH=arm CROSS_COMPILE=/<path to cross compiler>/arm-none-linux-gnueabi- make t1_defconfig

It'll automatically copy it over & get it setup for you (instead of copy/pasting)
[Galaxy S II I9100G Android Development] the_chemistry:
Good tutorial.. encountered error in java deodex but quickly restart deodexing service and succeed. Now my rom is deodexed.. I'm using a DZKL3 firmware :D
[Galaxy S II I9100G Android Development] xGeekyKiidx:
Cant Find PhoneSky.apk and PhoneSky.odex
[Galaxy S II I9100G Android Development] superatmos:
No issues. Just try to deodex. If you encounter issues with any apk/odex while deodexing, just remove that apk and odex from origi_app folder and deodex again. :)
[Galaxy S II I9100G Android Development] sgsgs:
Thanks for the great tutorial!

I am trying out your tutorial to compile a kernel for I9100, downloaded the I9100 source from samsung (update3) and managed to successfully compile with your initramfs, but didn't try it on the phone yet as I am not sure if your initramfs will work for I9100.

I have the following questions:

1) The I9100 source do not have t1_defconfig. How to determine which one to use? (I use c1_rev02_defconfig as described in the readme file and it compiles)

2) Where to download the default initramfs from samsung? Or can I extract from the phone?

3) There is a GT-I9100_Platform.tar.gz in the downloaded source, what is this for?

4) What it takes to root the kernel? (or save this for advance topic?)

Cheers and keep up the great work!
[Galaxy S II I9100G Android Development] paxChristos:
1) different phones have different defconfigs. For example, my phone, the Sony Xperia Plays defconfig is semc_zeus_defconfig. Pay attention to the readme, it should tell you the defconfig to use

2) This'll teach you how to get the ramdisk (initramfs) for your phone: http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images

4) In default.prop (it's in the ramdisk) change ro.secure=1 to ro.secure=0. You'll also want to add an auto-rooting script to your ramdisk & init.rc (also in your ramdisk) IMO.

3) I'll leave this for someone else ;)

Sent from my phone, please excuse any Swypos.
[Galaxy S II I9100G Android Development] superatmos:
Updated tutorial for Galaxy Note N7000 and Galaxy S2 GT-I9100

Hi,

Tutorial updated for Galaxy S2 I9100 as well as Galaxy Note N7000.

Link for Galaxy S2 GT-I9100: HERE

Link for Galaxy Note GT-N7000: HERE

Please let me know the feedback. :)
[Galaxy S II I9100G Android Development] sgsgs:
There are no swypos but your reordering of questions 3 & 4 got me baffled for a while :)

I can't relate the instructions in the link provided to the file system on my I9100, maybe it could be for other phones.

Anyway, superatmos has already posted another tutorial for I9100 with a link on extracting initramfs from zImage file.

Thanks for your quick and useful answers anyway!
[Galaxy S II I9100G Android Development] mzeesh2006:
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.

[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. :)

Enjoy. :)[/QUOTE]

Firstly, thanks for your tutorial.

Now, coming to the point, I am a bit confused as to where I should enter these commands because when I open my command prompt, it gives me "ADB not recognized error" considering that I have JDK installed. (Am I missing something more here?)

Also, when I try to open ADB.exe, it just scrolls a bit and then closes by itself. (Is that supposed to happen?)
[Galaxy S II I9100G Android Development] superatmos:
You need to give path to your adb.exe in Environment Variables of Windows.

Or in command prompt, cd to the path where you've adb.exe and then execute the above commands.
[Galaxy S II I9100G Android Development] nutsymtom:
Hi,

I wanted to DEODEX my device (9100GXXKL4 with lucifr Kernel V1.6), but i stuck at

after push enter get following output and my device is off:

Not shure whenn device shut down, but i need to remove battery and restore my saved buckup via cwm.

what i'm doing wrong?

P.S. ignore signature..I'm playing around with b the stock rom!

greetz nutz
[Galaxy S II I9100G Android Development] superatmos:
Check whether you've done_app and done_frame folders in /sdcard
[Galaxy S II I9100G Android Development] nutsymtom:
Folders are in /sdcard/ and *.apk`s in there, too.

I think its someting stupid, I'm doing wrong but don't know what..

debug mode - or maybe Download-mode?

greets nutz
[Galaxy S II I9100G Android Development] unichem:
Can create a guide how to extract sgs2G stock rom in windows?
[Galaxy S II I9100G Android Development] nutsymtom:
got it deodesed!

my mistake was: I had connected the USB memory..:rolleyes:

Thanks fo the Howto!

greets nutz
[Galaxy S II I9100G Android Development] rascal123:
use 7zip to extract sgs2G stock rom
[Galaxy S II I9100G Android Development] sengab1991:
make: *** No targets specified and no makefile found. Stop.

this appear for me when I type make any ideas how to solve that :S :S
[Galaxy S II I9100G Android Development] mzeesh2006:
Thanks a lot.

Also, I upgraded my firmware yesterday which resulted in my phone being unrooted/ odexed and unbusyboxed. So, I'll have to start all over again :P
[Galaxy S II I9100G Android Development] herinmo:
I like this thread very much and building/running a custom kernel was no problem.

My question is to how to build AOSP which results in a system.img with the right file system.

This is what I have done.

I can build AOSP (2.3.3_r1) in combination with Samsung Galxy SII platform code (GT_I9100_platform.tar.gz).

This results in 3 images.

system.img

ramdisk.img

userdata.img

I know that system.img is the file system and open this you can remove and add applications.

I can download this image to device but when device reboots after downloading installation is aborted because of error E:Error in /cache/recovery/sec_csc.zip

I think that the image has the wrong file system unyaffs instead of ext4fs (this is what Samsung need). How can I build AOSP which result in a system.img with ext4fs file system

Any help will be appreciate
[Galaxy S II I9100G Android Development] oldpistol:
still waiting ;-)
[Galaxy S II I9100G Android Development] t4ure4n:
I hope its soon enough
[Galaxy S II I9100G Android Development] dankmoe:
This thread is epic and OP helped the i1900G users big time! Screw doing a tut for i9100 users , you guys have all the Custom Rom's in the world , however were stuck here on GB while almost the entire world is enjoying ICS.

Please go ahead and finish on how to make custom ROM , i personally have never made a custom ROM before but im giving it a go for my phone.

Thank you

Keep it up
[Galaxy S II I9100G Android Development] albuquerque13:
make t1_defconfig

using make t1_defconfig should be easier than copying the file manually and renaming to .config

Just my 2 cents.
[Galaxy S II I9100G Android Development] susashva:
How do we go to origi_app folder and delete apk and odex files of Maps, PhoneSky and VoiceSearch.
[Galaxy S II I9100G Android Development] halfbytecode:
After deodexing I'm missing Maps, VoiceSearch, Latitude and Places apps. Any specific reason the former 2 apps weren't deodexed and is it possible to get them back?

EDIT: Nevermind I ended up getting them from Google Play.
[Galaxy S II I9100G Android Development] iPuTcher:
Can't make zimage please help :)
[Galaxy S II I9100G Android Development] superatmos:
Making custom ROM section updated

Hi all,

Please find updated custom rom section HERE.

Feedback and suggestions welcome. :)
[Galaxy S II I9100G Android Development] brightivan:
Hey, thanks for the tutorial! But i've got a few questions:

1) First of all, after I've deodex my phone (fyi I'm running options 1-4 manually, then I exit), I'm not sure whether it's fully deodexed or not because in /system/app there are still files with .odex. And I've wiped cache but not wipe data coz i don't want to lose my files.

2) adb is not a recognized command. How to fix this?

3) If i don't want to build my own kernel and want to based on other kernels, what should i do?

Thanks in advance!

:confused::confused::confused::confused::confused::confused:
[Galaxy S II I9100G Android Development] ad_ek:
same problem here. i cant seem to deodex my jplc1.

it keeps giving me the same error.

when i use the command rm /system/app/*.odex

it will say. cant remove filesaccountandsettings.odex : read only file system...

when type this command : busybox cp /sdcard/done_app/* /system/app/

cant create file xxx , : file already exist.

---------- Post added at 11:08 PM ---------- Previous post was at 10:42 PM ----------

the deodex guide is not really well written, and its not newbie friendly bro
[Galaxy S II I9100G Android Development] superatmos:
Did you read the deodex section properly? Did you read "What you need to have" under "deodexing" section?? You need to have a rooted kernel first..

secondly, after having rooted kernel, you need to follow the "code" (steps mentioned) under "deodexing" section exactly.. /system is remounted as "rw" before you even delete or copy /system/app.....

Read the instructions properly ....