Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(YouTube - Spoof video streams): Change default spoofing to iOS, allow setting a default language with Android VR #4171

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ 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<AudioStreamLanguage> SPOOF_VIDEO_STREAMS_LANGUAGE = new EnumSetting<>("revanced_spoof_video_streams_language", AudioStreamLanguage.DEFAULT, new SpoofiOSAvailability());
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());
"revanced_spoof_video_streams_ios_force_avc_user_dialog_message", parent(SPOOF_VIDEO_STREAMS));
public static final EnumSetting<ClientType> SPOOF_VIDEO_STREAMS_CLIENT_TYPE = new EnumSetting<>("revanced_spoof_video_streams_client", ClientType.ANDROID_VR, true, parent(SPOOF_VIDEO_STREAMS));

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ 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",
true,
false),
true
),
// Specific for kids videos.
IOS(5,
"IOS",
Expand All @@ -39,8 +39,7 @@ public enum ClientType {
// but 17.40 is the last version that supports iOS 13.
? "17.40.5"
: "19.47.7",
false,
true
false
);

private static boolean forceAVC() {
Expand Down Expand Up @@ -87,20 +86,14 @@ private static boolean forceAVC() {
*/
public final boolean canLogin;

/**
* If a language code should be used.
*/
public final boolean useLanguageCode;

ClientType(int id,
String clientName,
String deviceModel,
String osVersion,
String userAgent,
@Nullable String androidSdkVersion,
String clientVersion,
boolean canLogin,
boolean useLanguageCode) {
boolean canLogin) {
this.id = id;
this.clientName = clientName;
this.deviceModel = deviceModel;
Expand All @@ -109,6 +102,5 @@ private static boolean forceAVC() {
this.androidSdkVersion = androidSdkVersion;
this.clientVersion = clientVersion;
this.canLogin = canLogin;
this.useLanguageCode = useLanguageCode;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ static String createInnertubeBody(ClientType clientType) {
JSONObject context = new JSONObject();

JSONObject client = new JSONObject();
if (clientType.useLanguageCode) {
client.put("hl", BaseSettings.SPOOF_VIDEO_STREAMS_LANGUAGE.get().getIso639_1());
}
client.put("hl", BaseSettings.SPOOF_VIDEO_STREAMS_LANGUAGE.get().getIso639_1());
client.put("clientName", clientType.clientName);
client.put("clientVersion", clientType.clientVersion);
client.put("deviceModel", clientType.deviceModel);
Expand Down
3 changes: 2 additions & 1 deletion patches/src/main/resources/addresources/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1309,7 +1309,8 @@ AVC has a maximum resolution of 1080p, Opus audio codec is not available, and vi
<string name="revanced_spoof_video_streams_about_android_vr_title">Android VR spoofing side effects</string>
<string name="revanced_spoof_video_streams_about_android_vr_summary">"• Kids videos may not play
• Audio track menu is missing
• Stable volume is not available"</string>
• Stable volume is not available
• Force original audio patch does not work"</string>
<string name="revanced_spoof_video_streams_language_title">Default audio stream language</string>
<string name="revanced_spoof_video_streams_language_DEFAULT">App language</string>
<string name="revanced_spoof_video_streams_language_AR">Arabic</string>
Expand Down
Loading