acurs / smali

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

baksmali:when deodex get wrong: java.lang.RuntimeException: Invalid method index: 30 #199

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What seems to be the problem?
When I use baksmali to deodex an odex file , wrong msg: Invalid method index: 30
What is the exact smali/baksmali command that you ran?

java -jar baksmali-1.4.2.jar -a 17 -x core.odex

What version of smali/baksmali are you using? What rom are you working
from?
I must use Ver1.4.2 for miui patchrom

What is the airspeed velocity of an unladen swallow?

Please provide any additional information below: error messages, symptoms,
etc.
Error occured while disassembling class Ljava.lang.RealToString; - skipping 
class
java.lang.RuntimeException: Invalid method index: 29
    at org.jf.dexlib.Code.Analysis.InlineMethodResolver$InlineMethodResolver_version36.resolveExecuteInline(InlineMethodResolver.java:157)
    at org.jf.dexlib.Code.Analysis.DeodexUtil.lookupInlineMethod(DeodexUtil.java:64)
    at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyzeExecuteInline(MethodAnalyzer.java:3467)
    at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyzeInstruction(MethodAnalyzer.java:1087)
    at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyze(MethodAnalyzer.java:213)
    at org.jf.baksmali.Adaptors.MethodDefinition.addAnalyzedInstructionMethodItems(MethodDefinition.java:389)
    at org.jf.baksmali.Adaptors.MethodDefinition.getMethodItems(MethodDefinition.java:311)
    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.writeDirectMethods(ClassDefinition.java:294)
    at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:116)
    at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:186)
    at org.jf.baksmali.main.main(main.java:308)

Original issue reported on code.google.com by kkddccl...@gmail.com on 2 Feb 2014 at 9:16

Attachments:

GoogleCodeExporter commented 9 years ago
Why do you have to use 1.4.2? Also, you seem to have attached an inline.txt, 
and the exception seems to indicate that you need to use a custom inline method 
table. But based on the command you gave, you aren't actually using it. So I'm 
mostly just confused.

Original comment by jesusfreke@jesusfreke.com on 2 Feb 2014 at 11:50

GoogleCodeExporter commented 9 years ago
if use this command: java -jar baksmali-1.4.2.jar -T inline.txt -a 17 -x 
core.odex
get this err:

UNEXPECTED TOP-LEVEL EXCEPTION:
org.jf.dexlib.Util.ExceptionWithContext: regCount does not match the number of 
arguments of the method

if I use baksmali2.0.3 to deodex the Rom file ,it can not boot when flash to 
phone

btw:The Miui patchrom use baksmail1.4.2 ,so if change it to 2.0.3 ,will get 
more work to do.
sorry for my poor English.

Original comment by kkddccl...@gmail.com on 2 Feb 2014 at 1:57

GoogleCodeExporter commented 9 years ago
The Rom is for MT6592 base android 4.2.2 ,I tried value of api-level from 13 to 
18 ,all the same get err:regCount does not match the number of arguments of the 
method.

Original comment by kkddccl...@gmail.com on 2 Feb 2014 at 2:01

GoogleCodeExporter commented 9 years ago
Please provide the full stack trace for that error.

Where did you get the inline.txt from? Did you actually run deodexerant on your 
device? I suspect it's not the correct set of inline methods for your device.

I also suspect the not-booting issue when using 2.0.3 is also a symptom of 
deodexing with the wrong set of inline methods.

As far as the patchrom thing, you should be able to deodex with 2.0.3, 
reassemble into a dex file, and then disassemble again with 1.4.2 to get the 
1.4.2 sources.

Note that 1.4.2 is no longer supported, and no new fixes or releases are going 
to be made for the 1.* versions.

Original comment by jesusfreke@jesusfreke.com on 2 Feb 2014 at 7:00

GoogleCodeExporter commented 9 years ago
I have compiled deodexerant and ran in my phone to get inline.txt.
here is not-booting logcat when I used 2.0.3 to deodex.

Original comment by kkddccl...@gmail.com on 2 Feb 2014 at 11:42

Attachments:

GoogleCodeExporter commented 9 years ago
https://drive.google.com/file/d/0B3qZ_DOiLl6eTmNKbjFPamozRnc/edit?usp=sharing
here is framework of stockrom

Original comment by kkddccl...@gmail.com on 2 Feb 2014 at 11:49

GoogleCodeExporter commented 9 years ago
I modified sourcecode of 1.4.2 to correct regCode and add inlinemethod from 
inline.txt,and now it works fine.

btw: follow you said deodex with 2.0.3, reassemble into a dex file,but can`t 
disassemble again with 1.4.2 .

Original comment by kkddccl...@gmail.com on 3 Feb 2014 at 12:24

GoogleCodeExporter commented 9 years ago
Thanks for the info, I'll take a look at the framework files you gave and see 
if I notice anything that looks wrong when deodexing with 2.0.3.

What do you mean "to correct regCode"? And why can't you disassemble again with 
1.4.2?

Original comment by jesusfreke@jesusfreke.com on 3 Feb 2014 at 2:02

GoogleCodeExporter commented 9 years ago
I think I fixed the issue in 2.0.3. These odex files have invalid 
invoke-object-init/range instructions. Luckily, they appear to be valid enough 
to get the info that we need to deodex, at least. I've committed a hack that 
should work for these odex files. You can grab the latest source and try it out.

Original comment by jesusfreke@jesusfreke.com on 3 Feb 2014 at 3:31

GoogleCodeExporter commented 9 years ago
thanks , I will try it.

Original comment by kkddccl...@gmail.com on 3 Feb 2014 at 5:04

GoogleCodeExporter commented 9 years ago
Perfect.

Original comment by kkddccl...@gmail.com on 5 Feb 2014 at 7:31

GoogleCodeExporter commented 9 years ago

Original comment by jesusfreke@jesusfreke.com on 5 Feb 2014 at 7:50

GoogleCodeExporter commented 9 years ago
Hi,

It's possible to share with me the deodexerant binary please?! I have the same 
issues on my TK6592. And cannot deodex with 2.0.3.

Thx in advance

Original comment by dogan.ir...@gmail.com on 2 Mar 2014 at 4:47

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
hello, I have not figured out if they are available for the deodex of the smali 
mtk6592

Original comment by marsap...@gmail.com on 27 Mar 2014 at 12:58

GoogleCodeExporter commented 9 years ago
I have designed a script to deodex roms, and one of its advantages is that it 
fixes this error (get inline.txt of the device and then use it in baksmali).

Link: https://dl.dropboxusercontent.com/u/19923987/Unreal-Deodex.rar

Original comment by UnrealMi...@gmail.com on 30 May 2014 at 3:14