Skip to content

Commit

Permalink
feat(YouTube - Spoof client): Selectively spoof client for general vi…
Browse files Browse the repository at this point in the history
…deo / livestreams / Shorts / fallback (unplayable video)

Co-Authored-By: inotia00 <[email protected]>
  • Loading branch information
inotia00 authored and anddea committed May 31, 2024
1 parent 40df716 commit d92de62
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ object SpoofClientPatch : BaseBytecodePatch(
*/
SettingsPatch.addPreference(
arrayOf(
"PREFERENCE_CATEGORY: MISC_EXPERIMENTAL_FLAGS",
"SETTINGS: SPOOF_CLIENT"
)
)
Expand Down
40 changes: 40 additions & 0 deletions src/main/resources/youtube/settings/host/values/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,46 @@
<item>https://github.com/polymorphicshade/Tubular/releases/latest</item>
<item>https://github.com/deniscerri/ytdlnis/releases/latest</item>
</string-array>
<string-array name="revanced_spoof_client_general_options_entries">
<item>@string/revanced_spoof_client_options_entry_ios</item>
<item>@string/revanced_spoof_client_options_entry_android_testsuite</item>
<item>@string/revanced_spoof_client_options_entry_android_tv</item>
<item>@string/revanced_spoof_client_options_entry_android_vr</item>
</string-array>
<string-array name="revanced_spoof_client_general_options_entry_values">
<item>IOS</item>
<item>ANDROID_TESTSUITE</item>
<item>ANDROID_UNPLUGGED</item>
<item>ANDROID_VR</item>
</string-array>
<string-array name="revanced_spoof_client_livestream_options_entries">
<item>@string/revanced_spoof_client_options_entry_ios</item>
<item>@string/revanced_spoof_client_options_entry_android_tv</item>
<item>@string/revanced_spoof_client_options_entry_android_vr</item>
</string-array>
<string-array name="revanced_spoof_client_livestream_options_entry_values">
<item>IOS</item>
<item>ANDROID_UNPLUGGED</item>
<item>ANDROID_VR</item>
</string-array>
<string-array name="revanced_spoof_client_shorts_options_entries">
<item>@string/revanced_spoof_client_options_entry_ios</item>
<item>@string/revanced_spoof_client_options_entry_android_vr</item>
</string-array>
<string-array name="revanced_spoof_client_shorts_options_entry_values">
<item>IOS</item>
<item>ANDROID_VR</item>
</string-array>
<string-array name="revanced_spoof_client_fallback_options_entries">
<item>@string/revanced_spoof_client_options_entry_ios</item>
<item>@string/revanced_spoof_client_options_entry_android_testsuite</item>
<item>@string/revanced_spoof_client_options_entry_android_vr</item>
</string-array>
<string-array name="revanced_spoof_client_fallback_options_entry_values">
<item>IOS</item>
<item>ANDROID_TESTSUITE</item>
<item>ANDROID_VR</item>
</string-array>
<string-array name="revanced_spoof_app_version_target_entries">
<item>@string/revanced_spoof_app_version_target_entry_18_17_43</item>
<item>@string/revanced_spoof_app_version_target_entry_18_05_40</item>
Expand Down
42 changes: 26 additions & 16 deletions src/main/resources/youtube/settings/xml/revanced_prefs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,31 @@

<PreferenceScreen android:title="@string/revanced_preference_screen_misc_title" android:key="revanced_preference_screen_misc">

<PreferenceScreen android:title="@string/revanced_preference_screen_import_export_title" android:key="revanced_preference_screen_import_export" android:summary="@string/revanced_preference_screen_import_export_summary">
<PreferenceCategory android:title="@string/revanced_preference_category_import_export_as_file" android:layout="@layout/revanced_settings_preferences_category" />
<Preference android:title="@string/revanced_extended_settings_export_title" android:key="revanced_extended_settings_export" android:summary="@string/revanced_extended_settings_export_summary" />
<Preference android:title="@string/revanced_extended_settings_import_title" android:key="revanced_extended_settings_import" android:summary="@string/revanced_extended_settings_import_summary" />
<PreferenceCategory android:title="@string/revanced_preference_category_import_export_as_text" android:layout="@layout/revanced_settings_preferences_category" />
<app.revanced.integrations.youtube.settings.preference.ImportExportPreference android:title="@string/revanced_extended_settings_import_export_as_text_title" android:summary="@string/revanced_extended_settings_import_export_as_text_summary" android:inputType="textMultiLine" />
</PreferenceScreen>

<!-- SETTINGS: SPOOF_CLIENT
<PreferenceScreen android:title="@string/revanced_preference_screen_spoof_client_title" android:key="revanced_preference_screen_spoof_client" android:summary="@string/revanced_preference_screen_spoof_client_summary">
<SwitchPreference android:title="@string/revanced_spoof_client_title" android:key="revanced_spoof_client" android:summaryOn="@string/revanced_spoof_client_summary_on" android:summaryOff="@string/revanced_spoof_client_summary_off" />
<PreferenceCategory android:title="@string/revanced_preference_category_spoof_client_options" android:layout="@layout/revanced_settings_preferences_category" />
<ListPreference android:entries="@array/revanced_spoof_client_general_options_entries" android:title="@string/revanced_spoof_client_general_title" android:key="revanced_spoof_client_general" android:entryValues="@array/revanced_spoof_client_general_options_entry_values" android:dependency="revanced_spoof_client" />
<ListPreference android:entries="@array/revanced_spoof_client_livestream_options_entries" android:title="@string/revanced_spoof_client_livestream_title" android:key="revanced_spoof_client_livestream" android:entryValues="@array/revanced_spoof_client_livestream_options_entry_values" android:dependency="revanced_spoof_client" />
<ListPreference android:entries="@array/revanced_spoof_client_shorts_options_entries" android:title="@string/revanced_spoof_client_shorts_title" android:key="revanced_spoof_client_shorts" android:entryValues="@array/revanced_spoof_client_shorts_options_entry_values" android:dependency="revanced_spoof_client" />
<ListPreference android:entries="@array/revanced_spoof_client_fallback_options_entries" android:title="@string/revanced_spoof_client_fallback_title" android:key="revanced_spoof_client_fallback" android:entryValues="@array/revanced_spoof_client_fallback_options_entry_values" android:dependency="revanced_spoof_client" />
<PreferenceCategory android:title="@string/revanced_preference_category_spoof_client_about" android:layout="@layout/revanced_settings_preferences_category" />
<Preference android:title="@string/revanced_spoof_client_use_ios_title" android:key="revanced_spoof_client_use_ios" android:selectable="false" android:summary="@string/revanced_spoof_client_use_ios_summary" />
<Preference android:title="@string/revanced_spoof_client_use_android_testsuite_title" android:key="revanced_spoof_client_use_android_testsuite" android:selectable="false" android:summary="@string/revanced_spoof_client_use_android_testsuite_summary" android:dependency="revanced_spoof_client" />
<Preference android:title="@string/revanced_spoof_client_use_android_tv_title" android:key="revanced_spoof_client_use_android_tv" android:selectable="false" android:summary="@string/revanced_spoof_client_use_android_tv_summary" android:dependency="revanced_spoof_client" />
<Preference android:title="@string/revanced_spoof_client_use_android_vr_title" android:key="revanced_spoof_client_use_android_vr" android:selectable="false" android:summary="@string/revanced_spoof_client_use_android_vr_summary" android:dependency="revanced_spoof_client" />
</PreferenceScreen>SETTINGS: SPOOF_CLIENT -->

<!-- SETTINGS: DISABLE_QUIC_PROTOCOL
<SwitchPreference android:title="@string/revanced_disable_quic_protocol_title" android:key="revanced_disable_quic_protocol" android:defaultValue="false" android:summary="@string/revanced_disable_quic_protocol_summary" />SETTINGS: DISABLE_QUIC_PROTOCOL -->

Expand All @@ -545,15 +570,7 @@
<!-- SETTINGS: ENABLE_OPEN_LINKS_DIRECTLY
<SwitchPreference android:title="@string/revanced_enable_open_links_directly_title" android:key="revanced_enable_open_links_directly" android:defaultValue="true" android:summaryOn="@string/revanced_enable_open_links_directly_summary_on" android:summaryOff="@string/revanced_enable_open_links_directly_summary_off" />SETTINGS: ENABLE_OPEN_LINKS_DIRECTLY -->

<PreferenceScreen android:title="@string/revanced_preference_screen_import_export_title" android:key="revanced_preference_screen_import_export" android:summary="@string/revanced_preference_screen_import_export_summary">
<PreferenceCategory android:title="@string/revanced_preference_category_import_export_as_file" android:layout="@layout/revanced_settings_preferences_category" />
<Preference android:title="@string/revanced_extended_settings_export_title" android:key="revanced_extended_settings_export" android:summary="@string/revanced_extended_settings_export_summary" />
<Preference android:title="@string/revanced_extended_settings_import_title" android:key="revanced_extended_settings_import" android:summary="@string/revanced_extended_settings_import_summary" />
<PreferenceCategory android:title="@string/revanced_preference_category_import_export_as_text" android:layout="@layout/revanced_settings_preferences_category" />
<app.revanced.integrations.youtube.settings.preference.ImportExportPreference android:title="@string/revanced_extended_settings_import_export_as_text_title" android:summary="@string/revanced_extended_settings_import_export_as_text_summary" android:inputType="textMultiLine" />
</PreferenceScreen>

<app.revanced.integrations.youtube.settings.preference.OpenDefaultAppSettingsPreference android:title="@string/revanced_default_app_settings_title" android:key="revanced_default_app_settings" android:summary="@string/revanced_default_app_settings_summary" />
<app.revanced.integrations.youtube.settings.preference.OpenDefaultAppSettingsPreference android:title="@string/revanced_default_app_settings_title" android:summary="@string/revanced_default_app_settings_summary" />

<!-- PREFERENCE: GMS_CORE_SETTINGS
<Preference android:title="@string/gms_core_settings_title" android:key="gms_core_settings" android:summary="@string/gms_core_settings_summary">
Expand All @@ -566,13 +583,6 @@
<!-- PREFERENCE_CATEGORY: MISC_EXPERIMENTAL_FLAGS
<PreferenceCategory android:title="@string/revanced_preference_category_experimental_flag" android:layout="@layout/revanced_settings_preferences_category"/>PREFERENCE_CATEGORY: MISC_EXPERIMENTAL_FLAGS -->

<!-- SETTINGS: SPOOF_FORMAT_STREAM_DATA
<SwitchPreference android:title="@string/revanced_spoof_format_stream_data_title" android:key="revanced_spoof_format_stream_data" android:defaultValue="false" android:summary="@string/revanced_spoof_format_stream_data_summary" />SETTINGS: SPOOF_FORMAT_STREAM_DATA -->

<!-- SETTINGS: SPOOF_CLIENT
<SwitchPreference android:title="@string/revanced_spoof_client_title" android:key="revanced_spoof_client" android:defaultValue="false" android:summaryOn="@string/revanced_spoof_client_summary_on" android:summaryOff="@string/revanced_spoof_client_summary_off" />
<SwitchPreference android:title="@string/revanced_spoof_client_use_ios_title" android:key="revanced_spoof_client_use_ios" android:defaultValue="true" android:summaryOn="@string/revanced_spoof_client_use_ios_summary_on" android:summaryOff="@string/revanced_spoof_client_use_ios_summary_off" />SETTINGS: SPOOF_CLIENT -->

<!-- SETTINGS: SPOOF_PLAYER_PARAMETER
<SwitchPreference android:title="@string/revanced_spoof_player_parameter_title" android:key="revanced_spoof_player_parameter" android:defaultValue="false" android:summary="@string/revanced_spoof_player_parameter_summary" />
<SwitchPreference android:title="@string/revanced_spoof_player_parameter_in_feed_title" android:key="revanced_spoof_player_parameter_in_feed" android:defaultValue="false" android:summaryOn="@string/revanced_spoof_player_parameter_in_feed_summary_on" android:summaryOff="@string/revanced_spoof_player_parameter_in_feed_summary_off" android:dependency="revanced_spoof_player_parameter" />SETTINGS: SPOOF_PLAYER_PARAMETER -->
Expand Down

0 comments on commit d92de62

Please sign in to comment.