Compare commits
43 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
541a1a0e0a | ||
|
|
ce2f7042da | ||
|
|
ca3438b640 | ||
|
|
5121c3d45b | ||
|
|
666b241a53 | ||
|
|
b961bdf9d3 | ||
|
|
8aa1d58b76 | ||
|
|
570723bb59 | ||
|
|
7027929e30 | ||
|
|
f11f269c2f | ||
|
|
b0cd520b1a | ||
|
|
5c0fd8a6da | ||
|
|
e34d67f01e | ||
|
|
72703d6a56 | ||
|
|
b8c473796a | ||
|
|
25e86c5545 | ||
|
|
f1bf2c589b | ||
|
|
8b54559953 | ||
|
|
3761dbd7b2 | ||
|
|
8cf0343f29 | ||
|
|
f3753a22da | ||
|
|
c90312a925 | ||
|
|
c1d6aa3e49 | ||
|
|
c097370960 | ||
|
|
8ffa3b4746 | ||
|
|
1e6d0f7f62 | ||
|
|
e73c5dfebd | ||
|
|
32309ac007 | ||
|
|
079800aa1a | ||
|
|
06f0d05d19 | ||
|
|
c618a18851 | ||
|
|
1aac521af3 | ||
|
|
68fe1cc792 | ||
|
|
ba519d4b10 | ||
|
|
0351c8a50d | ||
|
|
d0c4ac5d8a | ||
|
|
daa55c59e2 | ||
|
|
4ad057b748 | ||
|
|
3eaefc7979 | ||
|
|
d81ce614a8 | ||
|
|
dcd711b341 | ||
|
|
96d500bc70 | ||
|
|
031b517245 |
140
CHANGELOG.md
@@ -1,3 +1,143 @@
|
||||
## [2.92.2](https://github.com/revanced/revanced-patches/compare/v2.92.1...v2.92.2) (2022-10-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube/theme:** theme missing gray color ([#873](https://github.com/revanced/revanced-patches/issues/873)) ([5267d56](https://github.com/revanced/revanced-patches/commit/5267d56a05b4053d556171ffd2d2870f3f932e8e))
|
||||
|
||||
## [2.92.1](https://github.com/revanced/revanced-patches/compare/v2.92.0...v2.92.1) (2022-10-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube/custom-branding:** use proper scaled icons ([24b5bcd](https://github.com/revanced/revanced-patches/commit/24b5bcdd703474c940fd436a37f0ae924d8b8c74))
|
||||
|
||||
# [2.92.0](https://github.com/revanced/revanced-patches/compare/v2.91.0...v2.92.0) (2022-10-26)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **youtube/hide-mix-playlists:** hide in video suggestions ([#854](https://github.com/revanced/revanced-patches/issues/854)) ([acde5f0](https://github.com/revanced/revanced-patches/commit/acde5f066053ca3d58ca09fc2a6a1381ba27d84b))
|
||||
|
||||
# [2.91.0](https://github.com/revanced/revanced-patches/compare/v2.90.0...v2.91.0) (2022-10-26)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* remove partially complete patch ([d212e19](https://github.com/revanced/revanced-patches/commit/d212e19c3276c2ba6550f03dfd9bba47b7773524))
|
||||
|
||||
# [2.90.0](https://github.com/revanced/revanced-patches/compare/v2.89.0...v2.90.0) (2022-10-25)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* `comment` patch ([#858](https://github.com/revanced/revanced-patches/issues/858)) ([472fb4f](https://github.com/revanced/revanced-patches/commit/472fb4f3747c835be2c5069a0f65017ab42f8d7e))
|
||||
|
||||
# [2.89.0](https://github.com/revanced/revanced-patches/compare/v2.88.0...v2.89.0) (2022-10-25)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* `hide-album-cards` patch ([#857](https://github.com/revanced/revanced-patches/issues/857)) ([bce9d0c](https://github.com/revanced/revanced-patches/commit/bce9d0c9405d7afd5c51c2a9c2c247f3ff7581f5))
|
||||
|
||||
# [2.88.0](https://github.com/revanced/revanced-patches/compare/v2.87.0...v2.88.0) (2022-10-25)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* `hide-artist-card` patch ([#859](https://github.com/revanced/revanced-patches/issues/859)) ([1f76246](https://github.com/revanced/revanced-patches/commit/1f7624680b86e3a7afd45521bfef86f88f52c976))
|
||||
|
||||
# [2.87.0](https://github.com/revanced/revanced-patches/compare/v2.86.0...v2.87.0) (2022-10-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **metanav/fix-scaling:** use semantic versioning in package versions ([a9445a8](https://github.com/revanced/revanced-patches/commit/a9445a823e3a4885764cea9d08b51a1584d3238f))
|
||||
* **youtube/theme:** theme litho ui components & use correct theme for settings ([#791](https://github.com/revanced/revanced-patches/issues/791)) ([91c03c5](https://github.com/revanced/revanced-patches/commit/91c03c5624ca28ac13ee761261dea423f0ac42d7))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* `fix-metanav-scaling` patch ([#831](https://github.com/revanced/revanced-patches/issues/831)) ([4808e09](https://github.com/revanced/revanced-patches/commit/4808e099856e50a6f7e66834a92e2210cc84c8bc))
|
||||
* `hide-crowdfunding-box` patch ([#856](https://github.com/revanced/revanced-patches/issues/856)) ([3704ce2](https://github.com/revanced/revanced-patches/commit/3704ce22dbbff02b2e2d6dbdf9a74254a2511d3c))
|
||||
|
||||
# [2.86.0](https://github.com/revanced/revanced-patches/compare/v2.85.2...v2.86.0) (2022-10-25)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **youtube/theme:** extend theming to splash screen ([#769](https://github.com/revanced/revanced-patches/issues/769)) ([f7bb937](https://github.com/revanced/revanced-patches/commit/f7bb937ef2374d1042ea3772f03627d7f0111b78))
|
||||
|
||||
## [2.85.2](https://github.com/revanced/revanced-patches/compare/v2.85.1...v2.85.2) (2022-10-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube/integrations:** set context for remaining activities ([#828](https://github.com/revanced/revanced-patches/issues/828)) ([b2b6a3d](https://github.com/revanced/revanced-patches/commit/b2b6a3d1492bc2d5a6e27c68c74e3904764dda4b))
|
||||
|
||||
## [2.85.1](https://github.com/revanced/revanced-patches/compare/v2.85.0...v2.85.1) (2022-10-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube/theme:** extend dark mode theming ([#827](https://github.com/revanced/revanced-patches/issues/827)) ([6d803c5](https://github.com/revanced/revanced-patches/commit/6d803c5386e1f6f6fb6a7fa0a9f0bb81ee1022ac))
|
||||
|
||||
# [2.85.0](https://github.com/revanced/revanced-patches/compare/v2.84.1...v2.85.0) (2022-10-20)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **youtube:** `hide-captions-button` patch ([#770](https://github.com/revanced/revanced-patches/issues/770)) ([478af6a](https://github.com/revanced/revanced-patches/commit/478af6ad54ffdf6f99abab35a84a4f50b59d28c8))
|
||||
|
||||
## [2.84.1](https://github.com/revanced/revanced-patches/compare/v2.84.0...v2.84.1) (2022-10-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube/hide-mix-playlists:** correct switch title, summary and defaults ([#821](https://github.com/revanced/revanced-patches/issues/821)) ([f9eea33](https://github.com/revanced/revanced-patches/commit/f9eea332cea0b8c3d5c3dfff645b60861e925b5a))
|
||||
|
||||
# [2.84.0](https://github.com/revanced/revanced-patches/compare/v2.83.3...v2.84.0) (2022-10-20)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **youtube:** `hide-mix-playlists` patch ([#816](https://github.com/revanced/revanced-patches/issues/816)) ([e76c73b](https://github.com/revanced/revanced-patches/commit/e76c73b455c65aa605e418f19d88b64e0e244901))
|
||||
|
||||
## [2.83.3](https://github.com/revanced/revanced-patches/compare/v2.83.2...v2.83.3) (2022-10-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube/video-ads:** revert faulty method patch ([#820](https://github.com/revanced/revanced-patches/issues/820)) ([666248a](https://github.com/revanced/revanced-patches/commit/666248ae65d1ee84d1a278714c0dcd2528c5dd14))
|
||||
|
||||
## [2.83.2](https://github.com/revanced/revanced-patches/compare/v2.83.1...v2.83.2) (2022-10-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube/video-ads:** add back initial method to block ads ([#818](https://github.com/revanced/revanced-patches/issues/818)) ([8b02acd](https://github.com/revanced/revanced-patches/commit/8b02acd3b33c4702d81ec46dccb35604ec5fbe02))
|
||||
|
||||
## [2.83.1](https://github.com/revanced/revanced-patches/compare/v2.83.0...v2.83.1) (2022-10-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube/video-ads:** block earlier in call hirarchy ([#813](https://github.com/revanced/revanced-patches/issues/813)) ([f9517d2](https://github.com/revanced/revanced-patches/commit/f9517d2058c7561cf89b59ed36f690417dc076f7))
|
||||
|
||||
# [2.83.0](https://github.com/revanced/revanced-patches/compare/v2.82.1...v2.83.0) (2022-10-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* bump YouTube Music patches compatibility ([#809](https://github.com/revanced/revanced-patches/issues/809)) ([09f2d8e](https://github.com/revanced/revanced-patches/commit/09f2d8e14937b582bc4bfb7d3a8bb2b7622f772d))
|
||||
|
||||
## [2.82.1](https://github.com/revanced/revanced-patches/compare/v2.82.0...v2.82.1) (2022-10-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube/video-ads:** return empty ad list earlier ([a47ce9b](https://github.com/revanced/revanced-patches/commit/a47ce9ba4f75673de23eb6054f5652224a48f43e))
|
||||
|
||||
# [2.82.0](https://github.com/revanced/revanced-patches/compare/v2.81.11...v2.82.0) (2022-10-13)
|
||||
|
||||
|
||||
|
||||
194
README.md
@@ -4,23 +4,42 @@ The official Patch bundle provided by ReVanced and the community.
|
||||
|
||||
> Looking for the JSON variant of this? [Click here](patches.json).
|
||||
|
||||
### 📦 `com.reddit.frontpage`
|
||||
### 📦 `com.ss.android.ugc.trill`
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `general-reddit-ads` | Removes general ads from the Reddit frontpage and subreddits. | all |
|
||||
| `premium-icon-reddit` | Unlocking Premium Icons in reddit app. | all |
|
||||
| `tiktok-ads` | Removes ads from TikTok. | all |
|
||||
| `tiktok-speed` | Enables the playback speed option for all videos. | all |
|
||||
| `tiktok-download` | Removes download restrictions and changes the default path to download to. | all |
|
||||
| `tiktok-seekbar` | Show progress bar for all video. | all |
|
||||
| `tiktok-settings` | Add settings menu to TikTok. | all |
|
||||
| `tiktok-force-login` | Do not force login. | all |
|
||||
| `tiktok-feed-filter` | Filters tiktok videos: removing ads, removing livestreams. | all |
|
||||
</details>
|
||||
|
||||
### 📦 `com.spotify.music`
|
||||
### 📦 `com.zhiliaoapp.musically`
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `hide-premium-navbar` | Removes the premium tab from the navbar. | all |
|
||||
| `disable-capture-restriction` | Allows capturing Spotify's audio output while screen sharing or screen recording. | all |
|
||||
| `spotify-theme` | Applies a custom theme. | all |
|
||||
| `tiktok-ads` | Removes ads from TikTok. | all |
|
||||
| `tiktok-speed` | Enables the playback speed option for all videos. | all |
|
||||
| `tiktok-download` | Removes download restrictions and changes the default path to download to. | all |
|
||||
| `tiktok-seekbar` | Show progress bar for all video. | all |
|
||||
| `tiktok-settings` | Add settings menu to TikTok. | all |
|
||||
| `tiktok-force-login` | Do not force login. | all |
|
||||
| `tiktok-feed-filter` | Filters tiktok videos: removing ads, removing livestreams. | all |
|
||||
</details>
|
||||
|
||||
### 📦 `com.twitter.android`
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `timeline-ads` | Removes ads from the Twitter timeline. | all |
|
||||
| `dynamic-color` | Replaces the default Twitter Blue with the users Material You palette. | all |
|
||||
| `monochrome-icon` | Adds a monochrome icon. | all |
|
||||
</details>
|
||||
|
||||
### 📦 `de.dwd.warnapp`
|
||||
@@ -31,67 +50,14 @@ The official Patch bundle provided by ReVanced and the community.
|
||||
| `promo-code-unlock` | Disables the validation of promo code. Any code will work to unlock all features. | all |
|
||||
</details>
|
||||
|
||||
### 📦 `com.garzotto.pflotsh.ecmwf_a`
|
||||
### 📦 `com.spotify.music`
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `pflotsh-ecmwf-subscription-unlock` | Unlocks all subscription features. | 3.5.4 |
|
||||
</details>
|
||||
|
||||
### 📦 `com.ss.android.ugc.trill`
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `tiktok-speed` | Enables the playback speed option for all videos. | all |
|
||||
| `tiktok-download` | Removes download restrictions and changes the default path to download to. | all |
|
||||
| `tiktok-seekbar` | Show progress bar for all video. | all |
|
||||
| `tiktok-force-login` | Do not force login. | all |
|
||||
| `tiktok-settings` | Add settings menu to TikTok. | all |
|
||||
| `tiktok-ads` | Removes ads from TikTok. | all |
|
||||
| `tiktok-feed-filter` | Filters tiktok videos: removing ads, removing livestreams. | all |
|
||||
</details>
|
||||
|
||||
### 📦 `com.zhiliaoapp.musically`
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `tiktok-speed` | Enables the playback speed option for all videos. | all |
|
||||
| `tiktok-download` | Removes download restrictions and changes the default path to download to. | all |
|
||||
| `tiktok-seekbar` | Show progress bar for all video. | all |
|
||||
| `tiktok-force-login` | Do not force login. | all |
|
||||
| `tiktok-settings` | Add settings menu to TikTok. | all |
|
||||
| `tiktok-ads` | Removes ads from TikTok. | all |
|
||||
| `tiktok-feed-filter` | Filters tiktok videos: removing ads, removing livestreams. | all |
|
||||
</details>
|
||||
|
||||
### 📦 `com.twitter.android`
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `monochrome-icon` | Adds a monochrome icon. | all |
|
||||
| `dynamic-color` | Replaces the default Twitter Blue with the users Material You palette. | all |
|
||||
| `timeline-ads` | Removes ads from the Twitter timeline. | all |
|
||||
</details>
|
||||
|
||||
### 📦 `com.google.android.apps.youtube.music`
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `exclusive-audio-playback` | Enables the option to play music without video. | 5.26.52 |
|
||||
| `codecs-unlock` | Adds more audio codec options. The new audio codecs usually result in better audio quality. | 5.26.52 |
|
||||
| `music-microg-support` | Allows YouTube Music ReVanced to run without root and under a different package name. | 5.26.52 |
|
||||
| `music-video-ads` | Removes ads in the music player. | 5.26.52 |
|
||||
| `tasteBuilder-remover` | Removes the "Tell us which artists you like" card from the home screen. | 5.26.52 |
|
||||
| `minimized-playback-music` | Enables minimized playback on Kids music. | 5.26.52 |
|
||||
| `compact-header` | Hides the music category bar at the top of the homepage. | 5.26.52 |
|
||||
| `upgrade-button-remover` | Removes the upgrade tab from the pivot bar. | 5.26.52 |
|
||||
| `hide-get-premium` | Removes all "Get Premium" evidences from the avatar menu. | 5.26.52 |
|
||||
| `background-play` | Enables playing music in the background. | 5.26.52 |
|
||||
| `spotify-theme` | Applies a custom theme. | all |
|
||||
| `disable-capture-restriction` | Allows capturing Spotify's audio output while screen sharing or screen recording. | all |
|
||||
| `hide-premium-navbar` | Removes the premium tab from the navbar. | all |
|
||||
</details>
|
||||
|
||||
### 📦 `com.google.android.youtube`
|
||||
@@ -99,42 +65,48 @@ The official Patch bundle provided by ReVanced and the community.
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `hide-crowdfunding-box` | Hides the crowdfunding box between the player and video description. | 17.36.37 |
|
||||
| `hide-time-and-seekbar` | Hides progress bar and time counter on videos. | 17.36.37 |
|
||||
| `hide-video-buttons` | Adds options to hide action buttons under a video. | 17.36.37 |
|
||||
| `enable-wide-searchbar` | Replaces the search icon with a wide search bar. This will hide the YouTube logo when active. | 17.36.37 |
|
||||
| `hide-captions-button` | Hides the captions button on video player. | 17.36.37 |
|
||||
| `hide-shorts-button` | Hides the shorts button on the navigation bar. | 17.36.37 |
|
||||
| `hide-create-button` | Hides the create button in the navigation bar. | 17.36.37 |
|
||||
| `disable-startup-shorts-player` | Disables playing YouTube Shorts when launching YouTube. | 17.36.37 |
|
||||
| `hide-cast-button` | Hides the cast button in the video player. | all |
|
||||
| `sponsorblock` | Integrate SponsorBlock. | 17.36.37 |
|
||||
| `hide-autoplay-button` | Hides the autoplay button in the video player. | 17.36.37 |
|
||||
| `hide-album-cards` | Hides the album cards below the artist description. | 17.36.37 |
|
||||
| `disable-auto-player-popup-panels` | Disable automatic popup panels (playlist or live chat) on video player. | 17.36.37 |
|
||||
| `disable-auto-captions` | Disable forced captions from being automatically enabled. | 17.36.37 |
|
||||
| `disable-fullscreen-panels` | Disables video description and comments panel in fullscreen view. | 17.36.37 |
|
||||
| `hide-artist-card` | Hides the artist card below the searchbar. | 17.36.37 |
|
||||
| `return-youtube-dislike` | Shows the dislike count of videos using the Return YouTube Dislike API. | 17.36.37 |
|
||||
| `comments` | Hides comments components below the video player. | 17.36.37 |
|
||||
| `theme` | Applies a custom theme. | all |
|
||||
| `hide-email-address` | Hides the email address in the account switcher. | 17.36.37 |
|
||||
| `tablet-mini-player` | Enables the tablet mini player layout. | 17.36.37 |
|
||||
| `hide-watermark` | Hides creator's watermarks on videos. | 17.36.37 |
|
||||
| `hide-my-mix` | Hides mix playlists. | 17.40.41 |
|
||||
| `custom-branding` | Changes the YouTube launcher icon and name to your choice (defaults to ReVanced). | all |
|
||||
| `premium-heading` | Shows premium branding on the home screen. | all |
|
||||
| `old-quality-layout` | Enables the original quality flyout menu. | 17.36.37 |
|
||||
| `general-ads` | Removes general ads. | 17.36.37 |
|
||||
| `video-ads` | Removes ads in the video player. | 17.36.37 |
|
||||
| `hide-infocard-suggestions` | Hides infocards in videos. | 17.36.37 |
|
||||
| `swipe-controls` | Adds volume and brightness swipe controls. | 17.36.37 |
|
||||
| `downloads` | Enables downloading music and videos from YouTube. | 17.36.37 |
|
||||
| `seekbar-tapping` | Enables tap-to-seek on the seekbar of the video player. | 17.36.37 |
|
||||
| `remember-video-quality` | Adds the ability to remember the video quality you chose in the video quality flyout. | 17.36.37 |
|
||||
| `enable-debugging` | Enables app debugging by patching the manifest file. | all |
|
||||
| `custom-playback-speed` | Adds more video playback speed options. | 17.36.37 |
|
||||
| `minimized-playback` | Enables minimized and background playback. | 17.36.37 |
|
||||
| `client-spoof` | Spoofs the YouTube or Vanced client to prevent playback issues. | all |
|
||||
| `custom-video-buffer` | Lets you change the buffers of videos. | 17.36.37 |
|
||||
| `settings` | Adds settings for ReVanced to YouTube. | all |
|
||||
| `microg-support` | Allows YouTube ReVanced to run without root and under a different package name with Vanced MicroG. | 17.36.37 |
|
||||
| `hdr-auto-brightness` | Makes the brightness of HDR videos follow the system default. | 17.36.37 |
|
||||
| `custom-video-buffer` | Lets you change the buffers of videos. | 17.36.37 |
|
||||
| `client-spoof` | Spoofs the YouTube or Vanced client to prevent playback issues. | all |
|
||||
| `always-autorepeat` | Always repeats the playing video again. | 17.36.37 |
|
||||
| `general-ads` | Removes general ads. | 17.36.37 |
|
||||
| `hide-infocard-suggestions` | Hides infocards in videos. | 17.36.37 |
|
||||
| `video-ads` | Removes ads in the video player. | 17.36.37 |
|
||||
| `hide-time-and-seekbar` | Hides progress bar and time counter on videos. | 17.36.37 |
|
||||
| `old-quality-layout` | Enables the original quality flyout menu. | 17.36.37 |
|
||||
| `enable-wide-searchbar` | Replaces the search icon with a wide search bar. This will hide the YouTube logo when active. | 17.36.37 |
|
||||
| `disable-fullscreen-panels` | Disables video description and comments panel in fullscreen view. | 17.36.37 |
|
||||
| `hide-autoplay-button` | Hides the autoplay button in the video player. | 17.36.37 |
|
||||
| `disable-startup-shorts-player` | Disables playing YouTube Shorts when launching YouTube. | 17.36.37 |
|
||||
| `premium-heading` | Shows premium branding on the home screen. | all |
|
||||
| `custom-branding` | Changes the YouTube launcher icon and name to your choice (defaults to ReVanced). | all |
|
||||
| `hide-create-button` | Hides the create button in the navigation bar. | 17.36.37 |
|
||||
| `hide-shorts-button` | Hides the shorts button on the navigation bar. | 17.36.37 |
|
||||
| `hide-video-buttons` | Adds options to hide action buttons under a video. | 17.36.37 |
|
||||
| `theme` | Applies a custom theme. | all |
|
||||
| `hide-email-address` | Hides the email address in the account switcher. | 17.36.37 |
|
||||
| `sponsorblock` | Integrate SponsorBlock. | 17.36.37 |
|
||||
| `hide-cast-button` | Hides the cast button in the video player. | all |
|
||||
| `tablet-mini-player` | Enables the tablet mini player layout. | 17.36.37 |
|
||||
| `return-youtube-dislike` | Shows the dislike count of videos using the Return YouTube Dislike API. | 17.36.37 |
|
||||
| `hide-watermark` | Hides creator's watermarks on videos. | 17.36.37 |
|
||||
| `disable-auto-player-popup-panels` | Disable automatic popup panels (playlist or live chat) on video player. | 17.36.37 |
|
||||
| `disable-auto-captions` | Disable forced captions from being automatically enabled. | 17.36.37 |
|
||||
| `enable-debugging` | Enables app debugging by patching the manifest file. | all |
|
||||
| `remember-video-quality` | Adds the ability to remember the video quality you chose in the video quality flyout. | 17.36.37 |
|
||||
| `minimized-playback` | Enables minimized and background playback. | 17.36.37 |
|
||||
| `custom-playback-speed` | Adds more video playback speed options. | 17.36.37 |
|
||||
| `hdr-auto-brightness` | Makes the brightness of HDR videos follow the system default. | 17.36.37 |
|
||||
</details>
|
||||
|
||||
### 📦 `com.vanced.android.youtube`
|
||||
@@ -145,6 +117,40 @@ The official Patch bundle provided by ReVanced and the community.
|
||||
| `client-spoof` | Spoofs the YouTube or Vanced client to prevent playback issues. | all |
|
||||
</details>
|
||||
|
||||
### 📦 `com.garzotto.pflotsh.ecmwf_a`
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `pflotsh-ecmwf-subscription-unlock` | Unlocks all subscription features. | 3.5.4 |
|
||||
</details>
|
||||
|
||||
### 📦 `com.google.android.apps.youtube.music`
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `tasteBuilder-remover` | Removes the "Tell us which artists you like" card from the home screen. | 5.29.52 |
|
||||
| `hide-get-premium` | Removes all "Get Premium" evidences from the avatar menu. | 5.29.52 |
|
||||
| `minimized-playback-music` | Enables minimized playback on Kids music. | 5.29.52 |
|
||||
| `compact-header` | Hides the music category bar at the top of the homepage. | 5.29.52 |
|
||||
| `upgrade-button-remover` | Removes the upgrade tab from the pivot bar. | 5.29.52 |
|
||||
| `music-video-ads` | Removes ads in the music player. | 5.29.52 |
|
||||
| `background-play` | Enables playing music in the background. | 5.29.52 |
|
||||
| `exclusive-audio-playback` | Enables the option to play music without video. | 5.29.52 |
|
||||
| `codecs-unlock` | Adds more audio codec options. The new audio codecs usually result in better audio quality. | 5.29.52 |
|
||||
| `music-microg-support` | Allows YouTube Music ReVanced to run without root and under a different package name. | 5.29.52 |
|
||||
</details>
|
||||
|
||||
### 📦 `com.reddit.frontpage`
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `premium-icon-reddit` | Unlocks premium Reddit app icons. | all |
|
||||
| `general-reddit-ads` | Removes general ads from the Reddit frontpage and subreddits. | all |
|
||||
</details>
|
||||
|
||||
|
||||
|
||||
## 📝 JSON Format
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
kotlin.code.style = official
|
||||
version = 2.82.0
|
||||
version = 2.92.2
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51", "5.21.52", "5.22.54", "5.23.50", "5.25.51", "5.25.52", "5.26.52")
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51", "5.21.52", "5.22.54", "5.23.50", "5.25.51", "5.25.52", "5.26.52", "5.27.51", "5.28.52", "5.29.52")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51", "5.21.52", "5.22.54", "5.23.50", "5.25.51", "5.25.52", "5.26.52")
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51", "5.21.52", "5.22.54", "5.23.50", "5.25.51", "5.25.52", "5.26.52", "5.27.51", "5.28.52", "5.29.52")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51", "5.21.52", "5.22.54", "5.23.50", "5.25.51", "5.25.52", "5.26.52")
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51", "5.21.52", "5.22.54", "5.23.50", "5.25.51", "5.25.52", "5.26.52", "5.27.51", "5.28.52", "5.29.52")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.21.52", "5.22.54", "5.23.50", "5.25.51", "5.25.52", "5.26.52")
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.21.52", "5.22.54", "5.23.50", "5.25.51", "5.25.52", "5.26.52", "5.27.51", "5.28.52", "5.29.52")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51", "5.21.52", "5.22.54", "5.23.50", "5.25.51", "5.25.52", "5.26.52")
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51", "5.21.52", "5.22.54", "5.23.50", "5.25.51", "5.25.52", "5.26.52", "5.27.51", "5.28.52", "5.29.52")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51", "5.21.52", "5.22.54", "5.23.50", "5.25.51", "5.25.52", "5.26.52")
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51", "5.21.52", "5.22.54", "5.23.50", "5.25.51", "5.25.52", "5.26.52", "5.27.51", "5.28.52", "5.29.52")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -10,7 +10,7 @@ import app.revanced.patcher.annotation.Package
|
||||
*/
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.21.52", "5.22.54", "5.23.50", "5.25.51", "5.25.52", "5.26.52")
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.21.52", "5.22.54", "5.23.50", "5.25.51", "5.25.52", "5.26.52", "5.27.51", "5.28.52", "5.29.52")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51", "5.21.52", "5.22.54", "5.23.50", "5.25.51", "5.25.52", "5.26.52")
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51", "5.21.52", "5.22.54", "5.23.50", "5.25.51", "5.25.52", "5.26.52", "5.27.51", "5.28.52", "5.29.52")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51", "5.21.52", "5.22.54", "5.23.50", "5.25.51", "5.25.52", "5.26.52")
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51", "5.21.52", "5.22.54", "5.23.50", "5.25.51", "5.25.52", "5.26.52", "5.27.51", "5.28.52", "5.29.52")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51", "5.21.52", "5.22.54", "5.23.50", "5.25.51", "5.25.52", "5.26.52")
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51", "5.21.52", "5.22.54", "5.23.50", "5.25.51", "5.25.52", "5.26.52", "5.27.51", "5.28.52", "5.29.52")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -14,7 +14,7 @@ import app.revanced.patches.reddit.layout.premiumicon.fingerprints.PremiumIconFi
|
||||
|
||||
@Patch
|
||||
@Name("premium-icon-reddit")
|
||||
@Description("Unlocking Premium Icons in reddit app.")
|
||||
@Description("Unlocks premium Reddit app icons.")
|
||||
@PremiumIconCompatibility
|
||||
@Version("0.0.1")
|
||||
class PremiumIconPatch : BytecodePatch(
|
||||
|
||||
@@ -105,13 +105,6 @@ class GeneralBytecodeAdsPatch : BytecodePatch() {
|
||||
StringResource("revanced_adremover_compact_banner_enabled_summary_on", "Compact banners are hidden"),
|
||||
StringResource("revanced_adremover_compact_banner_enabled_summary_off", "Compact banners are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_adremover_comments_removal",
|
||||
StringResource("revanced_adremover_comments_enabled_title", "Remove comments section"),
|
||||
false,
|
||||
StringResource("revanced_adremover_comments_enabled_summary_on", "Comment section is hidden"),
|
||||
StringResource("revanced_adremover_comments_enabled_summary_off", "Comment section is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_adremover_movie",
|
||||
StringResource("revanced_adremover_movie_enabled_title", "Remove movies section"),
|
||||
|
||||
@@ -5,15 +5,14 @@ import app.revanced.patcher.annotation.Version
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patches.youtube.ad.video.annotations.VideoAdsCompatibility
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("load-ads-fingerprint")
|
||||
|
||||
@VideoAdsCompatibility
|
||||
@Version("0.0.1")
|
||||
object LoadAdsFingerprint : MethodFingerprint(
|
||||
opcodes = listOf(Opcode.INVOKE_INTERFACE_RANGE),
|
||||
customFingerprint = { method ->
|
||||
method.parameterTypes.size > 0 && method.parameterTypes.first().endsWith("InstreamAdBreak;")
|
||||
}
|
||||
object LoadVideoAdsFingerprint : MethodFingerprint(
|
||||
strings = listOf(
|
||||
"OnFulfillmentTriggersActivated has non registered slot",
|
||||
"markFillRequested",
|
||||
"Trying to enter a slot when a slot of same type and physical position is already active. Its status: ",
|
||||
)
|
||||
)
|
||||
@@ -13,7 +13,7 @@ import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.youtube.ad.video.annotations.VideoAdsCompatibility
|
||||
import app.revanced.patches.youtube.ad.video.fingerprints.LoadAdsFingerprint
|
||||
import app.revanced.patches.youtube.ad.video.fingerprints.LoadVideoAdsFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
||||
@@ -27,7 +27,7 @@ import app.revanced.patches.youtube.misc.settings.framework.components.impl.Swit
|
||||
@Version("0.0.1")
|
||||
class VideoAdsPatch : BytecodePatch(
|
||||
listOf(
|
||||
LoadAdsFingerprint
|
||||
LoadVideoAdsFingerprint,
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
@@ -41,21 +41,16 @@ class VideoAdsPatch : BytecodePatch(
|
||||
)
|
||||
)
|
||||
|
||||
with(LoadAdsFingerprint.result!!) {
|
||||
val insertIndex = scanResult.patternScanResult!!.startIndex
|
||||
with(mutableMethod) {
|
||||
addInstructions(
|
||||
insertIndex,
|
||||
"""
|
||||
invoke-static { }, Lapp/revanced/integrations/patches/VideoAdsPatch;->shouldShowAds()Z
|
||||
move-result v4
|
||||
if-nez v4, :show_video_ads
|
||||
return-object v3
|
||||
""",
|
||||
listOf(ExternalLabel("show_video_ads", instruction(insertIndex)))
|
||||
)
|
||||
}
|
||||
}
|
||||
val loadVideoAdsFingerprintMethod = LoadVideoAdsFingerprint.result!!.mutableMethod
|
||||
|
||||
loadVideoAdsFingerprintMethod.addInstructions(
|
||||
0, """
|
||||
invoke-static { }, Lapp/revanced/integrations/patches/VideoAdsPatch;->shouldShowAds()Z
|
||||
move-result v0
|
||||
if-nez v0, :show_video_ads
|
||||
return-void
|
||||
""", listOf(ExternalLabel("show_video_ads", loadVideoAdsFingerprintMethod.instruction(0)))
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37")
|
||||
"com.google.android.youtube", arrayOf("17.33.42", "17.34.35", "17.34.36", "17.36.37")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -9,9 +9,9 @@ import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.layout.branding.icon.annotations.CustomBrandingCompatibility
|
||||
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
|
||||
import app.revanced.util.resources.ResourceUtils
|
||||
import app.revanced.util.resources.ResourceUtils.copyResources
|
||||
import java.io.File
|
||||
import java.io.FileInputStream
|
||||
import java.io.InputStream
|
||||
import java.nio.file.Files
|
||||
|
||||
@Patch
|
||||
@@ -22,36 +22,43 @@ import java.nio.file.Files
|
||||
@Version("0.0.1")
|
||||
class CustomBrandingPatch : ResourcePatch {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
val resDirectory = context["res"]
|
||||
if (!resDirectory.isDirectory) return PatchResultError("The res folder can not be found.")
|
||||
fun copyResources(resourceGroups: List<ResourceUtils.ResourceGroup>) {
|
||||
iconPath?.let { iconPathString ->
|
||||
val iconPath = File(iconPathString)
|
||||
val resourceDirectory = context["res"]
|
||||
|
||||
// Icon branding
|
||||
val iconNames = arrayOf(
|
||||
resourceGroups.forEach { group ->
|
||||
val fromDirectory = iconPath.resolve(group.resourceDirectoryName)
|
||||
val toDirectory = resourceDirectory.resolve(group.resourceDirectoryName)
|
||||
|
||||
group.resources.forEach { iconFileName ->
|
||||
Files.write(
|
||||
toDirectory.resolve(iconFileName).toPath(),
|
||||
fromDirectory.resolve(iconFileName).readBytes()
|
||||
)
|
||||
}
|
||||
}
|
||||
} ?: resourceGroups.forEach { context.copyResources("branding", it) }
|
||||
}
|
||||
|
||||
val iconResourceFileNames = arrayOf(
|
||||
"adaptiveproduct_youtube_background_color_108",
|
||||
"adaptiveproduct_youtube_foreground_color_108",
|
||||
"ic_launcher",
|
||||
"ic_launcher_round"
|
||||
).map { "$it.png" }.toTypedArray()
|
||||
|
||||
fun createGroup(directory: String) = ResourceUtils.ResourceGroup(
|
||||
directory, *iconResourceFileNames
|
||||
)
|
||||
|
||||
mapOf(
|
||||
"xxxhdpi" to 192,
|
||||
"xxhdpi" to 144,
|
||||
"xhdpi" to 96,
|
||||
"hdpi" to 72,
|
||||
"mdpi" to 48
|
||||
).forEach { (iconDirectory, size) ->
|
||||
iconNames.forEach { iconName ->
|
||||
val iconFile = getIconStream("branding/$size/$iconName.png")
|
||||
?: return PatchResultError("The icon $iconName can not be found.")
|
||||
// change the app icon
|
||||
arrayOf("xxxhdpi", "xxhdpi", "xhdpi", "hdpi", "mdpi")
|
||||
.map { "mipmap-$it" }
|
||||
.map(::createGroup)
|
||||
.let(::copyResources)
|
||||
|
||||
Files.write(
|
||||
resDirectory.resolve("mipmap-$iconDirectory").resolve("$iconName.png").toPath(),
|
||||
iconFile.readBytes()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// Name branding
|
||||
// change the name of the app
|
||||
val manifest = context["AndroidManifest.xml"]
|
||||
manifest.writeText(
|
||||
manifest.readText()
|
||||
@@ -64,15 +71,6 @@ class CustomBrandingPatch : ResourcePatch {
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
private fun getIconStream(iconPath: String): InputStream? {
|
||||
if (appIconPath == null) {
|
||||
return this.javaClass.classLoader.getResourceAsStream(iconPath)
|
||||
}
|
||||
val file = File(appIconPath!!).resolve(iconPath)
|
||||
if (!file.exists()) return null
|
||||
return FileInputStream(file)
|
||||
}
|
||||
|
||||
companion object : OptionsContainer() {
|
||||
private var appName: String? by option(
|
||||
PatchOption.StringOption(
|
||||
@@ -84,12 +82,12 @@ class CustomBrandingPatch : ResourcePatch {
|
||||
)
|
||||
)
|
||||
|
||||
private var appIconPath: String? by option(
|
||||
private var iconPath: String? by option(
|
||||
PatchOption.StringOption(
|
||||
key = "appIconPath",
|
||||
key = "iconPath",
|
||||
default = null,
|
||||
title = "Application Icon Path",
|
||||
description = "A path to the icon of the application."
|
||||
title = "App Icon Path",
|
||||
description = "A path containing mipmap resource folders with icons."
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package app.revanced.patches.youtube.layout.comments.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class CommentsCompatibility
|
||||
@@ -0,0 +1,53 @@
|
||||
package app.revanced.patches.youtube.layout.comments.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.ad.general.bytecode.patch.GeneralBytecodeAdsPatch
|
||||
import app.revanced.patches.youtube.layout.comments.annotations.CommentsCompatibility
|
||||
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingResourcePatch
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.PreferenceScreen
|
||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.SwitchPreference
|
||||
|
||||
@Patch
|
||||
@DependsOn([ResourceMappingResourcePatch::class, GeneralBytecodeAdsPatch::class])
|
||||
@Name("comments")
|
||||
@Description("Hides comments components below the video player.")
|
||||
@CommentsCompatibility
|
||||
@Version("0.0.1")
|
||||
class CommentsPatch : ResourcePatch {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
PreferenceScreen(
|
||||
"revanced_comments",
|
||||
StringResource("revanced_comments_title", "Comments"),
|
||||
listOf(
|
||||
SwitchPreference(
|
||||
"revanced_hide_comments_section",
|
||||
StringResource("revanced_hide_comments_section_title", "Remove comments section"),
|
||||
false,
|
||||
StringResource("revanced_hide_comments_section_summary_on", "Comment section is hidden"),
|
||||
StringResource("revanced_hide_comments_section_summary_off", "Comment section is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_preview_comment",
|
||||
StringResource("revanced_hide_preview_comment_title", "Hide preview comment"),
|
||||
false,
|
||||
StringResource("revanced_hide_preview_comment_on", "Preview comment is hidden"),
|
||||
StringResource("revanced_hide_preview_comment_off", "Preview comment is shown")
|
||||
),
|
||||
),
|
||||
StringResource("revanced_comments_summary", "Manage the visibility of comments section components")
|
||||
)
|
||||
)
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package app.revanced.patches.youtube.layout.hidealbumcards.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.33.42", "17.34.35", "17.34.36", "17.36.37")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class AlbumCardsCompatibility
|
||||
@@ -0,0 +1,29 @@
|
||||
package app.revanced.patches.youtube.layout.hidealbumcards.fingerprints
|
||||
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patches.youtube.layout.hidealbumcards.annotations.AlbumCardsCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("album-cards-view-fingerprint")
|
||||
@AlbumCardsCompatibility
|
||||
@Version("0.0.1")
|
||||
object AlbumCardsFingerprint : MethodFingerprint(
|
||||
"V",
|
||||
AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
||||
listOf("L", "L", "L", "L", "L", "L", "[B"),
|
||||
listOf(
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CONST,
|
||||
Opcode.CONST_4,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,59 @@
|
||||
package app.revanced.patches.youtube.layout.hidealbumcards.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.addInstruction
|
||||
import app.revanced.patcher.extensions.instruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.layout.hidealbumcards.annotations.AlbumCardsCompatibility
|
||||
import app.revanced.patches.youtube.layout.hidealbumcards.fingerprints.AlbumCardsFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingResourcePatch
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.SwitchPreference
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@Patch
|
||||
@DependsOn([IntegrationsPatch::class, SettingsPatch::class, ResourceMappingResourcePatch::class])
|
||||
@Name("hide-album-cards")
|
||||
@Description("Hides the album cards below the artist description.")
|
||||
@AlbumCardsCompatibility
|
||||
@Version("0.0.1")
|
||||
class AlbumCardsPatch : BytecodePatch(
|
||||
listOf(
|
||||
AlbumCardsFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_hide_album_cards",
|
||||
StringResource("revanced_hide_album_cards_title", "Hide the album cards"),
|
||||
false,
|
||||
StringResource("revanced_hide_album_cards_summary_on", "Album cards is hidden"),
|
||||
StringResource("revanced_hide_album_cards_summary_off", "Album cards is visible")
|
||||
)
|
||||
)
|
||||
|
||||
val albumCardsResult = AlbumCardsFingerprint.result!!
|
||||
val albumCardsMethod = albumCardsResult.mutableMethod
|
||||
|
||||
val checkCastIndex = albumCardsResult.scanResult.patternScanResult!!.endIndex
|
||||
val patchIndex = checkCastIndex + 1
|
||||
|
||||
albumCardsMethod.addInstruction(
|
||||
patchIndex, """
|
||||
invoke-static {v${(albumCardsMethod.instruction(checkCastIndex) as OneRegisterInstruction).registerA}}, Lapp/revanced/integrations/patches/HideAlbumCardsPatch;->hideAlbumCards(Landroid/view/View;)V
|
||||
"""
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package app.revanced.patches.youtube.layout.buttons.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class HideArtistCardCompatibility
|
||||
@@ -0,0 +1,38 @@
|
||||
package app.revanced.patches.youtube.layout.hideartistcard.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.ad.general.bytecode.patch.GeneralBytecodeAdsPatch
|
||||
import app.revanced.patches.youtube.layout.buttons.annotations.HideArtistCardCompatibility
|
||||
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingResourcePatch
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.SwitchPreference
|
||||
|
||||
@Patch
|
||||
@DependsOn([ResourceMappingResourcePatch::class, GeneralBytecodeAdsPatch::class])
|
||||
@Name("hide-artist-card")
|
||||
@Description("Hides the artist card below the searchbar.")
|
||||
@HideArtistCardCompatibility
|
||||
@Version("0.0.1")
|
||||
class HideArtistCardPatch : ResourcePatch {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_hide_artist_card",
|
||||
StringResource("revanced_hide_hide_artist_card_title", "Hide artist card"),
|
||||
false,
|
||||
StringResource("revanced_hide_hide_artist_card_on", "Artist card is hidden"),
|
||||
StringResource("revanced_hide_hide_artist_card_off", "Artist card is shown")
|
||||
),
|
||||
)
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package app.revanced.patches.youtube.layout.hidecaptionsbutton.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.addInstructions
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.layout.autocaptions.annotations.AutoCaptionsCompatibility
|
||||
import app.revanced.patches.youtube.layout.autocaptions.fingerprints.SubtitleButtonControllerFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.SwitchPreference
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Patch
|
||||
@DependsOn([IntegrationsPatch::class, SettingsPatch::class])
|
||||
@Name("hide-captions-button")
|
||||
@Description("Hides the captions button on video player.")
|
||||
@AutoCaptionsCompatibility
|
||||
@Version("0.0.1")
|
||||
class HideCaptionsButtonPatch : BytecodePatch(listOf(
|
||||
SubtitleButtonControllerFingerprint,
|
||||
)) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_hide_captions_button",
|
||||
StringResource("revanced_hide_captions_button_title", "Hide captions button"),
|
||||
false,
|
||||
StringResource("revanced_hide_captions_button_summary_on", "Captions button is hidden"),
|
||||
StringResource("revanced_hide_captions_button_summary_off", "Captions button is shown")
|
||||
)
|
||||
)
|
||||
|
||||
val subtitleButtonControllerMethod = SubtitleButtonControllerFingerprint.result!!.mutableMethod
|
||||
|
||||
// Due to previously applied patches, scanResult index cannot be used in this context
|
||||
val igetBooleanIndex = subtitleButtonControllerMethod.implementation!!.instructions.indexOfFirst {
|
||||
it.opcode == Opcode.IGET_BOOLEAN
|
||||
}
|
||||
|
||||
subtitleButtonControllerMethod.addInstructions(
|
||||
igetBooleanIndex + 1, """
|
||||
invoke-static {v0}, Lapp/revanced/integrations/patches/HideCaptionsButtonPatch;->hideCaptionsButton(Landroid/widget/ImageView;)V
|
||||
"""
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package app.revanced.patches.youtube.layout.hidecrowdfundingbox.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.33.42", "17.34.35", "17.34.36", "17.36.37")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class CrowdfundingBoxCompatibility
|
||||
@@ -0,0 +1,37 @@
|
||||
package app.revanced.patches.youtube.layout.hidecrowdfundingbox.fingerprints
|
||||
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patches.youtube.layout.hidecrowdfundingbox.annotations.CrowdfundingBoxCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("crowdfunding-box-view-fingerprint")
|
||||
@FuzzyPatternScanMethod(3)
|
||||
@CrowdfundingBoxCompatibility
|
||||
@Version("0.0.1")
|
||||
object CrowdfundingBoxFingerprint : MethodFingerprint(
|
||||
"V",
|
||||
AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
||||
listOf("L", "L", "L", "L", "L", "L", "L", "[B", "[B"),
|
||||
listOf(
|
||||
Opcode.MOVE_OBJECT,
|
||||
Opcode.MOVE_OBJECT_FROM16,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.MOVE_OBJECT_FROM16,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.MOVE_OBJECT_FROM16,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CONST_4,
|
||||
Opcode.CONST_4,
|
||||
Opcode.CONST,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,59 @@
|
||||
package app.revanced.patches.youtube.layout.hidecrowdfundingbox.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.addInstruction
|
||||
import app.revanced.patcher.extensions.instruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.layout.hidecrowdfundingbox.annotations.CrowdfundingBoxCompatibility
|
||||
import app.revanced.patches.youtube.layout.hidecrowdfundingbox.fingerprints.CrowdfundingBoxFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingResourcePatch
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.SwitchPreference
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@Patch
|
||||
@DependsOn([IntegrationsPatch::class, SettingsPatch::class, ResourceMappingResourcePatch::class])
|
||||
@Name("hide-crowdfunding-box")
|
||||
@Description("Hides the crowdfunding box between the player and video description.")
|
||||
@CrowdfundingBoxCompatibility
|
||||
@Version("0.0.1")
|
||||
class CrowdfundingBoxPatch : BytecodePatch(
|
||||
listOf(
|
||||
CrowdfundingBoxFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_hide_crowdfunding_box",
|
||||
StringResource("revanced_hide_crowdfunding_box_title", "Hide the crowdfunding box"),
|
||||
false,
|
||||
StringResource("revanced_hide_crowdfunding_box_summary_on", "Crowdfunding box is hidden"),
|
||||
StringResource("revanced_hide_crowdfunding_box_summary_off", "Crowdfunding box is visible")
|
||||
)
|
||||
)
|
||||
|
||||
val crowdfundingBoxResult = CrowdfundingBoxFingerprint.result!!
|
||||
val crowdfundingBoxMethod = crowdfundingBoxResult.mutableMethod
|
||||
|
||||
val moveResultObjectIndex = crowdfundingBoxResult.scanResult.patternScanResult!!.endIndex
|
||||
val patchIndex = moveResultObjectIndex + 1
|
||||
|
||||
crowdfundingBoxMethod.addInstruction(
|
||||
patchIndex, """
|
||||
invoke-static {v${(crowdfundingBoxMethod.instruction(moveResultObjectIndex) as OneRegisterInstruction).registerA}}, Lapp/revanced/integrations/patches/HideCrowdfundingBoxPatch;->hideCrowdfundingBox(Landroid/view/View;)V
|
||||
"""
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package app.revanced.patches.youtube.layout.hidemixplaylists.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.32.39", "17.34.36", "17.36.37", "17.36.39", "17.37.35", "17.38.36", "17.39.35", "17.40.41")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class MixPlaylistsPatchCompatibility
|
||||
@@ -0,0 +1,30 @@
|
||||
package app.revanced.patches.youtube.layout.hidemixplaylists.fingerprints
|
||||
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patches.youtube.layout.hidemixplaylists.annotations.MixPlaylistsPatchCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("create-mix-playlist-fingerprint")
|
||||
@MixPlaylistsPatchCompatibility
|
||||
@Version("0.0.1")
|
||||
object CreateMixPlaylistFingerprint : MethodFingerprint(
|
||||
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L", "L", "L", "L", "L"), listOf(
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,30 @@
|
||||
package app.revanced.patches.youtube.layout.hidemixplaylists.fingerprints
|
||||
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patches.youtube.layout.hidemixplaylists.annotations.MixPlaylistsPatchCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("second-create-mix-playlist-fingerprint")
|
||||
@MixPlaylistsPatchCompatibility
|
||||
@Version("0.0.1")
|
||||
object SecondCreateMixPlaylistFingerprint : MethodFingerprint(
|
||||
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L", "L", "L", "L"), listOf(
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.RETURN_VOID
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,64 @@
|
||||
package app.revanced.patches.youtube.layout.hidemixplaylists.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.addInstruction
|
||||
import app.revanced.patcher.extensions.instruction
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patches.youtube.layout.hidemixplaylists.annotations.MixPlaylistsPatchCompatibility
|
||||
import app.revanced.patches.youtube.layout.hidemixplaylists.fingerprints.CreateMixPlaylistFingerprint
|
||||
import app.revanced.patches.youtube.layout.hidemixplaylists.fingerprints.SecondCreateMixPlaylistFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.SwitchPreference
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@Patch
|
||||
@DependsOn([IntegrationsPatch::class])
|
||||
@Name("hide-my-mix")
|
||||
@Description("Hides mix playlists.")
|
||||
@MixPlaylistsPatchCompatibility
|
||||
@Version("0.0.1")
|
||||
class MixPlaylistsPatch : BytecodePatch(
|
||||
listOf(
|
||||
CreateMixPlaylistFingerprint, SecondCreateMixPlaylistFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_mix_playlists_hidden",
|
||||
StringResource("revanced_mix_playlists_title", "Hide mix playlists"),
|
||||
false,
|
||||
StringResource("revanced_mix_playlists_summary_on", "Mix playlists are hidden"),
|
||||
StringResource("revanced_mix_playlists_summary_off", "Mix playlists are shown")
|
||||
)
|
||||
)
|
||||
|
||||
arrayOf(CreateMixPlaylistFingerprint, SecondCreateMixPlaylistFingerprint).forEach(::addHook)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
private fun addHook(fingerprint: MethodFingerprint) {
|
||||
with (fingerprint.result!!) {
|
||||
val insertIndex = scanResult.patternScanResult!!.endIndex - 3
|
||||
|
||||
val register = (mutableMethod.instruction(insertIndex - 2) as OneRegisterInstruction).registerA
|
||||
|
||||
mutableMethod.addInstruction(
|
||||
insertIndex,
|
||||
"invoke-static {v$register}, Lapp/revanced/integrations/patches/HideMixPlaylistsPatch;->hideMixPlaylists(Landroid/view/View;)V"
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -8,10 +8,10 @@ import app.revanced.patches.youtube.layout.theme.annotations.ThemeCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("comment-actionbar-fingerprint")
|
||||
@Name("litho-ui-fingerprint")
|
||||
@ThemeCompatibility
|
||||
@Version("0.0.1")
|
||||
object CommentsFilterBarFingerprint : MethodFingerprint(
|
||||
object LithoThemeFingerprint : MethodFingerprint(
|
||||
"V", AccessFlags.PROTECTED or AccessFlags.FINAL, listOf("L"), listOf(
|
||||
Opcode.APUT,
|
||||
Opcode.NEW_INSTANCE,
|
||||
@@ -11,36 +11,27 @@ import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.youtube.layout.theme.annotations.ThemeCompatibility
|
||||
import app.revanced.patches.youtube.layout.theme.fingerprints.CommentsFilterBarFingerprint
|
||||
import app.revanced.patches.youtube.layout.theme.fingerprints.LithoThemeFingerprint
|
||||
|
||||
@Name("comment-filter-bar-theme")
|
||||
@Description("Applies custom theming to comments filter action bar.")
|
||||
@Name("litho-components-theme")
|
||||
@Description("Applies a custom theme to litho components.")
|
||||
@ThemeCompatibility
|
||||
@Version("0.0.1")
|
||||
class CommentsFilterBarPatch : BytecodePatch(
|
||||
class LithoThemePatch : BytecodePatch(
|
||||
listOf(
|
||||
CommentsFilterBarFingerprint
|
||||
LithoThemeFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
val result = CommentsFilterBarFingerprint.result!!
|
||||
val result = LithoThemeFingerprint.result!!
|
||||
val method = result.mutableMethod
|
||||
val patchIndex = result.scanResult.patternScanResult!!.endIndex - 1
|
||||
|
||||
method.addInstructions(
|
||||
patchIndex, """
|
||||
invoke-static {}, Lapp/revanced/integrations/utils/ThemeHelper;->isDarkTheme()Z
|
||||
move-result v2
|
||||
if-nez v2, :comments_filter_white
|
||||
const v1, -0x1
|
||||
if-ne v1, p1, :comments_filter_white
|
||||
const/4 p1, 0x0
|
||||
:comments_filter_white
|
||||
if-eqz v2, :comments_filter_dark
|
||||
const v1, -0xdededf
|
||||
if-ne v1, p1, :comments_filter_dark
|
||||
const/4 p1, 0x0
|
||||
""", listOf(ExternalLabel("comments_filter_dark", method.instruction(patchIndex)))
|
||||
invoke-static {p1}, Lapp/revanced/integrations/patches/LithoThemePatch;->applyLithoTheme(I)I
|
||||
move-result p1
|
||||
"""
|
||||
)
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
@@ -9,10 +9,12 @@ import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.layout.theme.annotations.ThemeCompatibility
|
||||
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
|
||||
import app.revanced.util.resources.ResourceUtils
|
||||
import app.revanced.util.resources.ResourceUtils.copyResources
|
||||
import org.w3c.dom.Element
|
||||
|
||||
@Patch
|
||||
@DependsOn([CommentsFilterBarPatch::class, FixLocaleConfigErrorPatch::class])
|
||||
@DependsOn([LithoThemePatch::class, FixLocaleConfigErrorPatch::class])
|
||||
@Name("theme")
|
||||
@Description("Applies a custom theme.")
|
||||
@ThemeCompatibility
|
||||
@@ -29,17 +31,24 @@ class ThemePatch : ResourcePatch {
|
||||
val node = resourcesNode.childNodes.item(i) as? Element ?: continue
|
||||
|
||||
node.textContent = when (node.getAttribute("name")) {
|
||||
"yt_black1", "yt_black1_opacity95", "yt_black1_opacity98", "yt_black2", "yt_black3", "yt_black4",
|
||||
"yt_status_bar_background_dark" -> darkThemeBackgroundColor
|
||||
"yt_black0", "yt_black1", "yt_black1_opacity95", "yt_black1_opacity98", "yt_black2", "yt_black3",
|
||||
"yt_black4", "yt_status_bar_background_dark", "material_grey_100", "material_grey_50",
|
||||
"material_grey_600", "material_grey_800", "material_grey_850", "material_grey_900",
|
||||
"material_grey_white_1000", "sud_glif_v3_dialog_background_color_dark" -> darkThemeBackgroundColor
|
||||
|
||||
"yt_white1", "yt_white1_opacity95", "yt_white1_opacity98", "yt_white2", "yt_white3",
|
||||
"yt_white4" -> lightThemeBackgroundColor
|
||||
"yt_white1", "yt_white1_opacity95", "yt_white1_opacity98", "yt_white2", "yt_white3", "yt_white4",
|
||||
"sud_glif_v3_dialog_background_color_light" -> lightThemeBackgroundColor
|
||||
|
||||
else -> continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// copies the resource file to change the splash screen color
|
||||
context.copyResources("theme",
|
||||
ResourceUtils.ResourceGroup("values-night-v31", "styles.xml")
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package app.revanced.patches.youtube.misc.integrations.fingerprints
|
||||
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.annotations.IntegrationsCompatibility
|
||||
|
||||
@Name("service-fingerprint")
|
||||
@IntegrationsCompatibility
|
||||
@Version("0.0.1")
|
||||
object ServiceFingerprint : MethodFingerprint(
|
||||
customFingerprint = { methodDef -> methodDef.definingClass.endsWith("ApiPlayerService;") && methodDef.name == "<init>" }
|
||||
)
|
||||
@@ -0,0 +1,16 @@
|
||||
package app.revanced.patches.youtube.misc.integrations.fingerprints
|
||||
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.annotations.IntegrationsCompatibility
|
||||
|
||||
@Name("standalone-player-fingerprint")
|
||||
@IntegrationsCompatibility
|
||||
@Version("0.0.1")
|
||||
object StandalonePlayerFingerprint : MethodFingerprint(
|
||||
strings = listOf(
|
||||
"Invalid PlaybackStartDescriptor. Returning the instance itself.",
|
||||
"com.google.android.music",
|
||||
)
|
||||
)
|
||||
@@ -4,6 +4,7 @@ import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.MethodFingerprintExtensions.name
|
||||
import app.revanced.patcher.extensions.addInstruction
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
@@ -14,6 +15,8 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMu
|
||||
import app.revanced.patcher.util.smali.toInstructions
|
||||
import app.revanced.patches.youtube.misc.integrations.annotations.IntegrationsCompatibility
|
||||
import app.revanced.patches.youtube.misc.integrations.fingerprints.InitFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.fingerprints.ServiceFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.fingerprints.StandalonePlayerFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.immutable.ImmutableMethod
|
||||
import org.jf.dexlib2.immutable.ImmutableMethodImplementation
|
||||
@@ -24,42 +27,33 @@ import org.jf.dexlib2.immutable.ImmutableMethodImplementation
|
||||
@Version("0.0.1")
|
||||
class IntegrationsPatch : BytecodePatch(
|
||||
listOf(
|
||||
InitFingerprint
|
||||
InitFingerprint, StandalonePlayerFingerprint, ServiceFingerprint
|
||||
)
|
||||
) {
|
||||
companion object {
|
||||
private const val INTEGRATIONS_DESCRIPTOR = "Lapp/revanced/integrations/utils/ReVancedUtils;"
|
||||
}
|
||||
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
if (context.findClass("Lapp/revanced/integrations/utils/ReVancedUtils") == null)
|
||||
return PatchResultError("Integrations have not been merged yet. This patch can not succeed without the integrations.")
|
||||
if (context.findClass(INTEGRATIONS_DESCRIPTOR) == null)
|
||||
return PatchResultError("Integrations have not been merged yet. This patch can not succeed without merging the integrations.")
|
||||
|
||||
val result = InitFingerprint.result!!
|
||||
arrayOf(InitFingerprint, StandalonePlayerFingerprint, ServiceFingerprint).map {
|
||||
it to (it.result ?: return PatchResultError("${it.name} failed to resolve"))
|
||||
}.forEach { (fingerprint, result) ->
|
||||
with(result.mutableMethod) {
|
||||
// parameter which holds the context
|
||||
val contextParameter = if (fingerprint == ServiceFingerprint) parameters.size else 1
|
||||
// register which holds the context
|
||||
val contextRegister = implementation!!.registerCount - contextParameter
|
||||
|
||||
val method = result.mutableMethod
|
||||
val implementation = method.implementation!!
|
||||
val count = implementation.registerCount - 1
|
||||
|
||||
method.addInstruction(
|
||||
0, "sput-object v$count, Lapp/revanced/integrations/utils/ReVancedUtils;->context:Landroid/content/Context;"
|
||||
)
|
||||
|
||||
val classDef = result.mutableClass
|
||||
classDef.methods.add(
|
||||
ImmutableMethod(
|
||||
classDef.type,
|
||||
"getAppContext",
|
||||
null,
|
||||
"Landroid/content/Context;",
|
||||
AccessFlags.PUBLIC or AccessFlags.STATIC,
|
||||
null,
|
||||
null,
|
||||
ImmutableMethodImplementation(
|
||||
1, """
|
||||
invoke-static { }, Lapp/revanced/integrations/utils/ReVancedUtils;->getAppContext()Landroid/content/Context;
|
||||
move-result-object v0
|
||||
return-object v0
|
||||
""".toInstructions(), null, null
|
||||
addInstruction(
|
||||
0,
|
||||
"sput-object v$contextRegister, $INTEGRATIONS_DESCRIPTOR->context:Landroid/content/Context;"
|
||||
)
|
||||
).toMutable()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package app.revanced.patches.youtube.misc.settings.bytecode.fingerprints
|
||||
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patches.youtube.misc.settings.annotations.SettingsCompatibility
|
||||
|
||||
// TODO: This is more of a class fingerprint than a method fingerprint.
|
||||
// Convert to a class fingerprint whenever possible.
|
||||
@Name("revanced-settings-activity-fingerprint")
|
||||
@SettingsCompatibility
|
||||
@Version("0.0.1")
|
||||
object ReVancedSettingsActivityFingerprint : MethodFingerprint(
|
||||
customFingerprint = { methodDef ->
|
||||
methodDef.definingClass.endsWith("ReVancedSettingActivity;") && methodDef.name == "initializeSettings"
|
||||
}
|
||||
)
|
||||
@@ -0,0 +1,39 @@
|
||||
package app.revanced.patches.youtube.misc.settings.bytecode.fingerprints
|
||||
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patches.youtube.misc.settings.annotations.SettingsCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("theme-setter-app-fingerprint")
|
||||
@SettingsCompatibility
|
||||
@Version("0.0.1")
|
||||
object ThemeSetterAppFingerprint : MethodFingerprint(
|
||||
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L", "L", "L"), listOf(
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.IF_NE,
|
||||
Opcode.CONST,
|
||||
Opcode.GOTO,
|
||||
Opcode.CONST,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.RETURN_OBJECT,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.IF_NE,
|
||||
Opcode.CONST,
|
||||
)
|
||||
)
|
||||
@@ -5,18 +5,19 @@ import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patches.youtube.misc.settings.annotations.SettingsCompatibility
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsResourcePatch
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
|
||||
|
||||
@Name("theme-setter-fingerprint")
|
||||
@Name("theme-setter-system-fingerprint")
|
||||
@SettingsCompatibility
|
||||
@Version("0.0.1")
|
||||
object ThemeSetterFingerprint : MethodFingerprint(
|
||||
object ThemeSetterSystemFingerprint : MethodFingerprint(
|
||||
"L",
|
||||
opcodes = listOf(Opcode.RETURN_OBJECT),
|
||||
customFingerprint = { methodDef ->
|
||||
methodDef.implementation?.instructions?.any {
|
||||
it.opcode.ordinal == Opcode.CONST.ordinal && (it as WideLiteralInstruction).wideLiteral == SettingsPatch.appearanceStringId
|
||||
it.opcode.ordinal == Opcode.CONST.ordinal && (it as WideLiteralInstruction).wideLiteral == SettingsResourcePatch.appearanceStringId
|
||||
} == true
|
||||
}
|
||||
)
|
||||
@@ -11,15 +11,12 @@ import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.util.smali.toInstruction
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingResourcePatch
|
||||
import app.revanced.patches.youtube.misc.settings.annotations.SettingsCompatibility
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.fingerprints.LicenseActivityFingerprint
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.fingerprints.ReVancedSettingsActivityFingerprint
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.fingerprints.ThemeSetterFingerprint
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.fingerprints.ThemeSetterAppFingerprint
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.fingerprints.ThemeSetterSystemFingerprint
|
||||
import app.revanced.patches.youtube.misc.settings.framework.components.BasePreference
|
||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.ArrayResource
|
||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.Preference
|
||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.PreferenceScreen
|
||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
||||
@@ -39,64 +36,92 @@ import java.io.Closeable
|
||||
@SettingsCompatibility
|
||||
@Version("0.0.1")
|
||||
class SettingsPatch : BytecodePatch(
|
||||
listOf(LicenseActivityFingerprint, ReVancedSettingsActivityFingerprint, ThemeSetterFingerprint)
|
||||
listOf(LicenseActivityFingerprint, ThemeSetterSystemFingerprint, ThemeSetterAppFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
val licenseActivityResult = LicenseActivityFingerprint.result!!
|
||||
val settingsResult = ReVancedSettingsActivityFingerprint.result!!
|
||||
val themeSetterResult = ThemeSetterFingerprint.result!!
|
||||
fun buildInvokeInstructionsString(
|
||||
registers: String = "v0",
|
||||
classDescriptor: String = THEME_HELPER_DESCRIPTOR,
|
||||
methodName: String = SET_THEME_METHOD_NAME,
|
||||
parameters: String = "Ljava/lang/Object;"
|
||||
) = "invoke-static {$registers}, $classDescriptor->$methodName($parameters)V"
|
||||
|
||||
val licenseActivityClass = licenseActivityResult.mutableClass
|
||||
val settingsClass = settingsResult.mutableClass
|
||||
// apply the current theme of the settings page
|
||||
with(ThemeSetterSystemFingerprint.result!!) {
|
||||
with(mutableMethod) {
|
||||
val call = buildInvokeInstructionsString()
|
||||
|
||||
val onCreate = licenseActivityResult.mutableMethod
|
||||
val setThemeMethodName = "setTheme"
|
||||
val initializeSettings = settingsResult.mutableMethod
|
||||
addInstruction(
|
||||
scanResult.patternScanResult!!.startIndex,
|
||||
call
|
||||
)
|
||||
|
||||
val setThemeInstruction =
|
||||
"invoke-static {v0}, Lapp/revanced/integrations/utils/ThemeHelper;->setTheme(Ljava/lang/Object;)V".toInstruction(
|
||||
themeSetterResult.mutableMethod
|
||||
)
|
||||
|
||||
// add instructions to set the theme of the settings activity
|
||||
themeSetterResult.mutableMethod.implementation!!.let {
|
||||
it.addInstruction(
|
||||
themeSetterResult.scanResult.patternScanResult!!.startIndex,
|
||||
setThemeInstruction
|
||||
)
|
||||
|
||||
it.addInstruction(
|
||||
it.instructions.size - 1, // add before return
|
||||
setThemeInstruction
|
||||
)
|
||||
addInstruction(
|
||||
mutableMethod.implementation!!.instructions.size - 1,
|
||||
call
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// add the setTheme call to the onCreate method to not affect the offsets
|
||||
onCreate.addInstructions(
|
||||
1,
|
||||
"""
|
||||
invoke-static { p0 }, ${settingsClass.type}->${initializeSettings.name}(${licenseActivityClass.type})V
|
||||
return-void
|
||||
"""
|
||||
)
|
||||
// set the theme based on the preference of the app
|
||||
with(ThemeSetterAppFingerprint.result!!) {
|
||||
with(mutableMethod) {
|
||||
fun buildInstructionsString(theme: Int) = """
|
||||
const/4 v0, 0x$theme
|
||||
${buildInvokeInstructionsString(parameters = "I")}
|
||||
"""
|
||||
|
||||
// add the initializeSettings call to the onCreate method
|
||||
onCreate.addInstruction(
|
||||
0,
|
||||
"invoke-static { p0 }, ${settingsClass.type}->$setThemeMethodName(${licenseActivityClass.type})V"
|
||||
)
|
||||
addInstructions(
|
||||
scanResult.patternScanResult!!.endIndex + 1,
|
||||
buildInstructionsString(1)
|
||||
)
|
||||
|
||||
// get rid of, now, useless overridden methods
|
||||
licenseActivityResult.mutableClass.methods.removeIf { it.name != "onCreate" && !MethodUtil.isConstructor(it) }
|
||||
addInstructions(
|
||||
mutableMethod.implementation!!.instructions.size - 2,
|
||||
buildInstructionsString(0)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// set the theme based on the preference of the device
|
||||
with(LicenseActivityFingerprint.result!!) licenseActivity@{
|
||||
with(mutableMethod) {
|
||||
fun buildSettingsActivityInvokeString(
|
||||
registers: String = "p0",
|
||||
classDescriptor: String = SETTINGS_ACTIVITY_DESCRIPTOR,
|
||||
methodName: String = "initializeSettings",
|
||||
parameters: String = this@licenseActivity.mutableClass.type
|
||||
) = buildInvokeInstructionsString(registers, classDescriptor, methodName, parameters)
|
||||
|
||||
// initialize the settings
|
||||
addInstructions(
|
||||
1,
|
||||
"""
|
||||
${buildSettingsActivityInvokeString()}
|
||||
return-void
|
||||
"""
|
||||
)
|
||||
|
||||
// set the current theme
|
||||
addInstruction(0, buildSettingsActivityInvokeString(methodName = "setTheme"))
|
||||
}
|
||||
|
||||
// remove method overrides
|
||||
with(mutableClass) {
|
||||
methods.removeIf { it.name != "onCreate" && !MethodUtil.isConstructor(it) }
|
||||
}
|
||||
}
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
internal companion object {
|
||||
// TODO: hide this somehow
|
||||
var appearanceStringId: Long = ResourceMappingResourcePatch.resourceMappings.find {
|
||||
it.type == "string" && it.name == "app_theme_appearance_dark"
|
||||
}!!.id
|
||||
private const val INTEGRATIONS_PACKAGE = "app/revanced/integrations"
|
||||
|
||||
private const val SETTINGS_ACTIVITY_DESCRIPTOR = "L$INTEGRATIONS_PACKAGE/settingsmenu/ReVancedSettingActivity;"
|
||||
|
||||
private const val THEME_HELPER_DESCRIPTOR = "L$INTEGRATIONS_PACKAGE/utils/ThemeHelper;"
|
||||
private const val SET_THEME_METHOD_NAME = "setTheme"
|
||||
|
||||
fun addString(identifier: String, value: String, formatted: Boolean = true) =
|
||||
SettingsResourcePatch.addString(identifier, value, formatted)
|
||||
@@ -107,9 +132,6 @@ class SettingsPatch : BytecodePatch(
|
||||
fun addPreference(preference: Preference) =
|
||||
SettingsResourcePatch.addPreference(preference)
|
||||
|
||||
fun addArray(arrayResource: ArrayResource) =
|
||||
SettingsResourcePatch.addArray(arrayResource)
|
||||
|
||||
fun renameIntentsTargetPackage(newPackage: String) {
|
||||
SettingsResourcePatch.overrideIntentsTargetPackage = newPackage
|
||||
}
|
||||
@@ -152,4 +174,4 @@ class SettingsPatch : BytecodePatch(
|
||||
|
||||
override fun close() = PreferenceScreen.values().forEach(PreferenceScreen::close)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,8 +24,14 @@ import org.w3c.dom.Node
|
||||
@DependsOn([FixLocaleConfigErrorPatch::class, ResourceMappingResourcePatch::class])
|
||||
@Version("0.0.1")
|
||||
class SettingsResourcePatch : ResourcePatch {
|
||||
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
/*
|
||||
* used by a fingerprint of SettingsPatch
|
||||
*/
|
||||
appearanceStringId = ResourceMappingResourcePatch.resourceMappings.find {
|
||||
it.type == "string" && it.name == "app_theme_appearance_dark"
|
||||
}!!.id
|
||||
|
||||
/*
|
||||
* create missing directory for the resources
|
||||
*/
|
||||
@@ -84,6 +90,12 @@ class SettingsResourcePatch : ResourcePatch {
|
||||
|
||||
|
||||
internal companion object {
|
||||
// Used by a fingerprint of SettingsPatch
|
||||
// this field is located in the SettingsResourcePatch
|
||||
// because if it were to be defined in the SettingsPatch companion object,
|
||||
// the companion object could be initialized before ResourceMappingResourcePatch has executed.
|
||||
internal var appearanceStringId: Long = -1
|
||||
|
||||
// if this is not null, all intents will be renamed to this
|
||||
var overrideIntentsTargetPackage: String? = null
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 276 B After Width: | Height: | Size: 276 B |
|
After Width: | Height: | Size: 1.5 KiB |
BIN
src/main/resources/branding/mipmap-hdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
src/main/resources/branding/mipmap-hdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 191 B After Width: | Height: | Size: 191 B |
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/main/resources/branding/mipmap-mdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
src/main/resources/branding/mipmap-mdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 343 B After Width: | Height: | Size: 343 B |
|
After Width: | Height: | Size: 2.1 KiB |
BIN
src/main/resources/branding/mipmap-xhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
src/main/resources/branding/mipmap-xhdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 483 B After Width: | Height: | Size: 483 B |
|
After Width: | Height: | Size: 2.8 KiB |
BIN
src/main/resources/branding/mipmap-xxhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
BIN
src/main/resources/branding/mipmap-xxhdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 163 B After Width: | Height: | Size: 163 B |
|
After Width: | Height: | Size: 3.4 KiB |
BIN
src/main/resources/branding/mipmap-xxxhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
src/main/resources/branding/mipmap-xxxhdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
8
src/main/resources/theme/values-night-v31/styles.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="Base.Theme.YouTube.Launcher" parent="@style/Theme.AppCompat.NoActionBar">
|
||||
<item name="android:windowSplashScreenBackground">@android:color/black</item>
|
||||
<item name="android:windowSplashScreenAnimatedIcon">@drawable/avd_anim</item>
|
||||
<item name="android:windowSplashScreenAnimationDuration">1000</item>
|
||||
</style>
|
||||
</resources>
|
||||