From 577dae61dbc6afb97cf635e83e135566389b458b Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Fri, 30 Jan 2026 16:17:05 +0100 Subject: [PATCH] match opcode sequence matching to fingerprint --- .../kotlin/app/revanced/patcher/Matching.kt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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())