mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-12 21:27:43 +02:00
feat(YouTube): Add Disable layout updates
patch https://github.com/inotia00/ReVanced_Extended/issues/2863
This commit is contained in:
@ -106,6 +106,34 @@ public class GeneralPatch {
|
||||
|
||||
// endregion
|
||||
|
||||
// region [Disable layout updates] patch
|
||||
|
||||
private static final String[] REQUEST_HEADER_KEYS = {
|
||||
"X-Youtube-Cold-Config-Data",
|
||||
"X-Youtube-Cold-Hash-Data",
|
||||
"X-Youtube-Hot-Config-Data",
|
||||
"X-Youtube-Hot-Hash-Data"
|
||||
};
|
||||
|
||||
private static final boolean DISABLE_LAYOUT_UPDATES =
|
||||
Settings.DISABLE_LAYOUT_UPDATES.get();
|
||||
|
||||
/**
|
||||
* @param key Keys to be added to the header of CronetBuilder.
|
||||
* @param value Values to be added to the header of CronetBuilder.
|
||||
* @return Empty value if setting is enabled.
|
||||
*/
|
||||
public static String disableLayoutUpdates(String key, String value) {
|
||||
if (DISABLE_LAYOUT_UPDATES && StringUtils.equalsAny(key, REQUEST_HEADER_KEYS)) {
|
||||
Logger.printDebug(() -> "Blocking: " + key);
|
||||
return "";
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
// endregion
|
||||
|
||||
// region [Disable splash animation] patch
|
||||
|
||||
public static boolean disableSplashAnimation(boolean original) {
|
||||
|
@ -158,6 +158,7 @@ public class Settings extends BaseSettings {
|
||||
|
||||
public static final EnumSetting<FormFactor> CHANGE_FORM_FACTOR = new EnumSetting<>("revanced_change_form_factor", FormFactor.DEFAULT, true, "revanced_change_form_factor_user_dialog_message");
|
||||
public static final BooleanSetting CHANGE_LIVE_RING_CLICK_ACTION = new BooleanSetting("revanced_change_live_ring_click_action", FALSE, true);
|
||||
public static final BooleanSetting DISABLE_LAYOUT_UPDATES = new BooleanSetting("revanced_disable_layout_updates", false, true, "revanced_disable_layout_updates_user_dialog_message");
|
||||
public static final BooleanSetting SPOOF_APP_VERSION = new BooleanSetting("revanced_spoof_app_version", false, true, "revanced_spoof_app_version_user_dialog_message");
|
||||
public static final StringSetting SPOOF_APP_VERSION_TARGET = new StringSetting("revanced_spoof_app_version_target", PatchStatus.SpoofAppVersionDefaultString(), true, parent(SPOOF_APP_VERSION));
|
||||
|
||||
|
Reference in New Issue
Block a user