diff --git a/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/misc/client/AppClient.java b/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/misc/client/AppClient.java index 5c8ed662c..25c49ae86 100644 --- a/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/misc/client/AppClient.java +++ b/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/misc/client/AppClient.java @@ -24,7 +24,6 @@ public class AppClient { private static final String CLIENT_VERSION_IOS = "19.47.7"; private static final String DEVICE_MAKE_IOS = "Apple"; /** - * The device machine id for the iPhone XS Max (iPhone11,4), used to get 60fps. * The device machine id for the iPhone 16 Pro Max (iPhone17,2), used to get HDR with AV1 hardware decoding. * *

@@ -32,20 +31,11 @@ public class AppClient { * information. *

*/ - private static final String DEVICE_MODEL_IOS = DeviceHardwareSupport.allowAV1() - ? "iPhone17,2" - : "iPhone11,4"; + private static final String DEVICE_MODEL_IOS = "iPhone17,2" private static final String OS_NAME_IOS = "iOS"; - /** - * The minimum supported OS version for the iOS YouTube client is iOS 14.0. - * Using an invalid OS version will use the AVC codec. - */ - private static final String OS_VERSION_IOS = DeviceHardwareSupport.allowVP9() - ? "18.1.1.22B91" - : "13.7.17H35"; - private static final String USER_AGENT_VERSION_IOS = DeviceHardwareSupport.allowVP9() - ? "18_1_1" - : "13_7"; + private static final String OS_VERSION_IOS = "18.1.1.22B91" + private static final String USER_AGENT_VERSION_IOS = "18_1_1" + private static final String USER_AGENT_IOS = "com.google.ios.youtube/" + CLIENT_VERSION_IOS + "(" + diff --git a/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/misc/client/DeviceHardwareSupport.java b/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/misc/client/DeviceHardwareSupport.java deleted file mode 100644 index 91ffd5aae..000000000 --- a/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/misc/client/DeviceHardwareSupport.java +++ /dev/null @@ -1,54 +0,0 @@ -package app.revanced.extension.youtube.patches.misc.client; - -import static app.revanced.extension.shared.utils.Utils.isSDKAbove; - -import android.media.MediaCodecInfo; -import android.media.MediaCodecList; - -import app.revanced.extension.shared.utils.Logger; -import app.revanced.extension.youtube.settings.Settings; - -public class DeviceHardwareSupport { - private static final boolean DEVICE_HAS_HARDWARE_DECODING_VP9; - private static final boolean DEVICE_HAS_HARDWARE_DECODING_AV1; - - static { - boolean vp9found = false; - boolean av1found = false; - MediaCodecList codecList = new MediaCodecList(MediaCodecList.ALL_CODECS); - final boolean deviceIsAndroidTenOrLater = isSDKAbove(29); - - for (MediaCodecInfo codecInfo : codecList.getCodecInfos()) { - final boolean isHardwareAccelerated = deviceIsAndroidTenOrLater - ? codecInfo.isHardwareAccelerated() - : !codecInfo.getName().startsWith("OMX.google"); // Software decoder. - if (isHardwareAccelerated && !codecInfo.isEncoder()) { - for (String type : codecInfo.getSupportedTypes()) { - if (type.equalsIgnoreCase("video/x-vnd.on2.vp9")) { - vp9found = true; - } else if (type.equalsIgnoreCase("video/av01")) { - av1found = true; - } - } - } - } - - DEVICE_HAS_HARDWARE_DECODING_VP9 = vp9found; - DEVICE_HAS_HARDWARE_DECODING_AV1 = av1found; - - Logger.printDebug(() -> DEVICE_HAS_HARDWARE_DECODING_AV1 - ? "Device supports AV1 hardware decoding\n" - : "Device does not support AV1 hardware decoding\n" - + (DEVICE_HAS_HARDWARE_DECODING_VP9 - ? "Device supports VP9 hardware decoding" - : "Device does not support VP9 hardware decoding")); - } - - public static boolean allowVP9() { - return DEVICE_HAS_HARDWARE_DECODING_VP9 && !Settings.SPOOF_STREAMING_DATA_IOS_FORCE_AVC.get(); - } - - public static boolean allowAV1() { - return allowVP9() && DEVICE_HAS_HARDWARE_DECODING_AV1; - } -} diff --git a/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/misc/requests/PlayerRoutes.java b/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/misc/requests/PlayerRoutes.java index 22032119a..5a7f87c94 100644 --- a/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/misc/requests/PlayerRoutes.java +++ b/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/misc/requests/PlayerRoutes.java @@ -92,6 +92,8 @@ public final class PlayerRoutes { connection.setRequestProperty("Content-Type", "application/json"); connection.setRequestProperty("User-Agent", clientType.userAgent); + connection.setRequestProperty("X-YouTube-Client-Name", clientType.id); + connection.setRequestProperty("X-YouTube-Client-Version", clientType.clientVersion); connection.setUseCaches(false); connection.setDoOutput(true); @@ -100,4 +102,4 @@ public final class PlayerRoutes { connection.setReadTimeout(CONNECTION_TIMEOUT_MILLISECONDS); return connection; } -} \ No newline at end of file +} diff --git a/extensions/shared/src/main/java/app/revanced/extension/youtube/settings/Settings.java b/extensions/shared/src/main/java/app/revanced/extension/youtube/settings/Settings.java index ab4683227..1a55ee198 100644 --- a/extensions/shared/src/main/java/app/revanced/extension/youtube/settings/Settings.java +++ b/extensions/shared/src/main/java/app/revanced/extension/youtube/settings/Settings.java @@ -565,8 +565,6 @@ public class Settings extends BaseSettings { // PreferenceScreen: Miscellaneous - Spoof streaming data // The order of the settings should not be changed otherwise the app may crash public static final BooleanSetting SPOOF_STREAMING_DATA = new BooleanSetting("revanced_spoof_streaming_data", TRUE, true, "revanced_spoof_streaming_data_user_dialog_message"); - public static final BooleanSetting SPOOF_STREAMING_DATA_IOS_FORCE_AVC = new BooleanSetting("revanced_spoof_streaming_data_ios_force_avc", FALSE, true, - "revanced_spoof_streaming_data_ios_force_avc_user_dialog_message", new SpoofStreamingDataPatch.iOSAvailability()); public static final BooleanSetting SPOOF_STREAMING_DATA_IOS_SKIP_LIVESTREAM_PLAYBACK = new BooleanSetting("revanced_spoof_streaming_data_ios_skip_livestream_playback", TRUE, true, new SpoofStreamingDataPatch.iOSAvailability()); public static final EnumSetting SPOOF_STREAMING_DATA_TYPE = new EnumSetting<>("revanced_spoof_streaming_data_type", ClientType.IOS, true, parent(SPOOF_STREAMING_DATA)); public static final BooleanSetting SPOOF_STREAMING_DATA_STATS_FOR_NERDS = new BooleanSetting("revanced_spoof_streaming_data_stats_for_nerds", TRUE, parent(SPOOF_STREAMING_DATA)); diff --git a/patches/src/main/resources/youtube/settings/host/values/strings.xml b/patches/src/main/resources/youtube/settings/host/values/strings.xml index 322d0d7a6..ca18490ac 100644 --- a/patches/src/main/resources/youtube/settings/host/values/strings.xml +++ b/patches/src/main/resources/youtube/settings/host/values/strings.xml @@ -1905,12 +1905,6 @@ Tap on the continue button and disable battery optimizations." • Stable volume is not available." "• Audio track menu is missing. • Stable volume is not available." - Force iOS AVC (H.264) - iOS video codec is AVC (H.264). - iOS video codec is AVC (H.264), VP9, or AV1. - "Enabling this might improve battery life and fix playback stuttering. - -AVC (H.264) has a maximum resolution of 1080p, and video playback will use more internet data than VP9 or AV1." Skip iOS livestream playback iOS client is not used for livestream playback. iOS client is used for livestream playback. diff --git a/patches/src/main/resources/youtube/settings/xml/revanced_prefs.xml b/patches/src/main/resources/youtube/settings/xml/revanced_prefs.xml index 9989a5cb7..4f54f2a5d 100644 --- a/patches/src/main/resources/youtube/settings/xml/revanced_prefs.xml +++ b/patches/src/main/resources/youtube/settings/xml/revanced_prefs.xml @@ -780,7 +780,6 @@ - SETTINGS: SPOOF_STREAMING_DATA -->