Skip to content

Commit

Permalink
add: MutableMethodImplementation.addInstructions extension
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Jun 5, 2022
1 parent 923efc4 commit e415733
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/kotlin/app/revanced/patcher/extensions/Extensions.kt
Original file line number Diff line number Diff line change
@@ -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
infix fun AccessFlags.or(other: AccessFlags) = this.value or other.value

fun MutableMethodImplementation.addInstructions(index: Int, instructions: List<BuilderInstruction>) {
for (i in instructions.lastIndex downTo 0) {
this.addInstruction(index, instructions[i])
}
}

0 comments on commit e415733

Please sign in to comment.