diff --git a/patcher/src/commonMain/kotlin/app/revanced/patcher/Matching.kt b/patcher/src/commonMain/kotlin/app/revanced/patcher/Matching.kt index a8355ea..eb0cbd9 100644 --- a/patcher/src/commonMain/kotlin/app/revanced/patcher/Matching.kt +++ b/patcher/src/commonMain/kotlin/app/revanced/patcher/Matching.kt @@ -922,10 +922,18 @@ fun MutablePredicateList.custom(block: Predicate) { predicate { block() } } -fun MutablePredicateList.opcodes(vararg opcodes: Opcode) = instructions { opcodes.forEach { +it() } } +fun MutablePredicateList.opcodes(vararg opcodes: Opcode) = + instructions { + +opcodes.first()() + opcodes.drop(1).forEach { +after(it()) } + } context(matchers: MutableList>) -fun MutablePredicateList.opcodes(vararg opcodes: Opcode) = instructions { opcodes.forEach { +it() } } +fun MutablePredicateList.opcodes(vararg opcodes: Opcode) = + instructions { + +opcodes.first()() + opcodes.drop(1).forEach { +after(it()) } + } private fun Array.toUnorderedStringPredicates() = unorderedAllOf(predicates = map { string(it) }.toTypedArray())