diff --git a/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/spoof/ClientType.java b/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/spoof/ClientType.java index b29d665b48..821eb4f8c4 100644 --- a/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/spoof/ClientType.java +++ b/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/spoof/ClientType.java @@ -1,7 +1,6 @@ package app.revanced.extension.youtube.patches.spoof; -import static app.revanced.extension.youtube.patches.spoof.DeviceHardwareSupport.allowAV1; -import static app.revanced.extension.youtube.patches.spoof.DeviceHardwareSupport.allowVP9; +import static app.revanced.extension.youtube.patches.spoof.DeviceHardwareSupport.DEVICE_HAS_HARDWARE_DECODING_AV1; import android.os.Build; @@ -16,28 +15,21 @@ public enum ClientType { "com.google.android.apps.youtube.vr.oculus/1.56.21 (Linux; U; Android 12; GB) gzip", "32", // Android 12.1 "1.56.21", - "ANDROID_VR", true ), // Specific for kids videos. IOS(5, // iPhone 15 supports AV1 hardware decoding. // Only use if this Android device also has hardware decoding. - allowAV1() + DEVICE_HAS_HARDWARE_DECODING_AV1 ? "iPhone16,2" // 15 Pro Max : "iPhone11,4", // XS Max - // iOS 14+ forces VP9. - allowVP9() - ? "17.5.1.21F90" - : "13.7.17H35", - allowVP9() - ? "com.google.ios.youtube/19.47.7 (iPhone; U; CPU iOS 17_5_1 like Mac OS X)" - : "com.google.ios.youtube/19.47.7 (iPhone; U; CPU iOS 13_7 like Mac OS X)", + "17.5.1.21F90", + "com.google.ios.youtube/19.47.7 (iPhone; U; CPU iOS 17_5_1 like Mac OS X)", null, // Version number should be a valid iOS release. // https://www.ipa4fun.com/history/185230 "19.47.7", - "IOS", false ); @@ -63,17 +55,13 @@ public enum ClientType { public final String userAgent; /** - * Android SDK version, equivalent to {@link Build.VERSION#SDK} (System property: ro.build.version.sdk) + * Android SDK version, equivalent to {@link Build.VERSION#SDK} + * (System property: ro.build.version.sdk) * Field is null if not applicable. */ @Nullable public final String androidSdkVersion; - /** - * Client name. - */ - public final String clientName; - /** * App version. */ @@ -90,7 +78,6 @@ public enum ClientType { String userAgent, @Nullable String androidSdkVersion, String clientVersion, - String clientName, boolean canLogin ) { this.id = id; @@ -99,7 +86,6 @@ public enum ClientType { this.userAgent = userAgent; this.androidSdkVersion = androidSdkVersion; this.clientVersion = clientVersion; - this.clientName = clientName; this.canLogin = canLogin; } } diff --git a/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/spoof/DeviceHardwareSupport.java b/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/spoof/DeviceHardwareSupport.java index 3adc6befb3..603c2b92ef 100644 --- a/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/spoof/DeviceHardwareSupport.java +++ b/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/spoof/DeviceHardwareSupport.java @@ -5,7 +5,6 @@ import android.os.Build; import app.revanced.extension.shared.Logger; -import app.revanced.extension.youtube.settings.Settings; public class DeviceHardwareSupport { public static final boolean DEVICE_HAS_HARDWARE_DECODING_VP9; @@ -42,12 +41,4 @@ public class DeviceHardwareSupport { ? "Device supports VP9 hardware decoding" : "Device does not support VP9 hardware decoding")); } - - public static boolean allowVP9() { - return DEVICE_HAS_HARDWARE_DECODING_VP9 && !Settings.SPOOF_VIDEO_STREAMS_IOS_FORCE_AVC.get(); - } - - public static boolean allowAV1() { - return allowVP9() && DEVICE_HAS_HARDWARE_DECODING_AV1; - } } diff --git a/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/spoof/SpoofVideoStreamsPatch.java b/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/spoof/SpoofVideoStreamsPatch.java index b50e3f4ffa..ef7ea680f6 100644 --- a/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/spoof/SpoofVideoStreamsPatch.java +++ b/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/spoof/SpoofVideoStreamsPatch.java @@ -11,19 +11,11 @@ import app.revanced.extension.shared.Logger; import app.revanced.extension.shared.Utils; import app.revanced.extension.shared.settings.BaseSettings; -import app.revanced.extension.shared.settings.Setting; import app.revanced.extension.youtube.patches.spoof.requests.StreamingDataRequest; import app.revanced.extension.youtube.settings.Settings; @SuppressWarnings("unused") public class SpoofVideoStreamsPatch { - public static final class ForceiOSAVCAvailability implements Setting.Availability { - @Override - public boolean isAvailable() { - return Settings.SPOOF_VIDEO_STREAMS.get() && Settings.SPOOF_VIDEO_STREAMS_CLIENT_TYPE.get() == ClientType.IOS; - } - } - private static final boolean SPOOF_STREAMING_DATA = Settings.SPOOF_VIDEO_STREAMS.get(); /** diff --git a/extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/Settings.java b/extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/Settings.java index 4f11de9284..b99eebdab4 100644 --- a/extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/Settings.java +++ b/extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/Settings.java @@ -20,7 +20,6 @@ import app.revanced.extension.youtube.patches.AlternativeThumbnailsPatch.ThumbnailOption; import app.revanced.extension.youtube.patches.AlternativeThumbnailsPatch.ThumbnailStillTime; import app.revanced.extension.youtube.patches.spoof.ClientType; -import app.revanced.extension.youtube.patches.spoof.SpoofVideoStreamsPatch; import app.revanced.extension.youtube.sponsorblock.SponsorBlockSettings; public class Settings extends BaseSettings { @@ -273,8 +272,6 @@ public class Settings extends BaseSettings { public static final BooleanSetting BYPASS_URL_REDIRECTS = new BooleanSetting("revanced_bypass_url_redirects", TRUE); public static final BooleanSetting ANNOUNCEMENTS = new BooleanSetting("revanced_announcements", TRUE); public static final BooleanSetting SPOOF_VIDEO_STREAMS = new BooleanSetting("revanced_spoof_video_streams", TRUE, true,"revanced_spoof_video_streams_user_dialog_message"); - public static final BooleanSetting SPOOF_VIDEO_STREAMS_IOS_FORCE_AVC = new BooleanSetting("revanced_spoof_video_streams_ios_force_avc", FALSE, true, - "revanced_spoof_video_streams_ios_force_avc_user_dialog_message", new SpoofVideoStreamsPatch.ForceiOSAVCAvailability()); public static final EnumSetting SPOOF_VIDEO_STREAMS_CLIENT_TYPE = new EnumSetting<>("revanced_spoof_video_streams_client", ClientType.ANDROID_VR, true, parent(SPOOF_VIDEO_STREAMS)); public static final IntegerSetting ANNOUNCEMENT_LAST_ID = new IntegerSetting("revanced_announcement_last_id", -1, false, false); public static final BooleanSetting CHECK_WATCH_HISTORY_DOMAIN_NAME = new BooleanSetting("revanced_check_watch_history_domain_name", TRUE, false, false); diff --git a/extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/preference/ForceAVCSpoofingPreference.java b/extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/preference/ForceAVCSpoofingPreference.java deleted file mode 100644 index 5581756758..0000000000 --- a/extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/preference/ForceAVCSpoofingPreference.java +++ /dev/null @@ -1,61 +0,0 @@ -package app.revanced.extension.youtube.settings.preference; - -import static app.revanced.extension.shared.StringRef.str; -import static app.revanced.extension.youtube.patches.spoof.DeviceHardwareSupport.DEVICE_HAS_HARDWARE_DECODING_VP9; - -import android.content.Context; -import android.preference.SwitchPreference; -import android.util.AttributeSet; - -@SuppressWarnings({"unused", "deprecation"}) -public class ForceAVCSpoofingPreference extends SwitchPreference { - { - if (!DEVICE_HAS_HARDWARE_DECODING_VP9) { - setSummaryOn(str("revanced_spoof_video_streams_ios_force_avc_no_hardware_vp9_summary_on")); - } - } - - public ForceAVCSpoofingPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { - super(context, attrs, defStyleAttr, defStyleRes); - } - public ForceAVCSpoofingPreference(Context context, AttributeSet attrs, int defStyleAttr) { - super(context, attrs, defStyleAttr); - } - public ForceAVCSpoofingPreference(Context context, AttributeSet attrs) { - super(context, attrs); - } - public ForceAVCSpoofingPreference(Context context) { - super(context); - } - - private void updateUI() { - if (DEVICE_HAS_HARDWARE_DECODING_VP9) { - return; - } - - // Temporarily remove the preference key to allow changing this preference without - // causing the settings UI listeners from showing reboot dialogs by the changes made here. - String key = getKey(); - setKey(null); - - // This setting cannot be changed by the user. - super.setEnabled(false); - super.setChecked(true); - - setKey(key); - } - - @Override - public void setEnabled(boolean enabled) { - super.setEnabled(enabled); - - updateUI(); - } - - @Override - public void setChecked(boolean checked) { - super.setChecked(checked); - - updateUI(); - } -} diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofVideoStreamsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofVideoStreamsPatch.kt index 515536b8f5..ecaf94f1d0 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofVideoStreamsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofVideoStreamsPatch.kt @@ -67,10 +67,6 @@ val spoofVideoStreamsPatch = bytecodePatch( "revanced_spoof_video_streams_client", summaryKey = null, ), - SwitchPreference( - "revanced_spoof_video_streams_ios_force_avc", - tag = "app.revanced.extension.youtube.settings.preference.ForceAVCSpoofingPreference", - ), NonInteractivePreference("revanced_spoof_video_streams_about_android_vr"), NonInteractivePreference("revanced_spoof_video_streams_about_ios"), ), diff --git a/patches/src/main/resources/addresources/values/strings.xml b/patches/src/main/resources/addresources/values/strings.xml index 51b21c2a11..e67ecfcdd0 100644 --- a/patches/src/main/resources/addresources/values/strings.xml +++ b/patches/src/main/resources/addresources/values/strings.xml @@ -1219,11 +1219,6 @@ This is because Crowdin requires temporarily flattening this file and removing t Video streams are not spoofed\n\nVideo playback may not work Turning off this setting may cause video playback issues. Default client - Force AVC (H.264) - Video codec is AVC (H.264) - Video codec is VP9 or AV1 - Your device does not have VP9 hardware decoding, and this setting is always on when Client spoofing is enabled - Enabling this might improve battery life and fix playback stuttering.\n\nAVC has a maximum resolution of 1080p, and video playback will use more internet data than VP9 or AV1. iOS spoofing side effects • Private kids videos may not play\n• Livestreams start from the beginning\n• Videos may end 1 second early Android VR spoofing side effects