mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-06-12 13:17:38 +02:00
feat(YouTube): Support version 19.43.41
(#3854)
This commit is contained in:

committed by
oSumAtrIX

parent
0f42574b7f
commit
85de5c7d96
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user