zzgambol / smali

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

Error while disassembling class #202

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What seems to be the problem?
When trying to baksmali I get,

Error occurred while disassembling class Ljava.lang.RealToString; - skipping 
class
java.lang.RuntimeException: Invalid method index: 30
    at org.jf.dexlib2.analysis.InlineMethodResolver$InlineMethodResolver_version36.resolveExecuteInline(InlineMethodResolver.java:175)
    at org.jf.dexlib2.analysis.MethodAnalyzer.analyzeExecuteInline(MethodAnalyzer.java:1422)
    at org.jf.dexlib2.analysis.MethodAnalyzer.analyzeInstruction(MethodAnalyzer.java:941)
    at org.jf.dexlib2.analysis.MethodAnalyzer.analyze(MethodAnalyzer.java:202)
    at org.jf.dexlib2.analysis.MethodAnalyzer.<init>(MethodAnalyzer.java:137)
    at org.jf.baksmali.Adaptors.MethodDefinition.addAnalyzedInstructionMethodItems(MethodDefinition.java:387)
    at org.jf.baksmali.Adaptors.MethodDefinition.getMethodItems(MethodDefinition.java:296)
    at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:198)
    at org.jf.baksmali.Adaptors.ClassDefinition.writeDirectMethods(ClassDefinition.java:277)
    at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:112)
    at org.jf.baksmali.baksmali.disassembleClass(baksmali.java:226)
    at org.jf.baksmali.baksmali.access$000(baksmali.java:56)
    at org.jf.baksmali.baksmali$1.call(baksmali.java:150)
    at org.jf.baksmali.baksmali$1.call(baksmali.java:148)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:662)

I compiled and tried to run deodexerant but I get,

Failed to load dvmGetInlineOpsTable

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

java -Xmx512m -jar baksmali.jar -a 18 -d ../framework -x core.odex

What version of smali/baksmali are you using? What rom are you working
from?
2.0.3
What is the airspeed velocity of an unladen swallow?
What do you mean? An African or European swallow? :)

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

This is against stock Nvidia Shield that's running Android 4.3

Original issue reported on code.google.com by razorbla...@gmail.com on 18 Feb 2014 at 1:10

GoogleCodeExporter commented 9 years ago
Make sure you're using the latest deodexerant, I recently updated it to work 
with newer versions of dalvik 
(https://code.google.com/p/smali/source/detail?r=15e44d5b8b0cc77f81f41a2a9f553e2
987d5033c)

Original comment by jesusfreke@jesusfreke.com on 20 Feb 2014 at 12:34

GoogleCodeExporter commented 9 years ago
So i downloaded the latest deodexerant and smali/baksmali source code.  Built 
them and re-ran.  99% of the files went fine except for services.odex.  See 
attached.

Original comment by razorbla...@gmail.com on 1 Mar 2014 at 2:28

Attachments:

GoogleCodeExporter commented 9 years ago
Please provide the full command you used

Original comment by jesusfreke@jesusfreke.com on 1 Mar 2014 at 2:33

GoogleCodeExporter commented 9 years ago
Sorry about that, java -jar baksmali.jar -a 18 -T inline.txt -x services.odex 
-d framework/

I had all the framework files in a framework directory where i was attempting 
it.

Original comment by razorbla...@gmail.com on 1 Mar 2014 at 2:35

GoogleCodeExporter commented 9 years ago
Hmm. I think I'll need to take a look at this myself. I'm not sure if it's a 
bug in baksmali or something weird about that class. Is the system image (or at 
least the framework directory) available somewhere?

Original comment by jesusfreke@jesusfreke.com on 1 Mar 2014 at 3:15

GoogleCodeExporter commented 9 years ago
Yep.  This is for an nvidia shield and they have the images available.  

http://developer.download.nvidia.com/mobile/shield/extract-nv-recovery-image-shi
eld-01.00.14422_318.3689.sh.zip

Original comment by razorbla...@gmail.com on 1 Mar 2014 at 3:18

GoogleCodeExporter commented 9 years ago
I can't reproduce the problem. It works fine for me.

After extracting the system image and grabbing the framework directory, this 
works fine, with no errors:

baksmali -a 18 -T /tmp/inline.txt -x services.odex -d /tmp/framework

This is with the latest build from source (baksmali 2.0.3-2d8cbfe6)

Original comment by jesusfreke@jesusfreke.com on 1 Mar 2014 at 3:48

GoogleCodeExporter commented 9 years ago
I'm going to redownload download the source, rebuild baksmali and try again.  
Also going to download the image again.

Original comment by razorbla...@gmail.com on 1 Mar 2014 at 3:51

GoogleCodeExporter commented 9 years ago
So my files must of gotten messed up somehow.  After rebuilding baksmali and 
redownloading the system files it worked fine....Not sure what happened with my 
original files but seems to be fine now.  Thanks for your help!

Original comment by razorbla...@gmail.com on 1 Mar 2014 at 4:26

GoogleCodeExporter commented 9 years ago

Original comment by jesusfreke@jesusfreke.com on 1 Mar 2014 at 4:27