xychix / smali

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

baksmali.jar - Invalid method index: 22 #89

Closed GoogleCodeExporter closed 9 years ago

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

baksmali.jar - Invalid method index: 22

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

SET 
BOOTCLASS=core.jar:bouncycastle.jar:ext.jar:framework.jar:android.policy.jar:ser
vices.jar:core-junit.jar:lguplus.jar
java -jar baksmali.jar -c %BOOTCLASS% -d framework -x framework.odex -o 
framework-mod

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

1.2.8

What is the airspeed velocity of an unladen swallow?

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

Error occured while disassembling class Landroid.bluetooth.AtParser; - skipping
class
java.lang.RuntimeException: Invalid method index: 22
        at org.jf.dexlib.Code.Analysis.InlineMethodResolver$InlineMethodResolver
_version36.resolveExecuteInline(InlineMethodResolver.java:152)
        at org.jf.dexlib.Code.Analysis.DeodexUtil.lookupInlineMethod(DeodexUtil.
java:58)
        at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyzeExecuteInline(Metho
dAnalyzer.java:3340)
        at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyzeInstruction(MethodA
nalyzer.java:1016)
        at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyze(MethodAnalyzer.jav
a:208)
        at org.jf.baksmali.Adaptors.MethodDefinition.addAnalyzedInstructionMetho
dItems(MethodDefinition.java:353)
        at org.jf.baksmali.Adaptors.MethodDefinition.getMethodItems(MethodDefini
tion.java:290)
        at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.ja
va:130)
        at org.jf.baksmali.Adaptors.ClassDefinition.writeMethods(ClassDefinition
.java:322)
        at org.jf.baksmali.Adaptors.ClassDefinition.writeVirtualMethods(ClassDef
inition.java:307)
        at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java
:136)
        at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:191)
        at org.jf.baksmali.main.main(main.java:278)

Original issue reported on code.google.com by kdh4...@gmail.com on 10 Nov 2011 at 4:24

GoogleCodeExporter commented 9 years ago
What rom is this from?

Original comment by jesusfreke@jesusfreke.com on 10 Nov 2011 at 4:31

GoogleCodeExporter commented 9 years ago
LG-LU6200 (Optimus LTE)

Original comment by kdh4...@gmail.com on 10 Nov 2011 at 4:35

GoogleCodeExporter commented 9 years ago
Great, thanks. What version of android?

Original comment by jesusfreke@jesusfreke.com on 10 Nov 2011 at 4:48

GoogleCodeExporter commented 9 years ago
Thanks for the quick reply.

android version : 2.3.5

I attach a build.prop file.

and I link a zip file /system/framework
http://me2.do/xcuV6e

Original comment by kdh4...@gmail.com on 10 Nov 2011 at 5:04

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks. I took a look at the latest AOSP source release, and there are only 22 
inline methods (indexes 0-21). The error indicates that it is looking for an 
inline method at index 22. so it sounds like the manufacturer added additional 
inline methods to dalvik for that device.

In order to support this type of thing, I'll need to create a utility to dump 
the inline method table from dalvik, and then add support in baksmali for using 
an alternate inline method table.

I'll try and get this done, possibly over the weekend, and then I'll do a new 
release with the changes.

Original comment by bgruv@google.com on 10 Nov 2011 at 5:26

GoogleCodeExporter commented 9 years ago
Did not solved yet?

Original comment by kdh4...@gmail.com on 17 Nov 2011 at 3:37

GoogleCodeExporter commented 9 years ago
Soon :)

Original comment by jesusfreke@jesusfreke.com on 17 Nov 2011 at 4:39

GoogleCodeExporter commented 9 years ago
I've added support in 1.3.0 for specifying a custom inline table. See my blog 
post for more details 
(http://blog.jesusfreke.com/2011/11/smalibaksmali-130.html).

If you need any help compiling the tool, let me know.

Also, I wouldn't mind seeing the dump of the inline table, once you get it :)

Original comment by jesusfreke@jesusfreke.com on 21 Nov 2011 at 7:45

GoogleCodeExporter commented 9 years ago
Thank you... but other error occured.

deodexerant was successfully compiled. and I have got inline.txt.

java -jar baksmali-1.3.0.jar -T inline.txt -c 
core.jar:bouncycastle.jar:ext.jar:framework.jar:android.policy.jar:services.jar:
core-junit.
jar:lguplus.jar -d framework -x framework.odex -o framework-mod

UNEXPECTED TOP-LEVEL EXCEPTION:
org.jf.dexlib.Util.ExceptionWithContext: regCount does not match the number of a
rguments 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 @0x1917bc

please help me...

Original comment by kdh4...@gmail.com on 21 Nov 2011 at 9:25

Attachments:

GoogleCodeExporter commented 9 years ago
When deodexing a pre-ICS odex, you now have to add -a <api-level> (as of 1.3.0)

Original comment by jesusfreke@jesusfreke.com on 21 Nov 2011 at 4:20

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Thank you very much.
smali and baksmali are work successfully.

Original comment by kdh4...@gmail.com on 22 Nov 2011 at 5:39