- Fixed an issue when decoding the index for instructions that contain an indexed item references

git-svn-id: https://smali.googlecode.com/svn/trunk@175 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
JesusFreke@JesusFreke.com 2009-06-20 20:02:58 +00:00
parent 1c9fcdee6d
commit 8bb1d77b66
2 changed files with 15 additions and 1 deletions

View File

@ -29,6 +29,7 @@
package org.jf.dexlib.code;
import org.jf.dexlib.*;
import org.jf.dexlib.util.NumberUtils;
import org.jf.dexlib.code.Format.Format;
public abstract class Instruction {
@ -84,7 +85,7 @@ public abstract class Instruction {
System.arraycopy(rest, 0, encodedInstruction, 1, rest.length);
if (opcode.referenceType != ReferenceType.none) {
int itemIndex = (encodedInstruction[3] << 8) | encodedInstruction[2];
int itemIndex = NumberUtils.decodeUnsignedShort(encodedInstruction[2], encodedInstruction[3]);
getReferencedItem(dexFile, opcode, itemIndex);
}
}

View File

@ -52,6 +52,19 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>org.jf.smali.main</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>