notishell / smali

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

cannot baksmali HTC_IME.odex in version 1.3.2 #111

Closed GoogleCodeExporter closed 9 years ago

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

baksmali 1.3.2 throws an exception and prints a stack trace when I try to run 
it against HTC_IME.odex.  Version 1.2.8 works fine however, so it seems there 
may be a regression?

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

baksmali -d ./framework -x HTC_IME.odex -o ime.out

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

baksmali 1.3.2 and MikG 3.1 

What is the airspeed velocity of an unladen swallow?

public double getAirspeedVelocity() {
    return isAfrican(this) ? AIRSPEED_AFRICAN : AIRSPEED_EUROPEAN;
}

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

I'm on Ubuntu 11.10.  I unzipped the MikG ROM, and then created a new directory 
on my system called htc_ime.  I then copied the entire system/framework 
directory over to htc_ime as well as system/app/HTC_IME.odex.  Then I cd into 
htc_ime and attempt to run baksmali.  Note that I have attempted passing a 
fully qualified path as an argument to -d and it fails in the same manner.  
Here is the output:

$ baksmali -d ./framework -x HTC_IME.odex -o ime.out

UNEXPECTED TOP-LEVEL EXCEPTION:
org.jf.dexlib.Util.ExceptionWithContext: regCount does not match the number of 
arguments of the method
    at org.jf.dexlib.Util.ExceptionWithContext.withContext(ExceptionWithContext.java:54)
    at org.jf.dexlib.Code.InstructionIterator.IterateInstructions(InstructionIterator.java:92)
    at org.jf.dexlib.CodeItem.readItem(CodeItem.java:154)
    at org.jf.dexlib.Item.readFrom(Item.java:76)
    at org.jf.dexlib.OffsettedSection.readItems(OffsettedSection.java:48)
    at org.jf.dexlib.Section.readFrom(Section.java:143)
    at org.jf.dexlib.DexFile.<init>(DexFile.java:431)
    at org.jf.baksmali.main.main(main.java:265)
Caused by: java.lang.RuntimeException: regCount does not match the number of 
arguments of the method
    at org.jf.dexlib.Code.Format.Instruction3rc.checkItem(Instruction3rc.java:129)
    at org.jf.dexlib.Code.Format.Instruction3rc.<init>(Instruction3rc.java:79)
    at org.jf.dexlib.Code.Format.Instruction3rc.<init>(Instruction3rc.java:44)
    at org.jf.dexlib.Code.Format.Instruction3rc$Factory.makeInstruction(Instruction3rc.java:145)
    at org.jf.dexlib.Code.InstructionIterator.IterateInstructions(InstructionIterator.java:84)
    ... 6 more
Error occured at code address 0
code_item @0x2e418

Original issue reported on code.google.com by bdma...@gmail.com on 5 Mar 2012 at 7:55

GoogleCodeExporter commented 9 years ago
Have you tried setting the proper api level? What version of Android?
Try: -a13 or -a10

Original comment by rustam...@gmail.com on 10 Mar 2012 at 11:37

GoogleCodeExporter commented 9 years ago
D'oh...works like a champ with the api argument.  It's 2.3.5 so using -a 10 
works great.  I guess you can close this then.  I'm still not really sure why 
it worked in 1.2.8 without specifying that argument but maybe this was a 
deliberate change?

In any case, thanks for the tip!

Original comment by bdma...@gmail.com on 11 Mar 2012 at 4:05

GoogleCodeExporter commented 9 years ago
Yes, recent versions of baksmali require the -a option when deodexing, if it's 
<ICS

Original comment by jesusfreke@jesusfreke.com on 11 Mar 2012 at 5:28