diff --git a/src/main/kotlin/app/revanced/patcher/extensions/Extensions.kt b/src/main/kotlin/app/revanced/patcher/extensions/Extensions.kt index 6fc09cb5..81bb5591 100644 --- a/src/main/kotlin/app/revanced/patcher/extensions/Extensions.kt +++ b/src/main/kotlin/app/revanced/patcher/extensions/Extensions.kt @@ -1,5 +1,13 @@ package app.revanced.patcher.extensions import org.jf.dexlib2.AccessFlags +import org.jf.dexlib2.builder.BuilderInstruction +import org.jf.dexlib2.builder.MutableMethodImplementation -infix fun AccessFlags.or(other: AccessFlags) = this.value or other.value \ No newline at end of file +infix fun AccessFlags.or(other: AccessFlags) = this.value or other.value + +fun MutableMethodImplementation.addInstructions(index: Int, instructions: List) { + for (i in instructions.lastIndex downTo 0) { + this.addInstruction(index, instructions[i]) + } +} \ No newline at end of file