Skip to content

Commit fe6709c

Browse files
fix(YouTube - Spoof video streams): Remove no longer functional 'Force AVC' setting
1 parent 6a44e75 commit fe6709c

File tree

7 files changed

+6
-110
lines changed

7 files changed

+6
-110
lines changed

extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/spoof/ClientType.java

+6-20
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package app.revanced.extension.youtube.patches.spoof;
22

3-
import static app.revanced.extension.youtube.patches.spoof.DeviceHardwareSupport.allowAV1;
4-
import static app.revanced.extension.youtube.patches.spoof.DeviceHardwareSupport.allowVP9;
3+
import static app.revanced.extension.youtube.patches.spoof.DeviceHardwareSupport.DEVICE_HAS_HARDWARE_DECODING_AV1;
54

65
import android.os.Build;
76

@@ -16,28 +15,21 @@ public enum ClientType {
1615
"com.google.android.apps.youtube.vr.oculus/1.56.21 (Linux; U; Android 12; GB) gzip",
1716
"32", // Android 12.1
1817
"1.56.21",
19-
"ANDROID_VR",
2018
true
2119
),
2220
// Specific for kids videos.
2321
IOS(5,
2422
// iPhone 15 supports AV1 hardware decoding.
2523
// Only use if this Android device also has hardware decoding.
26-
allowAV1()
24+
DEVICE_HAS_HARDWARE_DECODING_AV1
2725
? "iPhone16,2" // 15 Pro Max
2826
: "iPhone11,4", // XS Max
29-
// iOS 14+ forces VP9.
30-
allowVP9()
31-
? "17.5.1.21F90"
32-
: "13.7.17H35",
33-
allowVP9()
34-
? "com.google.ios.youtube/19.47.7 (iPhone; U; CPU iOS 17_5_1 like Mac OS X)"
35-
: "com.google.ios.youtube/19.47.7 (iPhone; U; CPU iOS 13_7 like Mac OS X)",
27+
"17.5.1.21F90",
28+
"com.google.ios.youtube/19.47.7 (iPhone; U; CPU iOS 17_5_1 like Mac OS X)",
3629
null,
3730
// Version number should be a valid iOS release.
3831
// https://www.ipa4fun.com/history/185230
3932
"19.47.7",
40-
"IOS",
4133
false
4234
);
4335

@@ -63,17 +55,13 @@ public enum ClientType {
6355
public final String userAgent;
6456

6557
/**
66-
* Android SDK version, equivalent to {@link Build.VERSION#SDK} (System property: ro.build.version.sdk)
58+
* Android SDK version, equivalent to {@link Build.VERSION#SDK}
59+
* (System property: ro.build.version.sdk)
6760
* Field is null if not applicable.
6861
*/
6962
@Nullable
7063
public final String androidSdkVersion;
7164

72-
/**
73-
* Client name.
74-
*/
75-
public final String clientName;
76-
7765
/**
7866
* App version.
7967
*/
@@ -90,7 +78,6 @@ public enum ClientType {
9078
String userAgent,
9179
@Nullable String androidSdkVersion,
9280
String clientVersion,
93-
String clientName,
9481
boolean canLogin
9582
) {
9683
this.id = id;
@@ -99,7 +86,6 @@ public enum ClientType {
9986
this.userAgent = userAgent;
10087
this.androidSdkVersion = androidSdkVersion;
10188
this.clientVersion = clientVersion;
102-
this.clientName = clientName;
10389
this.canLogin = canLogin;
10490
}
10591
}

extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/spoof/DeviceHardwareSupport.java

-9
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import android.os.Build;
66

77
import app.revanced.extension.shared.Logger;
8-
import app.revanced.extension.youtube.settings.Settings;
98

109
public class DeviceHardwareSupport {
1110
public static final boolean DEVICE_HAS_HARDWARE_DECODING_VP9;
@@ -42,12 +41,4 @@ public class DeviceHardwareSupport {
4241
? "Device supports VP9 hardware decoding"
4342
: "Device does not support VP9 hardware decoding"));
4443
}
45-
46-
public static boolean allowVP9() {
47-
return DEVICE_HAS_HARDWARE_DECODING_VP9 && !Settings.SPOOF_VIDEO_STREAMS_IOS_FORCE_AVC.get();
48-
}
49-
50-
public static boolean allowAV1() {
51-
return allowVP9() && DEVICE_HAS_HARDWARE_DECODING_AV1;
52-
}
5344
}

extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/spoof/SpoofVideoStreamsPatch.java

-8
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,11 @@
1111
import app.revanced.extension.shared.Logger;
1212
import app.revanced.extension.shared.Utils;
1313
import app.revanced.extension.shared.settings.BaseSettings;
14-
import app.revanced.extension.shared.settings.Setting;
1514
import app.revanced.extension.youtube.patches.spoof.requests.StreamingDataRequest;
1615
import app.revanced.extension.youtube.settings.Settings;
1716

1817
@SuppressWarnings("unused")
1918
public class SpoofVideoStreamsPatch {
20-
public static final class ForceiOSAVCAvailability implements Setting.Availability {
21-
@Override
22-
public boolean isAvailable() {
23-
return Settings.SPOOF_VIDEO_STREAMS.get() && Settings.SPOOF_VIDEO_STREAMS_CLIENT_TYPE.get() == ClientType.IOS;
24-
}
25-
}
26-
2719
private static final boolean SPOOF_STREAMING_DATA = Settings.SPOOF_VIDEO_STREAMS.get();
2820

2921
/**

extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/Settings.java

-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import app.revanced.extension.youtube.patches.AlternativeThumbnailsPatch.ThumbnailOption;
2121
import app.revanced.extension.youtube.patches.AlternativeThumbnailsPatch.ThumbnailStillTime;
2222
import app.revanced.extension.youtube.patches.spoof.ClientType;
23-
import app.revanced.extension.youtube.patches.spoof.SpoofVideoStreamsPatch;
2423
import app.revanced.extension.youtube.sponsorblock.SponsorBlockSettings;
2524

2625
public class Settings extends BaseSettings {
@@ -273,8 +272,6 @@ public class Settings extends BaseSettings {
273272
public static final BooleanSetting BYPASS_URL_REDIRECTS = new BooleanSetting("revanced_bypass_url_redirects", TRUE);
274273
public static final BooleanSetting ANNOUNCEMENTS = new BooleanSetting("revanced_announcements", TRUE);
275274
public static final BooleanSetting SPOOF_VIDEO_STREAMS = new BooleanSetting("revanced_spoof_video_streams", TRUE, true,"revanced_spoof_video_streams_user_dialog_message");
276-
public static final BooleanSetting SPOOF_VIDEO_STREAMS_IOS_FORCE_AVC = new BooleanSetting("revanced_spoof_video_streams_ios_force_avc", FALSE, true,
277-
"revanced_spoof_video_streams_ios_force_avc_user_dialog_message", new SpoofVideoStreamsPatch.ForceiOSAVCAvailability());
278275
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));
279276
public static final IntegerSetting ANNOUNCEMENT_LAST_ID = new IntegerSetting("revanced_announcement_last_id", -1, false, false);
280277
public static final BooleanSetting CHECK_WATCH_HISTORY_DOMAIN_NAME = new BooleanSetting("revanced_check_watch_history_domain_name", TRUE, false, false);

extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/preference/ForceAVCSpoofingPreference.java

-61
This file was deleted.

patches/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofVideoStreamsPatch.kt

-4
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,6 @@ val spoofVideoStreamsPatch = bytecodePatch(
6767
"revanced_spoof_video_streams_client",
6868
summaryKey = null,
6969
),
70-
SwitchPreference(
71-
"revanced_spoof_video_streams_ios_force_avc",
72-
tag = "app.revanced.extension.youtube.settings.preference.ForceAVCSpoofingPreference",
73-
),
7470
NonInteractivePreference("revanced_spoof_video_streams_about_android_vr"),
7571
NonInteractivePreference("revanced_spoof_video_streams_about_ios"),
7672
),

patches/src/main/resources/addresources/values/strings.xml

-5
Original file line numberDiff line numberDiff line change
@@ -1219,11 +1219,6 @@ This is because Crowdin requires temporarily flattening this file and removing t
12191219
<string name="revanced_spoof_video_streams_summary_off">Video streams are not spoofed\n\nVideo playback may not work</string>
12201220
<string name="revanced_spoof_video_streams_user_dialog_message">Turning off this setting may cause video playback issues.</string>
12211221
<string name="revanced_spoof_video_streams_client_title">Default client</string>
1222-
<string name="revanced_spoof_video_streams_ios_force_avc_title">Force AVC (H.264)</string>
1223-
<string name="revanced_spoof_video_streams_ios_force_avc_summary_on">Video codec is AVC (H.264)</string>
1224-
<string name="revanced_spoof_video_streams_ios_force_avc_summary_off">Video codec is VP9 or AV1</string>
1225-
<string name="revanced_spoof_video_streams_ios_force_avc_no_hardware_vp9_summary_on">Your device does not have VP9 hardware decoding, and this setting is always on when Client spoofing is enabled</string>
1226-
<string name="revanced_spoof_video_streams_ios_force_avc_user_dialog_message">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.</string>
12271222
<string name="revanced_spoof_video_streams_about_ios_title">iOS spoofing side effects</string>
12281223
<string name="revanced_spoof_video_streams_about_ios_summary">• Private kids videos may not play\n• Livestreams start from the beginning\n• Videos may end 1 second early</string>
12291224
<string name="revanced_spoof_video_streams_about_android_vr_title">Android VR spoofing side effects</string>

0 commit comments

Comments
 (0)