Skip to content
This repository has been archived by the owner on Oct 26, 2024. It is now read-only.

Commit

Permalink
feat: app promo banner removal setting
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Jun 4, 2022
1 parent 4f419dd commit 3072458
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions app/src/main/java/fi/razerman/youtube/litho/LithoAdRemoval.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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<String> blockList = new ArrayList<>();
Expand All @@ -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");
}
Expand Down Expand Up @@ -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<String> blockList = new ArrayList<>();
Expand All @@ -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");
}
Expand Down

0 comments on commit 3072458

Please sign in to comment.