From 4238ac2dd12461e285472dedfc0e53669b5aec35 Mon Sep 17 00:00:00 2001 From: "JesusFreke@JesusFreke.com" Date: Tue, 12 Jan 2010 07:12:55 +0000 Subject: [PATCH] Add missing interfaces to a couple of Instruction classes git-svn-id: https://smali.googlecode.com/svn/trunk@548 55b6fa8a-2a1e-11de-a435-ffa8d773f76a --- .../java/org/jf/dexlib/Code/Format/Instruction21t.java | 8 +++----- .../java/org/jf/dexlib/Code/Format/Instruction22b.java | 5 +++-- .../java/org/jf/dexlib/Code/Format/Instruction22s.java | 5 +++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction21t.java b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction21t.java index a8f9f725..7b09c6c8 100644 --- a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction21t.java +++ b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction21t.java @@ -28,14 +28,12 @@ package org.jf.dexlib.Code.Format; -import org.jf.dexlib.Code.Instruction; -import org.jf.dexlib.Code.Opcode; -import org.jf.dexlib.Code.OffsetInstruction; +import org.jf.dexlib.Code.*; import org.jf.dexlib.DexFile; import org.jf.dexlib.Util.NumberUtils; import org.jf.dexlib.Util.AnnotatedOutput; -public class Instruction21t extends Instruction implements OffsetInstruction { +public class Instruction21t extends Instruction implements OffsetInstruction, SingleRegisterInstruction { public static final Instruction.InstructionFactory Factory = new Factory(); private byte regA; private short offset; @@ -85,7 +83,7 @@ public class Instruction21t extends Instruction implements OffsetInstruction { return Format.Format21t; } - public int getRegister() { + public int getRegisterA() { return regA & 0xFF; } diff --git a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction22b.java b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction22b.java index 54277644..94e5848a 100644 --- a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction22b.java +++ b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction22b.java @@ -29,12 +29,13 @@ package org.jf.dexlib.Code.Format; import org.jf.dexlib.Code.Instruction; +import org.jf.dexlib.Code.LiteralInstruction; import org.jf.dexlib.Code.Opcode; import org.jf.dexlib.Code.TwoRegisterInstruction; import org.jf.dexlib.DexFile; import org.jf.dexlib.Util.AnnotatedOutput; -public class Instruction22b extends Instruction implements TwoRegisterInstruction { +public class Instruction22b extends Instruction implements TwoRegisterInstruction, LiteralInstruction { public static final Instruction.InstructionFactory Factory = new Factory(); private byte regA; private byte regB; @@ -80,7 +81,7 @@ public class Instruction22b extends Instruction implements TwoRegisterInstructio return regB & 0xFF; } - public byte getLiteral() { + public long getLiteral() { return litC; } diff --git a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction22s.java b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction22s.java index 17262b1f..39e77ca0 100644 --- a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction22s.java +++ b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction22s.java @@ -29,13 +29,14 @@ package org.jf.dexlib.Code.Format; import org.jf.dexlib.Code.Instruction; +import org.jf.dexlib.Code.LiteralInstruction; import org.jf.dexlib.Code.Opcode; import org.jf.dexlib.Code.TwoRegisterInstruction; import org.jf.dexlib.DexFile; import org.jf.dexlib.Util.NumberUtils; import org.jf.dexlib.Util.AnnotatedOutput; -public class Instruction22s extends Instruction implements TwoRegisterInstruction { +public class Instruction22s extends Instruction implements TwoRegisterInstruction, LiteralInstruction { public static final Instruction.InstructionFactory Factory = new Factory(); private byte regA; private byte regB; @@ -80,7 +81,7 @@ public class Instruction22s extends Instruction implements TwoRegisterInstructio return regB; } - public short getLiteral() { + public long getLiteral() { return litC; }