From 30724583e31dce16c59e6b49b5b599f54c2fd683 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sat, 4 Jun 2022 17:01:57 +0200 Subject: [PATCH] feat: app promo banner removal setting --- .../fi/razerman/youtube/litho/LithoAdRemoval.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/fi/razerman/youtube/litho/LithoAdRemoval.java b/app/src/main/java/fi/razerman/youtube/litho/LithoAdRemoval.java index 5dd8f1080d..35ae65ba61 100644 --- a/app/src/main/java/fi/razerman/youtube/litho/LithoAdRemoval.java +++ b/app/src/main/java/fi/razerman/youtube/litho/LithoAdRemoval.java @@ -34,6 +34,10 @@ public static boolean isExperimentalCompactBannerRemoval() { return SharedPrefs.getBoolean(Objects.requireNonNull(YouTubeTikTokRoot_Application.getAppContext()), "experimental_compact_banner", false); } + public static boolean isExperimentalAppPromoBannerRemoval() { + return SharedPrefs.getBoolean(Objects.requireNonNull(YouTubeTikTokRoot_Application.getAppContext()), "experimental_app_promo_banner", false); + } + public static boolean isExperimentalCommentsRemoval() { return SharedPrefs.getBoolean(Objects.requireNonNull(YouTubeTikTokRoot_Application.getAppContext()), "experimental_comments", false); } @@ -59,7 +63,7 @@ public static boolean isCommunityGuidelines() { } public static boolean containsAd(String value) { - if (!(isExperimentalAdRemoval() || isExperimentalMerchandiseRemoval() || isExperimentalCommunityPostRemoval() || isExperimentalMovieUpsellRemoval() || isExperimentalCompactBannerRemoval() || isExperimentalCommentsRemoval() || isExperimentalCompactMovieRemoval() || isExperimentalHorizontalMovieShelfRemoval() || isInFeedSurvey() || isShortsShelf() || isCommunityGuidelines()) || value == null || value.isEmpty()) { + if (!(isExperimentalAdRemoval() || isExperimentalMerchandiseRemoval() || isExperimentalAppPromoBannerRemoval() || isExperimentalCommunityPostRemoval() || isExperimentalMovieUpsellRemoval() || isExperimentalCompactBannerRemoval() || isExperimentalCommentsRemoval() || isExperimentalCompactMovieRemoval() || isExperimentalHorizontalMovieShelfRemoval() || isInFeedSurvey() || isShortsShelf() || isCommunityGuidelines()) || value == null || value.isEmpty()) { return false; } List blockList = new ArrayList<>(); @@ -76,6 +80,9 @@ public static boolean containsAd(String value) { if (isExperimentalMovieUpsellRemoval()) { blockList.add("movie_and_show_upsell_card"); } + if (isExperimentalAppPromoBannerRemoval()) { + blockList.add("watch_metadata_app_promo"); + } if (isExperimentalCompactBannerRemoval()) { blockList.add("compact_banner"); } @@ -114,7 +121,7 @@ public static boolean containsAd(String value) { public static boolean containsAd(String value, ByteBuffer buffer) { try { - if (!(isExperimentalAdRemoval() || isExperimentalMerchandiseRemoval() || isExperimentalCommunityPostRemoval() || isExperimentalMovieUpsellRemoval() || isExperimentalCompactBannerRemoval() || isExperimentalCommentsRemoval() || isExperimentalCompactMovieRemoval() || isExperimentalHorizontalMovieShelfRemoval() || isInFeedSurvey() || isShortsShelf() || isCommunityGuidelines()) || value == null || value.isEmpty()) { + if (!(isExperimentalAdRemoval() || isExperimentalMerchandiseRemoval() || isExperimentalAppPromoBannerRemoval() || isExperimentalCommunityPostRemoval() || isExperimentalMovieUpsellRemoval() || isExperimentalCompactBannerRemoval() || isExperimentalCommentsRemoval() || isExperimentalCompactMovieRemoval() || isExperimentalHorizontalMovieShelfRemoval() || isInFeedSurvey() || isShortsShelf() || isCommunityGuidelines()) || value == null || value.isEmpty()) { return false; } List blockList = new ArrayList<>(); @@ -132,6 +139,9 @@ public static boolean containsAd(String value, ByteBuffer buffer) { if (isExperimentalMovieUpsellRemoval()) { blockList.add("movie_and_show_upsell_card"); } + if (isExperimentalAppPromoBannerRemoval()) { + blockList.add("watch_metadata_app_promo"); + } if (isExperimentalCompactBannerRemoval()) { blockList.add("compact_banner"); }