Use the term VtableIndex rather than MethodIndex for invoke-*-quick instructions/formats
diff --git a/baksmali/src/main/java/org/jf/baksmali/Adaptors/Format/InstructionMethodItem.java b/baksmali/src/main/java/org/jf/baksmali/Adaptors/Format/InstructionMethodItem.java
index b1556b3..4b0a995 100644
--- a/baksmali/src/main/java/org/jf/baksmali/Adaptors/Format/InstructionMethodItem.java
+++ b/baksmali/src/main/java/org/jf/baksmali/Adaptors/Format/InstructionMethodItem.java
@@ -306,7 +306,7 @@
protected void writeVtableIndex(IndentingWriter writer) throws IOException {
writer.write("vtable@0x");
- writer.printUnsignedLongAsHex(((OdexedInvokeVirtual) instruction).getMethodIndex());
+ writer.printUnsignedLongAsHex(((OdexedInvokeVirtual) instruction).getVtableIndex());
}
protected void writeReference(IndentingWriter writer) throws IOException {
diff --git a/dexlib/src/main/java/org/jf/dexlib/Code/Analysis/InlineMethodResolver.java b/dexlib/src/main/java/org/jf/dexlib/Code/Analysis/InlineMethodResolver.java
index c766070..aad4cb5 100644
--- a/dexlib/src/main/java/org/jf/dexlib/Code/Analysis/InlineMethodResolver.java
+++ b/dexlib/src/main/java/org/jf/dexlib/Code/Analysis/InlineMethodResolver.java
@@ -81,7 +81,7 @@
assert analyzedInstruction.instruction instanceof OdexedInvokeVirtual;
OdexedInvokeVirtual instruction = (OdexedInvokeVirtual)analyzedInstruction.instruction;
- int methodIndex = instruction.getMethodIndex();
+ int methodIndex = instruction.getVtableIndex();
if (methodIndex < 0 || methodIndex >= inlineMethods.length) {
throw new RuntimeException("Invalid method index: " + methodIndex);
@@ -146,7 +146,7 @@
assert analyzedInstruction.instruction instanceof OdexedInvokeVirtual;
OdexedInvokeVirtual instruction = (OdexedInvokeVirtual)analyzedInstruction.instruction;
- int methodIndex = instruction.getMethodIndex();
+ int methodIndex = instruction.getVtableIndex();
if (methodIndex < 0 || methodIndex >= inlineMethods.length) {
throw new RuntimeException("Invalid method index: " + methodIndex);
diff --git a/dexlib/src/main/java/org/jf/dexlib/Code/Analysis/MethodAnalyzer.java b/dexlib/src/main/java/org/jf/dexlib/Code/Analysis/MethodAnalyzer.java
index 75a371b..232b891 100644
--- a/dexlib/src/main/java/org/jf/dexlib/Code/Analysis/MethodAnalyzer.java
+++ b/dexlib/src/main/java/org/jf/dexlib/Code/Analysis/MethodAnalyzer.java
@@ -3344,7 +3344,7 @@
MethodIdItem inlineMethodIdItem = inlineMethod.getMethodIdItem();
if (inlineMethodIdItem == null) {
throw new ValidationException(String.format("Cannot load inline method with index %d",
- instruction.getMethodIndex()));
+ instruction.getVtableIndex()));
}
Opcode deodexedOpcode = null;
@@ -3382,7 +3382,7 @@
MethodIdItem inlineMethodIdItem = inlineMethod.getMethodIdItem();
if (inlineMethodIdItem == null) {
throw new ValidationException(String.format("Cannot load inline method with index %d",
- instruction.getMethodIndex()));
+ instruction.getVtableIndex()));
}
Opcode deodexedOpcode = null;
@@ -3458,11 +3458,11 @@
if (isRange) {
Instruction3rms instruction = (Instruction3rms)analyzedInstruction.instruction;
- methodIndex = instruction.getMethodIndex();
+ methodIndex = instruction.getVtableIndex();
objectRegister = instruction.getStartRegister();
} else {
Instruction35ms instruction = (Instruction35ms)analyzedInstruction.instruction;
- methodIndex = instruction.getMethodIndex();
+ methodIndex = instruction.getVtableIndex();
objectRegister = instruction.getRegisterD();
}
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 13d5ccf..582bc38 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
@@ -45,10 +45,10 @@
private byte regE;
private byte regF;
private byte regG;
- private short methodIndex;
+ private short vtableIndex;
public Instruction35ms(Opcode opcode, int regCount, byte regD, byte regE, byte regF, byte regG,
- byte regA, int methodIndex) {
+ byte regA, int vtableIndex) {
super(opcode);
if (regCount > 5) {
throw new RuntimeException("regCount cannot be greater than 5");
@@ -62,7 +62,7 @@
throw new RuntimeException("All register args must fit in 4 bits");
}
- if (methodIndex >= 1 << 16) {
+ if (vtableIndex >= 1 << 16) {
throw new RuntimeException("The method index must be less than 65536");
}
@@ -72,7 +72,7 @@
this.regE = regE;
this.regF = regF;
this.regG = regG;
- this.methodIndex = (short)methodIndex;
+ this.vtableIndex = (short)vtableIndex;
}
private Instruction35ms(Opcode opcode, byte[] buffer, int bufferIndex) {
@@ -84,13 +84,13 @@
this.regE = NumberUtils.decodeHighUnsignedNibble(buffer[bufferIndex + 4]);
this.regF = NumberUtils.decodeLowUnsignedNibble(buffer[bufferIndex + 5]);
this.regG = NumberUtils.decodeHighUnsignedNibble(buffer[bufferIndex + 5]);
- this.methodIndex = (short)NumberUtils.decodeUnsignedShort(buffer, bufferIndex + 2);
+ this.vtableIndex = (short)NumberUtils.decodeUnsignedShort(buffer, bufferIndex + 2);
}
protected void writeInstruction(AnnotatedOutput out, int currentCodeAddress) {
out.writeByte(opcode.value);
out.writeByte((regCount << 4) | regA);
- out.writeShort(methodIndex);
+ out.writeShort(vtableIndex);
out.writeByte((regE << 4) | regD);
out.writeByte((regG << 4) | regF);
}
@@ -123,8 +123,8 @@
return regG;
}
- public int getMethodIndex() {
- return methodIndex & 0xFFFF;
+ public int getVtableIndex() {
+ return vtableIndex & 0xFFFF;
}
private static class Factory implements Instruction.InstructionFactory {
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 7ee0f6c..08d8e41 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
@@ -40,9 +40,9 @@
public static final Instruction.InstructionFactory Factory = new Factory();
private byte regCount;
private short startReg;
- private short methodIndex;
+ private short vtableIndex;
- public Instruction3rms(Opcode opcode, short regCount, int startReg, int methodIndex) {
+ public Instruction3rms(Opcode opcode, short regCount, int startReg, int vtableIndex) {
super(opcode);
if (regCount >= 1 << 8) {
@@ -59,27 +59,27 @@
throw new RuntimeException("The beginning register of the range cannot be negative");
}
- if (methodIndex >= 1 << 16) {
+ if (vtableIndex >= 1 << 16) {
throw new RuntimeException("The method index must be less than 65536");
}
this.regCount = (byte)regCount;
this.startReg = (short)startReg;
- this.methodIndex = (short)methodIndex;
+ this.vtableIndex = (short)vtableIndex;
}
private Instruction3rms(Opcode opcode, byte[] buffer, int bufferIndex) {
super(opcode);
this.regCount = (byte)NumberUtils.decodeUnsignedByte(buffer[bufferIndex + 1]);
- this.methodIndex = (short)NumberUtils.decodeUnsignedShort(buffer, bufferIndex + 2);
+ this.vtableIndex = (short)NumberUtils.decodeUnsignedShort(buffer, bufferIndex + 2);
this.startReg = (short)NumberUtils.decodeUnsignedShort(buffer, bufferIndex + 4);
}
protected void writeInstruction(AnnotatedOutput out, int currentCodeAddress) {
out.writeByte(opcode.value);
out.writeByte(regCount);
- out.writeShort(methodIndex);
+ out.writeShort(vtableIndex);
out.writeShort(startReg);
}
@@ -95,8 +95,8 @@
return startReg & 0xFFFF;
}
- public int getMethodIndex() {
- return methodIndex & 0xFFFF;
+ public int getVtableIndex() {
+ return vtableIndex & 0xFFFF;
}
private static class Factory implements Instruction.InstructionFactory {
diff --git a/dexlib/src/main/java/org/jf/dexlib/Code/OdexedInvokeVirtual.java b/dexlib/src/main/java/org/jf/dexlib/Code/OdexedInvokeVirtual.java
index ea4de88..02fd1e6 100644
--- a/dexlib/src/main/java/org/jf/dexlib/Code/OdexedInvokeVirtual.java
+++ b/dexlib/src/main/java/org/jf/dexlib/Code/OdexedInvokeVirtual.java
@@ -29,5 +29,5 @@
package org.jf.dexlib.Code;
public interface OdexedInvokeVirtual {
- int getMethodIndex();
+ int getVtableIndex();
}