hosijyun / smali

Automatically exported from code.google.com/p/smali
0 stars 0 forks source link

Exception in thread "main" org.jf.util.ExceptionWithContext: Calculator.odex is not an apk, dex file or odex file. #233

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What seems to be the problem?

I have downloaded latest Android factory image from 
(https://developers.google.com/android/nexus/images). I have mounted it on 
Linux. I want to convert .odex files of Apks to .dex. I tried Calculator.odex 
but encountered following error:

Exception in thread "main" org.jf.util.ExceptionWithContext: Calculator.odex is 
not an apk, dex file or odex file.

What is the exact smali/baksmali command that you ran?

java -jar ./smali/baksmali-2.0.5.jar -a 21 -x 
/andsysimg/app/Calculator/arm/Calculator.odex -d /andsysimg/framework -o 
Calculator

What version of smali/baksmali are you using? What rom are you working
from?

2.0.5

What is the airspeed velocity of an unladen swallow?

Please provide any additional information below: error messages, symptoms,
etc.

I have attached Calculator.odex and Calculator.apk extracted from Android 
factory image.

Original issue reported on code.google.com by waqar...@gmail.com on 30 Jan 2015 at 6:38

Attachments:

GoogleCodeExporter commented 9 years ago
ART odexes are not supported. See my comments in 
https://code.google.com/p/smali/issues/detail?id=225

Original comment by jesusfreke@jesusfreke.com on 30 Jan 2015 at 7:08

GoogleCodeExporter commented 9 years ago
That being said, I could probably at least do some sort of detection of an ART 
odex, and print a more helpful error mesage :)

Original comment by jesusfreke@jesusfreke.com on 30 Jan 2015 at 7:09

GoogleCodeExporter commented 9 years ago
Thanks, I am primarily interested in extracting classes.dex to be used by 
another tool for analysis. Can you recommend some other solution? 

Original comment by waqar...@gmail.com on 30 Jan 2015 at 9:20

GoogleCodeExporter commented 9 years ago
There are tools out there to extract the dex file from an oat file (those .odex 
files are actually oat files), but it will be in an art-specific odex form, 
which baksmali won't be able to deodex correctly. So it will have the odex 
instructions like invoke-virtual/quick, which have a vtable index instead of a 
method name - and similarly for field accesses.

I'm not aware of any tools for deodexing an art odex.

Original comment by jesusfreke@jesusfreke.com on 30 Jan 2015 at 11:55