mirror of
https://github.com/revanced/revanced-integrations.git
synced 2024-12-02 16:52:55 +01:00
feat(YouTube - Spoof app version): Add 18.09.39
to restore library tab (#552)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
parent
7ae10be507
commit
3bd48dca09
@ -40,6 +40,7 @@ import java.util.concurrent.TimeoutException;
|
||||
import app.revanced.integrations.shared.Logger;
|
||||
import app.revanced.integrations.shared.Utils;
|
||||
import app.revanced.integrations.youtube.ThemeHelper;
|
||||
import app.revanced.integrations.youtube.patches.spoof.SpoofAppVersionPatch;
|
||||
import app.revanced.integrations.youtube.returnyoutubedislike.requests.RYDVoteData;
|
||||
import app.revanced.integrations.youtube.returnyoutubedislike.requests.ReturnYouTubeDislikeApi;
|
||||
import app.revanced.integrations.youtube.settings.Settings;
|
||||
@ -89,6 +90,9 @@ public class ReturnYouTubeDislike {
|
||||
*/
|
||||
private static final char MIDDLE_SEPARATOR_CHARACTER = '◎'; // 'bullseye'
|
||||
|
||||
private static final boolean IS_SPOOFING_TO_OLD_SEPARATOR_COLOR
|
||||
= SpoofAppVersionPatch.isSpoofingToEqualOrLessThan("18.09.39");
|
||||
|
||||
/**
|
||||
* Cached lookup of all video ids.
|
||||
*/
|
||||
@ -179,10 +183,24 @@ public class ReturnYouTubeDislike {
|
||||
@GuardedBy("this")
|
||||
private SpannableString replacementLikeDislikeSpan;
|
||||
|
||||
/**
|
||||
* Color of the left and middle separator, based on the color of the right separator.
|
||||
* It's unknown where YT gets the color from, and the colors here are approximated by hand.
|
||||
* Ideally, the color here would be the actual color YT uses at runtime.
|
||||
*
|
||||
* Older versions before the 'Me' library tab use a slightly different color.
|
||||
* If spoofing was previously used and is now turned off,
|
||||
* or an old version was recently upgraded then the old colors are sometimes used.
|
||||
*/
|
||||
private static int getSeparatorColor() {
|
||||
if (IS_SPOOFING_TO_OLD_SEPARATOR_COLOR) {
|
||||
return ThemeHelper.isDarkTheme()
|
||||
? 0x29AAAAAA // transparent dark gray
|
||||
: 0xFFD9D9D9; // light gray
|
||||
}
|
||||
return ThemeHelper.isDarkTheme()
|
||||
? 0x33FFFFFF // transparent dark gray
|
||||
: 0xFFD9D9D9; // light gray
|
||||
? 0x33FFFFFF
|
||||
: 0xFFD9D9D9;
|
||||
}
|
||||
|
||||
public static ShapeDrawable getLeftSeparatorDrawable() {
|
||||
|
Loading…
Reference in New Issue
Block a user