From 526d617e05d512318f1e9f9be7de3a3c2a4f80be Mon Sep 17 00:00:00 2001 From: "JesusFreke@JesusFreke.com" Date: Wed, 23 Dec 2009 05:27:30 +0000 Subject: [PATCH] When writing an Instruction31t opcode, align the offset to the switch/array data git-svn-id: https://smali.googlecode.com/svn/trunk@506 55b6fa8a-2a1e-11de-a435-ffa8d773f76a --- .../main/java/org/jf/dexlib/Code/Format/Instruction31t.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction31t.java b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction31t.java index 4242f187..7da380a5 100644 --- a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction31t.java +++ b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction31t.java @@ -62,8 +62,7 @@ public class Instruction31t extends Instruction implements OffsetInstruction, Si protected void writeInstruction(AnnotatedOutput out, int currentCodeOffset) { out.writeByte(opcode.value); out.writeByte(regA); - //TODO: get offset from offsetTarget - out.writeInt(offset); + out.writeInt(offset + (((currentCodeOffset/2) + offset) % 2)); } public void updateOffset(int offset) {