mirror of
https://github.com/revanced/revanced-patches
synced 2024-11-09 05:28:22 +01:00
fix: swipe-controls
with active engagement panel (#177)
This commit is contained in:
parent
57e9c0a645
commit
000ec6d8f6
@ -13,6 +13,7 @@ import app.revanced.patcher.patch.impl.BytecodePatch
|
||||
import app.revanced.patches.youtube.interaction.swipecontrols.annotation.SwipeControlsCompatibility
|
||||
import app.revanced.patches.youtube.interaction.swipecontrols.fingerprints.WatchWhileOnStartFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.playeroverlay.patch.PlayerOverlaysHookPatch
|
||||
import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch
|
||||
|
||||
@Patch
|
||||
@ -24,6 +25,7 @@ import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch
|
||||
dependencies = [
|
||||
IntegrationsPatch::class,
|
||||
PlayerTypeHookPatch::class,
|
||||
PlayerOverlaysHookPatch::class,
|
||||
SwipeControlsResourcesPatch::class
|
||||
]
|
||||
)
|
||||
|
@ -0,0 +1,13 @@
|
||||
package app.revanced.patches.youtube.misc.playeroverlay.annotation
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.24.34", "17.25.34", "17.26.35")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class PlayerOverlaysHookCompatibility
|
@ -0,0 +1,21 @@
|
||||
package app.revanced.patches.youtube.misc.playeroverlay.fingerprint
|
||||
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
|
||||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patches.youtube.misc.playeroverlay.annotation.PlayerOverlaysHookCompatibility
|
||||
|
||||
@Name("player-overlays-onFinishInflate-fingerprint")
|
||||
@MatchingMethod(
|
||||
"LYouTubePlayerOverlaysLayout;", "onFinishInflate"
|
||||
)
|
||||
@DirectPatternScanMethod
|
||||
@PlayerOverlaysHookCompatibility
|
||||
@Version("0.0.1")
|
||||
object PlayerOverlaysOnFinishInflateFingerprint : MethodFingerprint(
|
||||
null, null, null, null, null, { methodDef ->
|
||||
methodDef.definingClass.endsWith("YouTubePlayerOverlaysLayout;") && methodDef.name == "onFinishInflate"
|
||||
}
|
||||
)
|
@ -0,0 +1,35 @@
|
||||
package app.revanced.patches.youtube.misc.playeroverlay.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.impl.BytecodeData
|
||||
import app.revanced.patcher.extensions.addInstruction
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.Dependencies
|
||||
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.playeroverlay.annotation.PlayerOverlaysHookCompatibility
|
||||
import app.revanced.patches.youtube.misc.playeroverlay.fingerprint.PlayerOverlaysOnFinishInflateFingerprint
|
||||
|
||||
@Name("player-overlays-hook")
|
||||
@Description("hook for adding custom overlays to the video player.")
|
||||
@PlayerOverlaysHookCompatibility
|
||||
@Version("0.0.1")
|
||||
@Dependencies(dependencies = [IntegrationsPatch::class])
|
||||
class PlayerOverlaysHookPatch : BytecodePatch(
|
||||
listOf(
|
||||
PlayerOverlaysOnFinishInflateFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
// hook YouTubePlayerOverlaysLayout.onFinishInflate()
|
||||
val method = PlayerOverlaysOnFinishInflateFingerprint.result!!.mutableMethod
|
||||
method.addInstruction(
|
||||
method.implementation!!.instructions.size - 2,
|
||||
"invoke-static { p0 }, Lapp/revanced/integrations/patches/PlayerOverlaysHookPatch;->YouTubePlayerOverlaysLayout_onFinishInflateHook(Ljava/lang/Object;)V"
|
||||
)
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user