mirror of
https://github.com/ReVanced/revanced-patcher.git
synced 2024-11-10 01:02:22 +01:00
feat: add or extension for AccessFlags
This commit is contained in:
parent
d98c9eeb30
commit
aec5eeb597
2 changed files with 9 additions and 2 deletions
|
@ -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
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue