1
mirror of https://github.com/revanced/revanced-patcher synced 2024-11-27 18:13:37 +01:00

add: MutableMethodImplementation.addInstructions extension

This commit is contained in:
oSumAtrIX 2022-04-06 23:09:16 +02:00
parent 923efc4caf
commit e4157332d3
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4

View File

@ -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])
}
}