mirror of
https://github.com/revanced/revanced-patches
synced 2025-02-22 05:11:12 +01:00
feat(GitHub): Add Pinch to zoom
patch
This commit is contained in:
parent
19f3faa1f2
commit
adc8cc6d5c
@ -0,0 +1,26 @@
|
|||||||
|
package app.revanced.patches.github.misc.gestures
|
||||||
|
|
||||||
|
import app.revanced.extensions.exception
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||||
|
import app.revanced.patcher.patch.annotation.Patch
|
||||||
|
import app.revanced.patches.github.misc.gestures.fingerprints.CodeViewFingerprint
|
||||||
|
|
||||||
|
@Patch(
|
||||||
|
name = "Pinch to zoom",
|
||||||
|
description = "Adds pinch to zoom functionality to the code viewer.",
|
||||||
|
compatiblePackages = [CompatiblePackage("com.github.android")],
|
||||||
|
requiresIntegrations = true
|
||||||
|
)
|
||||||
|
@Suppress("unused")
|
||||||
|
object PinchToZoomPatch : BytecodePatch(
|
||||||
|
setOf(CodeViewFingerprint)
|
||||||
|
) {
|
||||||
|
override fun execute(context: BytecodeContext) = CodeViewFingerprint.result?.mutableMethod?.addInstruction(
|
||||||
|
0,
|
||||||
|
"invoke-static { p2 }, Lapp/revanced/github/PinchToZoomPatch;->" +
|
||||||
|
"addPinchToZoomGesture(Landroid/view/ViewGroup;)V"
|
||||||
|
) ?: throw CodeViewFingerprint.exception
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
package app.revanced.patches.github.misc.gestures.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||||
|
|
||||||
|
object CodeViewFingerprint : MethodFingerprint(
|
||||||
|
parameters = listOf("Landroid/view/ViewGroup;", "Landroidx/recyclerview/widget/RecyclerView;")
|
||||||
|
)
|
Loading…
x
Reference in New Issue
Block a user