mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-11 05:36:17 +00:00
feat(YouTube): Add Disable sign in to TV popup patch (#5639)
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package app.revanced.extension.youtube.patches;
|
||||
|
||||
import app.revanced.extension.youtube.settings.Settings;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class DisableSignInToTvPopupPatch {
|
||||
|
||||
/**
|
||||
* Injection point.
|
||||
*/
|
||||
public static boolean disableSignInToTvPopup() {
|
||||
return Settings.DISABLE_SIGNIN_TO_TV_POPUP.get();
|
||||
}
|
||||
}
|
||||
@@ -256,6 +256,7 @@ public class Settings extends BaseSettings {
|
||||
public static final BooleanSetting GRADIENT_LOADING_SCREEN = new BooleanSetting("revanced_gradient_loading_screen", FALSE, true);
|
||||
public static final EnumSetting<SplashScreenAnimationStyle> SPLASH_SCREEN_ANIMATION_STYLE = new EnumSetting<>("revanced_splash_screen_animation_style", SplashScreenAnimationStyle.FPS_60_ONE_SECOND, true);
|
||||
public static final EnumSetting<HeaderLogo> HEADER_LOGO = new EnumSetting<>("revanced_header_logo", HeaderLogo.DEFAULT, true);
|
||||
public static final BooleanSetting DISABLE_SIGNIN_TO_TV_POPUP = new BooleanSetting("revanced_disable_signin_to_tv_popup", FALSE);
|
||||
|
||||
public static final BooleanSetting REMOVE_VIEWER_DISCRETION_DIALOG = new BooleanSetting("revanced_remove_viewer_discretion_dialog", FALSE,
|
||||
"revanced_remove_viewer_discretion_dialog_user_dialog_message");
|
||||
|
||||
@@ -1357,6 +1357,10 @@ public final class app/revanced/patches/youtube/layout/hide/shorts/HideShortsCom
|
||||
public static final fun getHideShortsComponentsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/youtube/layout/hide/signintotvpopup/DisableSignInToTvPatchPopupKt {
|
||||
public static final fun getDisableSignInToTvPopupPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatchKt {
|
||||
public static final fun getDisableSuggestedVideoEndScreenPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
package app.revanced.patches.youtube.layout.hide.signintotvpopup
|
||||
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.patches.all.misc.resources.addResources
|
||||
import app.revanced.patches.all.misc.resources.addResourcesPatch
|
||||
import app.revanced.patches.shared.misc.mapping.get
|
||||
import app.revanced.patches.shared.misc.mapping.resourceMappingPatch
|
||||
import app.revanced.patches.shared.misc.mapping.resourceMappings
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch
|
||||
import app.revanced.patches.youtube.misc.settings.PreferenceScreen
|
||||
import app.revanced.patches.youtube.misc.settings.settingsPatch
|
||||
|
||||
internal var mdx_seamless_tv_sign_in_drawer_fragment_title_id = -1L
|
||||
private set
|
||||
|
||||
private const val EXTENSION_CLASS_DESCRIPTOR =
|
||||
"Lapp/revanced/extension/youtube/patches/DisableSignInToTvPopupPatch;"
|
||||
|
||||
val disableSignInToTvPopupPatch = bytecodePatch(
|
||||
name = "Disable sign in to TV popup",
|
||||
description = "Adds an option to disable the popup asking to sign into a TV on the same local network.",
|
||||
) {
|
||||
dependsOn(
|
||||
settingsPatch,
|
||||
sharedExtensionPatch,
|
||||
addResourcesPatch,
|
||||
resourceMappingPatch
|
||||
)
|
||||
|
||||
compatibleWith(
|
||||
"com.google.android.youtube"(
|
||||
"19.34.42",
|
||||
"19.43.41",
|
||||
"19.47.53",
|
||||
"20.07.39",
|
||||
"20.12.46",
|
||||
"20.13.41",
|
||||
)
|
||||
)
|
||||
|
||||
execute {
|
||||
addResources("youtube", "layout.hide.signintotv.disableSignInToTvPopupPatch")
|
||||
|
||||
PreferenceScreen.MISC.addPreferences(
|
||||
SwitchPreference("revanced_disable_signin_to_tv_popup"),
|
||||
)
|
||||
|
||||
mdx_seamless_tv_sign_in_drawer_fragment_title_id = resourceMappings[
|
||||
"string",
|
||||
"mdx_seamless_tv_sign_in_drawer_fragment_title",
|
||||
]
|
||||
|
||||
signInToTvPopupFingerprint.method.addInstructionsWithLabels(
|
||||
0,
|
||||
"""
|
||||
invoke-static { }, $EXTENSION_CLASS_DESCRIPTOR->disableSignInToTvPopup()Z
|
||||
move-result v0
|
||||
if-eqz v0, :allow_sign_in_popup
|
||||
const/4 v0, 0x0
|
||||
return v0
|
||||
:allow_sign_in_popup
|
||||
nop
|
||||
"""
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package app.revanced.patches.youtube.layout.hide.signintotvpopup
|
||||
|
||||
import app.revanced.patcher.fingerprint
|
||||
import app.revanced.util.literal
|
||||
|
||||
internal val signInToTvPopupFingerprint = fingerprint {
|
||||
returns("Z")
|
||||
parameters("Ljava/lang/String;", "Z", "L")
|
||||
literal {
|
||||
mdx_seamless_tv_sign_in_drawer_fragment_title_id
|
||||
}
|
||||
}
|
||||
@@ -515,6 +515,11 @@ This feature is only available for older devices"</string>
|
||||
<string name="revanced_remove_viewer_discretion_dialog_summary_off">Dialog will be shown</string>
|
||||
<string name="revanced_remove_viewer_discretion_dialog_user_dialog_message">This does not bypass the age restriction. It just accepts it automatically.</string>
|
||||
</patch>
|
||||
<patch id="layout.hide.signintotv.disableSignInToTvPopupPatch">
|
||||
<string name="revanced_disable_signin_to_tv_popup_title">Disable Sign in to TV popup</string>
|
||||
<string name="revanced_disable_signin_to_tv_popup_summary_on">Sign in to TV popup is disabled</string>
|
||||
<string name="revanced_disable_signin_to_tv_popup_summary_off">Sign in to TV popup is enabled</string>
|
||||
</patch>
|
||||
<patch id="interaction.doubletap.disableDoubleTapActionsPatch">
|
||||
<string name="revanced_disable_chapter_skip_double_tap_title">Disable double tap chapter skip</string>
|
||||
<string name="revanced_disable_chapter_skip_double_tap_summary_on">Double tap can never trigger a skip to the next/previous chapter</string>
|
||||
|
||||
Reference in New Issue
Block a user