mirror of
https://github.com/revanced/revanced-patcher.git
synced 2025-05-02 22:04:24 +02:00
19 lines
603 B
Kotlin
19 lines
603 B
Kotlin
package app.revanced.patcher.extensions
|
|
|
|
import org.jf.dexlib2.AccessFlags
|
|
import org.jf.dexlib2.builder.BuilderInstruction
|
|
import org.jf.dexlib2.builder.MutableMethodImplementation
|
|
|
|
class AccessFlagExtensions {
|
|
companion object {
|
|
infix fun AccessFlags.or(other: AccessFlags) = this.value or other.value
|
|
infix fun Int.or(other: AccessFlags) = this or other.value
|
|
}
|
|
}
|
|
|
|
fun MutableMethodImplementation.addInstructions(index: Int, instructions: List<BuilderInstruction>) {
|
|
for (i in instructions.lastIndex downTo 0) {
|
|
this.addInstruction(index, instructions[i])
|
|
}
|
|
}
|