mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-08 02:24:35 +02:00
fix(youtube/overlay-buttons): overlay buttons are not hidden when swiping the seekbar with new thumbnail preview enabled
This commit is contained in:
parent
4b93941b23
commit
12cc51146e
@ -9,7 +9,7 @@ import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.seekbar.thumbnailpreview.fingerprints.ThumbnailPreviewConfigFingerprint
|
||||
import app.revanced.patches.youtube.utils.fingerprints.ThumbnailPreviewConfigFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.SEEKBAR
|
||||
|
@ -1,4 +1,4 @@
|
||||
package app.revanced.patches.youtube.seekbar.thumbnailpreview.fingerprints
|
||||
package app.revanced.patches.youtube.utils.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.util.bytecode.isWide32LiteralExists
|
@ -10,6 +10,7 @@ import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchException
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.youtube.utils.fingerprints.ThumbnailPreviewConfigFingerprint
|
||||
import app.revanced.patches.youtube.utils.fingerprints.YouTubeControlsOverlayFingerprint
|
||||
import app.revanced.patches.youtube.utils.playercontrols.fingerprints.BottomControlsInflateFingerprint
|
||||
import app.revanced.patches.youtube.utils.playercontrols.fingerprints.ControlsLayoutInflateFingerprint
|
||||
@ -36,6 +37,7 @@ class PlayerControlsPatch : BytecodePatch(
|
||||
ControlsLayoutInflateFingerprint,
|
||||
FullscreenEngagementSpeedEduVisibleParentFingerprint,
|
||||
PlayerControlsVisibilityModelFingerprint,
|
||||
ThumbnailPreviewConfigFingerprint,
|
||||
YouTubeControlsOverlayFingerprint
|
||||
)
|
||||
) {
|
||||
@ -124,12 +126,23 @@ class PlayerControlsPatch : BytecodePatch(
|
||||
?: throw FullscreenEngagementSpeedEduVisibleFingerprint.exception
|
||||
} ?: throw FullscreenEngagementSpeedEduVisibleParentFingerprint.exception
|
||||
|
||||
ThumbnailPreviewConfigFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
bigBoardsVisibilityMutableMethod = this
|
||||
|
||||
addInstruction(
|
||||
0,
|
||||
"const/4 v0, 0x1"
|
||||
)
|
||||
}
|
||||
} ?: throw ThumbnailPreviewConfigFingerprint.exception
|
||||
}
|
||||
|
||||
internal companion object {
|
||||
lateinit var controlsLayoutInflateResult: MethodFingerprintResult
|
||||
lateinit var inflateResult: MethodFingerprintResult
|
||||
|
||||
lateinit var bigBoardsVisibilityMutableMethod: MutableMethod
|
||||
lateinit var playerControlsVisibilityMutableMethod: MutableMethod
|
||||
lateinit var quickSeekVisibleMutableMethod: MutableMethod
|
||||
lateinit var seekEDUVisibleMutableMethod: MutableMethod
|
||||
@ -139,6 +152,15 @@ class PlayerControlsPatch : BytecodePatch(
|
||||
lateinit var fullscreenEngagementViewVisibleReference: Reference
|
||||
lateinit var speedEDUVisibleReference: Reference
|
||||
|
||||
private fun injectBigBoardsVisibilityCall(descriptor: String) {
|
||||
bigBoardsVisibilityMutableMethod.apply {
|
||||
addInstruction(
|
||||
1,
|
||||
"invoke-static {v0}, $descriptor->changeVisibilityNegatedImmediate(Z)V"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private fun injectFullscreenEngagementSpeedEduViewVisibilityCall(
|
||||
reference: Reference,
|
||||
descriptor: String
|
||||
@ -201,6 +223,8 @@ class PlayerControlsPatch : BytecodePatch(
|
||||
"changeVisibilityNegatedImmediate"
|
||||
)
|
||||
|
||||
injectBigBoardsVisibilityCall(descriptor)
|
||||
|
||||
injectFullscreenEngagementSpeedEduViewVisibilityCall(
|
||||
fullscreenEngagementViewVisibleReference,
|
||||
descriptor
|
||||
|
Loading…
x
Reference in New Issue
Block a user