Skip to content

Commit 6514420

Browse files
chore: Merge branch dev to main (#4803)
2 parents e2b9d65 + 0e064cd commit 6514420

File tree

186 files changed

+3026
-1324
lines changed

Some content is hidden

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

186 files changed

+3026
-1324
lines changed

CHANGELOG.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,87 @@
1+
# [5.21.0-dev.12](https://github.com/ReVanced/revanced-patches/compare/v5.21.0-dev.11...v5.21.0-dev.12) (2025-04-24)
2+
3+
4+
### Bug Fixes
5+
6+
* **YouTube - Hide video action buttons:** Add option to hide 'Ask' button ([#4852](https://github.com/ReVanced/revanced-patches/issues/4852)) ([43bcf5a](https://github.com/ReVanced/revanced-patches/commit/43bcf5a098c9008cc11dc7df9680437d5effbb32))
7+
8+
# [5.21.0-dev.11](https://github.com/ReVanced/revanced-patches/compare/v5.21.0-dev.10...v5.21.0-dev.11) (2025-04-24)
9+
10+
11+
### Bug Fixes
12+
13+
* **GmsCore Support:** Correct the description to refer to the app being patched ([2bbcf9d](https://github.com/ReVanced/revanced-patches/commit/2bbcf9d82ca2f442572a6aa886cc611b0d56ff0a))
14+
15+
# [5.21.0-dev.10](https://github.com/ReVanced/revanced-patches/compare/v5.21.0-dev.9...v5.21.0-dev.10) (2025-04-23)
16+
17+
18+
### Features
19+
20+
* **YouTube - Swipe controls:** Add option for vertical progress bar ([#4811](https://github.com/ReVanced/revanced-patches/issues/4811)) ([ebee07e](https://github.com/ReVanced/revanced-patches/commit/ebee07ec3aba6fd3adbd8e0af30390e197879d89))
21+
22+
# [5.21.0-dev.9](https://github.com/ReVanced/revanced-patches/compare/v5.21.0-dev.8...v5.21.0-dev.9) (2025-04-21)
23+
24+
25+
### Bug Fixes
26+
27+
* **YouTube - Hide video action buttons:** Hide A/B layout buttons ([4db5d3c](https://github.com/ReVanced/revanced-patches/commit/4db5d3c3d5ac04faf70cc07fb309b324d752e7e3))
28+
29+
# [5.21.0-dev.8](https://github.com/ReVanced/revanced-patches/compare/v5.21.0-dev.7...v5.21.0-dev.8) (2025-04-20)
30+
31+
32+
### Bug Fixes
33+
34+
* **Wide search bar:** Fix patching `19.16.39` ([433dbc3](https://github.com/ReVanced/revanced-patches/commit/433dbc3bf81823369e146035c954281e84d3a436))
35+
36+
# [5.21.0-dev.7](https://github.com/ReVanced/revanced-patches/compare/v5.21.0-dev.6...v5.21.0-dev.7) (2025-04-20)
37+
38+
39+
### Bug Fixes
40+
41+
* **YouTube - Change start page:** Add option to always override start page on app launch ([#4832](https://github.com/ReVanced/revanced-patches/issues/4832)) ([5062e24](https://github.com/ReVanced/revanced-patches/commit/5062e24433ba38eba397438e8fde32099109d3c3))
42+
43+
# [5.21.0-dev.6](https://github.com/ReVanced/revanced-patches/compare/v5.21.0-dev.5...v5.21.0-dev.6) (2025-04-19)
44+
45+
46+
### Bug Fixes
47+
48+
* **YouTube - Wide search bar:** Do not force phone layout for tablet devices ([#4827](https://github.com/ReVanced/revanced-patches/issues/4827)) ([0cb38f9](https://github.com/ReVanced/revanced-patches/commit/0cb38f9f367a7fe742d8ca336150049181d637b6))
49+
50+
# [5.21.0-dev.5](https://github.com/ReVanced/revanced-patches/compare/v5.21.0-dev.4...v5.21.0-dev.5) (2025-04-18)
51+
52+
53+
### Bug Fixes
54+
55+
* `Hide ADB status` patch ([#4814](https://github.com/ReVanced/revanced-patches/issues/4814)) ([dc89be0](https://github.com/ReVanced/revanced-patches/commit/dc89be0e94880733f862b250d95d4848f02c594d))
56+
57+
# [5.21.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v5.21.0-dev.3...v5.21.0-dev.4) (2025-04-17)
58+
59+
60+
### Bug Fixes
61+
62+
* **YouTube - Disable auto captions:** Correctly hide captions with YT 20.12 ([5ecbe82](https://github.com/ReVanced/revanced-patches/commit/5ecbe823ed5197533328cc37f1de5cd1f048a217))
63+
64+
# [5.21.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v5.21.0-dev.2...v5.21.0-dev.3) (2025-04-16)
65+
66+
67+
### Features
68+
69+
* **X / Twitter:** Support version `10.86.0-release.0` ([#4805](https://github.com/ReVanced/revanced-patches/issues/4805)) ([655b390](https://github.com/ReVanced/revanced-patches/commit/655b39043ad77efcb4380de67c3f603666e7bc49))
70+
71+
# [5.21.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v5.21.0-dev.1...v5.21.0-dev.2) (2025-04-16)
72+
73+
74+
### Features
75+
76+
* Add `Hide ADB status` patch ([#4585](https://github.com/ReVanced/revanced-patches/issues/4585)) ([1ea8047](https://github.com/ReVanced/revanced-patches/commit/1ea8047aefdaa358e9af8038923ac54d68a39176))
77+
78+
# [5.21.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v5.20.1...v5.21.0-dev.1) (2025-04-16)
79+
80+
81+
### Features
82+
83+
* **YouTube:** Support version `20.12.46` ([#4779](https://github.com/ReVanced/revanced-patches/issues/4779)) ([703359f](https://github.com/ReVanced/revanced-patches/commit/703359f0c16b613c204cf16cf42227b628f664fa))
84+
185
## [5.20.1](https://github.com/ReVanced/revanced-patches/compare/v5.20.0...v5.20.1) (2025-04-15)
286

387

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
android {
2+
namespace = "app.revanced.extension"
3+
4+
defaultConfig {
5+
minSdk = 21
6+
}
7+
8+
compileOptions {
9+
sourceCompatibility = JavaVersion.VERSION_11
10+
targetCompatibility = JavaVersion.VERSION_11
11+
}
12+
}
13+
14+
dependencies {
15+
compileOnly(libs.annotation)
16+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<manifest/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package app.revanced.extension.all.misc.hide.adb;
2+
3+
import android.content.ContentResolver;
4+
import android.provider.Settings;
5+
6+
import java.util.Arrays;
7+
import java.util.List;
8+
9+
@SuppressWarnings("unused")
10+
public final class HideAdbPatch {
11+
private static final List<String> SPOOF_SETTINGS = Arrays.asList("adb_enabled", "adb_wifi_enabled", "development_settings_enabled");
12+
13+
public static int getInt(ContentResolver cr, String name) throws Settings.SettingNotFoundException {
14+
if (SPOOF_SETTINGS.contains(name)) {
15+
return 0;
16+
}
17+
18+
return Settings.Global.getInt(cr, name);
19+
}
20+
21+
public static int getInt(ContentResolver cr, String name, int def) {
22+
if (SPOOF_SETTINGS.contains(name)) {
23+
return 0;
24+
}
25+
26+
return Settings.Global.getInt(cr, name, def);
27+
}
28+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package app.revanced.extension.all.connectivity.wifi.spoof;
1+
package app.revanced.extension.all.misc.connectivity.wifi.spoof;
22

33
import android.app.PendingIntent;
44
import android.content.Context;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package app.revanced.extension.all.screencapture.removerestriction;
1+
package app.revanced.extension.all.misc.screencapture.removerestriction;
22

33
import android.media.AudioAttributes;
44
import android.os.Build;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package app.revanced.extension.all.screenshot.removerestriction;
1+
package app.revanced.extension.all.misc.screenshot.removerestriction;
22

33
import android.view.Window;
44
import android.view.WindowManager;

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,12 @@ protected final void removeFromPreferences() {
342342

343343
/**
344344
* Identical to calling {@link #save(Object)} using {@link #defaultValue}.
345+
*
346+
* @return The newly saved default value.
345347
*/
346-
public void resetToDefault() {
348+
public T resetToDefault() {
347349
save(defaultValue);
350+
return defaultValue;
348351
}
349352

350353
/**

extensions/shared/library/src/main/java/app/revanced/extension/shared/spoof/requests/StreamingDataRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ private static ByteBuffer fetch(String videoId, Map<String, String> playerHeader
204204
// but empty response body does.
205205
if (connection.getContentLength() == 0) {
206206
if (BaseSettings.DEBUG.get() && BaseSettings.DEBUG_TOAST_ON_ERROR.get()) {
207-
Utils.showToastShort("Ignoring empty spoof stream client: " + clientType);
207+
Utils.showToastShort("Debug: Ignoring empty spoof stream client " + clientType);
208208
}
209209
} else {
210210
try (InputStream inputStream = new BufferedInputStream(connection.getInputStream());

extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/ChangeStartPagePatch.java

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import androidx.annotation.Nullable;
1010

1111
import app.revanced.extension.shared.Logger;
12+
import app.revanced.extension.shared.settings.Setting;
1213
import app.revanced.extension.youtube.settings.Settings;
1314

1415
@SuppressWarnings("unused")
@@ -81,6 +82,13 @@ private boolean isIntentAction() {
8182
}
8283
}
8384

85+
public static class ChangeStartPageTypeAvailability implements Setting.Availability {
86+
@Override
87+
public boolean isAvailable() {
88+
return Settings.CHANGE_START_PAGE.get() != StartPage.DEFAULT;
89+
}
90+
}
91+
8492
/**
8593
* Intent action when YouTube is cold started from the launcher.
8694
* <p>
@@ -93,6 +101,8 @@ private boolean isIntentAction() {
93101

94102
private static final StartPage START_PAGE = Settings.CHANGE_START_PAGE.get();
95103

104+
private static final boolean CHANGE_START_PAGE_ALWAYS = Settings.CHANGE_START_PAGE_ALWAYS.get();
105+
96106
/**
97107
* There is an issue where the back button on the toolbar doesn't work properly.
98108
* As a workaround for this issue, instead of overriding the browserId multiple times, just override it once.
@@ -104,13 +114,13 @@ public static String overrideBrowseId(@NonNull String original) {
104114
return original;
105115
}
106116

107-
if (appLaunched) {
117+
if (!CHANGE_START_PAGE_ALWAYS && appLaunched) {
108118
Logger.printDebug(() -> "Ignore override browseId as the app already launched");
109119
return original;
110120
}
111121
appLaunched = true;
112122

113-
Logger.printDebug(() -> "Changing browseId to " + START_PAGE.id);
123+
Logger.printDebug(() -> "Changing browseId to: " + START_PAGE.id);
114124
return START_PAGE.id;
115125
}
116126

@@ -125,14 +135,14 @@ public static void overrideIntentAction(@NonNull Intent intent) {
125135
return;
126136
}
127137

128-
if (appLaunched) {
138+
if (!CHANGE_START_PAGE_ALWAYS && appLaunched) {
129139
Logger.printDebug(() -> "Ignore override intent action as the app already launched");
130140
return;
131141
}
132142
appLaunched = true;
133143

134144
String intentAction = START_PAGE.id;
135-
Logger.printDebug(() -> "Changing intent action to " + intentAction);
145+
Logger.printDebug(() -> "Changing intent action to: " + intentAction);
136146
intent.setAction(intentAction);
137147
}
138148
}

extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/CustomPlayerOverlayOpacityPatch.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ public class CustomPlayerOverlayOpacityPatch {
1717

1818
if (opacity < 0 || opacity > 100) {
1919
Utils.showToastLong(str("revanced_player_overlay_opacity_invalid_toast"));
20-
Settings.PLAYER_OVERLAY_OPACITY.resetToDefault();
21-
opacity = Settings.PLAYER_OVERLAY_OPACITY.defaultValue;
20+
opacity = Settings.PLAYER_OVERLAY_OPACITY.resetToDefault();
2221
}
2322

2423
PLAYER_OVERLAY_OPACITY_LEVEL = (opacity * 255) / 100;
Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
package app.revanced.extension.youtube.patches;
22

33
import app.revanced.extension.youtube.settings.Settings;
4-
import app.revanced.extension.youtube.shared.ShortsPlayerState;
54

65
@SuppressWarnings("unused")
76
public class DisableAutoCaptionsPatch {
87

8+
private static volatile boolean captionsButtonStatus;
9+
910
/**
10-
* Used by injected code. Do not delete.
11+
* Injection point.
1112
*/
12-
public static boolean captionsButtonDisabled;
13-
14-
public static boolean autoCaptionsEnabled() {
15-
return Settings.AUTO_CAPTIONS.get()
16-
// Do not use auto captions for Shorts.
17-
&& ShortsPlayerState.isOpen();
13+
public static boolean disableAutoCaptions() {
14+
return Settings.DISABLE_AUTO_CAPTIONS.get() && !captionsButtonStatus;
1815
}
1916

17+
/**
18+
* Injection point.
19+
*/
20+
public static void setCaptionsButtonStatus(boolean status) {
21+
captionsButtonStatus = status;
22+
}
2023
}

extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/MiniplayerPatch.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,7 @@ public boolean isModern() {
162162

163163
if (opacity < 0 || opacity > 100) {
164164
Utils.showToastLong(str("revanced_miniplayer_opacity_invalid_toast"));
165-
Settings.MINIPLAYER_OPACITY.resetToDefault();
166-
opacity = Settings.MINIPLAYER_OPACITY.defaultValue;
165+
opacity = Settings.MINIPLAYER_OPACITY.resetToDefault();
167166
}
168167

169168
OPACITY_LEVEL = (opacity * 255) / 100;
Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,48 @@
11
package app.revanced.extension.youtube.patches;
22

3+
import android.content.res.Resources;
4+
import android.util.TypedValue;
5+
import android.view.View;
6+
7+
import app.revanced.extension.shared.Logger;
8+
import app.revanced.extension.shared.Utils;
39
import app.revanced.extension.youtube.settings.Settings;
410

511
@SuppressWarnings("unused")
612
public final class WideSearchbarPatch {
713

14+
private static final Boolean WIDE_SEARCHBAR_ENABLED = Settings.WIDE_SEARCHBAR.get();
15+
16+
/**
17+
* Injection point.
18+
*/
819
public static boolean enableWideSearchbar(boolean original) {
9-
return Settings.WIDE_SEARCHBAR.get() || original;
20+
return WIDE_SEARCHBAR_ENABLED || original;
21+
}
22+
23+
/**
24+
* Injection point.
25+
*/
26+
public static void setActionBar(View view) {
27+
try {
28+
if (!WIDE_SEARCHBAR_ENABLED) return;
29+
30+
View searchBarView = Utils.getChildViewByResourceName(view, "search_bar");
31+
32+
final int paddingLeft = searchBarView.getPaddingLeft();
33+
final int paddingRight = searchBarView.getPaddingRight();
34+
final int paddingTop = searchBarView.getPaddingTop();
35+
final int paddingBottom = searchBarView.getPaddingBottom();
36+
final int paddingStart = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
37+
8, Resources.getSystem().getDisplayMetrics());
38+
39+
if (Utils.isRightToLeftTextLayout()) {
40+
searchBarView.setPadding(paddingLeft, paddingTop, paddingStart, paddingBottom);
41+
} else {
42+
searchBarView.setPadding(paddingStart, paddingTop, paddingRight, paddingBottom);
43+
}
44+
} catch (Exception ex) {
45+
Logger.printException(() -> "setActionBar failure", ex);
46+
}
1047
}
1148
}

extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/components/ButtonsFilter.java

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public ButtonsFilter() {
3131

3232
bufferFilterPathGroup = new StringFilterGroup(
3333
null,
34-
"|ContainerType|button.eml|"
34+
"|ContainerType|button.eml"
3535
);
3636

3737
addPathCallbacks(
@@ -43,15 +43,15 @@ public ButtonsFilter() {
4343
),
4444
new StringFilterGroup(
4545
Settings.HIDE_DOWNLOAD_BUTTON,
46-
"|download_button.eml|"
46+
"|download_button.eml"
4747
),
4848
new StringFilterGroup(
4949
Settings.HIDE_PLAYLIST_BUTTON,
5050
"|save_to_playlist_button"
5151
),
5252
new StringFilterGroup(
5353
Settings.HIDE_CLIP_BUTTON,
54-
"|clip_button.eml|"
54+
"|clip_button.eml"
5555
)
5656
);
5757

@@ -68,15 +68,19 @@ public ButtonsFilter() {
6868
Settings.HIDE_REMIX_BUTTON,
6969
"yt_outline_youtube_shorts_plus"
7070
),
71+
new ByteArrayFilterGroup(
72+
Settings.HIDE_THANKS_BUTTON,
73+
"yt_outline_dollar_sign_heart"
74+
),
75+
new ByteArrayFilterGroup(
76+
Settings.HIDE_ASK_BUTTON,
77+
"yt_fill_spark"
78+
),
7179
// Check for clip button both here and using a path filter,
7280
// as there's a chance the path is a generic action button and won't contain 'clip_button'
7381
new ByteArrayFilterGroup(
7482
Settings.HIDE_CLIP_BUTTON,
7583
"yt_outline_scissors"
76-
),
77-
new ByteArrayFilterGroup(
78-
Settings.HIDE_THANKS_BUTTON,
79-
"yt_outline_dollar_sign_heart"
8084
)
8185
);
8286
}

0 commit comments

Comments
 (0)