private boolean isAllowedOdex(@Nonnull Opcode opcode) { baksmaliOptions options = methodDef.classDef.options; if (options.allowOdex) { return true; } if (methodDef.classDef.options.apiLevel >= 14) { return false; } return opcode.isOdexedInstanceVolatile() || opcode.isOdexedStaticVolatile() || opcode == Opcode.THROW_VERIFICATION_ERROR; }
private boolean isAllowedOdex(@Nonnull Opcode opcode) { baksmaliOptions options = methodDef.classDef.options; if (options.allowOdex) { return true; } if (methodDef.classDef.options.apiLevel >= 14) { return false; } return opcode.isOdexedInstanceVolatile() || opcode.isOdexedStaticVolatile() || opcode == Opcode.THROW_VERIFICATION_ERROR; }
private static int getOpcodeSubtype(@Nonnull Opcode opcode) { if (opcode.isOdexedInstanceQuick()) { return 0; } else if (opcode.isOdexedInstanceVolatile()) { return 1; } else if (opcode.isOdexedStaticVolatile()) { return 2; } throw new RuntimeException(String.format("Not an odexed field access opcode: %s", opcode.name)); }
private boolean analyzePutGetVolatile(@Nonnull AnalyzedInstruction analyzedInstruction, boolean analyzeResult) { FieldReference field = (FieldReference)((ReferenceInstruction)analyzedInstruction.instruction).getReference(); String fieldType = field.getType(); Opcode originalOpcode = analyzedInstruction.instruction.getOpcode(); Opcode opcode = OdexedFieldInstructionMapper.getAndCheckDeodexedOpcodeForOdexedOpcode(fieldType, originalOpcode,this); Instruction deodexedInstruction; if (originalOpcode.isOdexedStaticVolatile()) { OneRegisterInstruction instruction = (OneRegisterInstruction)analyzedInstruction.instruction; deodexedInstruction = new ImmutableInstruction21c(opcode, instruction.getRegisterA(), field); } else { TwoRegisterInstruction instruction = (TwoRegisterInstruction)analyzedInstruction.instruction; deodexedInstruction = new ImmutableInstruction22c(opcode, instruction.getRegisterA(), instruction.getRegisterB(), field); } analyzedInstruction.setDeodexedInstruction(deodexedInstruction); if (analyzeResult) { analyzeInstruction(analyzedInstruction); } return true; }