2023-09-20 05:33:02 +02:00
|
|
|
package app.revanced.patches.youtube.layout.panels.popup
|
2022-09-21 03:02:20 +02:00
|
|
|
|
2023-08-27 21:40:49 +02:00
|
|
|
import app.revanced.extensions.exception
|
2022-10-05 04:03:10 +02:00
|
|
|
import app.revanced.patcher.data.BytecodeContext
|
2023-06-07 03:46:13 +02:00
|
|
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
2022-10-05 04:03:10 +02:00
|
|
|
import app.revanced.patcher.patch.BytecodePatch
|
2023-09-20 05:33:02 +02:00
|
|
|
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
|
|
|
import app.revanced.patcher.patch.annotation.Patch
|
2023-01-28 06:24:24 +01:00
|
|
|
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
|
|
|
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
2023-02-25 00:00:58 +01:00
|
|
|
import app.revanced.patches.youtube.layout.panels.popup.fingerprints.EngagementPanelControllerFingerprint
|
2023-09-20 05:33:02 +02:00
|
|
|
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
|
|
|
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
2022-09-21 03:02:20 +02:00
|
|
|
|
2023-09-20 05:33:02 +02:00
|
|
|
@Patch(
|
|
|
|
name = "Disable player popup panels",
|
|
|
|
description = "Disables panels from appearing automatically when going into fullscreen (playlist or live chat).",
|
|
|
|
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
|
|
|
compatiblePackages = [
|
|
|
|
CompatiblePackage(
|
|
|
|
"com.google.android.youtube", [
|
|
|
|
"18.16.37",
|
|
|
|
"18.19.35",
|
|
|
|
"18.20.39",
|
|
|
|
"18.23.35",
|
|
|
|
"18.29.38",
|
2023-09-28 01:28:25 +02:00
|
|
|
"18.32.39",
|
2023-10-08 03:37:42 +02:00
|
|
|
"18.37.36",
|
|
|
|
"18.38.44"
|
2023-09-20 05:33:02 +02:00
|
|
|
]
|
|
|
|
)
|
|
|
|
]
|
|
|
|
)
|
|
|
|
@Suppress("unused")
|
|
|
|
object PlayerPopupPanelsPatch : BytecodePatch(
|
|
|
|
setOf(EngagementPanelControllerFingerprint)
|
2022-09-21 03:02:20 +02:00
|
|
|
) {
|
2023-08-27 21:40:49 +02:00
|
|
|
override fun execute(context: BytecodeContext) {
|
2022-09-21 03:02:20 +02:00
|
|
|
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
|
|
|
SwitchPreference(
|
2023-05-15 09:51:43 +02:00
|
|
|
"revanced_hide_player_popup_panels",
|
|
|
|
StringResource("revanced_hide_player_popup_panels_title", "Hide player popup panels"),
|
|
|
|
StringResource("revanced_hide_player_popup_panels_summary_on", "Player popup panels are hidden"),
|
|
|
|
StringResource("revanced_hide_player_popup_panels_summary_off", "Player popup panels are shown")
|
2022-09-21 03:02:20 +02:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2023-01-28 06:24:24 +01:00
|
|
|
val engagementPanelControllerMethod = EngagementPanelControllerFingerprint
|
2023-08-27 21:40:49 +02:00
|
|
|
.result?.mutableMethod ?: throw EngagementPanelControllerFingerprint.exception
|
2022-09-21 03:02:20 +02:00
|
|
|
|
2023-06-07 03:46:13 +02:00
|
|
|
engagementPanelControllerMethod.addInstructionsWithLabels(
|
|
|
|
0,
|
|
|
|
"""
|
|
|
|
invoke-static { }, Lapp/revanced/integrations/patches/DisablePlayerPopupPanelsPatch;->disablePlayerPopupPanels()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :player_popup_panels
|
|
|
|
if-eqz p4, :player_popup_panels
|
|
|
|
const/4 v0, 0x0
|
|
|
|
return-object v0
|
|
|
|
:player_popup_panels
|
|
|
|
nop
|
|
|
|
"""
|
2022-09-21 03:02:20 +02:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|