[TOOL][ROMDEV] working baksmali for honeycomb - Android Software Development

I recently made a discovery regarding the RETURN_VOID_BARRIER issues encountered while trying to deodex honeycomb's framework. Here is a working version of baksmali based on JesusFreke's 1.2.7 patch with the difference that it now produces compliant smali code that can be recompiled by smali.jar 1.2.6. This means that there is no need to edit the smali code to be able to recompile it.
I tried recompiling with smali 1.2.7 and got a nice box of bootloops so stick with 1.2.6 until a proper fix is implemented in the official smali tools.

Thanks! This was most useful for my project today!
I'm really amazed more people haven't noticed/commented on this TBH.

NetworkLocation.odex still give errors.
Thats the error:
Code:
Error occured while loading boot class path files. Aborting.
org.jf.dexlib.Code.Analysis.ClassPath$ClassNotFoundException: Could not find superclass Lcom/android/location/provider/GeocodeProvider;
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.loadSuperclass(ClassPath.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:163)
at org.jf.dexlib.Code.Analysis.ClassPath.InitializeClassPathFromOdex(ClassPath.java:110)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:104)
at org.jf.baksmali.main.main(main.java:282)
Error while loading class Lcom/google/android/location/GeocodeProvider; from file NetworkLocation.odex
Error while loading ClassPath class Lcom/google/android/location/GeocodeProvider;

I'm also getting errors on galaxy tab 10.1, framework was done without any problem but many of system app can not deodex

Thanks,the proeblem I meet is solved.

trying to download this file, it downloads as a zip, shouldnt it be a jar? I have tried renaming it to jar and it says its corrupt. help?

fallingup said:
trying to download this file, it downloads as a zip, shouldnt it be a jar? I have tried renaming it to jar and it says its corrupt. help?
Click to expand...
Click to collapse
I think you have to unzip it first. Have a peek inside.
sent from my cyanogen(mod) vision

gee one said:
I think you have to unzip it first. Have a peek inside.
sent from my cyanogen(mod) vision
Click to expand...
Click to collapse
its the contents of a .jar file...

fallingup said:
its the contents of a .jar file...
Click to expand...
Click to collapse
It's a zip of a jar file. The jar file is a zip like format, so maybe whatever you are using to unzip is a bit aggressive? Try something milder
sent from my cyanogen(mod) vision

gee one said:
It's a zip of a jar file. The jar file is a zip like format, so maybe whatever you are using to unzip is a bit aggressive? Try something milder
sent from my cyanogen(mod) vision
Click to expand...
Click to collapse
Thanks for gettin me outta my n00b moment silly osx unzipped it and made it seem like just one zip file, its been too long since ive done any dev work on my mac

Yeah, it happens. When I want to peek at something on my mac, sometimes it goes into a loop where it unzips to a tar.gz and then when I try to open that, it opens up a zip. Infinite loop!
It works fine from the terminal command line and zipeg seems to do a good job.
sent from my cyanogen(mod) vision

Related

how do i deoxed single apks?

iv been looking but cant figure it out, no one gives instructions on how to use there deodex tools
Download AvaboxV2 Here
Unzip the download somewhere, open up the 'De-odexer' and view the readme.
I think you just put the apk and odex file inside the "de-odexer" folder and double-click the ''deodexall.bat" or "deall.bat", something along those lines.
Can't check right now since I'm on my phone
i down loaded an used but its not creating a Classes.dex
DubsideWICKED said:
i down loaded an used but its not creating a Classes.dex
Click to expand...
Click to collapse
AvaboxV2 won't do that, it will take both the APPNAME.apk & APPNAME.odex files and make it into a single de-odexed APPNAME.apk
If you want the classes.dex file check out smali tools I believe that should do it for you. It may decompile as out.dex, if it does just rename it back to classes.dex
Edit: instructions for it are HERE
I think apk manager will let you deodex files as well.... I think....
theimpaler747 said:
I think apk manager will let you deodex files as well.... I think....
Click to expand...
Click to collapse
if it does i have never seen it
i thought when u de-odexed a file that it created a classes dex. im still having problemswith all methods mentioned
attach the apk and the odex files in a zip so I can download them. when I have time I'll see if I can get the classes.dex file for you and let you know what I did to get it
kyouko said:
attach the apk and the odex files in a zip so I can download them. when I have time I'll see if I can get the classes.dex file for you and let you know what I did to get it
Click to expand...
Click to collapse
i think its the systemUI he is trying to deodex everything i have tried to deodex it errors out.
however i have circumvented it and i am excited
ya im tryin to do what kyle said. i just wanna edit the signal bars. is it possible to make a odex file for a apk.

[SCRIPT/TOOL](Updated 10/22)Auto-deodexer 1.2.8 for the Captivate (Froyo-Gingerbread)

***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://forum.xda-developers.com/showthread.php?t=598026
http://forum.xda-developers.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://forum.xda-developers.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://forum.xda-developers.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://forum.xda-developers.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://forum.xda-developers.com/showthread.php?t=1242533
For KJ1, KJ2 and KJ3 use Boogs kernel here http://forum.xda-developers.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***
This is awesome !! Thanks for sharing.
I will have to check this out when I get time this weekend...or sooner.
What about an odexer?
I would like to odex the ROM on my phone after I get my desired modifications in. Any chance on an odexer script?
Thanks I've been looking for an easy way to deodex my own stock rom. I will put it to good use.
Sent from my SAMSUNG-SGH-I897 using XDA App
gibson3659 said:
I would like to odex the ROM on my phone after I get my desired modifications in. Any chance on an odexer script?
Click to expand...
Click to collapse
Odexing is a little tricky, I haven't found a compiler to do that, something exclusive to google and phone manufacturing developers. Though the performance of an odexed ROM is so slight over a deodexed one, it probably wouldn't be worth it.
Nice job on the "Read me".
Will be trying my hand at this asap...
thanks again
4-2ndtwin said:
Nice job on the "Read me".
Will be trying my hand at this asap...
thanks again
Click to expand...
Click to collapse
Thanks, let me know how it goes. I did three more ROMs after I fixed it and flashed two of them and had no problems. When I get home tonight, was going to add an option to root plus will upload some templates for cwm recovery.
Sent from my SAMSUNG-SGH-I897 using XDA App
crt60 said:
**NOTICE** I added another deodexer for high performance computers with quad-core or high end dual core processors, even though the original deodexer works fine, because the script would run so fast, it can produce errors, or skip files because of possible memory segment overlap, causing null pointer exceptions, so I added a 3 second pause between each operation to solve this issue. It only adds a minute or two to the deodexing time, but should add reliability and integrity to the deodexed ROM -> Deodexer_i897x.zip
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://forum.xda-developers.com/showthread.php?t=598026
http://forum.xda-developers.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 to manually add the boot class paths at the beginning when prompted, but I included a text file that you can just copy and paste the appropriate boot class paths into the script. I did that in case of future or other ROMs, so the boot class paths could be modified.
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 KB1, KF1, KH3, KI1-KI2, KJ1, KJ2, KJ3 and Rogers KH2 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, 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://forum.xda-developers.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.*****
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://forum.xda-developers.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.
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/
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://forum.xda-developers.com/showthread.php?t=1242533
For KJ1 and KJ2, use Boogs kernel here http://forum.xda-developers.com/showthread.php?t=1294849
As always, I am not responsible if it messes up your phone.
I hope someone finds this useful.
***Fixed Root***
Click to expand...
Click to collapse
thanks for your work ,so i can build my own rom by myself with less work
crt60,
Didn't get a chance to try this out last weekend. I hope to get to it this Sat. I'll give u some feed back afterwards.
Appreciate the work u are doing and sharing.
Sent from i897uckj3
How can I extract a one-click .exe stock ROM?
Thansk.
chappatti said:
How can I extract a one-click .exe stock ROM?
Thansk.
Click to expand...
Click to collapse
You can't that I know of, it is a microsoft mfc program and I haven't found a decompiler for it. You will have to find the original odin tar file
Sent from my SAMSUNG-SGH-I897 using XDA App
crt60 said:
You can't that I know of, it is a microsoft mfc program and I haven't found a decompiler for it.
Sent from my SAMSUNG-SGH-I897 using XDA App
Click to expand...
Click to collapse
Thanks for your quick reply !!
One thing is not clear in your reademe? Do I need to run the deodexer from the stock ROM folder, or do ineed to edit my win $path.?
chappatti said:
Thanks for your quick reply !!
One thing is not clear in your reademe? Do I need to run the deodexer from the stock ROM folder, or do ineed to edit my win $path.?
Click to expand...
Click to collapse
Copy the app and framework folders in system into the deodexer folder and merge with the app and framework folders already there.
Sent from my SAMSUNG-SGH-I897 using XDA App
crt60 said:
Copy the app and framework folders in system into the deodexer folder and merge with the app and framework folders already there.
Sent from my SAMSUNG-SGH-I897 using XDA App
Click to expand...
Click to collapse
I have checked the updater-script and found it doesn't extract the 'updates' folder ,so the zImage and modem.bin can't be installed
q659503934 said:
I have checked the updater-script and found it doesn't extract the 'updates' folder ,so the zImage and modem.bin can't be installed
Click to expand...
Click to collapse
I will check it out when i get time
Sent from my SAMSUNG-SGH-I897 using XDA App
crt60 said:
I will check it out when i get time
Sent from my SAMSUNG-SGH-I897 using XDA App
Click to expand...
Click to collapse
I just add the script
ui_print("");
ui_print("extract files...");
package_extract_dir("updates", "/tmp");
set_perm(0, 0, 0777, "/tmp/redbend_ua");
i think you could build a ROM template ,it's more useful.
Yep, you're right. I must have accidentally deleted that, when I removed the wipe program, trying to simplify the script. It has been fixed, plus I went ahead and added the wipe script back in. Thanks for your input...
Sent from my SAMSUNG-SGH-I897 using XDA App
I thought I would make it a little easier on your script by adding a couple extra lines to the 'deoall.bat' file so the bootclass path is included within. When it prompts you to enter the bootclass path, you can enter 1 for GingerBread, 2 for Froyo, or you can just enter your custom one.
Replace the line that starts with
Code:
set /P INPUT=Enter BootClassPath (ex 1.jar:2.jar:3.jar): %=%
with the following:
Code:
echo Enter BootClassPath: 1=GingerBread, 2=Froyo,
set /P INPUT=or custom (ex file1.jar:file2.jar:file3.jar): %=%
IF %INPUT%==1 (set INPUT=core.jar:bouncycastle.jar:core-junit.jar:twframework.jar:services.jar:framework.jar:seccamera.jar:javax.obex.jar:com.google.android.maps.jar)
IF %INPUT%==2 (set INPUT=core.jar:twframework.jar:android.policy.jar:services.jar:framework.jar:seccamera.jar:javax.obex.jar:com.google.android.maps.jar)
Thank you for your excellent work crt60!!
ralphreyes said:
I thought I would make it a little easier on your script by adding a couple extra lines to the 'deoall.bat' file so the bootclass path is included within. When it prompts you to enter the bootclass path, you can enter 1 for GingerBread, 2 for Froyo, or you can just enter your custom one.
Replace the line that starts with
Code:
set /P INPUT=Enter BootClassPath (ex 1.jar:2.jar:3.jar): %=%
with the following:
Code:
echo Enter BootClassPath: 1=GingerBread, 2=Froyo,
set /P INPUT=or custom (ex file1.jar:file2.jar:file3.jar): %=%
IF %INPUT%==1 (set INPUT=core.jar:bouncycastle.jar:core-junit.jar:twframework.jar:services.jar:framework.jar:seccamera.jar:javax.obex.jar:com.google.android.maps.jar)
IF %INPUT%==2 (set INPUT=core.jar:twframework.jar:android.policy.jar:services.jar:framework.jar:seccamera.jar:javax.obex.jar:com.google.android.maps.jar)
Thank you for your excellent work crt60!!
Click to expand...
Click to collapse
Nice, I did make a script like that but thought it would be too confusing for those that use this for non-captivate ROMs. I'll update the link with the new code.
Thanks
could add option 3 , custom boot class list (as it is now) for other devices! or have them save it to a txt file in a list one per line and have the bat read the custom txt list

Android 4.0 SDK system rip

Here is the android 4.0 SDK system rip!
Odex version:
http://www.multiupload.com/3LAX55ZV81
Please enjoy!
Interesting. Wish I new something about developing to use this... Thanks.?
Problem is, it fails to deodex =(
ybinnenweg said:
Problem is, it fails to deodex =(
Click to expand...
Click to collapse
ye i made a port but its getting stuck trying to optain the .odex files from framewokrs/apps, its just ignoring them
here a copy of the error.
10-19 04:40:18.174: E/dalvikvm(1453): /system/framework/android.policy.jar odex has stale dependencies
10-19 04:40:18.174: I/dalvikvm(1453): Zip is good, but no classes.dex inside, and no valid .odex file in the same directory
btw im using a gb boot.img/libs
It won't deodex until the current smali/baksmali tools are updated.
^Fs said:
It won't deodex until the current smali/baksmali are updated.
Click to expand...
Click to collapse
indeed, patiently wating

apktool compiling problem

Hi,
I use apktool and have a problem.
I sucessful decompile apk and get direcrory with app name.
When compile this directory (without change) I get apk file.
But apk file cannot install on phone!
What I do wrong?
I just decompile and compile without change and apk cannot install...
Help..
atlantisu21 said:
Hi,
I use apktool and have a problem.
I sucessful decompile apk and get direcrory with app name.
When compile this directory (without change) I get apk file.
But apk file cannot install on phone!
What I do wrong?
I just decompile and compile without change and apk cannot install...
Help..
Click to expand...
Click to collapse
What apk is it?
Some .apk's just will not install. I had an apk that compiled 1MB smaller, without change. Its not a perfect system.
Name is not important, but original file size is 1,376 MB
and compiled file size now is 1,372 MB
Where is 4KB?
Well I only asked the name incase it was one I myself had issues with or someone else had.
Now I just think you're doing something suspicious by answering.like that
4KB not as bad as 1MB. But you're still losing size which will be why it won't install.
Can't help any more than that I'm afraid. Except to say I have seen the issue before and never resolved it
Sent from my HTC Desire using Tapatalk
Suspicious
I tried more apk without sucess..beacause I dont tell a name.
Actual apk is BeoGSP-6.apk and there I lost 18KB...
I dont understand this compiler!?
Is there any another compiler with more working chance?
Can I export resource to Eclipse and make apk from here?
There is also APK manager. its pretty similar as far as I can tell.
There's APK Manager or APK Multi Tool which I use and both do the job quite well. I need APK Multi to decompile ICS or newer APK's and I use APK Manager 4.9 to decompile the APK's from the oxygen ROM.
If it decompiles and recompiles without errors then the only thing you might need to do is sign the APK. It won't install if it's a non-system APK and you haven't signed it.
APK Manager 4.9 option 16 signs the APK's so I just use that and if there're no errors it will sign and install fine.
Thanx! Works with APK Manager. This is a great thing!
I signed apk and now work

[GUIDE]Deodex An Application

Hey Guys,
This is a small tutorial for those who want to Deodex a Single Application manually.
Deodex And Odex:
The APKs or JARs of Android contain certain .odex files whose supposed function is to save space. These ‘odex’ files are actually collections of parts of an application that are optimized before booting. Doing so speeds up the boot process, as it preloads part of an application. On the other hand, it also makes hacking those applications difficult because a part of the coding has already been extracted to another location before execution.It will make your faster theoretically even though it would be too small to notice.When deodexing the .odex file is changed to classes.dex file. Deodexing also allows us to theme and install mods.Many of the Stock Roms and CyanogenMod 7 roms are now odexed and to theme them or to add mods we need to have it deodexed. So lets learn how!!
Deodexing:
Preparation:
Hope you have Java Development Kit installed on your computer to run the scripts.Get it from: here.Select you OS from the list and download the suitable package.(We would need the full thing and not the Demo versions.)
Download the Attached .zip File
Extract its Contents to a Folder.(Extracting to a New Folder in the Desktop is Preferred for Ease)
We will name this Folder with the Extracted Contents as Deodex(or any name that you like)
Procedure And Explanations:
First of all copy the Application file that you need to Deodex.A Android Application file is the .apk file found in the system/app directory.Copy the .apk file and the .odex file of the application that you want to Deodex and paste in the Deodex folder(Folder to which the attachment's contents was extracted)
Now go to your system/framework directory and you can see a lot of .jar and .odex files in this folder and copy all its contents to the folder to which the attachment's contents was extracted.
Before doing anything more backup your rom and the application file(If anything goes wrong you can use it then)
To Deodex a application you need to specify its "BOOTCLASSPATH" files. BOOTCLASSPATH are files that contain the classes for an application or in simple language BOOTCLASSPATH files are those files that are required by a android application to run properly. They are actually those files that we have copied from the system/framework directory to our Deodex folder. There are mainly 5 BOOTCLASSPATH files for every android rom.They are: android.policy.jar , core.jar , bouncycastle.jar , ext.jar , framework.jar
All apps are dependent on these files but some apps are dependent on some other BOOTCLASSPATH files.So sometimes the problem is that we actually dont know to which of these files is a particular app dependent to.So we will have to specify all the BOOTCLASSPATH files or the .jar files in the system/framework directory.So problem solved!! Now enough with the theory class,lets proceed to the practical classes!!!!!
Open Command Prompt.
As an example we will Deodex Settings.apk
Type in this command in Command Prompt:
Code:
java -Xmx1024m -jar baksmali.jar -c :am.jar:android.policy.jar:android.test.runner.jar:bmgr.jar:bouncycastle.jar:
com.android.location.provider.jar:com.google.android.maps.jar:sonyericsson.suquashi.jar:
core.jar:corej-unit.jar:ext.jar:framework.jar:ime.jar:input.jar:java.awt.jar:javax.obex.jar:monkey.jar:pm.jar:
:services.jar:sqlite-jdbc.jar:svc.jar -x Settings.odex
Here:
-Xmx says the heap memory needed.In the above command it is given to 1024m. Sometimes deodexing may have errors due to the low heap memory.So set it to 1024m itself.
-jar baksmali.jar says the program to run baksmali.jar file.
-c says that the following files are the BOOTCLASSPATH files of the application we are deodexing.
-x says the name of the application that we are deodexing.It should end with .odex extension.
Note:
When you specify the .jar files just add all those .jar file names in the system/framework folder(only add the .jar files and not the .odex files).Ensure that you have added the .jar extension at the end of each file. Separate the .jar files with colon " : " symbol.
If you have made no spelling errors and have done everything mentioned you will get a folder named "out".
Now we have to smali the out folder into classes.dex file.
So again type in the Command Prompt:
Code:
java -Xmx1024m -jar smali.jar out -o classes.dex
Here:
-o says what the output file should me named to.Dont rename the classes.dex file into anything else.
Now you will have a file in our Deodex folder(Folder to which the attachment's contents was extracted) called "classes.dex".
Finalizing:
Now open the application's .apk file(which you were trying to deodex) with WinRar.
Move the classes.dex file that you got to this .apk file.(Just drag and drop it to the .apk file opened with WinRar.)
Now you will have a deodexed .apk file.
Note: After deodexing you will have to delete the .odex file of the particular application which you had deodexed.
I will make a guide to Odex back a Deodexed application soon!
Hope this guide helps you....
For any doubts or questions please post it here in this forum and I will try to attend to it.........
Re: Deodex A Single Application
Thanks bro..
Good tut..
sent from my phone using hands and brain...
thanks
Re: Deodex A Single Application
Good tut...
But quite long
Sent from my W8 using xda app-developers app
hey...nice tutorial and nice explanation :good:
thanks
Re: Deodex A Single Application
But helpful too...
sent from my phone using hands and brain...
Gogeta said:
Good tut...
But quite long
Sent from my W8 using xda app-developers app
Click to expand...
Click to collapse
I made it long so that everyone understands.Even those who are very new to android
i'm stucked when i try to deodex settings.odex..
any suggestions???
Hidzrie said:
i'm stucked when i try to deodex settings.odex..
any suggestions???
Click to expand...
Click to collapse
you must deodex
settings.apk + settings.odex.....
i've already follow exactly like the tutorial above but cmd just stucked...
in 'out' folder there are \com\android\settings\ folder and these files were in it and nothing more:
AccessibilitySettings$1.smali
AccessibilitySettings$2.smali
AccessibilitySettings$3.smali
AccessibilitySettings$4.smali
AccessibilitySettings$5.smali
AccessibilitySettings$6.smali
AccessibilitySettings.smali
please anyone help..
Credit/thanks: http://forum.xda-developers.com/showthread.php?t=1208320 ?
Hidzrie said:
i've already follow exactly like the tutorial above but cmd just stucked...
in 'out' folder there are \com\android\settings\ folder and these files were in it and nothing more:
AccessibilitySettings$1.smali
AccessibilitySettings$2.smali
AccessibilitySettings$3.smali
AccessibilitySettings$4.smali
AccessibilitySettings$5.smali
AccessibilitySettings$6.smali
AccessibilitySettings.smali
please anyone help..
Click to expand...
Click to collapse
follow the highlighted lines and try again and deodexing takes time according to your computer's ram.so be patient.if you still cant do it then just upload the system=>framework folder and the app you want to deodex and its odex file and Private Message me the links. I will check whats the problem.
L_S said:
Credit/thanks: http://forum.xda-developers.com/showthread.php?t=1208320 ?
Click to expand...
Click to collapse
this can be found in the android sources site but it not so easy to understand for beginners so i made it a little easier to understand and i didnt refer that guide because all is clearly written in the android sources site.
i understood why some of you are making mistakes when trying to deodex a apk or jar file.
its because you are copying exactly the same bootclasspath files that i specified in the guide.
it varies depending on your device and your rom. So I have made some changes in my guide.some lines are highlighted in red.
follow those lines.
Hidzrie said:
i'm stucked when i try to deodex settings.odex..
any suggestions???
Click to expand...
Click to collapse
Specify your device and rom that you use. Are you sure that you followed what i told itself? Try it once more as I have made some more changes in the guide to help you guys.
Still if you cant do it then just copy your framework folder and the apk and .odex file that you want to deodex and pm me. I will try to deodex it.
fotak-x said:
you must deodex
settings.apk + settings.odex.....
Click to expand...
Click to collapse
no fotak we dont need to deodex settings.apk. We only need to deodex the .odex file but we will have to keep the apk file also in the same folder.
Leon1234 said:
Specify your device and rom that you use. Are you sure that you followed what i told itself? Try it once more as I have made some more changes in the guide to help you guys.
Still if you cant do it then just copy your framework folder and the apk and .odex file that you want to deodex and pm me. I will try to deodex it.
Click to expand...
Click to collapse
I'm using samsung gt-s5830i.. Rom simplicity v4..
I've tried like many times..still wont work..
Hidzrie said:
I'm using samsung gt-s5830i.. Rom simplicity v4..
I've tried like many times..still wont work..
Click to expand...
Click to collapse
dont worry,we can figure it our!
what error are you getting in command prompt?
can you give the lines that come up in command prompt?
Leon1234 said:
dont worry,we can figure it our!
what error are you getting in command prompt?
can you give the lines that come up in command prompt?
Click to expand...
Click to collapse
There are no error appear on cmd..
After I insert a command to deodex settings.odex and press enter, it just like nothing happen...
There are no error appear on cmd..
After I insert a command to deodex settings.odex and press enter, it just like nothing happen...
Click to expand...
Click to collapse
you will have to wait for some time when deodexing depending on the ram of your device.
what is the ram of your computer?
and do you have java 7?

Categories

Resources