Compare commits

...

22 Commits

Author SHA1 Message Date
semantic-release-bot
c181135cc1 chore: Release v5.2.0-dev.1 [skip ci]
# [5.2.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v5.1.1-dev.2...v5.2.0-dev.1) (2024-11-25)

### Features

* **YouTube - Theme:** Apply custom seekbar color to splash screen animation ([#3978](https://github.com/ReVanced/revanced-patches/issues/3978)) ([7f67759](7f6775950e))
2024-11-25 16:52:34 +00:00
LisoUseInAIKyrios
7f6775950e feat(YouTube - Theme): Apply custom seekbar color to splash screen animation (#3978) 2024-11-25 20:49:05 +04:00
github-actions[bot]
4b2abaf17e chore: Sync translations (#3985) 2024-11-25 20:47:23 +04:00
semantic-release-bot
677b18c41a chore: Release v5.1.1-dev.2 [skip ci]
## [5.1.1-dev.2](https://github.com/ReVanced/revanced-patches/compare/v5.1.1-dev.1...v5.1.1-dev.2) (2024-11-25)

### Bug Fixes

* **YouTube - Hide Shorts components:** Add missing options to patch ([736b6a9](736b6a96b8))
2024-11-25 15:43:26 +00:00
oSumAtrIX
736b6a96b8 fix(YouTube - Hide Shorts components): Add missing options to patch 2024-11-25 16:40:06 +01:00
semantic-release-bot
8c371d8579 chore: Release v5.1.1-dev.1 [skip ci]
## [5.1.1-dev.1](https://github.com/ReVanced/revanced-patches/compare/v5.1.0...v5.1.1-dev.1) (2024-11-24)

### Bug Fixes

* **My Expenses - Unlock pro:** Constrain compatible version to working version ([#3974](https://github.com/ReVanced/revanced-patches/issues/3974)) ([abcaa63](abcaa6336a))
2024-11-24 22:49:39 +00:00
LisoUseInAIKyrios
abcaa6336a fix(My Expenses - Unlock pro): Constrain compatible version to working version (#3974) 2024-11-24 23:47:15 +01:00
semantic-release-bot
11537526a4 chore: Release v5.1.0 [skip ci]
# [5.1.0](https://github.com/ReVanced/revanced-patches/compare/v5.0.2...v5.1.0) (2024-11-24)

### Bug Fixes

* **YouTube - Change header:** Apply header changes to A/B layout ([#3907](https://github.com/ReVanced/revanced-patches/issues/3907)) ([69c504c](69c504ca2f))
* **YouTube - Hide Shorts components:** Do not hide Shorts action buttons on app first launch ([#3933](https://github.com/ReVanced/revanced-patches/issues/3933)) ([c3701c4](c3701c4b6e))
* **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)) ([78f3fd6](78f3fd6aa4))
* **YouTube - SponsorBlock:** Fix create new segment crash on tablet custom roms ([#3946](https://github.com/ReVanced/revanced-patches/issues/3946)) ([a7fc08a](a7fc08a491))
* **YouTube - Spoof app version:** Adjust legacy spoof targets ([#3934](https://github.com/ReVanced/revanced-patches/issues/3934)) ([2e3b3dc](2e3b3dca4b))
* **YouTube - Spoof app version:** Remove broken spoof targets when patching 19.25+ ([#3915](https://github.com/ReVanced/revanced-patches/issues/3915)) ([17b5b2e](17b5b2e384))

### Features

* **YouTube - Miniplayer:** Add option to disable miniplayer ([#3961](https://github.com/ReVanced/revanced-patches/issues/3961)) ([01cc8e0](01cc8e0abf))
* **YouTube:** Support version `19.45.38` ([#3938](https://github.com/ReVanced/revanced-patches/issues/3938)) ([8c6c8e0](8c6c8e0442))
2024-11-24 04:53:48 +00:00
oSumAtrIX
403116f591 chore: Merge branch dev to main (#3909) 2024-11-24 05:49:58 +01:00
1fexd
a1d14cffe9 chore: Move Sync video downloads patch to correct package 2024-11-24 04:06:02 +04:00
semantic-release-bot
10f221f374 chore: Release v5.1.0-dev.3 [skip ci]
# [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)

### Features

* **YouTube - Miniplayer:** Add option to disable miniplayer ([#3961](https://github.com/ReVanced/revanced-patches/issues/3961)) ([01cc8e0](01cc8e0abf))
2024-11-22 16:44:41 +00:00
github-actions[bot]
ba1aab6d4d chore: Sync translations (#3962) 2024-11-22 20:41:24 +04:00
LisoUseInAIKyrios
01cc8e0abf feat(YouTube - Miniplayer): Add option to disable miniplayer (#3961)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2024-11-22 20:37:35 +04:00
LisoUseInAIKyrios
518958350d refactor(YouTube - Announcements): Do not include announcement setting with import/export 2024-11-21 18:48:06 +04:00
semantic-release-bot
a625309d1f chore: Release v5.1.0-dev.2 [skip ci]
# [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)

### Bug Fixes

* **YouTube - SponsorBlock:** Fix create new segment crash on tablet custom roms ([#3946](https://github.com/ReVanced/revanced-patches/issues/3946)) ([a7fc08a](a7fc08a491))
2024-11-21 05:47:29 +00:00
LisoUseInAIKyrios
a7fc08a491 fix(YouTube - SponsorBlock): Fix create new segment crash on tablet custom roms (#3946) 2024-11-21 09:44:32 +04:00
semantic-release-bot
97b129e088 chore: Release v5.1.0-dev.1 [skip ci]
# [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)

### Features

* **YouTube:** Support version `19.45.38` ([#3938](https://github.com/ReVanced/revanced-patches/issues/3938)) ([8c6c8e0](8c6c8e0442))
2024-11-20 09:54:50 +00:00
LisoUseInAIKyrios
8c6c8e0442 feat(YouTube): Support version 19.45.38 (#3938) 2024-11-20 13:51:36 +04:00
LisoUseInAIKyrios
16c090d2c0 refactor(YouTube): Use consistent language for 'auto' speed and quality 2024-11-19 11:07:49 +04:00
semantic-release-bot
ed35a2a4a9 chore: Release v5.0.3-dev.5 [skip ci]
## [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)

### Bug Fixes

* **YouTube - Hide Shorts components:** Do not hide Shorts action buttons on app first launch ([#3933](https://github.com/ReVanced/revanced-patches/issues/3933)) ([c3701c4](c3701c4b6e))
2024-11-18 08:28:49 +00:00
LisoUseInAIKyrios
c3701c4b6e fix(YouTube - Hide Shorts components): Do not hide Shorts action buttons on app first launch (#3933) 2024-11-18 12:25:32 +04:00
github-actions[bot]
e0dc821c50 chore: Sync translations (#3936) 2024-11-18 12:21:46 +04:00
179 changed files with 1753 additions and 1107 deletions

View File

@@ -1,3 +1,70 @@
# [5.2.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v5.1.1-dev.2...v5.2.0-dev.1) (2024-11-25)
### Features
* **YouTube - Theme:** Apply custom seekbar color to splash screen animation ([#3978](https://github.com/ReVanced/revanced-patches/issues/3978)) ([98d57e2](https://github.com/ReVanced/revanced-patches/commit/98d57e28af7206099867474b7aa3760cd4fe333f))
## [5.1.1-dev.2](https://github.com/ReVanced/revanced-patches/compare/v5.1.1-dev.1...v5.1.1-dev.2) (2024-11-25)
### Bug Fixes
* **YouTube - Hide Shorts components:** Add missing options to patch ([65f62fc](https://github.com/ReVanced/revanced-patches/commit/65f62fcd5ac340616a96542c64faf2af2a60df28))
## [5.1.1-dev.1](https://github.com/ReVanced/revanced-patches/compare/v5.1.0...v5.1.1-dev.1) (2024-11-24)
### Bug Fixes
* **My Expenses - Unlock pro:** Constrain compatible version to working version ([#3974](https://github.com/ReVanced/revanced-patches/issues/3974)) ([ba3bf69](https://github.com/ReVanced/revanced-patches/commit/ba3bf69df07ec8dab46868c3940ebd56db0cd137))
# [5.1.0](https://github.com/ReVanced/revanced-patches/compare/v5.0.2...v5.1.0) (2024-11-24)
### Bug Fixes
* **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))
* **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))
* **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))
* **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))
* **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))
* **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))
### Features
* **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))
* **YouTube:** Support version `19.45.38` ([#3938](https://github.com/ReVanced/revanced-patches/issues/3938)) ([7c4e3fe](https://github.com/ReVanced/revanced-patches/commit/7c4e3fe97e8cbbb8cf16a2fb95f64223ca2bd7ef))
# [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)
### Features
* **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))
# [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)
### Bug Fixes
* **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))
# [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)
### Features
* **YouTube:** Support version `19.45.38` ([#3938](https://github.com/ReVanced/revanced-patches/issues/3938)) ([7c4e3fe](https://github.com/ReVanced/revanced-patches/commit/7c4e3fe97e8cbbb8cf16a2fb95f64223ca2bd7ef))
## [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)
### Bug Fixes
* **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))
## [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)

View File

@@ -1,7 +1,11 @@
package app.revanced.extension.shared.checks;
// Fields are set by the patch. Do not modify.
// Fields are not final, because the compiler is inlining them.
/**
* Fields are set by the patch. Do not modify.
* Fields are not final, because the compiler is inlining them.
*
* @noinspection CanBeFinal
*/
final class PatchInfo {
static long PATCH_TIME = 0L;

View File

@@ -11,9 +11,6 @@ import static android.view.WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD;
import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED;
public class ShowOnLockscreenPatch {
/**
* @noinspection deprecation
*/
public static Window getWindow(AppCompatActivity activity, float brightness) {
Window window = activity.getWindow();

View File

@@ -24,9 +24,20 @@ public final class MiniplayerPatch {
* Mini player type. Null fields indicates to use the original un-patched value.
*/
public enum MiniplayerType {
/**
* Disabled. When swiped down the miniplayer is immediately closed.
* Only available with 19.43+
*/
DISABLED(false, null),
/** Unmodified type, and same as un-patched. */
ORIGINAL(null, null),
/**
* Exactly the same as MINIMAL, and only here for migration of user settings.
* Eventually this should be deleted.
*/
@Deprecated
PHONE(false, null),
MINIMAL(false, null),
TABLET(true, null),
MODERN_1(null, 1),
MODERN_2(null, 2),
@@ -164,6 +175,18 @@ public final class MiniplayerPatch {
OPACITY_LEVEL = (opacity * 255) / 100;
}
/**
* Injection point.
*
* Enables a handler that immediately closes the miniplayer when the video is minimized,
* effectively disabling the miniplayer.
*/
public static boolean getMiniplayerOnCloseHandler(boolean original) {
return CURRENT_TYPE == ORIGINAL
? original
: CURRENT_TYPE == DISABLED;
}
/**
* Injection point.
*/

View File

@@ -22,12 +22,12 @@ import app.revanced.extension.youtube.shared.PlayerType;
@SuppressWarnings("unused")
public final class ShortsFilter extends Filter {
private static final boolean HIDE_SHORTS_NAVIGATION_BAR = Settings.HIDE_SHORTS_NAVIGATION_BAR.get();
private final static String REEL_CHANNEL_BAR_PATH = "reel_channel_bar.eml";
private static final String REEL_CHANNEL_BAR_PATH = "reel_channel_bar.eml";
/**
* For paid promotion label and subscribe button that appears in the channel bar.
*/
private final static String REEL_METAPANEL_PATH = "reel_metapanel.eml";
private static final String REEL_METAPANEL_PATH = "reel_metapanel.eml";
/**
* Tags that appears when opening the Shorts player.
@@ -52,7 +52,7 @@ public final class ShortsFilter extends Filter {
private final StringFilterGroup suggestedAction;
private final ByteArrayFilterGroupList suggestedActionsGroupList = new ByteArrayFilterGroupList();
private final StringFilterGroup actionBar;
private final StringFilterGroup actionButton;
private final ByteArrayFilterGroupList videoActionButtonGroupList = new ByteArrayFilterGroupList();
public ShortsFilter() {
@@ -156,9 +156,9 @@ public final class ShortsFilter extends Filter {
"reel_player_disclosure.eml"
);
actionBar = new StringFilterGroup(
actionButton = new StringFilterGroup(
null,
"shorts_action_bar"
"shorts_video_action_button.eml"
);
suggestedAction = new StringFilterGroup(
@@ -167,7 +167,7 @@ public final class ShortsFilter extends Filter {
);
addPathCallbacks(
shortsCompactFeedVideoPath, suggestedAction, actionBar, joinButton, subscribeButton,
shortsCompactFeedVideoPath, suggestedAction, actionButton, joinButton, subscribeButton,
paidPromotionButton, pausedOverlayButtons, channelBar, fullVideoLinkLabel, videoTitle,
reelSoundMetadata, soundButton, infoPanel, stickers, likeFountain
);
@@ -287,7 +287,7 @@ public final class ShortsFilter extends Filter {
}
// Video action buttons (like, dislike, comment, share, remix) have the same path.
if (matchedGroup == actionBar) {
if (matchedGroup == actionButton) {
if (videoActionButtonGroupList.check(protobufBufferArray).isFiltered()) {
return super.isFiltered(identifier, path, protobufBufferArray, matchedGroup, contentType, contentIndex);
}

View File

@@ -2,9 +2,12 @@ package app.revanced.extension.youtube.patches.theme;
import static app.revanced.extension.shared.StringRef.str;
import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.drawable.AnimatedVectorDrawable;
import java.util.Arrays;
import java.util.Locale;
import app.revanced.extension.shared.Logger;
import app.revanced.extension.shared.Utils;
@@ -16,7 +19,8 @@ public final class SeekbarColorPatch {
private static final boolean SEEKBAR_CUSTOM_COLOR_ENABLED = Settings.SEEKBAR_CUSTOM_COLOR.get();
/**
* Default color of the seekbar.
* Default color of the litho seekbar.
* Differs slightly from the default custom seekbar color setting.
*/
private static final int ORIGINAL_SEEKBAR_COLOR = 0xFFFF0000;
@@ -72,12 +76,76 @@ public final class SeekbarColorPatch {
return seekbarColor;
}
/**
* Injection point
*/
public static boolean playerSeekbarGradientEnabled(boolean original) {
if (SEEKBAR_CUSTOM_COLOR_ENABLED) return false;
return original;
}
/**
* Injection point
*/
public static boolean useLotteLaunchSplashScreen(boolean original) {
Logger.printDebug(() -> "useLotteLaunchSplashScreen original: " + original);
if (SEEKBAR_CUSTOM_COLOR_ENABLED) return false;
return original;
}
private static int colorChannelTo3Bits(int channel8Bits) {
final float channel3Bits = channel8Bits * 7 / 255f;
// If a color channel is near zero, then allow rounding up so values between
// 0x12 and 0x23 will show as 0x24. But always round down when the channel is
// near full saturation, otherwise rounding to nearest will cause all values
// between 0xEC and 0xFE to always show as full saturation (0xFF).
return channel3Bits < 6
? Math.round(channel3Bits)
: (int) channel3Bits;
}
private static String get9BitStyleIdentifier(int color24Bit) {
final int r3 = colorChannelTo3Bits(Color.red(color24Bit));
final int g3 = colorChannelTo3Bits(Color.green(color24Bit));
final int b3 = colorChannelTo3Bits(Color.blue(color24Bit));
return String.format(Locale.US, "splash_seekbar_color_style_%d_%d_%d", r3, g3, b3);
}
/**
* Injection point
*/
public static void setSplashAnimationDrawableTheme(AnimatedVectorDrawable vectorDrawable) {
// Alternatively a ColorMatrixColorFilter can be used to change the color of the drawable
// without using any styles, but a color filter cannot selectively change the seekbar
// while keeping the red YT logo untouched.
// Even if the seekbar color xml value is changed to a completely different color (such as green),
// a color filter still cannot be selectively applied when the drawable has more than 1 color.
try {
String seekbarStyle = get9BitStyleIdentifier(seekbarColor);
Logger.printDebug(() -> "Using splash seekbar style: " + seekbarStyle);
final int styleIdentifierDefault = Utils.getResourceIdentifier(
seekbarStyle,
"style"
);
if (styleIdentifierDefault == 0) {
throw new RuntimeException("Seekbar style not found: " + seekbarStyle);
}
Resources.Theme theme = Utils.getContext().getResources().newTheme();
theme.applyStyle(styleIdentifierDefault, true);
vectorDrawable.applyTheme(theme);
} catch (Exception ex) {
Logger.printException(() -> "setSplashAnimationDrawableTheme failure", ex);
}
}
/**
* Injection point.
*
@@ -189,4 +257,4 @@ public final class SeekbarColorPatch {
private static float clamp(float value, float lower, float upper) {
return Math.max(lower, Math.min(value, upper));
}
}
}

View File

@@ -147,6 +147,7 @@ public class ReturnYouTubeDislikeApi {
*/
private static void randomlyWaitIfLocallyDebugging() {
final boolean DEBUG_RANDOMLY_DELAY_NETWORK_CALLS = false; // set true to debug UI
//noinspection ConstantValue
if (DEBUG_RANDOMLY_DELAY_NETWORK_CALLS) {
final long amountOfTimeToWaste = (long) (Math.random()
* (API_GET_VOTES_TCP_TIMEOUT_MILLISECONDS + API_GET_VOTES_HTTP_TIMEOUT_MILLISECONDS));
@@ -187,6 +188,7 @@ public class ReturnYouTubeDislikeApi {
*/
private static boolean checkIfRateLimitWasHit(int httpResponseCode) {
final boolean DEBUG_RATE_LIMIT = false; // set to true, to verify rate limit works
//noinspection ConstantValue
if (DEBUG_RATE_LIMIT) {
final double RANDOM_RATE_LIMIT_PERCENTAGE = 0.2; // 20% chance of a triggering a rate limit
if (Math.random() < RANDOM_RATE_LIMIT_PERCENTAGE) {

View File

@@ -233,7 +233,7 @@ public class Settings extends BaseSettings {
public static final BooleanSetting HIDE_SHORTS_UPCOMING_BUTTON = new BooleanSetting("revanced_hide_shorts_upcoming_button", TRUE);
public static final BooleanSetting HIDE_SHORTS_GREEN_SCREEN_BUTTON = new BooleanSetting("revanced_hide_shorts_green_screen_button", TRUE);
public static final BooleanSetting HIDE_SHORTS_HASHTAG_BUTTON = new BooleanSetting("revanced_hide_shorts_hashtag_button", TRUE);
public static final BooleanSetting HIDE_SHORTS_SEARCH_SUGGESTIONS = new BooleanSetting("revanced_hide_shorts_search_suggestions", FALSE);
public static final BooleanSetting HIDE_SHORTS_SEARCH_SUGGESTIONS = new BooleanSetting("revanced_hide_shorts_search_suggestions", TRUE);
public static final BooleanSetting HIDE_SHORTS_STICKERS = new BooleanSetting("revanced_hide_shorts_stickers", TRUE);
public static final BooleanSetting HIDE_SHORTS_SUPER_THANKS_BUTTON = new BooleanSetting("revanced_hide_shorts_super_thanks_button", TRUE);
public static final BooleanSetting HIDE_SHORTS_LIKE_FOUNTAIN = new BooleanSetting("revanced_hide_shorts_like_fountain", TRUE);
@@ -272,7 +272,7 @@ public class Settings extends BaseSettings {
public static final BooleanSetting SPOOF_DEVICE_DIMENSIONS = new BooleanSetting("revanced_spoof_device_dimensions", FALSE, true,
"revanced_spoof_device_dimensions_user_dialog_message");
public static final BooleanSetting BYPASS_URL_REDIRECTS = new BooleanSetting("revanced_bypass_url_redirects", TRUE);
public static final BooleanSetting ANNOUNCEMENTS = new BooleanSetting("revanced_announcements", TRUE);
public static final BooleanSetting ANNOUNCEMENTS = new BooleanSetting("revanced_announcements", TRUE, false, false);
public static final BooleanSetting SPOOF_VIDEO_STREAMS = new BooleanSetting("revanced_spoof_video_streams", TRUE, true,"revanced_spoof_video_streams_user_dialog_message");
public static final BooleanSetting SPOOF_VIDEO_STREAMS_IOS_FORCE_AVC = new BooleanSetting("revanced_spoof_video_streams_ios_force_avc", FALSE, true,
"revanced_spoof_video_streams_ios_force_avc_user_dialog_message", new SpoofVideoStreamsPatch.ForceiOSAVCAvailability());
@@ -375,15 +375,20 @@ public class Settings extends BaseSettings {
migrateOldSettingToNew(DEPRECATED_SB_UUID_OLD_MIGRATION_SETTING, SB_PRIVATE_USER_ID);
migrateOldSettingToNew(DEPRECATED_HIDE_PLAYER_BUTTONS, HIDE_PLAYER_PREVIOUS_NEXT_BUTTONS);
migrateOldSettingToNew(DEPRECATED_HIDE_PLAYER_FLYOUT_VIDEO_QUALITY_FOOTER, HIDE_PLAYER_FLYOUT_VIDEO_QUALITY_FOOTER);
// Old spoof versions that no longer work reliably.
if (SpoofAppVersionPatch.isSpoofingToLessThan(SPOOF_APP_VERSION_TARGET.defaultValue)) {
Logger.printInfo(() -> "Resetting spoof app version target");
SPOOF_APP_VERSION_TARGET.resetToDefault();
}
migrateOldSettingToNew(DEPRECATED_HIDE_PLAYER_BUTTONS, HIDE_PLAYER_PREVIOUS_NEXT_BUTTONS);
migrateOldSettingToNew(DEPRECATED_HIDE_PLAYER_FLYOUT_VIDEO_QUALITY_FOOTER, HIDE_PLAYER_FLYOUT_VIDEO_QUALITY_FOOTER);
// Migrate renamed enum type.
if (MINIPLAYER_TYPE.get() == PHONE) {
MINIPLAYER_TYPE.save(MINIMAL);
}
// endregion
}

View File

@@ -49,7 +49,7 @@ enum class PlayerType {
companion object {
private val nameToPlayerType = values().associateBy { it.name }
private val nameToPlayerType = PlayerType.entries.associateBy { it.name }
@JvmStatic
fun setFromString(enumName: String) {

View File

@@ -22,7 +22,7 @@ enum class VideoState {
companion object {
private val nameToVideoState = values().associateBy { it.name }
private val nameToVideoState = VideoState.entries.associateBy { it.name }
@JvmStatic
fun setFromString(enumName: String) {

View File

@@ -382,7 +382,6 @@ public class SponsorBlockUtils {
return statsNumberFormatter.format(viewCount);
}
@SuppressWarnings("ConstantConditions")
private static long parseSegmentTime(@NonNull String time) {
Matcher matcher = manualEditTimePattern.matcher(time);
if (!matcher.matches()) {

View File

@@ -113,6 +113,7 @@ public class SBRequester {
// Could benefit from:
// 1) collection of YouTube videos with test segment times (verify client skip timing matches the video, verify seekbar draws correctly)
// 2) unit tests (verify everything else)
//noinspection ConstantValue
if (false) {
segments.clear();
// Test auto-hide skip button:

View File

@@ -1,7 +1,5 @@
package app.revanced.extension.youtube.sponsorblock.ui;
import static app.revanced.extension.shared.Utils.getResourceIdentifier;
import android.view.View;
import android.widget.ImageView;

View File

@@ -107,12 +107,13 @@ public final class NewSegmentLayout extends FrameLayout {
*/
private void initializeButton(final Context context, final String resourceIdentifierName,
final ButtonOnClickHandlerFunction handler, final String debugMessage) {
final ImageButton button = findViewById(getResourceIdentifier(context, resourceIdentifierName, "id"));
ImageButton button = findViewById(getResourceIdentifier(context, resourceIdentifierName, "id"));
// Add ripple effect
button.setBackgroundResource(rippleEffectId);
RippleDrawable rippleDrawable = (RippleDrawable) button.getBackground();
rippleDrawable.setColor(rippleColorStateList);
RippleDrawable rippleDrawable = new RippleDrawable(
rippleColorStateList, null, null
);
button.setBackground(rippleDrawable);
button.setOnClickListener((v) -> {
handler.apply();
@@ -121,7 +122,7 @@ public final class NewSegmentLayout extends FrameLayout {
}
@FunctionalInterface
public interface ButtonOnClickHandlerFunction {
private interface ButtonOnClickHandlerFunction {
void apply();
}
}
}

View File

@@ -1,7 +1,5 @@
package app.revanced.extension.youtube.sponsorblock.ui;
import static app.revanced.extension.shared.Utils.getResourceIdentifier;
import android.view.View;
import android.widget.ImageView;

View File

@@ -7,8 +7,6 @@ import android.os.Handler
import android.os.Looper
import android.util.TypedValue
import android.view.HapticFeedbackConstants
import android.view.View
import android.view.ViewGroup
import android.widget.RelativeLayout
import android.widget.TextView
import app.revanced.extension.shared.StringRef.str
@@ -59,8 +57,8 @@ class SwipeControlsOverlayLayout(
val compoundIconPadding = 4.applyDimension(context, TypedValue.COMPLEX_UNIT_DIP)
feedbackTextView = TextView(context).apply {
layoutParams = LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT,
).apply {
addRule(CENTER_IN_PARENT, TRUE)
setPadding(
@@ -91,7 +89,7 @@ class SwipeControlsOverlayLayout(
private val feedbackHideHandler = Handler(Looper.getMainLooper())
private val feedbackHideCallback = Runnable {
feedbackTextView.visibility = View.GONE
feedbackTextView.visibility = GONE
}
/**

View File

@@ -3,4 +3,4 @@ org.gradle.jvmargs = -Xms512M -Xmx2048M
org.gradle.parallel = true
android.useAndroidX = true
kotlin.code.style = official
version = 5.0.3-dev.4
version = 5.2.0-dev.1

View File

@@ -503,6 +503,10 @@ public final class app/revanced/patches/reddit/customclients/sync/syncforreddit/
public static final fun getUseUserEndpointPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/reddit/customclients/sync/syncforreddit/fix/video/FixVideoDownloadsPatchKt {
public static final fun getFixVideoDownloadsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/reddit/customclients/syncforreddit/fix/video/FixVideoDownloadsPatchKt {
public static final fun getFixVideoDownloadsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
@@ -1324,6 +1328,7 @@ public final class app/revanced/patches/youtube/misc/playservice/VersionCheckPat
public static final fun is_19_36_or_greater ()Z
public static final fun is_19_41_or_greater ()Z
public static final fun is_19_43_or_greater ()Z
public static final fun is_19_46_or_greater ()Z
}
public final class app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatchKt {

View File

@@ -1,3 +1,5 @@
package app.revanced.patches.facebook.ads.mainfeed
import app.revanced.patcher.fingerprint
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode

View File

@@ -4,14 +4,11 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable
import baseModelMapperFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.builder.MutableMethodImplementation
import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction31i
import com.android.tools.smali.dexlib2.immutable.ImmutableMethod
import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter
import getSponsoredDataModelTemplateFingerprint
import getStoryVisibilityFingerprint
@Suppress("unused")
val hideSponsoredStoriesPatch = bytecodePatch(

View File

@@ -4,7 +4,6 @@ import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.patch.bytecodePatch
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
import com.sun.org.apache.bcel.internal.generic.InstructionConst.getInstruction
@Suppress("unused")
val enableCustomTabsPatch = bytecodePatch(

View File

@@ -4,7 +4,6 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.patch.bytecodePatch
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
import com.sun.org.apache.bcel.internal.generic.InstructionConst.getInstruction
@Suppress("unused")
val restoreHiddenBackUpWhileChargingTogglePatch = bytecodePatch(

View File

@@ -5,7 +5,6 @@ import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.extensions.InstructionExtensions.removeInstructions
import app.revanced.patcher.patch.bytecodePatch
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
import com.sun.org.apache.bcel.internal.generic.InstructionConst.getInstruction
@Suppress("unused")
val removeDeviceRestrictionsPatch = bytecodePatch(

View File

@@ -4,7 +4,6 @@ import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.patch.bytecodePatch
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
import com.sun.org.apache.bcel.internal.generic.InstructionConst.getInstruction
@Suppress("unused")
val disableSwitchingEmojiToStickerPatch = bytecodePatch(

View File

@@ -7,7 +7,6 @@ import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.patch.bytecodePatch
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
@Suppress("unused")
val hideGetPremiumPatch = bytecodePatch(
name = "Hide 'Get Music Premium' label",
description = "Hides the \"Get Music Premium\" label from the account menu and settings.",

View File

@@ -4,7 +4,6 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.bytecodePatch
@Suppress("unused")
val backgroundPlaybackPatch = bytecodePatch(
name = "Remove background playback restrictions",
description = "Removes restrictions on background playback, including playing kids videos in the background.",

View File

@@ -7,7 +7,7 @@ import app.revanced.patcher.patch.bytecodePatch
val unlockProPatch = bytecodePatch(
name = "Unlock pro",
) {
compatibleWith("org.totschnig.myexpenses")
compatibleWith("org.totschnig.myexpenses"("3.4.9"))
execute {
isEnabledFingerprint.method.addInstructions(

View File

@@ -1,4 +1,4 @@
package app.revanced.patches.reddit.customclients.syncforreddit.fix.video
package app.revanced.patches.reddit.customclients.sync.syncforreddit.fix.video
import app.revanced.patcher.fingerprint
import com.android.tools.smali.dexlib2.Opcode

View File

@@ -0,0 +1,56 @@
package app.revanced.patches.reddit.customclients.sync.syncforreddit.fix.video
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.patches.reddit.customclients.sync.syncforreddit.extension.sharedExtensionPatch
import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
private const val EXTENSION_CLASS_DESCRIPTOR =
"Lapp/revanced/extension/syncforreddit/FixRedditVideoDownloadPatch;"
private const val GET_LINKS_METHOD = "getLinks([B)[Ljava/lang/String;"
@Suppress("unused")
val fixVideoDownloadsPatch = bytecodePatch(
name = "Fix video downloads",
description = "Fixes a bug in Sync's MPD parser resulting in only the audio-track being saved.",
) {
dependsOn(sharedExtensionPatch)
compatibleWith(
"com.laurencedawson.reddit_sync",
"com.laurencedawson.reddit_sync.pro",
"com.laurencedawson.reddit_sync.dev",
)
execute {
val scanResult = parseRedditVideoNetworkResponseFingerprint.patternMatch!!
val newInstanceIndex = scanResult.startIndex
val invokeDirectIndex = scanResult.endIndex - 1
val buildResponseInstruction =
parseRedditVideoNetworkResponseFingerprint.method.getInstruction<Instruction35c>(invokeDirectIndex)
parseRedditVideoNetworkResponseFingerprint.method.addInstructions(
newInstanceIndex + 1,
"""
# Get byte array from response.
iget-object v2, p1, Lcom/android/volley/NetworkResponse;->data:[B
# Parse the videoUrl and audioUrl from the byte array.
invoke-static { v2 }, $EXTENSION_CLASS_DESCRIPTOR->$GET_LINKS_METHOD
move-result-object v2
# Get videoUrl (Index 0).
const/4 v5, 0x0
aget-object v${buildResponseInstruction.registerE}, v2, v5
# Get audioUrl (Index 1).
const/4 v6, 0x1
aget-object v${buildResponseInstruction.registerF}, v2, v6
# Register E and F are used to build the response.
""",
)
}
}

View File

@@ -1,56 +1,18 @@
package app.revanced.patches.reddit.customclients.syncforreddit.fix.video
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.patches.reddit.customclients.sync.syncforreddit.extension.sharedExtensionPatch
import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
private const val EXTENSION_CLASS_DESCRIPTOR =
"Lapp/revanced/extension/syncforreddit/FixRedditVideoDownloadPatch;"
private const val GET_LINKS_METHOD = "getLinks([B)[Ljava/lang/String;"
@Deprecated(
message = "Patch was move to a different package",
ReplaceWith("app.revanced.patches.reddit.customclients.sync.syncforreddit.fix.video.fixVideoDownloadsPatch")
)
@Suppress("unused")
val fixVideoDownloadsPatch = bytecodePatch(
name = "Fix video downloads",
description = "Fixes a bug in Sync's MPD parser resulting in only the audio-track being saved.",
) {
dependsOn(sharedExtensionPatch)
val fixVideoDownloadsPatch = bytecodePatch {
dependsOn(app.revanced.patches.reddit.customclients.sync.syncforreddit.fix.video.fixVideoDownloadsPatch)
compatibleWith(
"com.laurencedawson.reddit_sync",
"com.laurencedawson.reddit_sync.pro",
"com.laurencedawson.reddit_sync.dev",
)
execute {
val scanResult = parseRedditVideoNetworkResponseFingerprint.patternMatch!!
val newInstanceIndex = scanResult.startIndex
val invokeDirectIndex = scanResult.endIndex - 1
val buildResponseInstruction =
parseRedditVideoNetworkResponseFingerprint.method.getInstruction<Instruction35c>(invokeDirectIndex)
parseRedditVideoNetworkResponseFingerprint.method.addInstructions(
newInstanceIndex + 1,
"""
# Get byte array from response.
iget-object v2, p1, Lcom/android/volley/NetworkResponse;->data:[B
# Parse the videoUrl and audioUrl from the byte array.
invoke-static { v2 }, $EXTENSION_CLASS_DESCRIPTOR->$GET_LINKS_METHOD
move-result-object v2
# Get videoUrl (Index 0).
const/4 v5, 0x0
aget-object v${buildResponseInstruction.registerE}, v2, v5
# Get audioUrl (Index 1).
const/4 v6, 0x1
aget-object v${buildResponseInstruction.registerF}, v2, v6
# Register E and F are used to build the response.
""",
)
}
}
}

View File

@@ -21,7 +21,7 @@ internal val createTabsFingerprint = fingerprint {
if (reference.definingClass != ACTIVITY_TAB_DESCRIPTOR) return@any false
if (reference.returnType != "[${ACTIVITY_TAB_DESCRIPTOR}") return@any false
true
} ?: false
} == true
}
}
@@ -42,7 +42,7 @@ internal val showNotificationFingerprint = fingerprint {
}
}
true
} ?: false
} == true
}
}

View File

@@ -11,7 +11,6 @@ import app.revanced.patches.twitch.misc.extension.sharedExtensionPatch
import app.revanced.patches.twitch.misc.settings.PreferenceScreen
import app.revanced.patches.twitch.misc.settings.settingsPatch
@Suppress("unused")
val audioAdsPatch = bytecodePatch(
name = "Block audio ads",
description = "Blocks audio ads in streams and VODs.",

View File

@@ -9,7 +9,6 @@ import app.revanced.patches.twitch.misc.extension.sharedExtensionPatch
import app.revanced.patches.twitch.misc.settings.PreferenceScreen
import app.revanced.patches.twitch.misc.settings.settingsPatch
@Suppress("unused")
val embeddedAdsPatch = bytecodePatch(
name = "Block embedded ads",
description = "Blocks embedded stream ads using services like Luminous or PurpleAdBlocker.",

View File

@@ -12,7 +12,6 @@ import app.revanced.patches.twitch.misc.extension.sharedExtensionPatch
import app.revanced.patches.twitch.misc.settings.PreferenceScreen
import app.revanced.patches.twitch.misc.settings.settingsPatch
@Suppress("unused")
val showDeletedMessagesPatch = bytecodePatch(
name = "Show deleted messages",
description = "Shows deleted chat messages behind a clickable spoiler.",

View File

@@ -11,7 +11,6 @@ import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
import app.revanced.patches.twitch.misc.settings.PreferenceScreen
import app.revanced.patches.twitch.misc.settings.settingsPatch
@Suppress("unused")
val autoClaimChannelPointsPatch = bytecodePatch(
name = "Auto claim channel points",
description = "Automatically claim Channel Points.",

View File

@@ -9,7 +9,6 @@ import app.revanced.patches.twitch.misc.extension.sharedExtensionPatch
import app.revanced.patches.twitch.misc.settings.PreferenceScreen
import app.revanced.patches.twitch.misc.settings.settingsPatch
@Suppress("unused")
val debugModePatch = bytecodePatch(
name = "Debug mode",
description = "Enables Twitch's internal debugging mode.",

View File

@@ -75,6 +75,7 @@ val hideAdsPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -31,6 +31,7 @@ val hideGetPremiumPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -11,7 +11,6 @@ import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch
import app.revanced.patches.youtube.misc.settings.PreferenceScreen
import app.revanced.patches.youtube.misc.settings.settingsPatch
@Suppress("unused")
val videoAdsPatch = bytecodePatch(
name = "Video ads",
description = "Adds an option to remove ads in the video player.",
@@ -30,6 +29,7 @@ val videoAdsPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -59,6 +59,7 @@ val copyVideoUrlPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -11,7 +11,6 @@ import app.revanced.patches.youtube.misc.settings.PreferenceScreen
import app.revanced.patches.youtube.misc.settings.settingsPatch
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
@Suppress("unused")
val removeViewerDiscretionDialogPatch = bytecodePatch(
name = "Remove viewer discretion dialog",
description = "Adds an option to remove the dialog that appears when opening a video that has been age-restricted " +
@@ -31,6 +30,7 @@ val removeViewerDiscretionDialogPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -74,6 +74,7 @@ val downloadsPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -11,7 +11,6 @@ import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch
import app.revanced.patches.youtube.misc.settings.PreferenceScreen
import app.revanced.patches.youtube.misc.settings.settingsPatch
@Suppress("unused")
val disablePreciseSeekingGesturePatch = bytecodePatch(
name = "Disable precise seeking gesture",
description = "Adds an option to disable precise seeking when swiping up on the seekbar.",
@@ -30,6 +29,7 @@ val disablePreciseSeekingGesturePatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -14,7 +14,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
@Suppress("unused")
val enableSeekbarTappingPatch = bytecodePatch(
name = "Seekbar tapping",
description = "Adds an option to enable tap-to-seek on the seekbar of the video player.",
@@ -33,6 +32,7 @@ val enableSeekbarTappingPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -17,12 +17,10 @@ import app.revanced.util.getReference
import com.android.tools.smali.dexlib2.Opcode
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
import com.sun.org.apache.bcel.internal.generic.InstructionConst.getInstruction
internal const val EXTENSION_METHOD_DESCRIPTOR =
"Lapp/revanced/extension/youtube/patches/SlideToSeekPatch;->isSlideToSeekDisabled(Z)Z"
@Suppress("unused")
val enableSlideToSeekPatch = bytecodePatch(
name = "Enable slide to seek",
description = "Adds an option to enable slide to seek " +
@@ -44,6 +42,7 @@ val enableSlideToSeekPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -16,7 +16,6 @@ import app.revanced.patches.youtube.misc.settings.PreferenceScreen
private const val EXTENSION_CLASS_DESCRIPTOR =
"Lapp/revanced/extension/youtube/patches/SeekbarThumbnailsPatch;"
@Suppress("unused")
val seekbarThumbnailsPatch = bytecodePatch(
name = "Seekbar thumbnails",
description = "Adds an option to use high quality fullscreen seekbar thumbnails. " +
@@ -36,6 +35,7 @@ val seekbarThumbnailsPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
)
)

View File

@@ -71,6 +71,7 @@ val swipeControlsPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -10,7 +10,6 @@ import app.revanced.patches.youtube.misc.settings.PreferenceScreen
import app.revanced.patches.youtube.misc.settings.settingsPatch
import app.revanced.patches.youtube.shared.subtitleButtonControllerFingerprint
@Suppress("unused")
val autoCaptionsPatch = bytecodePatch(
name = "Disable auto captions",
description = "Adds an option to disable captions from being automatically enabled.",
@@ -29,6 +28,7 @@ val autoCaptionsPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -41,7 +41,17 @@ val customBrandingPatch = resourcePatch(
) {
dependsOn(versionCheckPatch)
compatibleWith("com.google.android.youtube")
compatibleWith(
"com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39",
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)
val appName by stringOption(
key = "appName",

View File

@@ -39,7 +39,17 @@ val changeHeaderPatch = resourcePatch(
) {
dependsOn(versionCheckPatch)
compatibleWith("com.google.android.youtube")
compatibleWith(
"com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39",
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
)
)
val header by stringOption(
key = "header",

View File

@@ -10,7 +10,6 @@ import app.revanced.patches.youtube.misc.litho.filter.addLithoFilter
import app.revanced.patches.youtube.misc.litho.filter.lithoFilterPatch
import app.revanced.patches.youtube.misc.settings.PreferenceScreen
@Suppress("unused")
val hideButtonsPatch = resourcePatch(
name = "Hide video action buttons",
description = "Adds options to hide action buttons (such as the Download button) under videos.",
@@ -29,6 +28,7 @@ val hideButtonsPatch = resourcePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -19,7 +19,6 @@ import app.revanced.util.indexOfFirstInstructionOrThrow
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
import com.sun.org.apache.bcel.internal.generic.InstructionConst.getInstruction
internal const val EXTENSION_CLASS_DESCRIPTOR =
"Lapp/revanced/extension/youtube/patches/NavigationButtonsPatch;"
@@ -43,6 +42,7 @@ val navigationButtonsPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -60,6 +60,7 @@ val hidePlayerOverlayButtonsPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -62,6 +62,7 @@ val hideEndscreenCardsPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -17,7 +17,6 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
internal const val EXTENSION_CLASS_DESCRIPTOR =
"Lapp/revanced/extension/youtube/patches/DisableFullscreenAmbientModePatch;"
@Suppress("unused")
val disableFullscreenAmbientModePatch = bytecodePatch(
name = "Disable fullscreen ambient mode",
description = "Adds an option to disable the ambient mode when in fullscreen.",
@@ -36,6 +35,7 @@ val disableFullscreenAmbientModePatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -107,7 +107,6 @@ private const val CUSTOM_FILTER_CLASS_NAME =
private const val KEYWORD_FILTER_CLASS_NAME =
"Lapp/revanced/extension/youtube/patches/components/KeywordContentFilter;"
@Suppress("unused")
val hideLayoutComponentsPatch = bytecodePatch(
name = "Hide layout components",
description = "Adds options to hide general layout components.",
@@ -129,6 +128,7 @@ val hideLayoutComponentsPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -63,6 +63,7 @@ val hideInfoCardsPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -11,7 +11,6 @@ import app.revanced.patches.youtube.misc.playertype.playerTypeHookPatch
import app.revanced.patches.youtube.misc.settings.PreferenceScreen
import app.revanced.patches.youtube.misc.settings.settingsPatch
@Suppress("unused")
val hidePlayerFlyoutMenuPatch = bytecodePatch(
name = "Hide player flyout menu items",
description = "Adds options to hide menu items that appear when pressing the gear icon in the video player.",
@@ -31,6 +30,7 @@ val hidePlayerFlyoutMenuPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -17,7 +17,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
private const val EXTENSION_CLASS_DESCRIPTOR =
"Lapp/revanced/extension/youtube/patches/DisableRollingNumberAnimationsPatch;"
@Suppress("unused")
val disableRollingNumberAnimationPatch = bytecodePatch(
name = "Disable rolling number animations",
description = "Adds an option to disable rolling number animations of video view count, user likes, and upload time.",
@@ -36,6 +35,7 @@ val disableRollingNumberAnimationPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -12,7 +12,6 @@ import app.revanced.patches.youtube.misc.settings.settingsPatch
import app.revanced.patches.youtube.shared.seekbarFingerprint
import app.revanced.patches.youtube.shared.seekbarOnDrawFingerprint
@Suppress("unused")
val hideSeekbarPatch = bytecodePatch(
name = "Hide seekbar",
description = "Adds an option to hide the seekbar.",
@@ -32,6 +31,7 @@ val hideSeekbarPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -29,7 +29,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
import com.sun.org.apache.bcel.internal.generic.InstructionConst.getInstruction
internal var reelMultipleItemShelfId = -1L
private set
@@ -189,9 +188,13 @@ val hideShortsComponentsPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)
hideShortsAppShortcutOption()
hideShortsWidgetOption()
execute {
// region Hide the Shorts shelf.

View File

@@ -60,6 +60,7 @@ val disableSuggestedVideoEndScreenPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -9,7 +9,6 @@ import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch
import app.revanced.patches.youtube.misc.settings.PreferenceScreen
import app.revanced.patches.youtube.misc.settings.settingsPatch
@Suppress("unused")
val hideTimestampPatch = bytecodePatch(
name = "Hide timestamp",
description = "Adds an option to hide the timestamp in the bottom left of the video player.",
@@ -28,6 +27,7 @@ val hideTimestampPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -43,6 +43,7 @@ internal const val MINIPLAYER_DRAG_DROP_FEATURE_KEY = 45628752L
internal const val MINIPLAYER_HORIZONTAL_DRAG_FEATURE_KEY = 45658112L
internal const val MINIPLAYER_ROUNDED_CORNERS_FEATURE_KEY = 45652224L
internal const val MINIPLAYER_INITIAL_SIZE_FEATURE_KEY = 45640023L
internal const val MINIPLAYER_DISABLED_FEATURE_KEY = 45657015L
internal val miniplayerModernConstructorFingerprint = fingerprint {
accessFlags(AccessFlags.PUBLIC, AccessFlags.CONSTRUCTOR)
@@ -50,6 +51,12 @@ internal val miniplayerModernConstructorFingerprint = fingerprint {
literal { 45623000L }
}
internal val miniplayerOnCloseHandlerFingerprint = fingerprint {
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
returns("Z")
literal { MINIPLAYER_DISABLED_FEATURE_KEY }
}
/**
* Matches using the class found in [miniplayerModernViewParentFingerprint].
*/

View File

@@ -147,8 +147,7 @@ val miniplayerPatch = bytecodePatch(
compatibleWith(
"com.google.android.youtube"(
"18.38.44",
"18.49.37",
// 18.49.37 // Could be supported, but no reason when 19.16 exists and has modern types.
// 19.14.43 // Incomplete code for modern miniplayers.
// 19.15.36 // Different code for handling subtitle texts and not worth supporting.
"19.16.39", // First with modern miniplayers.
@@ -170,6 +169,7 @@ val miniplayerPatch = bytecodePatch(
// 19.33.35
"19.34.42",
"19.43.41",
"19.45.38",
),
)
@@ -178,58 +178,60 @@ val miniplayerPatch = bytecodePatch(
val preferences = mutableSetOf<BasePreference>()
if (!is_19_16_or_greater) {
preferences += ListPreference(
"revanced_miniplayer_type",
summaryKey = null,
entriesKey = "revanced_miniplayer_type_legacy_entries",
entryValuesKey = "revanced_miniplayer_type_legacy_entry_values",
)
} else {
preferences += ListPreference(
"revanced_miniplayer_type",
summaryKey = null,
)
if (is_19_25_or_greater) {
if (!is_19_29_or_greater) {
preferences += SwitchPreference("revanced_miniplayer_double_tap_action")
}
preferences += SwitchPreference("revanced_miniplayer_drag_and_drop")
}
preferences +=
if (is_19_43_or_greater) {
preferences += SwitchPreference("revanced_miniplayer_horizontal_drag")
}
if (is_19_36_or_greater) {
preferences += SwitchPreference("revanced_miniplayer_rounded_corners")
}
preferences += SwitchPreference("revanced_miniplayer_hide_subtext")
preferences += if (is_19_26_or_greater) {
SwitchPreference("revanced_miniplayer_hide_expand_close")
ListPreference(
"revanced_miniplayer_type",
summaryKey = null,
)
} else {
SwitchPreference(
key = "revanced_miniplayer_hide_expand_close",
titleKey = "revanced_miniplayer_hide_expand_close_legacy_title",
summaryOnKey = "revanced_miniplayer_hide_expand_close_legacy_summary_on",
summaryOffKey = "revanced_miniplayer_hide_expand_close_legacy_summary_off",
ListPreference(
"revanced_miniplayer_type",
summaryKey = null,
entriesKey = "revanced_miniplayer_type_legacy_entries",
entryValuesKey = "revanced_miniplayer_type_legacy_entry_values",
)
}
if (!is_19_26_or_greater) {
preferences += SwitchPreference("revanced_miniplayer_hide_rewind_forward")
if (is_19_25_or_greater) {
if (!is_19_29_or_greater) {
preferences += SwitchPreference("revanced_miniplayer_double_tap_action")
}
if (is_19_26_or_greater) {
preferences += TextPreference("revanced_miniplayer_width_dip", inputType = InputType.NUMBER)
}
preferences += TextPreference("revanced_miniplayer_opacity", inputType = InputType.NUMBER)
preferences += SwitchPreference("revanced_miniplayer_drag_and_drop")
}
if (is_19_43_or_greater) {
preferences += SwitchPreference("revanced_miniplayer_horizontal_drag")
}
if (is_19_36_or_greater) {
preferences += SwitchPreference("revanced_miniplayer_rounded_corners")
}
preferences += SwitchPreference("revanced_miniplayer_hide_subtext")
preferences += if (is_19_26_or_greater) {
SwitchPreference("revanced_miniplayer_hide_expand_close")
} else {
SwitchPreference(
key = "revanced_miniplayer_hide_expand_close",
titleKey = "revanced_miniplayer_hide_expand_close_legacy_title",
summaryOnKey = "revanced_miniplayer_hide_expand_close_legacy_summary_on",
summaryOffKey = "revanced_miniplayer_hide_expand_close_legacy_summary_off",
)
}
if (!is_19_26_or_greater) {
preferences += SwitchPreference("revanced_miniplayer_hide_rewind_forward")
}
if (is_19_26_or_greater) {
preferences += TextPreference("revanced_miniplayer_width_dip", inputType = InputType.NUMBER)
}
preferences += TextPreference("revanced_miniplayer_opacity", inputType = InputType.NUMBER)
PreferenceScreen.PLAYER.addPreferences(
PreferenceScreenPreference(
key = "revanced_miniplayer_screen",
@@ -349,11 +351,6 @@ val miniplayerPatch = bytecodePatch(
it.method.insertLegacyTabletMiniplayerOverride(it.patternMatch!!.endIndex)
}
if (!is_19_16_or_greater) {
// Return here, as patch below is only for the current versions of the app.
return@execute
}
// endregion
// region Enable modern miniplayer.
@@ -379,13 +376,6 @@ val miniplayerPatch = bytecodePatch(
)
}
if (is_19_43_or_greater) {
miniplayerModernConstructorFingerprint.insertLiteralValueBooleanOverride(
MINIPLAYER_HORIZONTAL_DRAG_FEATURE_KEY,
"setHorizontalDrag",
)
}
if (is_19_25_or_greater) {
miniplayerModernConstructorFingerprint.insertLiteralValueBooleanOverride(
MINIPLAYER_MODERN_FEATURE_LEGACY_KEY,
@@ -442,6 +432,18 @@ val miniplayerPatch = bytecodePatch(
)
}
if (is_19_43_or_greater) {
miniplayerOnCloseHandlerFingerprint.insertLiteralValueBooleanOverride(
MINIPLAYER_DISABLED_FEATURE_KEY,
"getMiniplayerOnCloseHandler"
)
miniplayerModernConstructorFingerprint.insertLiteralValueBooleanOverride(
MINIPLAYER_HORIZONTAL_DRAG_FEATURE_KEY,
"setHorizontalDrag",
)
}
// endregion
// region Fix 19.16 using mixed up drawables for tablet modern.

View File

@@ -9,7 +9,6 @@ import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch
import app.revanced.patches.youtube.misc.settings.PreferenceScreen
import app.revanced.patches.youtube.misc.settings.settingsPatch
@Suppress("unused")
val playerPopupPanelsPatch = bytecodePatch(
name = "Disable player popup panels",
description = "Adds an option to disable panels (such as live chat) from opening automatically.",
@@ -28,6 +27,7 @@ val playerPopupPanelsPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -18,6 +18,7 @@ val playerControlsBackgroundPatch = resourcePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -58,6 +58,7 @@ val customPlayerOverlayOpacityPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -31,7 +31,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
import com.android.tools.smali.dexlib2.iface.reference.FieldReference
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
import com.android.tools.smali.dexlib2.iface.reference.TypeReference
import com.sun.org.apache.bcel.internal.generic.InstructionConst.getInstruction
private const val EXTENSION_CLASS_DESCRIPTOR =
"Lapp/revanced/extension/youtube/patches/ReturnYouTubeDislikePatch;"
@@ -39,7 +38,6 @@ private const val EXTENSION_CLASS_DESCRIPTOR =
private const val FILTER_CLASS_DESCRIPTOR =
"Lapp/revanced/extension/youtube/patches/components/ReturnYouTubeDislikeFilterPatch;"
@Suppress("unused")
val returnYouTubeDislikePatch = bytecodePatch(
name = "Return YouTube Dislike",
description = "Adds an option to show the dislike count of videos with Return YouTube Dislike.",
@@ -61,6 +59,7 @@ val returnYouTubeDislikePatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -17,7 +17,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
private const val EXTENSION_CLASS_DESCRIPTOR =
"Lapp/revanced/extension/youtube/patches/WideSearchbarPatch;"
@Suppress("unused")
val wideSearchbarPatch = bytecodePatch(
name = "Wide searchbar",
description = "Adds an option to replace the search icon with a wide search bar. This will hide the YouTube logo when active.",
@@ -36,6 +35,7 @@ val wideSearchbarPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -48,3 +48,17 @@ internal val lithoLinearGradientFingerprint = fingerprint {
returns("Landroid/graphics/LinearGradient;")
parameters("F", "F", "F", "F", "[I", "[F")
}
internal const val launchScreenLayoutTypeLotteFeatureFlag = 268507948L
internal val launchScreenLayoutTypeFingerprint = fingerprint {
accessFlags(AccessFlags.PUBLIC, AccessFlags.CONSTRUCTOR)
returns("V")
custom { method, _ ->
val firstParameter = method.parameterTypes.firstOrNull()
// 19.25 - 19.45
(firstParameter == "Lcom/google/android/apps/youtube/app/watchwhile/MainActivity;"
|| firstParameter == "Landroid/app/Activity;") // 19.46+
&& method.containsLiteralInstruction(launchScreenLayoutTypeLotteFeatureFlag)
}
}

View File

@@ -13,15 +13,24 @@ import app.revanced.patches.shared.misc.mapping.resourceMappings
import app.revanced.patches.youtube.layout.theme.lithoColorHookPatch
import app.revanced.patches.youtube.layout.theme.lithoColorOverrideHook
import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch
import app.revanced.patches.youtube.misc.playservice.is_19_23_or_greater
import app.revanced.patches.youtube.misc.playservice.is_19_25_or_greater
import app.revanced.patches.youtube.misc.playservice.is_19_46_or_greater
import app.revanced.patches.youtube.misc.playservice.versionCheckPatch
import app.revanced.patches.youtube.misc.settings.settingsPatch
import app.revanced.patches.youtube.shared.mainActivityOnCreateFingerprint
import app.revanced.util.copyXmlNode
import app.revanced.util.findElementByAttributeValueOrThrow
import app.revanced.util.getReference
import app.revanced.util.indexOfFirstInstructionOrThrow
import app.revanced.util.indexOfFirstLiteralInstructionOrThrow
import app.revanced.util.inputStreamFromBundledResource
import com.android.tools.smali.dexlib2.Opcode
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
import org.w3c.dom.Element
import java.io.ByteArrayInputStream
import kotlin.use
internal var reelTimeBarPlayedColorId = -1L
private set
@@ -30,6 +39,8 @@ internal var inlineTimeBarColorizedBarPlayedColorDarkId = -1L
internal var inlineTimeBarPlayedNotHighlightedColorId = -1L
private set
internal const val splashSeekbarColorAttributeName = "splash_custom_seekbar_color"
private val seekbarColorResourcePatch = resourcePatch {
dependsOn(
settingsPatch,
@@ -51,9 +62,8 @@ private val seekbarColorResourcePatch = resourcePatch {
"inline_time_bar_played_not_highlighted_color",
]
// Edit the resume playback drawable and replace the progress bar with a custom drawable
// Modify the resume playback drawable and replace the progress bar with a custom drawable.
document("res/drawable/resume_playback_progressbar_drawable.xml").use { document ->
val layerList = document.getElementsByTagName("layer-list").item(0) as Element
val progressNode = layerList.getElementsByTagName("item").item(1) as Element
if (!progressNode.getAttributeNode("android:id").value.endsWith("progress")) {
@@ -66,9 +76,102 @@ private val seekbarColorResourcePatch = resourcePatch {
)
scaleNode.replaceChild(replacementNode, shapeNode)
}
if (!is_19_25_or_greater) {
return@execute
}
// Add attribute and styles for splash screen custom color.
// Using a style is the only way to selectively change just the seekbar fill color.
//
// Because the style colors must be hard coded for all color possibilities,
// instead of allowing 24 bit color the style is restricted to 9-bit (3 bits per color channel)
// and the style color closest to the users custom color is used for the splash screen.
arrayOf(
inputStreamFromBundledResource("seekbar/values", "attrs.xml")!! to "res/values/attrs.xml",
ByteArrayInputStream(create9BitSeekbarColorStyles().toByteArray()) to "res/values/styles.xml"
).forEach { (source, destination) ->
"resources".copyXmlNode(
document(source),
document(destination),
).close()
}
fun setSplashDrawablePathFillColor(xmlFileNames: Iterable<String>, vararg resourceNames: String) {
xmlFileNames.forEach { xmlFileName ->
document(xmlFileName).use { document ->
resourceNames.forEach { elementId ->
val element = document.childNodes.findElementByAttributeValueOrThrow(
"android:name",
elementId
)
val attribute = "android:fillColor"
if (!element.hasAttribute(attribute)) {
throw PatchException("Could not find $attribute for $elementId")
}
element.setAttribute(attribute, "?attr/$splashSeekbarColorAttributeName")
}
}
}
}
setSplashDrawablePathFillColor(
listOf(
"res/drawable/\$startup_animation_light__0.xml",
"res/drawable/\$startup_animation_dark__0.xml"
),
"_R_G_L_10_G_D_0_P_0"
)
if (!is_19_46_or_greater) {
// Resources removed in 19.46+
setSplashDrawablePathFillColor(
listOf(
"res/drawable/\$buenos_aires_animation_light__0.xml",
"res/drawable/\$buenos_aires_animation_dark__0.xml"
),
"_R_G_L_8_G_D_0_P_0"
)
}
}
}
/**
* Generate a style xml with all combinations of 9-bit colors.
*/
private fun create9BitSeekbarColorStyles(): String = StringBuilder().apply {
append("<?xml version=\"1.0\" encoding=\"utf-8\"?>")
append("<resources>\n")
for (red in 0..7) {
for (green in 0..7) {
for (blue in 0..7) {
val name = "${red}_${green}_${blue}"
fun roundTo3BitHex(channel8Bits: Int) =
(channel8Bits * 255 / 7).toString(16).padStart(2, '0')
val r = roundTo3BitHex(red)
val g = roundTo3BitHex(green)
val b = roundTo3BitHex(blue)
val color = "#ff$r$g$b"
append(
"""
<style name="splash_seekbar_color_style_$name">
<item name="$splashSeekbarColorAttributeName">$color</item>
</style>
"""
)
}
}
}
append("</resources>")
}.toString()
private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/theme/SeekbarColorPatch;"
val seekbarColorPatch = bytecodePatch(
@@ -117,27 +220,73 @@ val seekbarColorPatch = bytecodePatch(
}
}
if (is_19_23_or_greater) {
playerSeekbarGradientConfigFingerprint.method.apply {
val literalIndex = indexOfFirstLiteralInstructionOrThrow(PLAYER_SEEKBAR_GRADIENT_FEATURE_FLAG)
lithoColorOverrideHook(EXTENSION_CLASS_DESCRIPTOR, "getLithoColor")
if (!is_19_25_or_greater) {
return@execute
}
// 19.25+ changes
playerSeekbarGradientConfigFingerprint.method.apply {
val literalIndex = indexOfFirstLiteralInstructionOrThrow(PLAYER_SEEKBAR_GRADIENT_FEATURE_FLAG)
val resultIndex = indexOfFirstInstructionOrThrow(literalIndex, Opcode.MOVE_RESULT)
val register = getInstruction<OneRegisterInstruction>(resultIndex).registerA
addInstructions(
resultIndex + 1,
"""
invoke-static { v$register }, $EXTENSION_CLASS_DESCRIPTOR->playerSeekbarGradientEnabled(Z)Z
move-result v$register
"""
)
}
lithoLinearGradientFingerprint.method.addInstruction(
0,
"invoke-static/range { p4 .. p5 }, $EXTENSION_CLASS_DESCRIPTOR->setLinearGradient([I[F)V"
)
// region apply seekbar custom color to splash screen animation.
// Don't use the lotte splash screen layout if using custom seekbar.
arrayOf(
launchScreenLayoutTypeFingerprint,
mainActivityOnCreateFingerprint
).forEach { fingerprint ->
fingerprint.method.apply {
val literalIndex = indexOfFirstLiteralInstructionOrThrow(launchScreenLayoutTypeLotteFeatureFlag)
val resultIndex = indexOfFirstInstructionOrThrow(literalIndex, Opcode.MOVE_RESULT)
val register = getInstruction<OneRegisterInstruction>(resultIndex).registerA
addInstructions(
resultIndex + 1,
"""
invoke-static { v$register }, $EXTENSION_CLASS_DESCRIPTOR->playerSeekbarGradientEnabled(Z)Z
invoke-static { v$register }, $EXTENSION_CLASS_DESCRIPTOR->useLotteLaunchSplashScreen(Z)Z
move-result v$register
""",
"""
)
}
}
lithoLinearGradientFingerprint.method.addInstruction(
0,
"invoke-static/range { p4 .. p5 }, $EXTENSION_CLASS_DESCRIPTOR->setLinearGradient([I[F)V",
// Hook the splash animation drawable to set the a seekbar color theme.
mainActivityOnCreateFingerprint.method.apply {
val drawableIndex = indexOfFirstInstructionOrThrow {
val reference = getReference<MethodReference>()
reference?.definingClass == "Landroid/widget/ImageView;"
&& reference.name == "getDrawable"
}
val checkCastIndex = indexOfFirstInstructionOrThrow(drawableIndex, Opcode.CHECK_CAST)
val drawableRegister = getInstruction<OneRegisterInstruction>(checkCastIndex).registerA
addInstruction(
checkCastIndex + 1,
"invoke-static { v$drawableRegister }, $EXTENSION_CLASS_DESCRIPTOR->" +
"setSplashAnimationDrawableTheme(Landroid/graphics/drawable/AnimatedVectorDrawable;)V"
)
}
lithoColorOverrideHook(EXTENSION_CLASS_DESCRIPTOR, "getLithoColor")
// endregion
}
}

View File

@@ -19,7 +19,6 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/ShortsAutoplayPatch;"
@Suppress("unused")
val shortsAutoplayPatch = bytecodePatch(
name = "Shorts autoplay",
description = "Adds options to automatically play the next Short.",
@@ -38,6 +37,7 @@ val shortsAutoplayPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)
@@ -56,7 +56,7 @@ val shortsAutoplayPatch = bytecodePatch(
// Main activity is used to check if app is in pip mode.
mainActivityOnCreateFingerprint.method.addInstructions(
0,
1,
"invoke-static/range { p0 .. p0 }, $EXTENSION_CLASS_DESCRIPTOR->" +
"setMainActivity(Landroid/app/Activity;)V",
)

View File

@@ -117,6 +117,7 @@ val sponsorBlockPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -17,7 +17,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
private const val EXTENSION_CLASS_DESCRIPTOR =
"Lapp/revanced/extension/youtube/patches/spoof/SpoofAppVersionPatch;"
@Suppress("unused")
val spoofAppVersionPatch = bytecodePatch(
name = "Spoof app version",
description = "Adds an option to trick YouTube into thinking you are running an older version of the app. " +
@@ -39,6 +38,7 @@ val spoofAppVersionPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -17,7 +17,6 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference
private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/ChangeStartPagePatch;"
@Suppress("unused")
val changeStartPagePatch = bytecodePatch(
name = "Change start page",
description = "Adds an option to set which page the app opens in instead of the homepage.",
@@ -36,6 +35,7 @@ val changeStartPagePatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -19,7 +19,6 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
private const val EXTENSION_CLASS_DESCRIPTOR =
"Lapp/revanced/extension/youtube/patches/DisableResumingStartupShortsPlayerPatch;"
@Suppress("unused")
val disableResumingShortsOnStartupPatch = bytecodePatch(
name = "Disable resuming Shorts on startup",
description = "Adds an option to disable the Shorts player from resuming on app startup when Shorts were last being watched.",
@@ -38,6 +37,7 @@ val disableResumingShortsOnStartupPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -14,7 +14,6 @@ import app.revanced.patches.youtube.misc.settings.settingsPatch
const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/TabletLayoutPatch;"
@Suppress("unused")
val enableTabletLayoutPatch = bytecodePatch(
name = "Enable tablet layout",
description = "Adds an option to enable tablet layout.",
@@ -33,6 +32,7 @@ val enableTabletLayoutPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -28,7 +28,6 @@ private const val EXTENSION_CLASS_DESCRIPTOR =
internal const val GRADIENT_LOADING_SCREEN_AB_CONSTANT = 45412406L
@Suppress("unused")
val themePatch = bytecodePatch(
name = "Theme",
description = "Adds options for theming and applies a custom background theme (dark background theme defaults to amoled black).",
@@ -201,6 +200,7 @@ val themePatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -19,7 +19,6 @@ import app.revanced.patches.youtube.misc.settings.settingsPatch
private const val EXTENSION_CLASS_DESCRIPTOR =
"Lapp/revanced/extension/youtube/patches/AlternativeThumbnailsPatch;"
@Suppress("unused")
val alternativeThumbnailsPatch = bytecodePatch(
name = "Alternative thumbnails",
description = "Adds options to replace video thumbnails using the DeArrow API or image captures from the video.",
@@ -40,6 +39,7 @@ val alternativeThumbnailsPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -13,7 +13,6 @@ import app.revanced.patches.youtube.misc.settings.settingsPatch
private const val EXTENSION_CLASS_DESCRIPTOR =
"Lapp/revanced/extension/youtube/patches/BypassImageRegionRestrictionsPatch;"
@Suppress("unused")
val bypassImageRegionRestrictionsPatch = bytecodePatch(
name = "Bypass image region restrictions",
description = "Adds an option to use a different host for user avatar and channel images " +
@@ -34,6 +33,7 @@ val bypassImageRegionRestrictionsPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -12,7 +12,6 @@ import app.revanced.patches.youtube.shared.mainActivityOnCreateFingerprint
private const val EXTENSION_CLASS_DESCRIPTOR =
"Lapp/revanced/extension/youtube/patches/announcements/AnnouncementsPatch;"
@Suppress("unused")
val announcementsPatch = bytecodePatch(
name = "Announcements",
description = "Adds an option to show announcements from ReVanced on app startup.",
@@ -30,6 +29,7 @@ val announcementsPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -11,10 +11,8 @@ import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch
import app.revanced.patches.youtube.misc.settings.PreferenceScreen
import app.revanced.patches.youtube.shared.autoRepeatFingerprint
import app.revanced.patches.youtube.shared.autoRepeatParentFingerprint
import org.stringtemplate.v4.compiler.Bytecode.instructions
// TODO: Rename this patch to AlwaysRepeatPatch (as well as strings and references in the extension).
@Suppress("unused")
val autoRepeatPatch = bytecodePatch(
name = "Always repeat",
description = "Adds an option to always repeat videos when they end.",
@@ -32,6 +30,7 @@ val autoRepeatPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -54,6 +54,7 @@ val backgroundPlaybackPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -17,7 +17,6 @@ import com.android.tools.smali.dexlib2.Opcode
private const val EXTENSION_CLASS_DESCRIPTOR =
"Lapp/revanced/extension/youtube/patches/EnableDebuggingPatch;"
@Suppress("unused")
val enableDebuggingPatch = bytecodePatch(
name = "Enable debugging",
description = "Adds options for debugging.",
@@ -36,6 +35,7 @@ val enableDebuggingPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -12,7 +12,6 @@ import app.revanced.patches.youtube.misc.settings.settingsPatch
private const val EXTENSION_CLASS_DESCRIPTOR =
"Lapp/revanced/extension/youtube/patches/spoof/SpoofDeviceDimensionsPatch;"
@Suppress("unused")
val spoofDeviceDimensionsPatch = bytecodePatch(
name = "Spoof device dimensions",
description = "Adds an option to spoof the device dimensions which can unlock higher video qualities.",
@@ -31,6 +30,7 @@ val spoofDeviceDimensionsPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -9,7 +9,6 @@ import app.revanced.patches.youtube.shared.mainActivityOnCreateFingerprint
private const val EXTENSION_CLASS_DESCRIPTOR =
"Lapp/revanced/extension/youtube/patches/CheckWatchHistoryDomainNameResolutionPatch;"
@Suppress("unused")
val checkWatchHistoryDomainNameResolutionPatch = bytecodePatch(
name = "Check watch history domain name resolution",
description = "Checks if the device DNS server is preventing user watch history from being saved.",
@@ -24,6 +23,7 @@ val checkWatchHistoryDomainNameResolutionPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -43,6 +43,7 @@ val spoofVideoStreamsPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -41,6 +41,7 @@ val gmsCoreSupportPatch = gmsCoreSupportPatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)
}

View File

@@ -17,7 +17,6 @@ import com.android.tools.smali.dexlib2.iface.Method
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
@Suppress("unused")
val bypassURLRedirectsPatch = bytecodePatch(
name = "Bypass URL redirects",
description = "Adds an option to bypass URL redirects and open the original URL directly.",
@@ -37,6 +36,7 @@ val bypassURLRedirectsPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -10,7 +10,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
import com.android.tools.smali.dexlib2.iface.reference.StringReference
@Suppress("unused")
val openLinksExternallyPatch = bytecodePatch(
name = "Open links externally",
description = "Adds an option to always open links in your browser instead of in the in-app-browser.",
@@ -48,6 +47,7 @@ val openLinksExternallyPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -37,6 +37,8 @@ var is_19_41_or_greater = false
private set
var is_19_43_or_greater = false
private set
var is_19_46_or_greater = false
private set
val versionCheckPatch = resourcePatch(
description = "Uses the Play Store service version to find the major/minor version of the YouTube target app.",
@@ -68,5 +70,6 @@ val versionCheckPatch = resourcePatch(
is_19_36_or_greater = 243705000 <= playStoreServicesVersion
is_19_41_or_greater = 244305000 <= playStoreServicesVersion
is_19_43_or_greater = 244405000 <= playStoreServicesVersion
is_19_46_or_greater = 244705000 <= playStoreServicesVersion
}
}

View File

@@ -18,7 +18,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
private const val EXTENSION_CLASS_DESCRIPTOR =
"Lapp/revanced/extension/youtube/patches/RemoveTrackingQueryParameterPatch;"
@Suppress("unused")
val removeTrackingQueryParameterPatch = bytecodePatch(
name = "Remove tracking query parameter",
description = "Adds an option to remove the tracking info from links you share.",
@@ -37,6 +36,7 @@ val removeTrackingQueryParameterPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -10,7 +10,6 @@ import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
import app.revanced.patches.youtube.misc.settings.PreferenceScreen
import app.revanced.patches.youtube.misc.settings.settingsPatch
@Suppress("unused")
val zoomHapticsPatch = bytecodePatch(
name = "Disable zoom haptics",
description = "Adds an option to disable haptics when zooming.",
@@ -28,6 +27,7 @@ val zoomHapticsPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -111,7 +111,7 @@ val playerResponseMethodHookPatch = bytecodePatch {
}
}
sealed class Hook private constructor(private val methodDescriptor: String) {
sealed class Hook(private val methodDescriptor: String) {
class VideoId(methodDescriptor: String) : Hook(methodDescriptor)
class ProtoBufferParameter(methodDescriptor: String) : Hook(methodDescriptor)

View File

@@ -18,12 +18,10 @@ import app.revanced.patches.youtube.video.information.videoInformationPatch
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
import com.android.tools.smali.dexlib2.iface.reference.FieldReference
import com.sun.org.apache.bcel.internal.generic.InstructionConst.getInstruction
private const val EXTENSION_CLASS_DESCRIPTOR =
"Lapp/revanced/extension/youtube/patches/playback/quality/RememberVideoQualityPatch;"
@Suppress("unused")
val rememberVideoQualityPatch = bytecodePatch(
name = "Remember video quality",
description = "Adds an option to remember the last video quality selected.",
@@ -43,6 +41,7 @@ val rememberVideoQualityPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -25,6 +25,7 @@ val playbackSpeedPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)
}

View File

@@ -80,6 +80,7 @@ val restoreOldVideoQualityMenuPatch = bytecodePatch(
"19.25.37",
"19.34.42",
"19.43.41",
"19.45.38",
),
)

View File

@@ -114,7 +114,6 @@ fun String.copyXmlNode(
target: Document,
): AutoCloseable {
val hostNodes = source.getElementsByTagName(this).item(0).childNodes
val destinationNode = target.getElementsByTagName(this).item(0)
for (index in 0 until hostNodes.length) {

View File

@@ -208,6 +208,7 @@ This is because Crowdin requires temporarily flattening this file and removing t
<patch id="misc.zoomhaptics.zoomHapticsPatch">
</patch>
<patch id="video.quality.rememberVideoQualityPatch">
<!-- Translations should use the same text as revanced_custom_playback_speeds_auto -->
</patch>
<patch id="video.speed.button.playbackSpeedButtonPatch">
</patch>

Some files were not shown because too many files have changed in this diff Show More