From fd818a35f5252fc0a37e12b528e020cdfac0ab53 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Tue, 10 Jan 2023 22:27:43 +0400 Subject: [PATCH] feat(youtube): `spoof-app-version` patch (#282) Co-authored-by: oSumAtrIX --- .../patches/SpoofAppVersionPatch.java | 15 +++++++++++++++ .../integrations/settings/SettingsEnum.java | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 app/src/main/java/app/revanced/integrations/patches/SpoofAppVersionPatch.java diff --git a/app/src/main/java/app/revanced/integrations/patches/SpoofAppVersionPatch.java b/app/src/main/java/app/revanced/integrations/patches/SpoofAppVersionPatch.java new file mode 100644 index 00000000..21cb5d07 --- /dev/null +++ b/app/src/main/java/app/revanced/integrations/patches/SpoofAppVersionPatch.java @@ -0,0 +1,15 @@ +package app.revanced.integrations.patches; + +import app.revanced.integrations.settings.SettingsEnum; + +public class SpoofAppVersionPatch { + + public static String getYouTubeVersionOverride(String version) { + if (SettingsEnum.SPOOF_APP_VERSION.getBoolean()){ + // Override with the most recent version that does not show the new UI player layout. + // If the new UI shows up for some users, then change this to an older version (such as 17.29.34). + return "17.30.34"; + } + return version; + } +} diff --git a/app/src/main/java/app/revanced/integrations/settings/SettingsEnum.java b/app/src/main/java/app/revanced/integrations/settings/SettingsEnum.java index 2d138bf5..8d376386 100644 --- a/app/src/main/java/app/revanced/integrations/settings/SettingsEnum.java +++ b/app/src/main/java/app/revanced/integrations/settings/SettingsEnum.java @@ -1,7 +1,6 @@ package app.revanced.integrations.settings; import android.content.Context; -import android.util.Log; import java.util.ArrayList; import java.util.List; @@ -68,6 +67,7 @@ public enum SettingsEnum { DISABLE_STARTUP_SHORTS_PLAYER("revanced_startup_shorts_player_enabled", false, ReturnType.BOOLEAN), PLAYER_POPUP_PANELS("revanced_player_popup_panels_enabled", false, ReturnType.BOOLEAN), USE_TABLET_MINIPLAYER("revanced_tablet_miniplayer", false, ReturnType.BOOLEAN, true), + SPOOF_APP_VERSION("revanced_spoof_app_version", false, ReturnType.BOOLEAN, true), WIDE_SEARCHBAR("revanced_wide_searchbar", false, ReturnType.BOOLEAN, true), HIDE_ALBUM_CARDS("revanced_hide_album_cards", false, ReturnType.BOOLEAN, true), HIDE_ARTIST_CARD("revanced_hide_artist_card", false, ReturnType.BOOLEAN),