本文整理匯總了Java中org.jf.dexlib.Item類的典型用法代碼示例。如果您正苦於以下問題:Java Item類的具體用法?Java Item怎麽用?Java Item使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Item類屬於org.jf.dexlib包,在下文中一共展示了Item類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: checkItem
import org.jf.dexlib.Item; //導入依賴的package包/類
private static void checkItem(Opcode opcode, Item item, int regCount) {
if (opcode == FILLED_NEW_ARRAY_RANGE) {
//check data for filled-new-array/range opcode
String type = ((TypeIdItem) item).getTypeDescriptor();
if (type.charAt(0) != '[') {
throw new RuntimeException("The type must be an array type");
}
if (type.charAt(1) == 'J' || type.charAt(1) == 'D') {
throw new RuntimeException("The type cannot be an array of longs or doubles");
}
} else if (opcode.value >= INVOKE_VIRTUAL_RANGE.value && opcode.value <= INVOKE_INTERFACE_RANGE.value) {
//check data for invoke-*/range opcodes
MethodIdItem methodIdItem = (MethodIdItem) item;
int parameterRegisterCount = methodIdItem.getPrototype().getParameterRegisterCount();
if (opcode != INVOKE_STATIC_RANGE) {
parameterRegisterCount++;
}
if (parameterRegisterCount != regCount) {
throw new RuntimeException("regCount does not match the number of arguments of the method");
}
}
}
示例2: Instruction21c
import org.jf.dexlib.Item; //導入依賴的package包/類
public Instruction21c(Opcode opcode, short regA, Item referencedItem) {
super(opcode, referencedItem);
if (regA >= 1 << 8) {
throw new RuntimeException("The register number must be less than v256");
}
if (opcode == Opcode.NEW_INSTANCE) {
assert referencedItem instanceof TypeIdItem;
if (((TypeIdItem)referencedItem).getTypeDescriptor().charAt(0) != 'L') {
throw new RuntimeException("Only class references can be used with the new-instance opcode");
}
}
this.regA = (byte)regA;
}
示例3: Instruction35s
import org.jf.dexlib.Item; //導入依賴的package包/類
public Instruction35s(Opcode opcode, int regCount, byte regD, byte regE, byte regF, byte regG,
byte regA, Item referencedItem) {
super(opcode, referencedItem);
if (regCount > 5) {
throw new RuntimeException("regCount cannot be greater than 5");
}
if (regD >= 1 << 4 ||
regE >= 1 << 4 ||
regF >= 1 << 4 ||
regG >= 1 << 4 ||
regA >= 1 << 4) {
throw new RuntimeException("All register args must fit in 4 bits");
}
checkItem(opcode, referencedItem, regCount);
this.regCount = (byte)regCount;
this.regA = regA;
this.regD = regD;
this.regE = regE;
this.regF = regF;
this.regG = regG;
}
示例4: checkItem
import org.jf.dexlib.Item; //導入依賴的package包/類
private static void checkItem(Opcode opcode, Item item, int regCount) {
if (opcode == FILLED_NEW_ARRAY) {
//check data for filled-new-array opcode
String type = ((TypeIdItem) item).getTypeDescriptor();
if (type.charAt(0) != '[') {
throw new RuntimeException("The type must be an array type");
}
if (type.charAt(1) == 'J' || type.charAt(1) == 'D') {
throw new RuntimeException("The type cannot be an array of longs or doubles");
}
} else if (opcode.value >= INVOKE_VIRTUAL.value && opcode.value <= INVOKE_INTERFACE.value) {
//check data for invoke-* opcodes
MethodIdItem methodIdItem = (MethodIdItem) item;
int parameterRegisterCount = methodIdItem.getPrototype().getParameterRegisterCount();
if (opcode != INVOKE_STATIC) {
parameterRegisterCount++;
}
if (parameterRegisterCount != regCount) {
throw new RuntimeException("regCount does not match the number of arguments of the method");
}
}
}
示例5: Instruction35c
import org.jf.dexlib.Item; //導入依賴的package包/類
public Instruction35c(Opcode opcode, int regCount, byte regD, byte regE, byte regF, byte regG,
byte regA, Item referencedItem) {
super(opcode, referencedItem);
if (regCount > 5) {
throw new RuntimeException("regCount cannot be greater than 5");
}
if (regD >= 1 << 4 ||
regE >= 1 << 4 ||
regF >= 1 << 4 ||
regG >= 1 << 4 ||
regA >= 1 << 4) {
throw new RuntimeException("All register args must fit in 4 bits");
}
this.regCount = (byte)regCount;
this.regA = regA;
this.regD = regD;
this.regE = regE;
this.regF = regF;
this.regG = regG;
checkItem(opcode, referencedItem, regCount);
}
示例6: Instruction3rc
import org.jf.dexlib.Item; //導入依賴的package包/類
public Instruction3rc(Opcode opcode, short regCount, int startReg, Item referencedItem) {
super(opcode, referencedItem);
if (regCount >= 1 << 8) {
throw new RuntimeException("regCount must be less than 256");
}
if (regCount < 0) {
throw new RuntimeException("regCount cannot be negative");
}
if (startReg >= 1 << 16) {
throw new RuntimeException("The beginning register of the range must be less than 65536");
}
if (startReg < 0) {
throw new RuntimeException("The beginning register of the range cannot be negative");
}
this.regCount = (byte)regCount;
this.startReg = (short)startReg;
checkItem(opcode, referencedItem, regCount);
}
示例7: Instruction35c
import org.jf.dexlib.Item; //導入依賴的package包/類
public Instruction35c(Opcode opcode, int regCount, byte regD, byte regE, byte regF, byte regG,
byte regA, Item referencedItem) {
super(opcode, referencedItem);
if (regCount > 5) {
throw new RuntimeException("regCount cannot be greater than 5");
}
if (regD >= 1 << 4 ||
regE >= 1 << 4 ||
regF >= 1 << 4 ||
regG >= 1 << 4 ||
regA >= 1 << 4) {
throw new RuntimeException("All register args must fit in 4 bits");
}
checkItem(opcode, referencedItem, regCount);
this.regCount = (byte)regCount;
this.regA = regA;
this.regD = regD;
this.regE = regE;
this.regF = regF;
this.regG = regG;
}
示例8: checkItem
import org.jf.dexlib.Item; //導入依賴的package包/類
private static void checkItem(Opcode opcode, Item item, int regCount) {
if (opcode == FILLED_NEW_ARRAY) {
//check data for filled-new-array opcode
String type = ((TypeIdItem) item).getTypeDescriptor();
if (type.charAt(0) != '[') {
throw new RuntimeException("The type must be an array type");
}
if (type.charAt(1) == 'J' || type.charAt(1) == 'D') {
throw new RuntimeException("The type cannot be an array of longs or doubles");
}
} else if (opcode.value >= INVOKE_VIRTUAL.value && opcode.value <= INVOKE_INTERFACE.value ||
opcode == INVOKE_DIRECT_EMPTY) {
//check data for invoke-* opcodes
MethodIdItem methodIdItem = (MethodIdItem) item;
int parameterRegisterCount = methodIdItem.getPrototype().getParameterRegisterCount();
if (opcode != INVOKE_STATIC) {
parameterRegisterCount++;
}
if (parameterRegisterCount != regCount) {
throw new RuntimeException("regCount does not match the number of arguments of the method");
}
}
}
示例9: Instruction41c
import org.jf.dexlib.Item; //導入依賴的package包/類
public Instruction41c(Opcode opcode, int regA, Item referencedItem) {
super(opcode, referencedItem);
if (regA >= 1 << 16) {
throw new RuntimeException("The register number must be less than v65536");
}
if (opcode == Opcode.NEW_INSTANCE_JUMBO) {
assert referencedItem instanceof TypeIdItem;
if (((TypeIdItem)referencedItem).getTypeDescriptor().charAt(0) != 'L') {
throw new RuntimeException("Only class references can be used with the new-instance/jumbo opcode");
}
}
this.regA = (short)regA;
}
示例10: checkItem
import org.jf.dexlib.Item; //導入依賴的package包/類
private static void checkItem(Opcode opcode, Item item, int regCount) {
if (opcode == FILLED_NEW_ARRAY_RANGE) {
//check data for filled-new-array/range opcode
String type = ((TypeIdItem) item).getTypeDescriptor();
if (type.charAt(0) != '[') {
throw new RuntimeException("The type must be an array type");
}
if (type.charAt(1) == 'J' || type.charAt(1) == 'D') {
throw new RuntimeException("The type cannot be an array of longs or doubles");
}
} else if (opcode.value >= INVOKE_VIRTUAL_RANGE.value && opcode.value <= INVOKE_INTERFACE_RANGE.value ||
opcode == INVOKE_OBJECT_INIT_RANGE) {
//check data for invoke-*/range opcodes
MethodIdItem methodIdItem = (MethodIdItem) item;
int parameterRegisterCount = methodIdItem.getPrototype().getParameterRegisterCount();
if (opcode != INVOKE_STATIC_RANGE) {
parameterRegisterCount++;
}
if (parameterRegisterCount != regCount) {
throw new RuntimeException("regCount does not match the number of arguments of the method");
}
}
}
示例11: Instruction5rc
import org.jf.dexlib.Item; //導入依賴的package包/類
public Instruction5rc(Opcode opcode, int regCount, int startReg, Item referencedItem) {
super(opcode, referencedItem);
if (regCount >= 1 << 16) {
throw new RuntimeException("regCount must be less than 65536");
}
if (regCount < 0) {
throw new RuntimeException("regCount cannot be negative");
}
if (startReg >= 1 << 16) {
throw new RuntimeException("The beginning register of the range must be less than 65536");
}
if (startReg < 0) {
throw new RuntimeException("The beginning register of the range cannot be negative");
}
this.regCount = (short)regCount;
this.startReg = (short)startReg;
checkItem(opcode, referencedItem, regCount);
}
示例12: checkItem
import org.jf.dexlib.Item; //導入依賴的package包/類
private static void checkItem(Opcode opcode, Item item, int regCount) {
if (opcode == FILLED_NEW_ARRAY_JUMBO) {
//check data for filled-new-array/jumbo opcode
String type = ((TypeIdItem) item).getTypeDescriptor();
if (type.charAt(0) != '[') {
throw new RuntimeException("The type must be an array type");
}
if (type.charAt(1) == 'J' || type.charAt(1) == 'D') {
throw new RuntimeException("The type cannot be an array of longs or doubles");
}
} else if (opcode.value >= INVOKE_VIRTUAL_JUMBO.value && opcode.value <= INVOKE_INTERFACE_JUMBO.value ||
opcode == INVOKE_OBJECT_INIT_JUMBO) {
//check data for invoke-*/range opcodes
MethodIdItem methodIdItem = (MethodIdItem) item;
int parameterRegisterCount = methodIdItem.getPrototype().getParameterRegisterCount();
if (opcode != INVOKE_STATIC_JUMBO) {
parameterRegisterCount++;
}
if (parameterRegisterCount != regCount) {
throw new RuntimeException("regCount does not match the number of arguments of the method");
}
}
}
示例13: Instruction31c
import org.jf.dexlib.Item; //導入依賴的package包/類
public Instruction31c(Opcode opcode, short regA, Item referencedItem) {
super(opcode, referencedItem);
if (regA >= 1 << 8) {
throw new RuntimeException("The register number must be less than v256");
}
this.regA = (byte)regA;
}
示例14: Instruction22c
import org.jf.dexlib.Item; //導入依賴的package包/類
public Instruction22c(Opcode opcode, byte regA, byte regB, Item referencedItem) {
super(opcode, referencedItem);
if (regA >= 1 << 4 ||
regB >= 1 << 4) {
throw new RuntimeException("The register number must be less than v16");
}
this.regA = regA;
this.regB = regB;
}
示例15: Instruction52c
import org.jf.dexlib.Item; //導入依賴的package包/類
public Instruction52c(Opcode opcode, int regA, int regB, Item referencedItem) {
super(opcode, referencedItem);
if (regA >= 1 << 16) {
throw new RuntimeException("The register number must be less than v65536");
}
if (regB >= 1 << 16) {
throw new RuntimeException("The register number must be less than v65536");
}
this.regA = (short)regA;
this.regB = (short)regB;
}