Skip to content

Commit f1b85d2

Browse files
author
LisoUseInAIKyrios
authored
chore: Merge branch dev to main (#4864)
2 parents 0d54f8b + 37d0de5 commit f1b85d2

File tree

107 files changed

+1069
-531
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+1069
-531
lines changed

CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,38 @@
1+
# [5.22.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v5.22.0-dev.3...v5.22.0-dev.4) (2025-04-30)
2+
3+
4+
### Bug Fixes
5+
6+
* **YouTube - Hide layout components:** Hide new type of community posts ([#4888](https://github.com/ReVanced/revanced-patches/issues/4888)) ([f0c9c35](https://github.com/ReVanced/revanced-patches/commit/f0c9c35778ab43a99149ee5ad0ccfd8aeb09f638))
7+
* **YouTube - Hide Shorts components:** Hide action buttons A/B button layout ([#4889](https://github.com/ReVanced/revanced-patches/issues/4889)) ([9dcd3d3](https://github.com/ReVanced/revanced-patches/commit/9dcd3d35dddf019547ab6ce431bac7a5a8a4c291))
8+
9+
# [5.22.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v5.22.0-dev.2...v5.22.0-dev.3) (2025-04-29)
10+
11+
12+
### Features
13+
14+
* **YouTube - GmsCore support:** Show troubleshooting in app text if the user recently changed their account details ([#4879](https://github.com/ReVanced/revanced-patches/issues/4879)) ([ab4bdc8](https://github.com/ReVanced/revanced-patches/commit/ab4bdc8a2519cee15f79bf95d89e7ea56ea464ee))
15+
16+
# [5.22.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v5.22.0-dev.1...v5.22.0-dev.2) (2025-04-27)
17+
18+
19+
### Bug Fixes
20+
21+
* **YouTube - Shorts autoplay:** Fix autoplay with YT 20.12 ([06b35b2](https://github.com/ReVanced/revanced-patches/commit/06b35b2a7d7371915881e8f430c32ce15fa224de))
22+
23+
# [5.22.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v5.21.0...v5.22.0-dev.1) (2025-04-26)
24+
25+
26+
### Bug Fixes
27+
28+
* **TikTok - Feed filter:** Hide ads in following feed ([#4844](https://github.com/ReVanced/revanced-patches/issues/4844)) ([c255ac1](https://github.com/ReVanced/revanced-patches/commit/c255ac18e0b2dcf917bd0559876be5a2a81023db))
29+
* **YouTube - Spoof app version:** Do not hide spoof version in general settings menu ([#4861](https://github.com/ReVanced/revanced-patches/issues/4861)) ([f459c3c](https://github.com/ReVanced/revanced-patches/commit/f459c3c7fae3a1b8addf3354488dcef9f95255cc))
30+
31+
32+
### Features
33+
34+
* **TikTok - Feed Filter:** Remove TikTok Shop from feed. ([#4851](https://github.com/ReVanced/revanced-patches/issues/4851)) ([f198bec](https://github.com/ReVanced/revanced-patches/commit/f198bece653e3e1adf083129dedb77c1d1a633d7))
35+
136
# [5.21.0](https://github.com/ReVanced/revanced-patches/compare/v5.20.1...v5.21.0) (2025-04-25)
237

338

extensions/shared/library/src/main/java/app/revanced/extension/shared/GmsCoreSupport.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020
import java.net.MalformedURLException;
2121
import java.net.URL;
2222

23-
/**
24-
* @noinspection unused
25-
*/
23+
@SuppressWarnings("unused")
2624
public class GmsCoreSupport {
2725
private static final String PACKAGE_NAME_YOUTUBE = "com.google.android.youtube";
2826
private static final String PACKAGE_NAME_YOUTUBE_MUSIC = "com.google.android.apps.youtube.music";

extensions/tiktok/src/main/java/app/revanced/extension/tiktok/feedfilter/FeedItemsFilter.java

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.ss.android.ugc.aweme.feed.model.Aweme;
44
import com.ss.android.ugc.aweme.feed.model.FeedItemList;
5+
import com.ss.android.ugc.aweme.follow.presenter.FollowFeedList;
56

67
import java.util.Iterator;
78
import java.util.List;
@@ -13,22 +14,41 @@ public final class FeedItemsFilter {
1314
new StoryFilter(),
1415
new ImageVideoFilter(),
1516
new ViewCountFilter(),
16-
new LikeCountFilter()
17+
new LikeCountFilter(),
18+
new ShopFilter()
1719
);
1820

1921
public static void filter(FeedItemList feedItemList) {
20-
Iterator<Aweme> feedItemListIterator = feedItemList.items.iterator();
21-
while (feedItemListIterator.hasNext()) {
22-
Aweme item = feedItemListIterator.next();
23-
if (item == null) continue;
24-
25-
for (IFilter filter : FILTERS) {
26-
boolean enabled = filter.getEnabled();
27-
if (enabled && filter.getFiltered(item)) {
28-
feedItemListIterator.remove();
29-
break;
30-
}
22+
filterFeedList(feedItemList.items, item -> item);
23+
}
24+
25+
public static void filter(FollowFeedList followFeedList) {
26+
filterFeedList(followFeedList.mItems, feed -> (feed != null) ? feed.aweme : null);
27+
}
28+
29+
private static <T> void filterFeedList(List<T> list, AwemeExtractor<T> extractor) {
30+
// Could be simplified with removeIf() but requires Android 7.0+ while TikTok supports 4.0+.
31+
Iterator<T> iterator = list.iterator();
32+
while (iterator.hasNext()) {
33+
T container = iterator.next();
34+
Aweme item = extractor.extract(container);
35+
if (item != null && shouldFilter(item)) {
36+
iterator.remove();
37+
}
38+
}
39+
}
40+
41+
private static boolean shouldFilter(Aweme item) {
42+
for (IFilter filter : FILTERS) {
43+
if (filter.getEnabled() && filter.getFiltered(item)) {
44+
return true;
3145
}
3246
}
47+
return false;
48+
}
49+
50+
@FunctionalInterface
51+
interface AwemeExtractor<T> {
52+
Aweme extract(T source);
3353
}
34-
}
54+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package app.revanced.extension.tiktok.feedfilter;
2+
3+
import app.revanced.extension.tiktok.settings.Settings;
4+
import com.ss.android.ugc.aweme.feed.model.Aweme;
5+
6+
public class ShopFilter implements IFilter {
7+
private static final String SHOP_INFO = "placeholder_product_id";
8+
@Override
9+
public boolean getEnabled() {
10+
return Settings.HIDE_SHOP.get();
11+
}
12+
13+
@Override
14+
public boolean getFiltered(Aweme item) {
15+
return item.getShareUrl().contains(SHOP_INFO);
16+
}
17+
}

extensions/tiktok/src/main/java/app/revanced/extension/tiktok/settings/Settings.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
public class Settings extends BaseSettings {
1212
public static final BooleanSetting REMOVE_ADS = new BooleanSetting("remove_ads", TRUE, true);
1313
public static final BooleanSetting HIDE_LIVE = new BooleanSetting("hide_live", FALSE, true);
14+
public static final BooleanSetting HIDE_SHOP = new BooleanSetting("hide_shop", FALSE, true);
1415
public static final BooleanSetting HIDE_STORY = new BooleanSetting("hide_story", FALSE, true);
1516
public static final BooleanSetting HIDE_IMAGE = new BooleanSetting("hide_image", FALSE, true);
1617
public static final StringSetting MIN_MAX_VIEWS = new StringSetting("min_max_views", "0-" + Long.MAX_VALUE, true);

extensions/tiktok/src/main/java/app/revanced/extension/tiktok/settings/preference/categories/FeedFilterPreferenceCategory.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ public void addPreferences(Context context) {
2626
"Remove feed ads", "Remove ads from feed.",
2727
Settings.REMOVE_ADS
2828
));
29+
addPreference(new TogglePreference(
30+
context,
31+
"Hide TikTok Shop", "Hide TikTok shop from feed.",
32+
Settings.HIDE_SHOP
33+
));
2934
addPreference(new TogglePreference(
3035
context,
3136
"Hide livestreams", "Hide livestreams from feed.",

extensions/tiktok/stub/src/main/java/com/ss/android/ugc/aweme/feed/model/Aweme.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,8 @@ public boolean isPhotoMode() {
3333
public AwemeStatistics getStatistics() {
3434
throw new UnsupportedOperationException("Stub");
3535
}
36+
37+
public String getShareUrl() {
38+
throw new UnsupportedOperationException("Stub");
39+
}
3640
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.ss.android.ugc.aweme.follow.presenter;
2+
3+
import com.ss.android.ugc.aweme.feed.model.Aweme;
4+
5+
//Dummy class
6+
public class FollowFeed {
7+
public Aweme aweme;
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.ss.android.ugc.aweme.follow.presenter;
2+
3+
import java.util.List;
4+
5+
//Dummy class
6+
public class FollowFeedList {
7+
public List<FollowFeed> mItems;
8+
}

extensions/youtube/src/main/java/app/revanced/extension/youtube/ThemeHelper.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import android.app.Activity;
44
import android.graphics.Color;
5+
import android.os.Build;
6+
import android.view.Window;
57

68
import androidx.annotation.Nullable;
79

@@ -102,4 +104,21 @@ public static int getToolbarBackgroundColor() {
102104

103105
return Utils.getColorFromString(colorName);
104106
}
107+
108+
/**
109+
* Sets the system navigation bar color for the activity.
110+
* Applies the background color obtained from {@link #getBackgroundColor()} to the navigation bar.
111+
* For Android 10 (API 29) and above, enforces navigation bar contrast to ensure visibility.
112+
*/
113+
public static void setNavigationBarColor(@Nullable Window window) {
114+
if (window == null) {
115+
Logger.printDebug(() -> "Cannot set navigation bar color, window is null");
116+
return;
117+
}
118+
119+
window.setNavigationBarColor(getBackgroundColor());
120+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
121+
window.setNavigationBarContrastEnforced(true);
122+
}
123+
}
105124
}

0 commit comments

Comments
 (0)