[Xoom Android Development] dhemke17:
MAC/ LINUX Instructions

How to Deodex your Xoom the long way:

Requirements:

1)	Have a knowledge of ADB and have it set up on your computer

2)	Have smali and baksmali on your computer. I used the ones attached below.

3)	If on a Mac, download betterzip, Windows, download 7Zip or WinRar

Steps:

1)	First, you must pull your system apps and framework from your xoom. To accomplish this, navigate to where ADB is located and do the following:

adb pull /system/app/ <output directory>/app
example: adb pull /system/app /Users/dhemke17/Desktop/system_dump/app/
adb pull /system/framework/ /<output directory>/framework
example: adb pull /system/app/ /Users/dhemke17/Desktop/system_dump/framework

2)	Now that you have your apps and framework, you can begin working…this is a pretty lengthy process so bare with me…

3)	Place both smali.jar and baksmali.jar into the folder where your framework is. And do the following commands. (These are for a mac and may need to be altered for Windows). You must change the xxxx.odex to the desired odex file and substitute in your output directory

java –jar baksmali.jar –o temp1 –x xxxx.odex
cd <output directory>/framework/temp1
find ./ -type f -exec sed -i -e 's/return-void-barrier/return-void/g' {} \;
cd <output directory>/framework/
java -Xmx512M -jar smali.jar temp1 -o classes.dex
rm –rf temp1

4)	Once these steps are completed, you have a classes.dex folder in your framework folder. Using BetterZip (7-Zip) Open the initial jar file (example: if you just deodexed am.odex, open am.jar) and place the classes.dex into the root of the archive (do not place it in any folder) and then delete the classes.dex file. This will work for all framework files but framework.jar, policy.jar, services.jar, and ext.jar. For these, do the following: just replace xxxxx with each of the 4 corresponding . odex files.

java -jar baksmali.jar -c :core-junit.jar:framework.jar -o temp1 -x xxxxx.odex
cd <output directory>/framework/temp1
find ./ -type f -exec sed -i -e 's/return-void-barrier/return-void/g' {} \;
cd <output directory>/framework/
java -Xmx512M -jar smali.jar temp1 -o classes.dex
rm –rf temp1

5)	Once completed, create a folder named frame_done and copy the deodexed framework files into it.

6)	Copy all of the framework files into the <output directory>/app folder as they are needed to deodex the system apps.

7)	Copy your baksmali.jar and smali.jar into the <output directory>/app folder as well.

8)	To deodex the system apps, do the following. Be sure to replace xxxx.odex with the desired odex file.

java -jar baksmali.jar -c :com.android.location.provider.jar:javax.obex.jar:core.jar:apache-xml.jar:bouncycastle.jar -o temp1 -x xxxx.odex
cd <output directory>/app/temp1;
find ./ -type f -exec sed -i -e 's/return-void-barrier/return-void/g' {} \;
cd <output directory>/app/;
java -Xmx512M -jar smali.jar temp1 -o classes.dex
rm -rf temp1

9)	At this point, it’s a repeat story. Just open the corresponding .apk file and drop the classes.dex into archive’s root and then delete the classes.dex file. Continue steps 8 and 9 until all of your system apps are deodexed. Create a folder named app_done and move all of the completed apk files into it.

10)	Now you have a completely deodexed system and framework in separate folders. To get them onto your xoom, you can use the following update.zip, just be sure to place your apps into the /system/app folder and your framework into the /system/framework folder. Flash the update.zip in CWR and reboot. Your system will now be deodexed!

Update.zip for you to drop your framework and apps into:

Deodex.zip

Helpful hints:

For a mac, for the steps after the baksmali step, you can create a script to do the rest, besides moving anything. Mine can be downloaded but needs to be modified to your output directory/temp1 and output directory in two different spots, then you can just do the following:

java –jar baksmali.jar –o temp1 –x xxxx.odex
bash deodex.sh

My Script:

deodex.sh

Baksmali is attached in a zip file below...be sure to extract and rename it to baksmali.jar

Smali.jar

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Windows Instructions

Requirements:

1) Know how to use adb and have it set up

2) Have Baksmali and smali.jars installed

3) Have 7-Zip or WinRAR

4) Must have Cygwin installed...steps are below

Procedure to install Cygwin (Thanks dsixda):

1. Download and install the Java JDK for Windows 32-bit from java.sun.com (WARNING: Do not install Cygwin before the JDK!!)

2. (Install the JDK in Step 1 before you proceed to this step!!)

3. Download the file cygwin_packages.zip, unzip it and follow the instructions in the "kitchen_readme.txt" file to install a customized version of Cygwin. Done!!

NOTE: A default install of Cygwin will not work, you need to use the customized version described in the guide.

NOTE2: If you had installed Java after Cygwin, then Cygwin may have issues finding the Java executable file, which will require an edit of the .bash_profile file. See here to fix it.

Procedure to Deodex:

1)	First, you must pull your system apps and framework from your xoom. To accomplish this, navigate to where ADB is located and do the following:

adb pull /system/app/ <output directory>/app
example: adb pull /system/app /Users/dhemke17/Desktop/system_dump/app/
adb pull /system/framework/ /<output directory>/framework
example: adb pull /system/app/ /Users/dhemke17/Desktop/system_dump/framework

2) Place both smali.jar and baksmali.jar into the folder where your framework is. And do the following commands. (These are for a mac and may need to be altered for Windows). You must change the xxxx.odex to the desired odex file and substitute in your output directory. Notice, in the find command line, -e has been removed as it is not needed.

java –jar baksmali.jar –o temp1 –x xxxx.odex
cd <output directory>/framework/temp1
find ./ -type f -exec sed -i 's/return-void-barrier/return-void/g' {} \;
cd <output directory>/framework/
java -Xmx512M -jar smali.jar temp1 -o classes.dex
rm –rf temp1

3) Follow Steps 4 - 10 From the mac instructions MAKING SURE YOU MAKE THE CHANGE TO THE FIND LINE INDICATED ABOVE

If there is anything you are unsure about and you get confused, please feel free to PM me, or ask on this board...

If this post has helped you, and you feel so inclined to do so, you can hit the thanks button, or if you are really excited, you can donate to me here: Donate HERE