diff --git a/src/main/kotlin/app/revanced/patcher/extensions/Extensions.kt b/src/main/kotlin/app/revanced/patcher/extensions/Extensions.kt new file mode 100644 index 00000000..6fc09cb5 --- /dev/null +++ b/src/main/kotlin/app/revanced/patcher/extensions/Extensions.kt @@ -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 \ No newline at end of file diff --git a/src/test/kotlin/patcher/PatcherTest.kt b/src/test/kotlin/patcher/PatcherTest.kt index b857f1df..663e3d8d 100644 --- a/src/test/kotlin/patcher/PatcherTest.kt +++ b/src/test/kotlin/patcher/PatcherTest.kt @@ -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() -} \ No newline at end of file +}