notishell / smali

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

ClassCastException while disassembling an apk #150

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What seems to be the problem?
While running baksmali, getting class cast exception. The classes themselves 
are within the dex lib. So, somewhere during the disassembling the classes are 
muxed.

What is the exact smali/baksmali command that you ran?
java -jar $baksmali_jar_location -b -o /tmp/classes classes.dex

What version of smali/baksmali are you using? What rom are you working
from?
Tried both 1.3.3 and 1.4

What is the airspeed velocity of an unladen swallow?
aprox 430 inches/s

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

Error occured while disassembling class 
Lcom.tf.cvcalc.filter.xlsx.reader.DrawingMLChartImporter$TagChartAction; - 
skipping class
java.lang.ClassCastException: org.jf.dexlib.TypeIdItem cannot be cast to 
org.jf.dexlib.FieldIdItem
at 
org.jf.dexlib.Code.Analysis.SyntheticAccessorResolver.getAccessedMember(Syntheti
cAccessorResolver.java:105)
at 
org.jf.baksmali.Adaptors.MethodDefinition.addInstructionMethodItems(MethodDefini
tion.java:363)
at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:132)
at 
org.jf.baksmali.Adaptors.ClassDefinition.writeMethods(ClassDefinition.java:338)
at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:117)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:205)
at org.jf.baksmali.main.main(main.java:297)

Original issue reported on code.google.com by Ping...@gmail.com on 8 Oct 2012 at 10:11

GoogleCodeExporter commented 9 years ago
Hmm. I had somehow missed this issue. Sorry for not getting back to you sooner. 
I'll take a look at it.

Original comment by jesusfreke@jesusfreke.com on 14 Nov 2012 at 7:48

GoogleCodeExporter commented 9 years ago
As a temporary workaround, you can use the -m option, to disable the accessor 
comments.

Original comment by jesusfreke@jesusfreke.com on 14 Nov 2012 at 7:52

GoogleCodeExporter commented 9 years ago
I will try with that option. (Not immediately, out of access, will try it in a 
week) Just as a curiosity, even with -m option, the class will be skipped, what 
happens while re-assembling if the smali file is missing for that class?

Original comment by Ping...@gmail.com on 15 Nov 2012 at 6:15

GoogleCodeExporter commented 9 years ago
The class won't be skipped. Using the -m option will entirely skip the codepath 
that is raising the excepption. You just won't get the nice helpful comments 
above invokes to access$012 type methods, telling you what method/field it's 
actually accessing.

Original comment by jesusfreke@jesusfreke.com on 15 Nov 2012 at 7:01

GoogleCodeExporter commented 9 years ago
Ok, it looks like I already fixed this, right after you reported it. Which is 
really strange, because I don't remember fixing it :)

In any case, the fix will be in 1.4.1.

Original comment by jesusfreke@jesusfreke.com on 19 Nov 2012 at 7:48