feat: add or extension for AccessFlags

This commit is contained in:
Lucaskyy 2022-03-31 22:46:46 +02:00
parent d98c9eeb30
commit aec5eeb597
No known key found for this signature in database
GPG key ID: 1530BFF96D1EEB89
2 changed files with 9 additions and 2 deletions

View file

@ -0,0 +1,5 @@
package app.revanced.patcher.extensions
import org.jf.dexlib2.AccessFlags
infix fun AccessFlags.or(other: AccessFlags) = this.value or other.value

View file

@ -2,6 +2,7 @@ package patcher
import app.revanced.patcher.Patcher
import app.revanced.patcher.cache.Cache
import app.revanced.patcher.extensions.or
import app.revanced.patcher.patch.Patch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError
@ -18,7 +19,7 @@ fun main() {
MethodSignature(
"main-method",
"V",
AccessFlags.STATIC.value or AccessFlags.PUBLIC.value,
AccessFlags.STATIC or AccessFlags.PUBLIC,
listOf("[O"),
arrayOf(
Opcode.SGET_OBJECT,
@ -84,7 +85,8 @@ fun main() {
return PatchResultSuccess()
}
}
patcher.addPatches(mainMethodPatchViaClassProxy, mainMethodPatchViaSignature)
patcher.applyPatches()
patcher.save()
}
}