mirror of
https://github.com/revanced/revanced-patcher.git
synced 2025-05-01 21:54:24 +02:00
chore: move replace extension method to Extensions.kt
This commit is contained in:
parent
066ad274ed
commit
b44bf4c267
@ -3,6 +3,7 @@ package app.revanced.patcher.extensions
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.builder.BuilderInstruction
|
||||
import org.jf.dexlib2.builder.MutableMethodImplementation
|
||||
import org.jf.dexlib2.iface.ClassDef
|
||||
|
||||
infix fun AccessFlags.or(other: AccessFlags) = this.value or other.value
|
||||
|
||||
@ -10,4 +11,9 @@ fun MutableMethodImplementation.addInstructions(index: Int, instructions: List<B
|
||||
for (i in instructions.lastIndex downTo 0) {
|
||||
this.addInstruction(index, instructions[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal fun MutableSet<ClassDef>.replace(originalIndex: Int, mutatedClass: ClassDef) {
|
||||
this.remove(this.elementAt(originalIndex))
|
||||
this.add(mutatedClass)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user