From 8bb1d77b669003451e5ef7395742a47a35d70e7d Mon Sep 17 00:00:00 2001 From: "JesusFreke@JesusFreke.com" Date: Sat, 20 Jun 2009 20:02:58 +0000 Subject: [PATCH] - 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 --- .../main/java/org/jf/dexlib/code/Instruction.java | 3 ++- smali/pom.xml | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/dexlib/src/main/java/org/jf/dexlib/code/Instruction.java b/dexlib/src/main/java/org/jf/dexlib/code/Instruction.java index d16490c8..8dbe7978 100644 --- a/dexlib/src/main/java/org/jf/dexlib/code/Instruction.java +++ b/dexlib/src/main/java/org/jf/dexlib/code/Instruction.java @@ -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); } } diff --git a/smali/pom.xml b/smali/pom.xml index 5532beed..6073a0b3 100644 --- a/smali/pom.xml +++ b/smali/pom.xml @@ -52,6 +52,19 @@ + + maven-assembly-plugin + + + jar-with-dependencies + + + + org.jf.smali.main + + + +