fix(seekbar-tapping): do not disable seekbar when hiding it (#600)

This commit is contained in:
OxrxL 2022-09-23 21:09:47 +02:00 committed by GitHub
parent 33cd294bc7
commit 68a9457464
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,7 +10,6 @@ import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patches.youtube.interaction.seekbar.fingerprints.SeekbarTappingFingerprint
import app.revanced.patches.youtube.layout.hidetimeandseekbar.fingerprints.TimeCounterFingerprint
import app.revanced.patches.youtube.layout.hidetimeandseekbar.annotations.HideTimeAndSeekbarCompatibility
import app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints.CreateVideoPlayerSeekbarFingerprint
@ -27,7 +26,7 @@ import app.revanced.patches.youtube.misc.settings.framework.components.impl.Swit
@Version("0.0.1")
class HideTimeAndSeekbarPatch : BytecodePatch(
listOf(
CreateVideoPlayerSeekbarFingerprint, SeekbarTappingFingerprint, TimeCounterFingerprint
CreateVideoPlayerSeekbarFingerprint, TimeCounterFingerprint
)
) {
override fun execute(data: BytecodeData): PatchResult {
@ -55,20 +54,6 @@ class HideTimeAndSeekbarPatch : BytecodePatch(
"""
)
val seekbarTappingMethod = SeekbarTappingFingerprint.result!!.mutableMethod
seekbarTappingMethod.addInstructions(
0, """
invoke-static { }, Lapp/revanced/integrations/patches/HideTimeAndSeekbarPatch;->hideTimeAndSeekbar()Z
move-result v0
if-eqz v0, :hide_time_and_seekbar
const/4 v0, 0x0
return v0
:hide_time_and_seekbar
nop
"""
)
val timeCounterMethod = TimeCounterFingerprint.result!!.mutableMethod
timeCounterMethod.addInstructions(