SuperZane / smali

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

Elements of AnnotationEncodedSubValue need to be sorted #158

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What seems to be the problem?
Elements of AnnotationEncodedSubValue need to be sorted according to the idx of 
the element_name.

What is the exact smali/baksmali command that you ran?
I use dexlib to parse, instrument and reassemble DEX files. Running one of them 
on Gingerbread threw an exception inside DexOpt:

D/dalvikvm(11949): DexOpt: --- BEGIN 'virtual_call2.dex.zip' (bootstrap=0) ---
D/dalvikvm(11950): creating instr width table
E/dalvikvm(11950): Out-of-order encoded_annotation name_idx: 0x65 then 0x53
E/dalvikvm(11950): Trouble with item 0 @ offset 0x181c
E/dalvikvm(11950): Swap of section type 2004 failed
E/dalvikvm(11950): ERROR: Byte swap + verify failed
E/dalvikvm(11950): Optimization failed
W/dalvikvm(11949): DexOpt: --- END 'virtual_call2.dex.zip' --- status=0xff00, 
process failed

What version of smali/baksmali are you using? What rom are you working
from?
Git version of smali, Cyanogenmod 7.2, Nexus One

What is the airspeed velocity of an unladen swallow?
I don't know that... aaaaaaaaaa....

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

I've implemented the fix and it worked like charm. Patch is attached...

Original issue reported on code.google.com by david.br...@gmail.com on 23 Dec 2012 at 8:04

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the great bug report!

Note however that your patch is incorrect. You sort the names, but not the 
associated values. So any annotations with elements that were originally out of 
order are going to be all out of whack :)

I've pushed a fix for the issue - please try it out and verify it fixes your 
problem.

Original comment by jesusfreke@jesusfreke.com on 26 Dec 2012 at 5:18

GoogleCodeExporter commented 9 years ago
God, you're right! How did I not realize that?! 
Anyway... Tried your fix and I can confirm it works. Thanks...

Original comment by david.br...@gmail.com on 26 Dec 2012 at 10:43

GoogleCodeExporter commented 9 years ago

Original comment by jesusfreke@jesusfreke.com on 26 Dec 2012 at 8:13