mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2024-11-10 01:01:56 +01:00
feat(GitHub): Add Pinch to zoom
patch
This commit is contained in:
parent
19f3faa1f2
commit
adc8cc6d5c
2 changed files with 33 additions and 0 deletions
|
@ -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…
Reference in a new issue