feat(YouTube): Support version 19.43.41 (#3854)

This commit is contained in:
LisoUseInAIKyrios
2024-11-03 08:46:20 -04:00
committed by oSumAtrIX
parent 0f42574b7f
commit 85de5c7d96
59 changed files with 249 additions and 64 deletions

View File

@ -4,7 +4,22 @@ import app.revanced.extension.youtube.settings.Settings;
/** @noinspection unused*/
public final class DisableFullscreenAmbientModePatch {
public static boolean enableFullScreenAmbientMode() {
return !Settings.DISABLE_FULLSCREEN_AMBIENT_MODE.get();
private static final boolean DISABLE_FULLSCREEN_AMBIENT_MODE = Settings.DISABLE_FULLSCREEN_AMBIENT_MODE.get();
/**
* Constant found in: androidx.window.embedding.DividerAttributes
*/
private static final int DIVIDER_ATTRIBUTES_COLOR_SYSTEM_DEFAULT = -16777216;
/**
* Injection point.
*/
public static int getFullScreenBackgroundColor(int originalColor) {
if (DISABLE_FULLSCREEN_AMBIENT_MODE) {
return DIVIDER_ATTRIBUTES_COLOR_SYSTEM_DEFAULT;
}
return originalColor;
}
}

View File

@ -0,0 +1,24 @@
package app.revanced.extension.youtube.patches;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import app.revanced.extension.shared.Logger;
import app.revanced.extension.shared.settings.BaseSettings;
@SuppressWarnings("unused")
public final class EnableDebuggingPatch {
private static final ConcurrentMap<Long, Boolean> featureFlags
= new ConcurrentHashMap<>(150, 0.75f, 1);
public static boolean isFeatureFlagEnabled(long flag, boolean value) {
if (value && BaseSettings.DEBUG.get()) {
if (featureFlags.putIfAbsent(flag, true) == null) {
Logger.printDebug(() -> "feature is enabled: " + flag);
}
}
return value;
}
}