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

refactor(YouTube - Spoof streaming data): Remove Force iOS AVC setting #103

Merged
merged 4 commits into from
Dec 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,18 @@ 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.
*
* <p>
* See <a href="https://gist.github.com/adamawolf/3048717">this GitHub Gist</a> for more
* information.
* </p>
*/
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 +
"(" +
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ static HttpURLConnection getPlayerResponseConnectionFromRoute(Route.CompiledRout

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);
Expand All @@ -100,4 +102,4 @@ static HttpURLConnection getPlayerResponseConnectionFromRoute(Route.CompiledRout
connection.setReadTimeout(CONNECTION_TIMEOUT_MILLISECONDS);
return connection;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -545,8 +545,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<ClientType> 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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1846,12 +1846,6 @@ Tap on the continue button and disable battery optimizations."</string>
• Stable volume is not available."</string>
<string name="revanced_spoof_streaming_data_side_effects_android_vr">"• Audio track menu is missing.
• Stable volume is not available."</string>
<string name="revanced_spoof_streaming_data_ios_force_avc_title">Force iOS AVC (H.264)</string>
<string name="revanced_spoof_streaming_data_ios_force_avc_summary_on">iOS video codec is AVC (H.264).</string>
<string name="revanced_spoof_streaming_data_ios_force_avc_summary_off">iOS video codec is AVC (H.264), VP9, or AV1.</string>
<string name="revanced_spoof_streaming_data_ios_force_avc_user_dialog_message">"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."</string>
<string name="revanced_spoof_streaming_data_ios_skip_livestream_playback_title">Skip iOS livestream playback</string>
<string name="revanced_spoof_streaming_data_ios_skip_livestream_playback_summary_on">iOS client is not used for livestream playback.</string>
<string name="revanced_spoof_streaming_data_ios_skip_livestream_playback_summary_off">iOS client is used for livestream playback.</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,6 @@
<SwitchPreference android:title="@string/revanced_spoof_streaming_data_title" android:key="revanced_spoof_streaming_data" android:summaryOn="@string/revanced_spoof_streaming_data_summary_on" android:summaryOff="@string/revanced_spoof_streaming_data_summary_off" />
<ListPreference android:entries="@array/revanced_spoof_streaming_data_type_entries" android:title="@string/revanced_spoof_streaming_data_type_title" android:key="revanced_spoof_streaming_data_type" android:entryValues="@array/revanced_spoof_streaming_data_type_entry_values" />
<app.revanced.extension.youtube.settings.preference.SpoofStreamingDataSideEffectsPreference android:title="@string/revanced_spoof_streaming_data_side_effects_title" />
<SwitchPreference android:title="@string/revanced_spoof_streaming_data_ios_force_avc_title" android:key="revanced_spoof_streaming_data_ios_force_avc" android:summaryOn="@string/revanced_spoof_streaming_data_ios_force_avc_summary_on" android:summaryOff="@string/revanced_spoof_streaming_data_ios_force_avc_summary_off" />
<SwitchPreference android:title="@string/revanced_spoof_streaming_data_ios_skip_livestream_playback_title" android:key="revanced_spoof_streaming_data_ios_skip_livestream_playback" android:summaryOn="@string/revanced_spoof_streaming_data_ios_skip_livestream_playback_summary_on" android:summaryOff="@string/revanced_spoof_streaming_data_ios_skip_livestream_playback_summary_off" />
<SwitchPreference android:title="@string/revanced_spoof_streaming_data_stats_for_nerds_title" android:key="revanced_spoof_streaming_data_stats_for_nerds" android:summaryOn="@string/revanced_spoof_streaming_data_stats_for_nerds_summary_on" android:summaryOff="@string/revanced_spoof_streaming_data_stats_for_nerds_summary_off" />
</PreferenceScreen>SETTINGS: SPOOF_STREAMING_DATA -->
Expand Down