4

I am trying to decompile a system app. Unfortunately there is no classes.dex for this particular system app. There is only a *.odex. I know I have to deodex this so that I get a .dex file. I have looked at smali but evry time I run it I get the following error. Baksmali tells me to use the following syntax:(I am running on windows hence I cant use the bash wrapper provided)

java -jar baksmali-1.3.3.jar -x name.odex

However it throws a top level exception:

UNEXPECTED TOP-LEVEL EXCEPTION:
org.jf.dexlib.Util.ExceptionWithContext: regCount does not match the number of a
rguments of the method
Sab
  • 103
  • 2
  • 5
  • This really is beyond the scope of this site. This site is primarily concerned with helping people use their Android devices. A site like xda-developers is probably better suited for this. – ale Jun 26 '12 at 14:27
  • Okay. I didnt know that. Will post it there. – Sab Jun 26 '12 at 14:42
  • Since this is also apparently a programming issue, [so] might also be an appropriate venue. – ale Jun 26 '12 at 14:43
  • Okay. I guess I wont try to delete it since I have got a couple of answers here which may be helpful. Thanks for the heads up:) – Sab Jun 26 '12 at 14:47

1 Answers1

2

Might be better to use the all in one tool that could help you published courtesy of Sony Ericsson and its open source.

To quote from their wiki page:

Support odex applications and libraries

Use this for the right reason, not for the wrong reason (such as rampant piracy etc, and in no way am I implying anything)

In fact this saved my bacon at one stage when I could not remember whether I bundled a jpeg in a apk that I built and had to go through that tool to confirm my "blonde moment"

Edit: Another thing I noticed - you're missing a switch, for example, this was pulled from here (Credit to the Madteam forum):

java -jar baksmali.jar -d C:\framework -x TouchWiz30Launcher.odex

You need the framework-res.apk (this can be found in /system/framework on the handset) in place hence the -d directory

t0mm13b
  • 13,436
  • 1
  • 48
  • 58
  • looks like a glorified apktool to me. dex2jar was also helpful at one time but i can't really remember if it also did odex. – svarog Jun 26 '12 at 14:30
  • Nope. dex2jar does not support odex. Otherwise it really is a good tool when combined with the power of jad or jd-gui – Sab Jun 26 '12 at 14:43
  • The switch you are talking about is not really required is what I understand from this article-http://code.google.com/p/smali/wiki/DeodexInstructions – Sab Jun 26 '12 at 14:55