diff --git a/dexlib/src/main/java/org/jf/dexlib/Code/FiveRegisterInstruction.java b/dexlib/src/main/java/org/jf/dexlib/Code/FiveRegisterInstruction.java new file mode 100644 index 00000000..f4c3b611 --- /dev/null +++ b/dexlib/src/main/java/org/jf/dexlib/Code/FiveRegisterInstruction.java @@ -0,0 +1,10 @@ +package org.jf.dexlib.Code; + +public interface FiveRegisterInstruction { + byte getRegCount(); + byte getRegisterA(); + byte getRegisterD(); + byte getRegisterE(); + byte getRegisterF(); + byte getRegisterG(); +} diff --git a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35c.java b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35c.java index 2ea0552c..e402054e 100644 --- a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35c.java +++ b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35c.java @@ -28,6 +28,7 @@ package org.jf.dexlib.Code.Format; +import org.jf.dexlib.Code.FiveRegisterInstruction; import org.jf.dexlib.Code.Instruction; import org.jf.dexlib.Code.InstructionWithReference; import org.jf.dexlib.Code.Opcode; @@ -39,7 +40,7 @@ import org.jf.dexlib.TypeIdItem; import org.jf.dexlib.Util.NumberUtils; import org.jf.dexlib.Util.AnnotatedOutput; -public class Instruction35c extends InstructionWithReference { +public class Instruction35c extends InstructionWithReference implements FiveRegisterInstruction { public static final Instruction.InstructionFactory Factory = new Factory(); private byte regCount; private byte regA; @@ -103,14 +104,14 @@ public class Instruction35c extends InstructionWithReference { return Format.Format35c; } - public byte getRegisterA() { - return regA; - } - public byte getRegCount() { return regCount; } + public byte getRegisterA() { + return regA; + } + public byte getRegisterD() { return regD; } diff --git a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35ms.java b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35ms.java index 1f247cf2..06f48036 100644 --- a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35ms.java +++ b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35ms.java @@ -28,6 +28,7 @@ package org.jf.dexlib.Code.Format; +import org.jf.dexlib.Code.FiveRegisterInstruction; import org.jf.dexlib.Code.Instruction; import org.jf.dexlib.Code.Opcode; import org.jf.dexlib.Util.NumberUtils; @@ -35,7 +36,7 @@ import org.jf.dexlib.Util.AnnotatedOutput; import org.jf.dexlib.DexFile; -public class Instruction35ms extends Instruction { +public class Instruction35ms extends Instruction implements FiveRegisterInstruction { public static final Instruction.InstructionFactory Factory = new Factory(); private byte regCount; private byte regA; @@ -97,14 +98,14 @@ public class Instruction35ms extends Instruction { return Format.Format35ms; } - public byte getRegisterA() { - return regA; - } - public byte getRegCount() { return regCount; } + public byte getRegisterA() { + return regA; + } + public byte getRegisterD() { return regD; } diff --git a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35msf.java b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35msf.java index 5374d3f4..34afaf07 100644 --- a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35msf.java +++ b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35msf.java @@ -28,12 +28,13 @@ package org.jf.dexlib.Code.Format; +import org.jf.dexlib.Code.FiveRegisterInstruction; import org.jf.dexlib.Code.Opcode; import org.jf.dexlib.Code.InstructionWithReference; import org.jf.dexlib.MethodIdItem; import org.jf.dexlib.Util.AnnotatedOutput; -public class Instruction35msf extends InstructionWithReference { +public class Instruction35msf extends InstructionWithReference implements FiveRegisterInstruction { private final Instruction35ms unfixedInstruction; public Instruction35msf(Opcode opcode, Instruction35ms unfixedInstruction, MethodIdItem method) { @@ -61,14 +62,14 @@ public class Instruction35msf extends InstructionWithReference { return Format.Format35msf; } - public byte getRegisterA() { - return unfixedInstruction.getRegisterA(); - } - public byte getRegCount() { return unfixedInstruction.getRegCount(); } + public byte getRegisterA() { + return unfixedInstruction.getRegisterA(); + } + public byte getRegisterD() { return unfixedInstruction.getRegisterD(); } diff --git a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35s.java b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35s.java index 026b15df..f30e0bbb 100644 --- a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35s.java +++ b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35s.java @@ -28,6 +28,7 @@ package org.jf.dexlib.Code.Format; +import org.jf.dexlib.Code.FiveRegisterInstruction; import org.jf.dexlib.Code.Instruction; import org.jf.dexlib.Code.Opcode; import org.jf.dexlib.Code.InstructionWithReference; @@ -39,7 +40,7 @@ import org.jf.dexlib.DexFile; import org.jf.dexlib.TypeIdItem; import org.jf.dexlib.MethodIdItem; -public class Instruction35s extends InstructionWithReference { +public class Instruction35s extends InstructionWithReference implements FiveRegisterInstruction { public static final Instruction.InstructionFactory Factory = new Factory(); private byte regCount; private byte regA; @@ -103,14 +104,14 @@ public class Instruction35s extends InstructionWithReference { return Format.Format35s; } - public byte getRegisterA() { - return regA; - } - public byte getRegCount() { return regCount; } + public byte getRegisterA() { + return regA; + } + public byte getRegisterD() { return regD; } diff --git a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35sf.java b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35sf.java index 7480ed05..ae721fce 100644 --- a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35sf.java +++ b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction35sf.java @@ -28,11 +28,12 @@ package org.jf.dexlib.Code.Format; +import org.jf.dexlib.Code.FiveRegisterInstruction; import org.jf.dexlib.Code.Opcode; import org.jf.dexlib.Code.InstructionWithReference; import org.jf.dexlib.Util.AnnotatedOutput; -public class Instruction35sf extends InstructionWithReference { +public class Instruction35sf extends InstructionWithReference implements FiveRegisterInstruction { private final Instruction35s unfixedInstruction; public Instruction35sf(Instruction35s unfixedInstruction) { @@ -59,14 +60,14 @@ public class Instruction35sf extends InstructionWithReference { return Format.Format35sf; } - public byte getRegisterA() { - return unfixedInstruction.getRegisterA(); - } - public byte getRegCount() { return unfixedInstruction.getRegCount(); } + public byte getRegisterA() { + return unfixedInstruction.getRegisterA(); + } + public byte getRegisterD() { return unfixedInstruction.getRegisterD(); } diff --git a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction3rc.java b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction3rc.java index eacf241c..1c0a2426 100644 --- a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction3rc.java +++ b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction3rc.java @@ -32,6 +32,8 @@ import org.jf.dexlib.Code.Instruction; import org.jf.dexlib.Code.InstructionWithReference; import org.jf.dexlib.Code.Opcode; import static org.jf.dexlib.Code.Opcode.*; + +import org.jf.dexlib.Code.RegisterRangeInstruction; import org.jf.dexlib.DexFile; import org.jf.dexlib.Item; import org.jf.dexlib.MethodIdItem; @@ -39,7 +41,7 @@ import org.jf.dexlib.TypeIdItem; import org.jf.dexlib.Util.NumberUtils; import org.jf.dexlib.Util.AnnotatedOutput; -public class Instruction3rc extends InstructionWithReference { +public class Instruction3rc extends InstructionWithReference implements RegisterRangeInstruction { public static final Instruction.InstructionFactory Factory = new Factory(); private byte regCount; private short startReg; diff --git a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction3rms.java b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction3rms.java index b26d5eef..bda501ab 100644 --- a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction3rms.java +++ b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction3rms.java @@ -30,11 +30,12 @@ package org.jf.dexlib.Code.Format; import org.jf.dexlib.Code.Instruction; import org.jf.dexlib.Code.Opcode; +import org.jf.dexlib.Code.RegisterRangeInstruction; import org.jf.dexlib.Util.NumberUtils; import org.jf.dexlib.Util.AnnotatedOutput; import org.jf.dexlib.DexFile; -public class Instruction3rms extends Instruction { +public class Instruction3rms extends Instruction implements RegisterRangeInstruction { public static final Instruction.InstructionFactory Factory = new Factory(); private byte regCount; private short startReg; diff --git a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction3rmsf.java b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction3rmsf.java index 9081c57a..7fbd4a3d 100644 --- a/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction3rmsf.java +++ b/dexlib/src/main/java/org/jf/dexlib/Code/Format/Instruction3rmsf.java @@ -30,10 +30,11 @@ package org.jf.dexlib.Code.Format; import org.jf.dexlib.Code.Opcode; import org.jf.dexlib.Code.InstructionWithReference; +import org.jf.dexlib.Code.RegisterRangeInstruction; import org.jf.dexlib.MethodIdItem; import org.jf.dexlib.Util.AnnotatedOutput; -public class Instruction3rmsf extends InstructionWithReference { +public class Instruction3rmsf extends InstructionWithReference implements RegisterRangeInstruction { private final Instruction3rms unfixedInstruction; public Instruction3rmsf(Opcode opcode, Instruction3rms unfixedInstruction, MethodIdItem method) { diff --git a/dexlib/src/main/java/org/jf/dexlib/Code/RegisterRangeInstruction.java b/dexlib/src/main/java/org/jf/dexlib/Code/RegisterRangeInstruction.java new file mode 100644 index 00000000..c557fb01 --- /dev/null +++ b/dexlib/src/main/java/org/jf/dexlib/Code/RegisterRangeInstruction.java @@ -0,0 +1,6 @@ +package org.jf.dexlib.Code; + +public interface RegisterRangeInstruction { + short getRegCount(); + int getStartRegister(); +}