build(revanced-patcher): bump version

This commit is contained in:
inotia00
2023-05-09 18:37:49 +09:00
parent 8958c3870f
commit 0f5350e691
43 changed files with 485 additions and 567 deletions

View File

@ -0,0 +1,30 @@
package app.revanced.util.bytecode
import org.jf.dexlib2.Opcode
import org.jf.dexlib2.iface.Method
import org.jf.dexlib2.iface.instruction.NarrowLiteralInstruction
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
fun Method.getNarrowLiteralIndex(value: Int): Int {
return implementation?.let {
it.instructions.indexOfFirst { instruction ->
instruction.opcode == Opcode.CONST && (instruction as NarrowLiteralInstruction).narrowLiteral == value
}
} ?: -1
}
fun Method.isNarrowLiteralExists(value: Int): Boolean {
return getNarrowLiteralIndex(value) != -1
}
fun Method.getWideLiteralIndex(value: Long): Int {
return implementation?.let {
it.instructions.indexOfFirst { instruction ->
instruction.opcode == Opcode.CONST && (instruction as WideLiteralInstruction).wideLiteral == value
}
} ?: -1
}
fun Method.isWideLiteralExists(value: Long): Boolean {
return getWideLiteralIndex(value) != -1
}