mirror of
https://github.com/revanced/smali.git
synced 2025-06-12 04:17:36 +02:00
Add support for the invoke-object-init/jumbo odex opcode
This commit is contained in:
@ -1095,6 +1095,9 @@ public class MethodAnalyzer {
|
||||
case SPUT_OBJECT_VOLATILE:
|
||||
analyzePutGetVolatile(analyzedInstruction);
|
||||
return true;
|
||||
case INVOKE_OBJECT_INIT_JUMBO:
|
||||
analyzeInvokeObjectInitJumbo(analyzedInstruction);
|
||||
return true;
|
||||
default:
|
||||
assert false;
|
||||
return true;
|
||||
@ -1589,6 +1592,7 @@ public class MethodAnalyzer {
|
||||
case IPUT_OBJECT_VOLATILE:
|
||||
case SGET_OBJECT_VOLATILE:
|
||||
case SPUT_OBJECT_VOLATILE:
|
||||
case INVOKE_OBJECT_INIT_JUMBO:
|
||||
//TODO: throw validation exception?
|
||||
default:
|
||||
assert false;
|
||||
@ -3639,6 +3643,17 @@ public class MethodAnalyzer {
|
||||
return true;
|
||||
}
|
||||
|
||||
private void analyzeInvokeObjectInitJumbo(AnalyzedInstruction analyzedInstruction) {
|
||||
Instruction5rc instruction = (Instruction5rc)analyzedInstruction.instruction;
|
||||
|
||||
Instruction5rc deodexedInstruction = new Instruction5rc(Opcode.INVOKE_DIRECT_JUMBO,
|
||||
instruction.getRegCount(), instruction.getStartRegister(), instruction.getReferencedItem());
|
||||
|
||||
analyzedInstruction.setDeodexedInstruction(deodexedInstruction);
|
||||
|
||||
analyzeInstruction(analyzedInstruction);
|
||||
}
|
||||
|
||||
private static boolean checkArrayFieldAssignment(RegisterType.Category arrayFieldCategory,
|
||||
RegisterType.Category instructionCategory) {
|
||||
if (arrayFieldCategory == instructionCategory) {
|
||||
|
@ -111,7 +111,8 @@ public class Instruction5rc extends InstructionWithJumboReference implements Reg
|
||||
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) {
|
||||
} 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();
|
||||
|
@ -322,7 +322,9 @@ public enum Opcode
|
||||
INVOKE_SUPER_JUMBO((short)0xff23, "invoke-super/jumbo", ReferenceType.method, Format.Format5rc, Opcode.CAN_THROW | Opcode.CAN_CONTINUE | Opcode.SETS_RESULT),
|
||||
INVOKE_DIRECT_JUMBO((short)0xff24, "invoke-direct/jumbo", ReferenceType.method, Format.Format5rc, Opcode.CAN_THROW | Opcode.CAN_CONTINUE | Opcode.SETS_RESULT),
|
||||
INVOKE_STATIC_JUMBO((short)0xff25, "invoke-static/jumbo", ReferenceType.method, Format.Format5rc, Opcode.CAN_THROW | Opcode.CAN_CONTINUE | Opcode.SETS_RESULT),
|
||||
INVOKE_INTERFACE_JUMBO((short)0xff26, "invoke-interface/jumbo", ReferenceType.method, Format.Format5rc, Opcode.CAN_THROW | Opcode.CAN_CONTINUE | Opcode.SETS_RESULT);
|
||||
INVOKE_INTERFACE_JUMBO((short)0xff26, "invoke-interface/jumbo", ReferenceType.method, Format.Format5rc, Opcode.CAN_THROW | Opcode.CAN_CONTINUE | Opcode.SETS_RESULT),
|
||||
|
||||
INVOKE_OBJECT_INIT_JUMBO((short)0xfff2, "invoke-object-init/jumbo", ReferenceType.method, Format.Format5rc, Opcode.ODEX_ONLY | Opcode.CAN_THROW | Opcode.CAN_CONTINUE | Opcode.SETS_RESULT);
|
||||
|
||||
private static Opcode[] opcodesByValue;
|
||||
private static Opcode[] expandedOpcodesByValue;
|
||||
@ -432,7 +434,7 @@ public enum Opcode
|
||||
SGET_CHAR_JUMBO, SGET_SHORT_JUMBO, SPUT_JUMBO, SPUT_WIDE_JUMBO, SPUT_OBJECT_JUMBO,
|
||||
SPUT_BOOLEAN_JUMBO, SPUT_BYTE_JUMBO, SPUT_CHAR_JUMBO, SPUT_SHORT_JUMBO, INVOKE_VIRTUAL_JUMBO,
|
||||
INVOKE_SUPER_JUMBO, INVOKE_DIRECT_JUMBO, INVOKE_STATIC_JUMBO, INVOKE_INTERFACE_JUMBO,
|
||||
INVOKE_OBJECT_INIT_RANGE);
|
||||
INVOKE_OBJECT_INIT_RANGE, INVOKE_OBJECT_INIT_JUMBO);
|
||||
addOpcodes(INVOKE_DIRECT_EMPTY);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user