From 0e44d7c767d9f8a9cb6b3a5f803bb58d3f41a04f Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 21 Dec 2024 13:28:34 +0400 Subject: [PATCH 01/10] fix(YouTube - Spoof video streams): Use Android VR as default spoof client --- .../app/revanced/extension/shared/settings/BaseSettings.java | 2 +- .../patches/youtube/misc/spoof/SpoofVideoStreamsPatch.kt | 2 +- patches/src/main/resources/addresources/values/arrays.xml | 4 ++-- patches/src/main/resources/addresources/values/strings.xml | 5 +++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/extensions/shared/library/src/main/java/app/revanced/extension/shared/settings/BaseSettings.java b/extensions/shared/library/src/main/java/app/revanced/extension/shared/settings/BaseSettings.java index 4669e999a1..0f7bb3991c 100644 --- a/extensions/shared/library/src/main/java/app/revanced/extension/shared/settings/BaseSettings.java +++ b/extensions/shared/library/src/main/java/app/revanced/extension/shared/settings/BaseSettings.java @@ -25,6 +25,6 @@ public class BaseSettings { public static final EnumSetting SPOOF_VIDEO_STREAMS_LANGUAGE = new EnumSetting<>("revanced_spoof_video_streams_language", AudioStreamLanguage.DEFAULT, parent(SPOOF_VIDEO_STREAMS)); 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 SpoofiOSAvailability()); - public static final EnumSetting SPOOF_VIDEO_STREAMS_CLIENT_TYPE = new EnumSetting<>("revanced_spoof_video_streams_client_type", ClientType.IOS, true, parent(SPOOF_VIDEO_STREAMS)); + public static final EnumSetting SPOOF_VIDEO_STREAMS_CLIENT_TYPE = new EnumSetting<>("revanced_spoof_video_streams_type", ClientType.ANDROID_VR, true, parent(SPOOF_VIDEO_STREAMS)); } diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/misc/spoof/SpoofVideoStreamsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/misc/spoof/SpoofVideoStreamsPatch.kt index fa53200bf5..7687d5fa62 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/misc/spoof/SpoofVideoStreamsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/misc/spoof/SpoofVideoStreamsPatch.kt @@ -37,7 +37,7 @@ val spoofVideoStreamsPatch = spoofVideoStreamsPatch({ preferences = setOf( SwitchPreference("revanced_spoof_video_streams"), ListPreference( - "revanced_spoof_video_streams_client_type", + "revanced_spoof_video_streams_type", summaryKey = null, ), ListPreference( diff --git a/patches/src/main/resources/addresources/values/arrays.xml b/patches/src/main/resources/addresources/values/arrays.xml index 3ce8ff5e39..715ade60b8 100644 --- a/patches/src/main/resources/addresources/values/arrays.xml +++ b/patches/src/main/resources/addresources/values/arrays.xml @@ -1,12 +1,12 @@ - + Android VR iOS - + ANDROID_VR IOS diff --git a/patches/src/main/resources/addresources/values/strings.xml b/patches/src/main/resources/addresources/values/strings.xml index dc826d49b9..eceb46daf4 100644 --- a/patches/src/main/resources/addresources/values/strings.xml +++ b/patches/src/main/resources/addresources/values/strings.xml @@ -1296,7 +1296,7 @@ Enabling this can unlock higher video qualities" Video playback may not work" Turning off this setting may cause video playback issues. - Default client + Default client Force AVC (H.264) Video codec is forced to AVC (H.264) Video codec is determined automatically @@ -1304,7 +1304,8 @@ Video playback may not work" AVC has a maximum resolution of 1080p, Opus audio codec is not available, and video playback will use more internet data than VP9 or AV1." iOS spoofing side effects - "• Private kids videos may not play + "• Video playback may not work +• Private kids videos may not play • Videos end 1 second early" Android VR spoofing side effects "• Kids videos may not play From 3d6a9c8861763c30aa51c267ed398de4cf4bd4f0 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 21 Dec 2024 14:16:10 +0400 Subject: [PATCH 02/10] Remove iOS, add Android TV --- .../shared/settings/BaseSettings.java | 3 - .../extension/shared/spoof/ClientType.java | 37 ++------ .../shared/spoof/SpoofVideoStreamsPatch.java | 34 ++------ .../extension/youtube/settings/Settings.java | 4 +- ...oofStreamingDataSideEffectsPreference.java | 85 ------------------- .../patches/shared/misc/spoof/Fingerprints.kt | 11 --- .../misc/spoof/SpoofVideoStreamsPatch.kt | 10 --- .../misc/spoof/SpoofVideoStreamsPatch.kt | 7 +- .../resources/addresources/values/arrays.xml | 4 +- .../resources/addresources/values/strings.xml | 16 +--- 10 files changed, 22 insertions(+), 189 deletions(-) delete mode 100644 extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/preference/SpoofStreamingDataSideEffectsPreference.java diff --git a/extensions/shared/library/src/main/java/app/revanced/extension/shared/settings/BaseSettings.java b/extensions/shared/library/src/main/java/app/revanced/extension/shared/settings/BaseSettings.java index 0f7bb3991c..dce56d4d80 100644 --- a/extensions/shared/library/src/main/java/app/revanced/extension/shared/settings/BaseSettings.java +++ b/extensions/shared/library/src/main/java/app/revanced/extension/shared/settings/BaseSettings.java @@ -3,7 +3,6 @@ import static java.lang.Boolean.FALSE; import static java.lang.Boolean.TRUE; import static app.revanced.extension.shared.settings.Setting.parent; -import static app.revanced.extension.shared.spoof.SpoofVideoStreamsPatch.SpoofiOSAvailability; import app.revanced.extension.shared.spoof.AudioStreamLanguage; import app.revanced.extension.shared.spoof.ClientType; @@ -23,8 +22,6 @@ public class BaseSettings { 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 EnumSetting SPOOF_VIDEO_STREAMS_LANGUAGE = new EnumSetting<>("revanced_spoof_video_streams_language", AudioStreamLanguage.DEFAULT, parent(SPOOF_VIDEO_STREAMS)); - 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 SpoofiOSAvailability()); public static final EnumSetting SPOOF_VIDEO_STREAMS_CLIENT_TYPE = new EnumSetting<>("revanced_spoof_video_streams_type", ClientType.ANDROID_VR, true, parent(SPOOF_VIDEO_STREAMS)); } diff --git a/extensions/shared/library/src/main/java/app/revanced/extension/shared/spoof/ClientType.java b/extensions/shared/library/src/main/java/app/revanced/extension/shared/spoof/ClientType.java index e281cf50e4..7d723a24e4 100644 --- a/extensions/shared/library/src/main/java/app/revanced/extension/shared/spoof/ClientType.java +++ b/extensions/shared/library/src/main/java/app/revanced/extension/shared/spoof/ClientType.java @@ -4,10 +4,7 @@ import androidx.annotation.Nullable; -import app.revanced.extension.shared.settings.BaseSettings; - public enum ClientType { - // Specific purpose for age restricted, or private videos, because the iOS client is not logged in. // https://dumps.tadiphone.dev/dumps/oculus/eureka ANDROID_VR(28, "ANDROID_VR", @@ -18,34 +15,16 @@ public enum ClientType { "1.56.21", true ), - // Specific for kids videos. - IOS(5, - "IOS", - forceAVC() - ? "iPhone12,5" // 11 Pro Max (last device with iOS 13) - : "iPhone17,2", // 16 Pro Max - // iOS 13 and earlier uses only AVC. 14+ adds VP9 and AV1. - forceAVC() - ? "13.7.17H35" // Last release of iOS 13. - : "18.1.1.22B91", - forceAVC() - ? "com.google.ios.youtube/17.40.5 (iPhone; U; CPU iOS 13_7 like Mac OS X)" - : "com.google.ios.youtube/19.49.5 (iPhone; U; CPU iOS 18_1_1 like Mac OS X)", - null, - // Version number should be a valid iOS release. - // https://www.ipa4fun.com/history/185230 - forceAVC() - // Some newer versions can also force AVC, - // but 17.40 is the last version that supports iOS 13. - ? "17.40.5" - : "19.49.5", - false + ANDROID_UNPLUGGED(29, + "ANDROID_UNPLUGGED", + "Google TV Streamer", + "14", + "com.google.android.apps.youtube.unplugged/8.49.0 (Linux; U; Android 14; GB) gzip", + "34", + "8.49.0", + true ); - private static boolean forceAVC() { - return BaseSettings.SPOOF_VIDEO_STREAMS_IOS_FORCE_AVC.get(); - } - /** * YouTube * client type diff --git a/extensions/shared/library/src/main/java/app/revanced/extension/shared/spoof/SpoofVideoStreamsPatch.java b/extensions/shared/library/src/main/java/app/revanced/extension/shared/spoof/SpoofVideoStreamsPatch.java index fe3d684bb5..1b0eb5ef14 100644 --- a/extensions/shared/library/src/main/java/app/revanced/extension/shared/spoof/SpoofVideoStreamsPatch.java +++ b/extensions/shared/library/src/main/java/app/revanced/extension/shared/spoof/SpoofVideoStreamsPatch.java @@ -18,9 +18,6 @@ public class SpoofVideoStreamsPatch { private static final boolean SPOOF_STREAMING_DATA = BaseSettings.SPOOF_VIDEO_STREAMS.get(); - private static final boolean FIX_HLS_CURRENT_TIME = SPOOF_STREAMING_DATA - && BaseSettings.SPOOF_VIDEO_STREAMS_CLIENT_TYPE.get() == ClientType.IOS; - /** * Any unreachable ip address. Used to intentionally fail requests. */ @@ -34,20 +31,20 @@ private static boolean isPatchIncluded() { return false; // Modified during patching. } - public static final class NotSpoofingAndroidVrAvailability implements Setting.Availability { + public static final class NotSpoofingAndroidAvailability implements Setting.Availability { @Override public boolean isAvailable() { if (SpoofVideoStreamsPatch.isPatchIncluded()) { - EnumSetting clientType = BaseSettings.SPOOF_VIDEO_STREAMS_CLIENT_TYPE; - return clientType.isAvailable() && clientType.get() != ClientType.ANDROID_VR; + EnumSetting setting = BaseSettings.SPOOF_VIDEO_STREAMS_CLIENT_TYPE; + ClientType type = setting.get(); + return setting.isAvailable() && type != ClientType.ANDROID_VR + && type != ClientType.ANDROID_UNPLUGGED; } return true; } } - - /** * Injection point. * Blocks /get_watch requests by returning an unreachable URI. @@ -190,25 +187,4 @@ public static byte[] removeVideoPlaybackPostBody(Uri uri, int method, byte[] pos return postData; } - - /** - * Injection point. - * - * Fixes iOS livestreams starting from the beginning. - */ - public static boolean fixHLSCurrentTime(boolean original) { - if (FIX_HLS_CURRENT_TIME) { - return false; - } - - return original; - } - - public static final class SpoofiOSAvailability implements Setting.Availability { - @Override - public boolean isAvailable() { - return BaseSettings.SPOOF_VIDEO_STREAMS.get() - && BaseSettings.SPOOF_VIDEO_STREAMS_CLIENT_TYPE.get() == ClientType.IOS; - } - } } 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 c2995dd34f..b147249d8f 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 @@ -7,7 +7,7 @@ import static app.revanced.extension.shared.settings.Setting.migrateOldSettingToNew; import static app.revanced.extension.shared.settings.Setting.parent; import static app.revanced.extension.shared.settings.Setting.parentsAny; -import static app.revanced.extension.shared.spoof.SpoofVideoStreamsPatch.NotSpoofingAndroidVrAvailability; +import static app.revanced.extension.shared.spoof.SpoofVideoStreamsPatch.NotSpoofingAndroidAvailability; import static app.revanced.extension.youtube.patches.ChangeStartPagePatch.StartPage; import static app.revanced.extension.youtube.patches.MiniplayerPatch.MiniplayerHideExpandCloseAvailability; import static app.revanced.extension.youtube.patches.MiniplayerPatch.MiniplayerHorizontalDragAvailability; @@ -54,7 +54,7 @@ public class Settings extends BaseSettings { public static final StringSetting CUSTOM_PLAYBACK_SPEEDS = new StringSetting("revanced_custom_playback_speeds", "0.25\n0.5\n0.75\n0.9\n0.95\n1.0\n1.05\n1.1\n1.25\n1.5\n1.75\n2.0\n3.0\n4.0\n5.0", true); // Audio - public static final BooleanSetting FORCE_ORIGINAL_AUDIO = new BooleanSetting("revanced_force_original_audio", FALSE, new NotSpoofingAndroidVrAvailability()); + public static final BooleanSetting FORCE_ORIGINAL_AUDIO = new BooleanSetting("revanced_force_original_audio", FALSE, new NotSpoofingAndroidAvailability()); // Ads public static final BooleanSetting HIDE_BUTTONED_ADS = new BooleanSetting("revanced_hide_buttoned_ads", TRUE); diff --git a/extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/preference/SpoofStreamingDataSideEffectsPreference.java b/extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/preference/SpoofStreamingDataSideEffectsPreference.java deleted file mode 100644 index 4a9be0d5fd..0000000000 --- a/extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/preference/SpoofStreamingDataSideEffectsPreference.java +++ /dev/null @@ -1,85 +0,0 @@ -package app.revanced.extension.youtube.settings.preference; - -import static app.revanced.extension.shared.StringRef.str; - -import android.content.Context; -import android.content.SharedPreferences; -import android.preference.Preference; -import android.preference.PreferenceManager; -import android.util.AttributeSet; - -import androidx.annotation.Nullable; - -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.shared.spoof.ClientType; - -@SuppressWarnings({"deprecation", "unused"}) -public class SpoofStreamingDataSideEffectsPreference extends Preference { - - @Nullable - private ClientType currentClientType; - - private final SharedPreferences.OnSharedPreferenceChangeListener listener = (sharedPreferences, str) -> { - // Because this listener may run before the ReVanced settings fragment updates Settings, - // this could show the prior config and not the current. - // - // Push this call to the end of the main run queue, - // so all other listeners are done and Settings is up to date. - Utils.runOnMainThread(this::updateUI); - }; - - public SpoofStreamingDataSideEffectsPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { - super(context, attrs, defStyleAttr, defStyleRes); - } - - public SpoofStreamingDataSideEffectsPreference(Context context, AttributeSet attrs, int defStyleAttr) { - super(context, attrs, defStyleAttr); - } - - public SpoofStreamingDataSideEffectsPreference(Context context, AttributeSet attrs) { - super(context, attrs); - } - - public SpoofStreamingDataSideEffectsPreference(Context context) { - super(context); - } - - private void addChangeListener() { - Setting.preferences.preferences.registerOnSharedPreferenceChangeListener(listener); - } - - private void removeChangeListener() { - Setting.preferences.preferences.unregisterOnSharedPreferenceChangeListener(listener); - } - - @Override - protected void onAttachedToHierarchy(PreferenceManager preferenceManager) { - super.onAttachedToHierarchy(preferenceManager); - updateUI(); - addChangeListener(); - } - - @Override - protected void onPrepareForRemoval() { - super.onPrepareForRemoval(); - removeChangeListener(); - } - - private void updateUI() { - ClientType clientType = BaseSettings.SPOOF_VIDEO_STREAMS_CLIENT_TYPE.get(); - if (currentClientType == clientType) { - return; - } - - Logger.printDebug(() -> "Updating spoof stream side effects preference"); - setEnabled(BaseSettings.SPOOF_VIDEO_STREAMS.get()); - - String key = "revanced_spoof_video_streams_about_" - + clientType.name().toLowerCase(); - setTitle(str(key + "_title")); - setSummary(str(key + "_summary")); - } -} diff --git a/patches/src/main/kotlin/app/revanced/patches/shared/misc/spoof/Fingerprints.kt b/patches/src/main/kotlin/app/revanced/patches/shared/misc/spoof/Fingerprints.kt index c4a581c52a..683529a71b 100644 --- a/patches/src/main/kotlin/app/revanced/patches/shared/misc/spoof/Fingerprints.kt +++ b/patches/src/main/kotlin/app/revanced/patches/shared/misc/spoof/Fingerprints.kt @@ -1,7 +1,6 @@ package app.revanced.patches.shared.misc.spoof import app.revanced.patcher.fingerprint -import app.revanced.util.literal import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode @@ -112,16 +111,6 @@ internal val buildMediaDataSourceFingerprint = fingerprint { ) } -internal const val HLS_CURRENT_TIME_FEATURE_FLAG = 45355374L - -internal val hlsCurrentTimeFingerprint = fingerprint { - accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL) - parameters("Z", "L") - literal { - HLS_CURRENT_TIME_FEATURE_FLAG - } -} - internal val patchIncludedExtensionMethodFingerprint = fingerprint { accessFlags(AccessFlags.PRIVATE, AccessFlags.STATIC) returns("Z") diff --git a/patches/src/main/kotlin/app/revanced/patches/shared/misc/spoof/SpoofVideoStreamsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/shared/misc/spoof/SpoofVideoStreamsPatch.kt index 417873c709..30c7bf9c9b 100644 --- a/patches/src/main/kotlin/app/revanced/patches/shared/misc/spoof/SpoofVideoStreamsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/shared/misc/spoof/SpoofVideoStreamsPatch.kt @@ -12,7 +12,6 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMu import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.util.getReference import app.revanced.util.indexOfFirstInstructionOrThrow -import app.revanced.util.insertFeatureFlagBooleanOverride import app.revanced.util.returnEarly import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode @@ -209,15 +208,6 @@ fun spoofVideoStreamsPatch( } // endregion - // region Fix iOS livestream current time. - - hlsCurrentTimeFingerprint.method.insertFeatureFlagBooleanOverride( - HLS_CURRENT_TIME_FEATURE_FLAG, - "$EXTENSION_CLASS_DESCRIPTOR->fixHLSCurrentTime(Z)Z" - ) - - // endregion - executeBlock() } } diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/misc/spoof/SpoofVideoStreamsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/misc/spoof/SpoofVideoStreamsPatch.kt index 7687d5fa62..e075f2b95b 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/misc/spoof/SpoofVideoStreamsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/misc/spoof/SpoofVideoStreamsPatch.kt @@ -44,12 +44,7 @@ val spoofVideoStreamsPatch = spoofVideoStreamsPatch({ "revanced_spoof_video_streams_language", summaryKey = null ), - SwitchPreference("revanced_spoof_video_streams_ios_force_avc"), - NonInteractivePreference( - // Requires a key and title but the actual text is chosen at runtime. - key = "revanced_spoof_video_streams_about_android_vr", - tag = "app.revanced.extension.youtube.settings.preference.SpoofStreamingDataSideEffectsPreference" - ), + NonInteractivePreference("revanced_spoof_video_streams_about_android") ), ), ) diff --git a/patches/src/main/resources/addresources/values/arrays.xml b/patches/src/main/resources/addresources/values/arrays.xml index 715ade60b8..b9cb73a0b1 100644 --- a/patches/src/main/resources/addresources/values/arrays.xml +++ b/patches/src/main/resources/addresources/values/arrays.xml @@ -4,12 +4,12 @@ Android VR - iOS + Android TV ANDROID_VR - IOS + ANDROID_UNPLUGGED @string/revanced_spoof_video_streams_language_DEFAULT diff --git a/patches/src/main/resources/addresources/values/strings.xml b/patches/src/main/resources/addresources/values/strings.xml index eceb46daf4..27a989a82b 100644 --- a/patches/src/main/resources/addresources/values/strings.xml +++ b/patches/src/main/resources/addresources/values/strings.xml @@ -1297,18 +1297,10 @@ Enabling this can unlock higher video qualities" Video playback may not work" Turning off this setting may cause video playback issues. Default client - Force AVC (H.264) - Video codec is forced to AVC (H.264) - Video codec is determined automatically - "Enabling this might improve battery life and fix playback stuttering. - -AVC has a maximum resolution of 1080p, Opus audio codec is not available, and video playback will use more internet data than VP9 or AV1." - iOS spoofing side effects - "• Video playback may not work -• Private kids videos may not play -• Videos end 1 second early" - Android VR spoofing side effects - "• Kids videos may not play + Android spoofing side effects + "• Age restricted videos may not play +• Kids videos may not play +• Movies or paid videos may not play • Audio track menu is missing • Stable volume is not available • Force original audio is not available" From 51f12d9d3a9b7dede19beb0759cae0bd3d7c0c32 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 21 Dec 2024 14:20:07 +0400 Subject: [PATCH 03/10] Age restricted seems to work. Paid videos probably works since it's authenticated --- patches/src/main/resources/addresources/values/strings.xml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/patches/src/main/resources/addresources/values/strings.xml b/patches/src/main/resources/addresources/values/strings.xml index 27a989a82b..e0aba2b40f 100644 --- a/patches/src/main/resources/addresources/values/strings.xml +++ b/patches/src/main/resources/addresources/values/strings.xml @@ -1298,9 +1298,7 @@ Video playback may not work" Turning off this setting may cause video playback issues. Default client Android spoofing side effects - "• Age restricted videos may not play -• Kids videos may not play -• Movies or paid videos may not play + "• Kids videos may not play • Audio track menu is missing • Stable volume is not available • Force original audio is not available" From e873fb9e1286d69e5e0959f31b56f2ee579754bb Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 21 Dec 2024 14:32:27 +0400 Subject: [PATCH 04/10] Add Android creator client type --- .../extension/shared/spoof/ClientType.java | 16 +++++++++++----- .../resources/addresources/values/arrays.xml | 2 ++ .../resources/addresources/values/strings.xml | 1 + 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/extensions/shared/library/src/main/java/app/revanced/extension/shared/spoof/ClientType.java b/extensions/shared/library/src/main/java/app/revanced/extension/shared/spoof/ClientType.java index 7d723a24e4..09fac045ed 100644 --- a/extensions/shared/library/src/main/java/app/revanced/extension/shared/spoof/ClientType.java +++ b/extensions/shared/library/src/main/java/app/revanced/extension/shared/spoof/ClientType.java @@ -7,7 +7,6 @@ public enum ClientType { // https://dumps.tadiphone.dev/dumps/oculus/eureka ANDROID_VR(28, - "ANDROID_VR", "Quest 3", "12", "com.google.android.apps.youtube.vr.oculus/1.56.21 (Linux; U; Android 12; GB) gzip", @@ -16,14 +15,22 @@ public enum ClientType { true ), ANDROID_UNPLUGGED(29, - "ANDROID_UNPLUGGED", "Google TV Streamer", "14", "com.google.android.apps.youtube.unplugged/8.49.0 (Linux; U; Android 14; GB) gzip", "34", "8.49.0", true - ); + ), + ANDROID_CREATOR( + 14, + "Android", + "11", + "com.google.android.apps.youtube.creator/24.45.100 (Linux; U; Android 11) gzip", + "30", + "24.45.100", + true +); /** * YouTube @@ -66,7 +73,6 @@ public enum ClientType { public final boolean canLogin; ClientType(int id, - String clientName, String deviceModel, String osVersion, String userAgent, @@ -74,7 +80,7 @@ public enum ClientType { String clientVersion, boolean canLogin) { this.id = id; - this.clientName = clientName; + this.clientName = name(); this.deviceModel = deviceModel; this.osVersion = osVersion; this.userAgent = userAgent; diff --git a/patches/src/main/resources/addresources/values/arrays.xml b/patches/src/main/resources/addresources/values/arrays.xml index b9cb73a0b1..ae60b0faa1 100644 --- a/patches/src/main/resources/addresources/values/arrays.xml +++ b/patches/src/main/resources/addresources/values/arrays.xml @@ -5,11 +5,13 @@ Android VR Android TV + @string/revanced_spoof_video_streams_android_creator ANDROID_VR ANDROID_UNPLUGGED + ANDROID_CREATOR @string/revanced_spoof_video_streams_language_DEFAULT diff --git a/patches/src/main/resources/addresources/values/strings.xml b/patches/src/main/resources/addresources/values/strings.xml index e0aba2b40f..41a93dec17 100644 --- a/patches/src/main/resources/addresources/values/strings.xml +++ b/patches/src/main/resources/addresources/values/strings.xml @@ -1297,6 +1297,7 @@ Enabling this can unlock higher video qualities" Video playback may not work" Turning off this setting may cause video playback issues. Default client + Android Creator Android spoofing side effects "• Kids videos may not play • Audio track menu is missing From 8c40f4f2e283fa64b1943c63b0e6fe5dbf0a0d5f Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 21 Dec 2024 14:35:13 +0400 Subject: [PATCH 05/10] Fix settings --- .../extension/shared/spoof/SpoofVideoStreamsPatch.java | 3 +-- patches/src/main/resources/addresources/values/arrays.xml | 2 +- patches/src/main/resources/addresources/values/strings.xml | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/extensions/shared/library/src/main/java/app/revanced/extension/shared/spoof/SpoofVideoStreamsPatch.java b/extensions/shared/library/src/main/java/app/revanced/extension/shared/spoof/SpoofVideoStreamsPatch.java index 1b0eb5ef14..e55306e5ad 100644 --- a/extensions/shared/library/src/main/java/app/revanced/extension/shared/spoof/SpoofVideoStreamsPatch.java +++ b/extensions/shared/library/src/main/java/app/revanced/extension/shared/spoof/SpoofVideoStreamsPatch.java @@ -37,8 +37,7 @@ public boolean isAvailable() { if (SpoofVideoStreamsPatch.isPatchIncluded()) { EnumSetting setting = BaseSettings.SPOOF_VIDEO_STREAMS_CLIENT_TYPE; ClientType type = setting.get(); - return setting.isAvailable() && type != ClientType.ANDROID_VR - && type != ClientType.ANDROID_UNPLUGGED; + return setting.isAvailable() && type.androidSdkVersion == null; } return true; diff --git a/patches/src/main/resources/addresources/values/arrays.xml b/patches/src/main/resources/addresources/values/arrays.xml index ae60b0faa1..f93cb89dba 100644 --- a/patches/src/main/resources/addresources/values/arrays.xml +++ b/patches/src/main/resources/addresources/values/arrays.xml @@ -5,7 +5,7 @@ Android VR Android TV - @string/revanced_spoof_video_streams_android_creator + @string/revanced_spoof_video_streams_type_android_creator diff --git a/patches/src/main/resources/addresources/values/strings.xml b/patches/src/main/resources/addresources/values/strings.xml index 41a93dec17..fd3b8c6d78 100644 --- a/patches/src/main/resources/addresources/values/strings.xml +++ b/patches/src/main/resources/addresources/values/strings.xml @@ -1297,7 +1297,7 @@ Enabling this can unlock higher video qualities" Video playback may not work" Turning off this setting may cause video playback issues. Default client - Android Creator + Android Creator Android spoofing side effects "• Kids videos may not play • Audio track menu is missing From 853cabd9899cff2dd55520032a3460cbca828b06 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 21 Dec 2024 15:23:30 +0400 Subject: [PATCH 06/10] fix: No good reason to localize the client name --- patches/src/main/resources/addresources/values/arrays.xml | 2 +- patches/src/main/resources/addresources/values/strings.xml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/patches/src/main/resources/addresources/values/arrays.xml b/patches/src/main/resources/addresources/values/arrays.xml index f93cb89dba..191ca69a13 100644 --- a/patches/src/main/resources/addresources/values/arrays.xml +++ b/patches/src/main/resources/addresources/values/arrays.xml @@ -5,7 +5,7 @@ Android VR Android TV - @string/revanced_spoof_video_streams_type_android_creator + Android Creator diff --git a/patches/src/main/resources/addresources/values/strings.xml b/patches/src/main/resources/addresources/values/strings.xml index fd3b8c6d78..e0aba2b40f 100644 --- a/patches/src/main/resources/addresources/values/strings.xml +++ b/patches/src/main/resources/addresources/values/strings.xml @@ -1297,7 +1297,6 @@ Enabling this can unlock higher video qualities" Video playback may not work" Turning off this setting may cause video playback issues. Default client - Android Creator Android spoofing side effects "• Kids videos may not play • Audio track menu is missing From 83d606b1939b420ec4202655ee5e5424e38a546b Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 21 Dec 2024 15:24:59 +0400 Subject: [PATCH 07/10] fix: Don't need to rename key since prior default enum type was deleted --- .../app/revanced/extension/shared/settings/BaseSettings.java | 2 +- .../patches/youtube/misc/spoof/SpoofVideoStreamsPatch.kt | 2 +- patches/src/main/resources/addresources/values/arrays.xml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/shared/library/src/main/java/app/revanced/extension/shared/settings/BaseSettings.java b/extensions/shared/library/src/main/java/app/revanced/extension/shared/settings/BaseSettings.java index dce56d4d80..e8f9c83517 100644 --- a/extensions/shared/library/src/main/java/app/revanced/extension/shared/settings/BaseSettings.java +++ b/extensions/shared/library/src/main/java/app/revanced/extension/shared/settings/BaseSettings.java @@ -22,6 +22,6 @@ public class BaseSettings { 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 EnumSetting SPOOF_VIDEO_STREAMS_LANGUAGE = new EnumSetting<>("revanced_spoof_video_streams_language", AudioStreamLanguage.DEFAULT, parent(SPOOF_VIDEO_STREAMS)); - public static final EnumSetting SPOOF_VIDEO_STREAMS_CLIENT_TYPE = new EnumSetting<>("revanced_spoof_video_streams_type", ClientType.ANDROID_VR, true, parent(SPOOF_VIDEO_STREAMS)); + public static final EnumSetting SPOOF_VIDEO_STREAMS_CLIENT_TYPE = new EnumSetting<>("revanced_spoof_video_streams_client_type", ClientType.ANDROID_VR, true, parent(SPOOF_VIDEO_STREAMS)); } diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/misc/spoof/SpoofVideoStreamsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/misc/spoof/SpoofVideoStreamsPatch.kt index e075f2b95b..674854a4c5 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/misc/spoof/SpoofVideoStreamsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/misc/spoof/SpoofVideoStreamsPatch.kt @@ -37,7 +37,7 @@ val spoofVideoStreamsPatch = spoofVideoStreamsPatch({ preferences = setOf( SwitchPreference("revanced_spoof_video_streams"), ListPreference( - "revanced_spoof_video_streams_type", + "revanced_spoof_video_streams_client_type", summaryKey = null, ), ListPreference( diff --git a/patches/src/main/resources/addresources/values/arrays.xml b/patches/src/main/resources/addresources/values/arrays.xml index 191ca69a13..e3b93e71d6 100644 --- a/patches/src/main/resources/addresources/values/arrays.xml +++ b/patches/src/main/resources/addresources/values/arrays.xml @@ -1,13 +1,13 @@ - + Android VR Android TV Android Creator - + ANDROID_VR ANDROID_UNPLUGGED From 4bb9263c41869671805c5a5af63b4c1e87cd2c1c Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 21 Dec 2024 15:27:24 +0400 Subject: [PATCH 08/10] Cleanup --- .../app/revanced/extension/shared/spoof/ClientType.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/extensions/shared/library/src/main/java/app/revanced/extension/shared/spoof/ClientType.java b/extensions/shared/library/src/main/java/app/revanced/extension/shared/spoof/ClientType.java index 09fac045ed..af274deb77 100644 --- a/extensions/shared/library/src/main/java/app/revanced/extension/shared/spoof/ClientType.java +++ b/extensions/shared/library/src/main/java/app/revanced/extension/shared/spoof/ClientType.java @@ -6,7 +6,8 @@ public enum ClientType { // https://dumps.tadiphone.dev/dumps/oculus/eureka - ANDROID_VR(28, + ANDROID_VR( + 28, "Quest 3", "12", "com.google.android.apps.youtube.vr.oculus/1.56.21 (Linux; U; Android 12; GB) gzip", @@ -14,7 +15,8 @@ public enum ClientType { "1.56.21", true ), - ANDROID_UNPLUGGED(29, + ANDROID_UNPLUGGED( + 29, "Google TV Streamer", "14", "com.google.android.apps.youtube.unplugged/8.49.0 (Linux; U; Android 14; GB) gzip", From 247af2b7c7488a2f2da475c8f3200f633b17c58e Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 21 Dec 2024 15:30:30 +0400 Subject: [PATCH 09/10] fix: Add disclaimer --- .../patches/youtube/video/audio/ForceOriginalAudioPatch.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/video/audio/ForceOriginalAudioPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/video/audio/ForceOriginalAudioPatch.kt index 94a80d908d..1e11044923 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/video/audio/ForceOriginalAudioPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/video/audio/ForceOriginalAudioPatch.kt @@ -31,7 +31,8 @@ private const val EXTENSION_CLASS_DESCRIPTOR = @Suppress("unused") val forceOriginalAudioPatch = bytecodePatch( name = "Force original audio", - description = "Adds an option to always use the original audio track.", + description = "Adds an option to always use the original audio track. " + + "This patch does nothing if 'Spoof video streams' is enabled.", ) { dependsOn( sharedExtensionPatch, From 07ebeada448630deb08604b4a4f0bbd14cbe37ea Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 21 Dec 2024 15:31:33 +0400 Subject: [PATCH 10/10] fix strings --- patches/src/main/resources/addresources/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/src/main/resources/addresources/values/strings.xml b/patches/src/main/resources/addresources/values/strings.xml index e0aba2b40f..2d994070bb 100644 --- a/patches/src/main/resources/addresources/values/strings.xml +++ b/patches/src/main/resources/addresources/values/strings.xml @@ -1296,7 +1296,7 @@ Enabling this can unlock higher video qualities" Video playback may not work" Turning off this setting may cause video playback issues. - Default client + Default client Android spoofing side effects "• Kids videos may not play • Audio track menu is missing