Skip to content

Commit a0f22a5

Browse files
authored
chore: Merge branch dev to main (#3909)
2 parents c3d00ce + 8266c37 commit a0f22a5

File tree

176 files changed

+1753
-1179
lines changed

Some content is hidden

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

176 files changed

+1753
-1179
lines changed

CHANGELOG.md

+56
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,59 @@
1+
# [5.1.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v5.1.0-dev.2...v5.1.0-dev.3) (2024-11-22)
2+
3+
4+
### Features
5+
6+
* **YouTube - Miniplayer:** Add option to disable miniplayer ([#3961](https://github.com/ReVanced/revanced-patches/issues/3961)) ([e565cdb](https://github.com/ReVanced/revanced-patches/commit/e565cdb583aacfc0052d12c430f56fd9abd5bf00))
7+
8+
# [5.1.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v5.1.0-dev.1...v5.1.0-dev.2) (2024-11-21)
9+
10+
11+
### Bug Fixes
12+
13+
* **YouTube - SponsorBlock:** Fix create new segment crash on tablet custom roms ([#3946](https://github.com/ReVanced/revanced-patches/issues/3946)) ([a0da377](https://github.com/ReVanced/revanced-patches/commit/a0da377ba8f90ba39e905ed9730b3e819633bd50))
14+
15+
# [5.1.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v5.0.3-dev.5...v5.1.0-dev.1) (2024-11-20)
16+
17+
18+
### Features
19+
20+
* **YouTube:** Support version `19.45.38` ([#3938](https://github.com/ReVanced/revanced-patches/issues/3938)) ([7c4e3fe](https://github.com/ReVanced/revanced-patches/commit/7c4e3fe97e8cbbb8cf16a2fb95f64223ca2bd7ef))
21+
22+
## [5.0.3-dev.5](https://github.com/ReVanced/revanced-patches/compare/v5.0.3-dev.4...v5.0.3-dev.5) (2024-11-18)
23+
24+
25+
### Bug Fixes
26+
27+
* **YouTube - Hide Shorts components:** Do not hide Shorts action buttons on app first launch ([#3933](https://github.com/ReVanced/revanced-patches/issues/3933)) ([0d78815](https://github.com/ReVanced/revanced-patches/commit/0d78815e33bf2ae216e519f067fb773df0f2084e))
28+
29+
## [5.0.3-dev.4](https://github.com/ReVanced/revanced-patches/compare/v5.0.3-dev.3...v5.0.3-dev.4) (2024-11-18)
30+
31+
32+
### Bug Fixes
33+
34+
* **YouTube - Spoof app version:** Adjust legacy spoof targets ([#3934](https://github.com/ReVanced/revanced-patches/issues/3934)) ([f5794c1](https://github.com/ReVanced/revanced-patches/commit/f5794c1f896c331d76fdfc299e31a2773f2209ca))
35+
36+
## [5.0.3-dev.3](https://github.com/ReVanced/revanced-patches/compare/v5.0.3-dev.2...v5.0.3-dev.3) (2024-11-15)
37+
38+
39+
### Bug Fixes
40+
41+
* **YouTube - Playback speed:** Add 'Auto' speed. Always override speed if default is set to 1.0x ([#3914](https://github.com/ReVanced/revanced-patches/issues/3914)) ([497739e](https://github.com/ReVanced/revanced-patches/commit/497739e8ce6933c1f1ea46edffc102e56b985623))
42+
43+
## [5.0.3-dev.2](https://github.com/ReVanced/revanced-patches/compare/v5.0.3-dev.1...v5.0.3-dev.2) (2024-11-15)
44+
45+
46+
### Bug Fixes
47+
48+
* **YouTube - Spoof app version:** Remove broken spoof targets when patching 19.25+ ([#3915](https://github.com/ReVanced/revanced-patches/issues/3915)) ([9e18eca](https://github.com/ReVanced/revanced-patches/commit/9e18ecab1877dd33a3ad0fe216e6b91a8daaf1f8))
49+
50+
## [5.0.3-dev.1](https://github.com/ReVanced/revanced-patches/compare/v5.0.2...v5.0.3-dev.1) (2024-11-13)
51+
52+
53+
### Bug Fixes
54+
55+
* **YouTube - Change header:** Apply header changes to A/B layout ([#3907](https://github.com/ReVanced/revanced-patches/issues/3907)) ([6ccf114](https://github.com/ReVanced/revanced-patches/commit/6ccf11426ec9e9cd9c8e89a2443f0d0645cc78b1))
56+
157
## [5.0.2](https://github.com/ReVanced/revanced-patches/compare/v5.0.1...v5.0.2) (2024-11-12)
258

359

extensions/shared/src/main/java/app/revanced/extension/shared/checks/PatchInfo.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
package app.revanced.extension.shared.checks;
22

3-
// Fields are set by the patch. Do not modify.
4-
// Fields are not final, because the compiler is inlining them.
3+
/**
4+
* Fields are set by the patch. Do not modify.
5+
* Fields are not final, because the compiler is inlining them.
6+
*
7+
* @noinspection CanBeFinal
8+
*/
59
final class PatchInfo {
610
static long PATCH_TIME = 0L;
711

extensions/shared/src/main/java/app/revanced/extension/tudortmund/lockscreen/ShowOnLockscreenPatch.java

-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED;
1212

1313
public class ShowOnLockscreenPatch {
14-
/**
15-
* @noinspection deprecation
16-
*/
1714
public static Window getWindow(AppCompatActivity activity, float brightness) {
1815
Window window = activity.getWindow();
1916

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

+23
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,20 @@ public final class MiniplayerPatch {
2424
* Mini player type. Null fields indicates to use the original un-patched value.
2525
*/
2626
public enum MiniplayerType {
27+
/**
28+
* Disabled. When swiped down the miniplayer is immediately closed.
29+
* Only available with 19.43+
30+
*/
31+
DISABLED(false, null),
2732
/** Unmodified type, and same as un-patched. */
2833
ORIGINAL(null, null),
34+
/**
35+
* Exactly the same as MINIMAL, and only here for migration of user settings.
36+
* Eventually this should be deleted.
37+
*/
38+
@Deprecated
2939
PHONE(false, null),
40+
MINIMAL(false, null),
3041
TABLET(true, null),
3142
MODERN_1(null, 1),
3243
MODERN_2(null, 2),
@@ -164,6 +175,18 @@ public boolean isAvailable() {
164175
OPACITY_LEVEL = (opacity * 255) / 100;
165176
}
166177

178+
/**
179+
* Injection point.
180+
*
181+
* Enables a handler that immediately closes the miniplayer when the video is minimized,
182+
* effectively disabling the miniplayer.
183+
*/
184+
public static boolean getMiniplayerOnCloseHandler(boolean original) {
185+
return CURRENT_TYPE == ORIGINAL
186+
? original
187+
: CURRENT_TYPE == DISABLED;
188+
}
189+
167190
/**
168191
* Injection point.
169192
*/

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public final class LayoutComponentsFilter extends Filter {
3131
"cell_description_body"
3232
);
3333
private static final ByteArrayFilterGroup mixPlaylists = new ByteArrayFilterGroup(
34-
Settings.HIDE_MIX_PLAYLISTS,
34+
null,
3535
"&list="
3636
);
3737

@@ -344,6 +344,10 @@ boolean isFiltered(@Nullable String identifier, String path, byte[] protobufBuff
344344
*/
345345
public static boolean filterMixPlaylists(final Object conversionContext, @Nullable final byte[] bytes) {
346346
try {
347+
if (!Settings.HIDE_MIX_PLAYLISTS.get()) {
348+
return false;
349+
}
350+
347351
if (bytes == null) {
348352
Logger.printDebug(() -> "bytes is null");
349353
return false;

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

+7-7
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
@SuppressWarnings("unused")
2323
public final class ShortsFilter extends Filter {
2424
private static final boolean HIDE_SHORTS_NAVIGATION_BAR = Settings.HIDE_SHORTS_NAVIGATION_BAR.get();
25-
private final static String REEL_CHANNEL_BAR_PATH = "reel_channel_bar.eml";
25+
private static final String REEL_CHANNEL_BAR_PATH = "reel_channel_bar.eml";
2626

2727
/**
2828
* For paid promotion label and subscribe button that appears in the channel bar.
2929
*/
30-
private final static String REEL_METAPANEL_PATH = "reel_metapanel.eml";
30+
private static final String REEL_METAPANEL_PATH = "reel_metapanel.eml";
3131

3232
/**
3333
* Tags that appears when opening the Shorts player.
@@ -52,7 +52,7 @@ public final class ShortsFilter extends Filter {
5252
private final StringFilterGroup suggestedAction;
5353
private final ByteArrayFilterGroupList suggestedActionsGroupList = new ByteArrayFilterGroupList();
5454

55-
private final StringFilterGroup actionBar;
55+
private final StringFilterGroup actionButton;
5656
private final ByteArrayFilterGroupList videoActionButtonGroupList = new ByteArrayFilterGroupList();
5757

5858
public ShortsFilter() {
@@ -156,9 +156,9 @@ public ShortsFilter() {
156156
"reel_player_disclosure.eml"
157157
);
158158

159-
actionBar = new StringFilterGroup(
159+
actionButton = new StringFilterGroup(
160160
null,
161-
"shorts_action_bar"
161+
"shorts_video_action_button.eml"
162162
);
163163

164164
suggestedAction = new StringFilterGroup(
@@ -167,7 +167,7 @@ public ShortsFilter() {
167167
);
168168

169169
addPathCallbacks(
170-
shortsCompactFeedVideoPath, suggestedAction, actionBar, joinButton, subscribeButton,
170+
shortsCompactFeedVideoPath, suggestedAction, actionButton, joinButton, subscribeButton,
171171
paidPromotionButton, pausedOverlayButtons, channelBar, fullVideoLinkLabel, videoTitle,
172172
reelSoundMetadata, soundButton, infoPanel, stickers, likeFountain
173173
);
@@ -287,7 +287,7 @@ boolean isFiltered(@Nullable String identifier, String path, byte[] protobufBuff
287287
}
288288

289289
// Video action buttons (like, dislike, comment, share, remix) have the same path.
290-
if (matchedGroup == actionBar) {
290+
if (matchedGroup == actionButton) {
291291
if (videoActionButtonGroupList.check(protobufBufferArray).isFiltered()) {
292292
return super.isFiltered(identifier, path, protobufBufferArray, matchedGroup, contentType, contentIndex);
293293
}

extensions/shared/src/main/java/app/revanced/extension/youtube/patches/playback/speed/CustomPlaybackSpeedPatch.java

+19-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package app.revanced.extension.youtube.patches.playback.speed;
22

3+
import static app.revanced.extension.shared.StringRef.sf;
34
import static app.revanced.extension.shared.StringRef.str;
45

56
import android.preference.ListPreference;
@@ -10,23 +11,26 @@
1011

1112
import androidx.annotation.NonNull;
1213

13-
import app.revanced.extension.youtube.patches.components.PlaybackSpeedMenuFilterPatch;
14-
import app.revanced.extension.youtube.settings.Settings;
14+
import java.util.Arrays;
15+
1516
import app.revanced.extension.shared.Logger;
1617
import app.revanced.extension.shared.Utils;
17-
18-
import java.util.Arrays;
18+
import app.revanced.extension.youtube.patches.components.PlaybackSpeedMenuFilterPatch;
19+
import app.revanced.extension.youtube.settings.Settings;
1920

2021
@SuppressWarnings("unused")
2122
public class CustomPlaybackSpeedPatch {
23+
24+
private static final float PLAYBACK_SPEED_AUTO = Settings.PLAYBACK_SPEED_DEFAULT.defaultValue;
25+
2226
/**
2327
* Maximum playback speed, exclusive value. Custom speeds must be less than this value.
2428
*
2529
* Going over 8x does not increase the actual playback speed any higher,
2630
* and the UI selector starts flickering and acting weird.
2731
* Over 10x and the speeds show up out of order in the UI selector.
2832
*/
29-
public static final float MAXIMUM_PLAYBACK_SPEED = 8;
33+
public static final float PLAYBACK_SPEED_MAXIMUM = 8;
3034

3135
/**
3236
* Custom playback speeds.
@@ -69,8 +73,8 @@ private static void loadCustomSpeeds() {
6973
throw new IllegalArgumentException();
7074
}
7175

72-
if (speedFloat >= MAXIMUM_PLAYBACK_SPEED) {
73-
resetCustomSpeeds(str("revanced_custom_playback_speeds_invalid", MAXIMUM_PLAYBACK_SPEED));
76+
if (speedFloat >= PLAYBACK_SPEED_MAXIMUM) {
77+
resetCustomSpeeds(str("revanced_custom_playback_speeds_invalid", PLAYBACK_SPEED_MAXIMUM));
7478
loadCustomSpeeds();
7579
return;
7680
}
@@ -98,10 +102,15 @@ private static boolean arrayContains(float[] array, float value) {
98102
@SuppressWarnings("deprecation")
99103
public static void initializeListPreference(ListPreference preference) {
100104
if (preferenceListEntries == null) {
101-
preferenceListEntries = new String[customPlaybackSpeeds.length];
102-
preferenceListEntryValues = new String[customPlaybackSpeeds.length];
105+
final int numberOfEntries = customPlaybackSpeeds.length + 1;
106+
preferenceListEntries = new String[numberOfEntries];
107+
preferenceListEntryValues = new String[numberOfEntries];
103108

104-
int i = 0;
109+
// Auto speed (same behavior as unpatched).
110+
preferenceListEntries[0] = sf("revanced_custom_playback_speeds_auto").toString();
111+
preferenceListEntryValues[0] = String.valueOf(PLAYBACK_SPEED_AUTO);
112+
113+
int i = 1;
105114
for (float speed : customPlaybackSpeeds) {
106115
String speedString = String.valueOf(speed);
107116
preferenceListEntries[i] = speedString + "x";

extensions/shared/src/main/java/app/revanced/extension/youtube/patches/playback/speed/RememberPlaybackSpeedPatch.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public static void userSelectedPlaybackSpeed(float playbackSpeed) {
3333
// With the 0.05x menu, if the speed is set by integrations to higher than 2.0x
3434
// then the menu will allow increasing without bounds but the max speed is
3535
// still capped to under 8.0x.
36-
playbackSpeed = Math.min(playbackSpeed, CustomPlaybackSpeedPatch.MAXIMUM_PLAYBACK_SPEED - 0.05f);
36+
playbackSpeed = Math.min(playbackSpeed, CustomPlaybackSpeedPatch.PLAYBACK_SPEED_MAXIMUM - 0.05f);
3737

3838
// Prevent toast spamming if using the 0.05x adjustments.
3939
// Show exactly one toast after the user stops interacting with the speed menu.

extensions/shared/src/main/java/app/revanced/extension/youtube/returnyoutubedislike/requests/ReturnYouTubeDislikeApi.java

+2
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ private ReturnYouTubeDislikeApi() {
147147
*/
148148
private static void randomlyWaitIfLocallyDebugging() {
149149
final boolean DEBUG_RANDOMLY_DELAY_NETWORK_CALLS = false; // set true to debug UI
150+
//noinspection ConstantValue
150151
if (DEBUG_RANDOMLY_DELAY_NETWORK_CALLS) {
151152
final long amountOfTimeToWaste = (long) (Math.random()
152153
* (API_GET_VOTES_TCP_TIMEOUT_MILLISECONDS + API_GET_VOTES_HTTP_TIMEOUT_MILLISECONDS));
@@ -187,6 +188,7 @@ private static boolean checkIfRateLimitInEffect(String apiEndPointName) {
187188
*/
188189
private static boolean checkIfRateLimitWasHit(int httpResponseCode) {
189190
final boolean DEBUG_RATE_LIMIT = false; // set to true, to verify rate limit works
191+
//noinspection ConstantValue
190192
if (DEBUG_RATE_LIMIT) {
191193
final double RANDOM_RATE_LIMIT_PERCENTAGE = 0.2; // 20% chance of a triggering a rate limit
192194
if (Math.random() < RANDOM_RATE_LIMIT_PERCENTAGE) {

0 commit comments

Comments
 (0)