Skip to content

Commit 18c374a

Browse files
author
LisoUseInAIKyrios
authored
chore: Merge branch dev to main (#4947)
2 parents 7d3b8d9 + 092303e commit 18c374a

File tree

150 files changed

+4119
-1894
lines changed

Some content is hidden

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

150 files changed

+4119
-1894
lines changed

CHANGELOG.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,72 @@
1+
# [5.24.0-dev.9](https://github.com/ReVanced/revanced-patches/compare/v5.24.0-dev.8...v5.24.0-dev.9) (2025-05-18)
2+
3+
4+
### Bug Fixes
5+
6+
* **YouTube - SponsorBlock:** Fix segment category summary not showing category description ([06934a6](https://github.com/ReVanced/revanced-patches/commit/06934a60d91b40a5cdf7f4cd92deae4a136c149b))
7+
8+
# [5.24.0-dev.8](https://github.com/ReVanced/revanced-patches/compare/v5.24.0-dev.7...v5.24.0-dev.8) (2025-05-17)
9+
10+
11+
### Bug Fixes
12+
13+
* **YouTube - Settings:** Correctly show summary text if search box is closed before searching ([d0ae835](https://github.com/ReVanced/revanced-patches/commit/d0ae835d3381fc659c9bb4a2d130d4db8a1499cf))
14+
15+
# [5.24.0-dev.7](https://github.com/ReVanced/revanced-patches/compare/v5.24.0-dev.6...v5.24.0-dev.7) (2025-05-17)
16+
17+
18+
### Features
19+
20+
* **YouTube - Hide layout components:** Add `Hide ticket shelf` ([#4969](https://github.com/ReVanced/revanced-patches/issues/4969)) ([6436af7](https://github.com/ReVanced/revanced-patches/commit/6436af7e77c77d2034dfceba8bc51132ad7632be))
21+
22+
# [5.24.0-dev.6](https://github.com/ReVanced/revanced-patches/compare/v5.24.0-dev.5...v5.24.0-dev.6) (2025-05-17)
23+
24+
25+
### Features
26+
27+
* **YouTube - Hide description components:** Add `Hide Ask` ([#4972](https://github.com/ReVanced/revanced-patches/issues/4972)) ([ebc94a5](https://github.com/ReVanced/revanced-patches/commit/ebc94a5da6214b67399c9c01515689bd4b20547c))
28+
29+
# [5.24.0-dev.5](https://github.com/ReVanced/revanced-patches/compare/v5.24.0-dev.4...v5.24.0-dev.5) (2025-05-17)
30+
31+
32+
### Bug Fixes
33+
34+
* **Spotify - Fix third party launchers widgets:** Add missing compatibility annotation ([0493f80](https://github.com/ReVanced/revanced-patches/commit/0493f8035b26b90c5f8e42be2e2a5ce73d8685a5))
35+
36+
37+
### Features
38+
39+
* **YouTube - Settings:** Add ability to search in settings ([#4881](https://github.com/ReVanced/revanced-patches/issues/4881)) ([aca8b20](https://github.com/ReVanced/revanced-patches/commit/aca8b207c15f254bcc9ad94bc7dfb895f21d4058))
40+
41+
# [5.24.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v5.24.0-dev.3...v5.24.0-dev.4) (2025-05-16)
42+
43+
44+
### Features
45+
46+
* **Spotify:** Add `Fix third party launchers widgets` patch ([#4893](https://github.com/ReVanced/revanced-patches/issues/4893)) ([23bfdc9](https://github.com/ReVanced/revanced-patches/commit/23bfdc98fbbcc8ecf0ffbf8704f58dd2272e4af2))
47+
48+
# [5.24.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v5.24.0-dev.2...v5.24.0-dev.3) (2025-05-14)
49+
50+
51+
### Bug Fixes
52+
53+
* **YouTube - Hide layout components:** Fix `Hide video recommendation labels` ([#4956](https://github.com/ReVanced/revanced-patches/issues/4956)) ([ae05ac3](https://github.com/ReVanced/revanced-patches/commit/ae05ac38151ebd3197953af97ca0dd847a04cc2d))
54+
55+
# [5.24.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v5.24.0-dev.1...v5.24.0-dev.2) (2025-05-14)
56+
57+
58+
### Features
59+
60+
* **GmsCore support:** Open vendor specific DontKillMyApp if available ([#4952](https://github.com/ReVanced/revanced-patches/issues/4952)) ([b89927a](https://github.com/ReVanced/revanced-patches/commit/b89927a10e3b909a3c37fbb75c16a7abbce44560))
61+
* **YouTube - Hide player components:** Hide related video overlay in fullscreen ([#4938](https://github.com/ReVanced/revanced-patches/issues/4938)) ([ac9be97](https://github.com/ReVanced/revanced-patches/commit/ac9be9760c9965e54df196b227a310d64ead4bf5))
62+
63+
# [5.24.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v5.23.0...v5.24.0-dev.1) (2025-05-12)
64+
65+
66+
### Features
67+
68+
* **NU.nl:** Support version `11.3.0` ([#4925](https://github.com/ReVanced/revanced-patches/issues/4925)) ([bedde60](https://github.com/ReVanced/revanced-patches/commit/bedde60fc1a52b0fd491174b3b5b887435eb621a))
69+
170
# [5.23.0](https://github.com/ReVanced/revanced-patches/compare/v5.22.0...v5.23.0) (2025-05-10)
271

372

extensions/nunl/src/main/java/app/revanced/extension/nunl/ads/HideAdsPatch.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public static void filterAds(List<Block> blocks) {
8282

8383
// Filter HeaderBlock with known ads until next HeaderBlock.
8484
if (currentBlock instanceof HeaderBlock headerBlock) {
85-
StyledText headerText = headerBlock.component20();
85+
StyledText headerText = headerBlock.getTitle();
8686
if (headerText != null) {
8787
skipFullHeader = false;
8888
for (String blockedHeaderBlock : blockedHeaderBlocks) {

extensions/nunl/stub/src/main/java/nl/nu/performance/api/client/objects/HeaderBlock.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
import nl.nu.performance.api.client.interfaces.Block;
44

55
public class HeaderBlock extends Block {
6-
// returns title
7-
public final StyledText component20() {
6+
public final StyledText getTitle() {
87
throw new UnsupportedOperationException("Stub");
98
}
109
}

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

Lines changed: 68 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package app.revanced.extension.shared;
22

33
import static app.revanced.extension.shared.StringRef.str;
4+
import static app.revanced.extension.shared.requests.Route.Method.GET;
45

56
import android.annotation.SuppressLint;
67
import android.app.Activity;
@@ -15,10 +16,16 @@
1516
import android.os.PowerManager;
1617
import android.provider.Settings;
1718

19+
import androidx.annotation.Nullable;
1820
import androidx.annotation.RequiresApi;
1921

22+
import java.net.HttpURLConnection;
2023
import java.net.MalformedURLException;
2124
import java.net.URL;
25+
import java.util.Locale;
26+
27+
import app.revanced.extension.shared.requests.Requester;
28+
import app.revanced.extension.shared.requests.Route;
2229

2330
@SuppressWarnings("unused")
2431
public class GmsCoreSupport {
@@ -29,10 +36,24 @@ public class GmsCoreSupport {
2936
= getGmsCoreVendorGroupId() + ".android.gms";
3037
private static final Uri GMS_CORE_PROVIDER
3138
= Uri.parse("content://" + getGmsCoreVendorGroupId() + ".android.gsf.gservices/prefix");
32-
private static final String DONT_KILL_MY_APP_LINK
33-
= "https://dontkillmyapp.com";
39+
private static final String DONT_KILL_MY_APP_URL
40+
= "https://dontkillmyapp.com/";
41+
private static final Route DONT_KILL_MY_APP_MANUFACTURER_API
42+
= new Route(GET, "/api/v2/{manufacturer}.json");
43+
private static final String DONT_KILL_MY_APP_NAME_PARAMETER
44+
= "?app=MicroG";
45+
private static final String BUILD_MANUFACTURER
46+
= Build.MANUFACTURER.toLowerCase(Locale.ROOT).replace(" ", "-");
47+
48+
/**
49+
* If a manufacturer specific page exists on DontKillMyApp.
50+
*/
51+
@Nullable
52+
private static volatile Boolean DONT_KILL_MY_APP_MANUFACTURER_SUPPORTED;
3453

3554
private static void open(String queryOrLink) {
55+
Logger.printInfo(() -> "Opening link: " + queryOrLink);
56+
3657
Intent intent;
3758
try {
3859
// Check if queryOrLink is a valid URL.
@@ -86,7 +107,7 @@ public static void checkGmsCore(Activity context) {
86107

87108
// Do not exit. If the app exits before launch completes (and without
88109
// opening another activity), then on some devices such as Pixel phone Android 10
89-
// no toast will be shown and the app will continually be relaunched
110+
// no toast will be shown and the app will continually relaunch
90111
// with the appearance of a hung app.
91112
}
92113

@@ -122,11 +143,12 @@ public static void checkGmsCore(Activity context) {
122143
try (var client = context.getContentResolver().acquireContentProviderClient(GMS_CORE_PROVIDER)) {
123144
if (client == null) {
124145
Logger.printInfo(() -> "GmsCore is not running in the background");
146+
checkIfDontKillMyAppSupportsManufacturer();
125147

126148
showBatteryOptimizationDialog(context,
127149
"gms_core_dialog_not_whitelisted_not_allowed_in_background_message",
128150
"gms_core_dialog_open_website_text",
129-
(dialog, id) -> open(DONT_KILL_MY_APP_LINK));
151+
(dialog, id) -> openDontKillMyApp());
130152
}
131153
}
132154
} catch (Exception ex) {
@@ -141,6 +163,48 @@ private static void openGmsCoreDisableBatteryOptimizationsIntent(Activity activi
141163
activity.startActivityForResult(intent, 0);
142164
}
143165

166+
private static void checkIfDontKillMyAppSupportsManufacturer() {
167+
Utils.runOnBackgroundThread(() -> {
168+
try {
169+
final long start = System.currentTimeMillis();
170+
HttpURLConnection connection = Requester.getConnectionFromRoute(
171+
DONT_KILL_MY_APP_URL, DONT_KILL_MY_APP_MANUFACTURER_API, BUILD_MANUFACTURER);
172+
connection.setConnectTimeout(5000);
173+
connection.setReadTimeout(5000);
174+
175+
final boolean supported = connection.getResponseCode() == 200;
176+
Logger.printInfo(() -> "Manufacturer is " + (supported ? "" : "NOT ")
177+
+ "listed on DontKillMyApp: " + BUILD_MANUFACTURER
178+
+ " fetch took: " + (System.currentTimeMillis() - start) + "ms");
179+
DONT_KILL_MY_APP_MANUFACTURER_SUPPORTED = supported;
180+
} catch (Exception ex) {
181+
Logger.printInfo(() -> "Could not check if manufacturer is listed on DontKillMyApp: "
182+
+ BUILD_MANUFACTURER, ex);
183+
DONT_KILL_MY_APP_MANUFACTURER_SUPPORTED = null;
184+
}
185+
});
186+
}
187+
188+
private static void openDontKillMyApp() {
189+
final Boolean manufacturerSupported = DONT_KILL_MY_APP_MANUFACTURER_SUPPORTED;
190+
191+
String manufacturerPageToOpen;
192+
if (manufacturerSupported == null) {
193+
// Fetch has not completed yet. Only happens on extremely slow internet connections
194+
// and the user spends less than 1 second reading what's on screen.
195+
// Instead of waiting for the fetch (which may timeout),
196+
// open the website without a vendor.
197+
manufacturerPageToOpen = "";
198+
} else if (manufacturerSupported) {
199+
manufacturerPageToOpen = BUILD_MANUFACTURER;
200+
} else {
201+
// No manufacturer specific page exists. Open the general page.
202+
manufacturerPageToOpen = "general";
203+
}
204+
205+
open(DONT_KILL_MY_APP_URL + manufacturerPageToOpen + DONT_KILL_MY_APP_NAME_PARAMETER);
206+
}
207+
144208
/**
145209
* @return If GmsCore is not whitelisted from battery optimizations.
146210
*/

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

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ public static void setContext(Context appContext) {
371371
if (language != AppLanguage.DEFAULT) {
372372
// Create a new context with the desired language.
373373
Logger.printDebug(() -> "Using app language: " + language);
374-
Configuration config = appContext.getResources().getConfiguration();
374+
Configuration config = new Configuration(appContext.getResources().getConfiguration());
375375
config.setLocale(language.getLocale());
376376
context = appContext.createConfigurationContext(config);
377377
}
@@ -391,16 +391,47 @@ public static boolean isTablet() {
391391
private static Boolean isRightToLeftTextLayout;
392392

393393
/**
394-
* If the device language uses right to left text layout (hebrew, arabic, etc)
394+
* @return If the device language uses right to left text layout (Hebrew, Arabic, etc).
395+
* If this should match any ReVanced language override then instead use
396+
* {@link #isRightToLeftLocale(Locale)} with {@link BaseSettings#REVANCED_LANGUAGE}.
397+
* This is the default locale of the device, which may differ if
398+
* {@link BaseSettings#REVANCED_LANGUAGE} is set to a different language.
395399
*/
396-
public static boolean isRightToLeftTextLayout() {
400+
public static boolean isRightToLeftLocale() {
397401
if (isRightToLeftTextLayout == null) {
398-
String displayLanguage = Locale.getDefault().getDisplayLanguage();
399-
isRightToLeftTextLayout = new Bidi(displayLanguage, Bidi.DIRECTION_DEFAULT_LEFT_TO_RIGHT).isRightToLeft();
402+
isRightToLeftTextLayout = isRightToLeftLocale(Locale.getDefault());
400403
}
401404
return isRightToLeftTextLayout;
402405
}
403406

407+
/**
408+
* @return If the locale uses right to left text layout (Hebrew, Arabic, etc).
409+
*/
410+
public static boolean isRightToLeftLocale(Locale locale) {
411+
String displayLanguage = locale.getDisplayLanguage();
412+
return new Bidi(displayLanguage, Bidi.DIRECTION_DEFAULT_LEFT_TO_RIGHT).isRightToLeft();
413+
}
414+
415+
/**
416+
* @return A UTF8 string containing a left-to-right or right-to-left
417+
* character of the device locale. If this should match any ReVanced language
418+
* override then instead use {@link #getTextDirectionString(Locale)} with
419+
* {@link BaseSettings#REVANCED_LANGUAGE}.
420+
*/
421+
public static String getTextDirectionString() {
422+
return getTextDirectionString(isRightToLeftLocale());
423+
}
424+
425+
public static String getTextDirectionString(Locale locale) {
426+
return getTextDirectionString(isRightToLeftLocale(locale));
427+
}
428+
429+
private static String getTextDirectionString(boolean isRightToLeft) {
430+
return isRightToLeft
431+
? "\u200F" // u200F = right to left character.
432+
: "\u200E"; // u200E = left to right character.
433+
}
434+
404435
/**
405436
* @return if the text contains at least 1 number character,
406437
* including any unicode numbers such as Arabic.
@@ -692,9 +723,10 @@ static Sort fromKey(@Nullable String key, @NonNull Sort defaultSort) {
692723
/**
693724
* Strips all punctuation and converts to lower case. A null parameter returns an empty string.
694725
*/
695-
public static String removePunctuationConvertToLowercase(@Nullable CharSequence original) {
726+
public static String removePunctuationToLowercase(@Nullable CharSequence original) {
696727
if (original == null) return "";
697-
return punctuationPattern.matcher(original).replaceAll("").toLowerCase();
728+
return punctuationPattern.matcher(original).replaceAll("")
729+
.toLowerCase(BaseSettings.REVANCED_LANGUAGE.get().getLocale());
698730
}
699731

700732
/**
@@ -726,7 +758,7 @@ public static void sortPreferenceGroups(@NonNull PreferenceGroup group) {
726758
final String sortValue;
727759
switch (preferenceSort) {
728760
case BY_TITLE:
729-
sortValue = removePunctuationConvertToLowercase(preference.getTitle());
761+
sortValue = removePunctuationToLowercase(preference.getTitle());
730762
break;
731763
case BY_KEY:
732764
sortValue = preference.getKey();
@@ -810,4 +842,12 @@ public static int getColorFromString(String colorString) throws IllegalArgumentE
810842
}
811843
return getResourceColor(colorString);
812844
}
845+
846+
public static int clamp(int value, int lower, int upper) {
847+
return Math.max(lower, Math.min(value, upper));
848+
}
849+
850+
public static float clamp(float value, float lower, float upper) {
851+
return Math.max(lower, Math.min(value, upper));
852+
}
813853
}

extensions/shared/library/src/main/java/app/revanced/extension/shared/settings/AppLanguage.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,11 @@ public enum AppLanguage {
8989
ZU;
9090

9191
private final String language;
92+
private final Locale locale;
9293

9394
AppLanguage() {
9495
language = name().toLowerCase(Locale.US);
96+
locale = Locale.forLanguageTag(language);
9597
}
9698

9799
/**
@@ -112,6 +114,6 @@ public Locale getLocale() {
112114
return Locale.getDefault();
113115
}
114116

115-
return Locale.forLanguageTag(language);
117+
return locale;
116118
}
117119
}

extensions/shared/library/src/main/java/app/revanced/extension/shared/settings/preference/NoTitlePreferenceCategory.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ public NoTitlePreferenceCategory(Context context, AttributeSet attrs, int defSty
2121
super(context, attrs, defStyleAttr);
2222
}
2323

24+
public NoTitlePreferenceCategory(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
25+
super(context, attrs, defStyleAttr, defStyleRes);
26+
}
27+
2428
public NoTitlePreferenceCategory(Context context) {
2529
super(context);
2630
}

0 commit comments

Comments
 (0)