Lucaskyy 18853f70a4
refactor: migrate signature schema changes to Patcher
also updated Extensions, for good measure.
2022-06-05 08:03:13 +02:00

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