Compare commits
32 Commits
v2.157.0-d
...
v2.159.0-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e3c06684a | ||
|
|
aefc1f02a4 | ||
|
|
762e290658 | ||
|
|
17b046df60 | ||
|
|
8d57c555a0 | ||
|
|
8e4235af16 | ||
|
|
b3f9858402 | ||
|
|
bd9c89cdcc | ||
|
|
963089d866 | ||
|
|
86e28acd2f | ||
|
|
cc86f4ead3 | ||
|
|
5324d471c9 | ||
|
|
8ee531f816 | ||
|
|
d3bd5f65ef | ||
|
|
d5fff653d5 | ||
|
|
3cf86bd1e9 | ||
|
|
f24a7c3ca9 | ||
|
|
69394a60b2 | ||
|
|
9ff595d5df | ||
|
|
46effd337f | ||
|
|
06a981a317 | ||
|
|
dd3a9a4f38 | ||
|
|
5228700317 | ||
|
|
e68a65c950 | ||
|
|
817ad0b9f2 | ||
|
|
57e13cf8a8 | ||
|
|
e4fa523b15 | ||
|
|
440278be33 | ||
|
|
3bf8d1d3cb | ||
|
|
246a6ce927 | ||
|
|
225726feeb | ||
|
|
f0b384bbfe |
111
CHANGELOG.md
@@ -1,3 +1,114 @@
|
||||
# [2.159.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.158.0...v2.159.0-dev.1) (2023-02-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube/custom-branding:** correct scaling, margin and images ([#1580](https://github.com/revanced/revanced-patches/issues/1580)) ([491c413](https://github.com/revanced/revanced-patches/commit/491c4138f0185664a9c5d3db9ebdf026ff4594e8))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **music:** bump patches compatibility to v5.41.50 ([#1551](https://github.com/revanced/revanced-patches/issues/1551)) ([0b1024a](https://github.com/revanced/revanced-patches/commit/0b1024ab754a3e2ce798a54cccda6f41f97069a5))
|
||||
* **spotify-lite:** enable on-demand patch ([9f0de4f](https://github.com/revanced/revanced-patches/commit/9f0de4f5678e9f57baaf6ec788821641d75defdc))
|
||||
|
||||
# [2.158.0](https://github.com/revanced/revanced-patches/compare/v2.157.0...v2.158.0) (2023-01-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube/microg-support:** replace new permission ([3d1cce5](https://github.com/revanced/revanced-patches/commit/3d1cce5b4ca54c622b863f24febeb03a6060033c))
|
||||
* **youtube:** resolve duplicate preference keys ([#1550](https://github.com/revanced/revanced-patches/issues/1550)) ([aafdb89](https://github.com/revanced/revanced-patches/commit/aafdb891b2f0f243cb2d997a38ab3e6a7b46aba8))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **irplus:** `remove-ads` patch ([#1554](https://github.com/revanced/revanced-patches/issues/1554)) ([9943a52](https://github.com/revanced/revanced-patches/commit/9943a520d29ee89598b4aa6aba69ff83cb4768ce))
|
||||
|
||||
# [2.158.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.157.1-dev.2...v2.158.0-dev.1) (2023-01-28)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **irplus:** `remove-ads` patch ([#1554](https://github.com/revanced/revanced-patches/issues/1554)) ([9943a52](https://github.com/revanced/revanced-patches/commit/9943a520d29ee89598b4aa6aba69ff83cb4768ce))
|
||||
|
||||
## [2.157.1-dev.2](https://github.com/revanced/revanced-patches/compare/v2.157.1-dev.1...v2.157.1-dev.2) (2023-01-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube:** resolve duplicate preference keys ([#1550](https://github.com/revanced/revanced-patches/issues/1550)) ([aafdb89](https://github.com/revanced/revanced-patches/commit/aafdb891b2f0f243cb2d997a38ab3e6a7b46aba8))
|
||||
|
||||
## [2.157.1-dev.1](https://github.com/revanced/revanced-patches/compare/v2.157.0...v2.157.1-dev.1) (2023-01-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube/microg-support:** replace new permission ([3d1cce5](https://github.com/revanced/revanced-patches/commit/3d1cce5b4ca54c622b863f24febeb03a6060033c))
|
||||
|
||||
# [2.157.0](https://github.com/revanced/revanced-patches/compare/v2.156.0...v2.157.0) (2023-01-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* parse any kind of patch version ([66cd88f](https://github.com/revanced/revanced-patches/commit/66cd88f4d8a9161a4c51b70f2384dcee92fe2aea))
|
||||
* **twitter/hide-views-stats:** constrain to last working version ([#1522](https://github.com/revanced/revanced-patches/issues/1522)) ([bf45817](https://github.com/revanced/revanced-patches/commit/bf45817677fd058f9b255dbef5c1ca9aaec95531))
|
||||
* **youtube/return-youtube-dislike:** do not fetch voting stats when watching shorts ([#1532](https://github.com/revanced/revanced-patches/issues/1532)) ([f46fcad](https://github.com/revanced/revanced-patches/commit/f46fcadd855a13d9f8916f21980abcf5564e97d7))
|
||||
* **youtube/settings:** resolve fingerprints robustly ([8e98605](https://github.com/revanced/revanced-patches/commit/8e98605a7491d69e99c6b1aeb2de3db9396faa20))
|
||||
* **youtube/sponsorblock:** replace missing strings ([7b8f0db](https://github.com/revanced/revanced-patches/commit/7b8f0db2c17da6488db1ec2c21a21a14ff8466aa))
|
||||
* **youtube:** reliably resolve fingerprints ([1598306](https://github.com/revanced/revanced-patches/commit/1598306eb58ae8f8dc38b472628b237e55ec0f1b))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **finanzonline:** `remove-bootloader-detection` patch ([3952138](https://github.com/revanced/revanced-patches/commit/39521386c2296f46479e31c39ab245c2778ebd65))
|
||||
* **finanzonline:** `remove-root-detection` patch ([1d46d63](https://github.com/revanced/revanced-patches/commit/1d46d63fdcf3cbce53a7719f4490225368c4d5ae))
|
||||
* **music:** update patches compatibility to v5.40.51 ([#1541](https://github.com/revanced/revanced-patches/issues/1541)) ([13143cb](https://github.com/revanced/revanced-patches/commit/13143cb5260f8793d246633a6a506bdc9f3a3ce7))
|
||||
* **youtube/general-ads:** remove hiding video shelf ([c4c9e5b](https://github.com/revanced/revanced-patches/commit/c4c9e5bb3765d08d6653864d33546c25ba367292))
|
||||
* **youtube/microg-support:** check if Vanced MicroG is running in the background ([#1531](https://github.com/revanced/revanced-patches/issues/1531)) ([81934ef](https://github.com/revanced/revanced-patches/commit/81934efb39b8ed9b0a523ffd7c4d841227ac141f))
|
||||
* **youtube:** `open-links-externally` patch ([#1524](https://github.com/revanced/revanced-patches/issues/1524)) ([caf3d70](https://github.com/revanced/revanced-patches/commit/caf3d70c30bc440923c0e76e7331010905f6e729))
|
||||
* **youtube:** show toasts along exceptions ([#1511](https://github.com/revanced/revanced-patches/issues/1511)) ([5817e4d](https://github.com/revanced/revanced-patches/commit/5817e4d27fab692c0e95ab4aa2fa8f13005cb780))
|
||||
|
||||
# [2.157.0-dev.6](https://github.com/revanced/revanced-patches/compare/v2.157.0-dev.5...v2.157.0-dev.6) (2023-01-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube/sponsorblock:** replace missing strings ([7b8f0db](https://github.com/revanced/revanced-patches/commit/7b8f0db2c17da6488db1ec2c21a21a14ff8466aa))
|
||||
|
||||
# [2.157.0-dev.5](https://github.com/revanced/revanced-patches/compare/v2.157.0-dev.4...v2.157.0-dev.5) (2023-01-28)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **youtube:** show toasts along exceptions ([#1511](https://github.com/revanced/revanced-patches/issues/1511)) ([5817e4d](https://github.com/revanced/revanced-patches/commit/5817e4d27fab692c0e95ab4aa2fa8f13005cb780))
|
||||
|
||||
# [2.157.0-dev.4](https://github.com/revanced/revanced-patches/compare/v2.157.0-dev.3...v2.157.0-dev.4) (2023-01-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube/return-youtube-dislike:** do not fetch voting stats when watching shorts ([#1532](https://github.com/revanced/revanced-patches/issues/1532)) ([f46fcad](https://github.com/revanced/revanced-patches/commit/f46fcadd855a13d9f8916f21980abcf5564e97d7))
|
||||
|
||||
# [2.157.0-dev.3](https://github.com/revanced/revanced-patches/compare/v2.157.0-dev.2...v2.157.0-dev.3) (2023-01-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube/settings:** resolve fingerprints robustly ([8e98605](https://github.com/revanced/revanced-patches/commit/8e98605a7491d69e99c6b1aeb2de3db9396faa20))
|
||||
* **youtube:** reliably resolve fingerprints ([1598306](https://github.com/revanced/revanced-patches/commit/1598306eb58ae8f8dc38b472628b237e55ec0f1b))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **youtube/general-ads:** remove hiding video shelf ([c4c9e5b](https://github.com/revanced/revanced-patches/commit/c4c9e5bb3765d08d6653864d33546c25ba367292))
|
||||
|
||||
# [2.157.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.157.0-dev.1...v2.157.0-dev.2) (2023-01-24)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **music:** update patches compatibility to v5.40.51 ([#1541](https://github.com/revanced/revanced-patches/issues/1541)) ([13143cb](https://github.com/revanced/revanced-patches/commit/13143cb5260f8793d246633a6a506bdc9f3a3ce7))
|
||||
|
||||
# [2.157.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.156.0...v2.157.0-dev.1) (2023-01-23)
|
||||
|
||||
|
||||
|
||||
107
README.md
@@ -9,58 +9,57 @@ The official Patch bundle provided by ReVanced and the community.
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `always-autorepeat` | Always repeats the playing video again. | 17.49.37 |
|
||||
| `always-autorepeat` | Always repeats the playing video again. | 18.03.36 |
|
||||
| `client-spoof` | Spoofs the YouTube or Vanced client to prevent playback issues. | all |
|
||||
| `comments` | Hides components related to comments. | 17.49.37 |
|
||||
| `copy-video-url` | Adds buttons in player to copy video links. | 17.49.37 |
|
||||
| `comments` | Hides components related to comments. | 18.03.36 |
|
||||
| `copy-video-url` | Adds buttons in player to copy video links. | 18.03.36 |
|
||||
| `custom-branding` | Changes the YouTube launcher icon and name to your choice (defaults to ReVanced). | all |
|
||||
| `custom-video-buffer` | Lets you change the buffers of videos. | 17.49.37 |
|
||||
| `custom-video-speed` | Adds more video speed options. | 17.49.37 |
|
||||
| `custom-video-buffer` | Lets you change the buffers of videos. | 18.03.36 |
|
||||
| `custom-video-speed` | Adds more video speed options. | 18.03.36 |
|
||||
| `debugging` | Adds debugging options. | all |
|
||||
| `disable-auto-captions` | Disable forced captions from being automatically enabled. | 17.49.37 |
|
||||
| `disable-auto-player-popup-panels` | Disable automatic popup panels (playlist or live chat) on video player. | 17.49.37 |
|
||||
| `disable-fullscreen-panels` | Disables video description and comments panel in fullscreen view. | 17.49.37 |
|
||||
| `disable-startup-shorts-player` | Disables playing YouTube Shorts when launching YouTube. | 17.49.37 |
|
||||
| `disable-auto-captions` | Disable forced captions from being automatically enabled. | 18.03.36 |
|
||||
| `disable-auto-player-popup-panels` | Disable automatic popup panels (playlist or live chat) on video player. | 18.03.36 |
|
||||
| `disable-fullscreen-panels` | Disables video description and comments panel in fullscreen view. | 18.03.36 |
|
||||
| `disable-startup-shorts-player` | Disables playing YouTube Shorts when launching YouTube. | 18.03.36 |
|
||||
| `disable-zoom-haptics` | Disables haptics when zooming. | all |
|
||||
| `downloads` | Enables downloading music and videos from YouTube. | 17.49.37 |
|
||||
| `enable-wide-searchbar` | Replaces the search icon with a wide search bar. This will hide the YouTube logo when active. | 17.49.37 |
|
||||
| `general-ads` | Removes general ads. | 17.49.37 |
|
||||
| `hdr-auto-brightness` | Makes the brightness of HDR videos follow the system default. | 17.49.37 |
|
||||
| `hide-album-cards` | Hides the album cards below the artist description. | 17.49.37 |
|
||||
| `hide-artist-card` | Hides the artist card below the searchbar. | 17.49.37 |
|
||||
| `hide-autoplay-button` | Hides the autoplay button in the video player. | 17.49.37 |
|
||||
| `hide-breaking-news-shelf` | Hides the breaking news shelf on the homepage tab. | 17.49.37 |
|
||||
| `hide-captions-button` | Hides the captions button on video player. | 17.49.37 |
|
||||
| `downloads` | Enables downloading music and videos from YouTube. | 18.03.36 |
|
||||
| `enable-wide-searchbar` | Replaces the search icon with a wide search bar. This will hide the YouTube logo when active. | 18.03.36 |
|
||||
| `general-ads` | Removes general ads. | 18.03.36 |
|
||||
| `hdr-auto-brightness` | Makes the brightness of HDR videos follow the system default. | 18.03.36 |
|
||||
| `hide-album-cards` | Hides the album cards below the artist description. | 18.03.36 |
|
||||
| `hide-artist-card` | Hides the artist card below the searchbar. | 18.03.36 |
|
||||
| `hide-autoplay-button` | Hides the autoplay button in the video player. | 18.03.36 |
|
||||
| `hide-breaking-news-shelf` | Hides the breaking news shelf on the homepage tab. | 18.03.36 |
|
||||
| `hide-captions-button` | Hides the captions button on video player. | 18.03.36 |
|
||||
| `hide-cast-button` | Hides the cast button in the video player. | all |
|
||||
| `hide-create-button` | Hides the create button in the navigation bar. | 17.49.37 |
|
||||
| `hide-crowdfunding-box` | Hides the crowdfunding box between the player and video description. | 17.49.37 |
|
||||
| `hide-email-address` | Hides the email address in the account switcher. | 17.49.37 |
|
||||
| `hide-endscreen-cards` | Hides the suggested video cards at the end of a video in fullscreen. | 17.49.37 |
|
||||
| `hide-info-cards` | Hides info-cards in videos. | 17.49.37 |
|
||||
| `hide-my-mix` | Hides mix playlists. | 17.49.37 |
|
||||
| `hide-shorts-button` | Hides the shorts button on the navigation bar. | 17.49.37 |
|
||||
| `hide-time-and-seekbar` | Hides progress bar and time counter on videos. | 17.49.37 |
|
||||
| `hide-video-buttons` | Adds options to hide action buttons under a video. | 17.49.37 |
|
||||
| `hide-watch-in-vr` | Hides the Watch in VR option in the player settings flyout panel. | 17.49.37 |
|
||||
| `hide-watermark` | Hides creator's watermarks on videos. | 17.49.37 |
|
||||
| `microg-support` | Allows YouTube ReVanced to run without root and under a different package name with Vanced MicroG. | 17.49.37 |
|
||||
| `minimized-playback` | Enables minimized and background playback. | 17.49.37 |
|
||||
| `old-quality-layout` | Enables the original video quality flyout in the video player settings | 17.49.37 |
|
||||
| `open-links-directly` | Bypasses https://youtube.com/redirect URLs. | 17.49.37 |
|
||||
| `open-links-externally` | Open links outside of the app directly in your browser. | 17.49.37 |
|
||||
| `hide-create-button` | Hides the create button in the navigation bar. | 18.03.36 |
|
||||
| `hide-crowdfunding-box` | Hides the crowdfunding box between the player and video description. | 18.03.36 |
|
||||
| `hide-email-address` | Hides the email address in the account switcher. | 18.03.36 |
|
||||
| `hide-endscreen-cards` | Hides the suggested video cards at the end of a video in fullscreen. | 18.03.36 |
|
||||
| `hide-info-cards` | Hides info-cards in videos. | 18.03.36 |
|
||||
| `hide-my-mix` | Hides mix playlists. | 18.03.36 |
|
||||
| `hide-shorts-button` | Hides the shorts button on the navigation bar. | 18.03.36 |
|
||||
| `hide-time-and-seekbar` | Hides progress bar and time counter on videos. | 18.03.36 |
|
||||
| `hide-video-buttons` | Adds options to hide action buttons under a video. | 18.03.36 |
|
||||
| `hide-watch-in-vr` | Hides the Watch in VR option in the player settings flyout panel. | 18.03.36 |
|
||||
| `hide-watermark` | Hides creator's watermarks on videos. | 18.03.36 |
|
||||
| `microg-support` | Allows YouTube ReVanced to run without root and under a different package name with Vanced MicroG. | 18.03.36 |
|
||||
| `minimized-playback` | Enables minimized and background playback. | 18.03.36 |
|
||||
| `old-quality-layout` | Enables the original video quality flyout in the video player settings | 18.03.36 |
|
||||
| `open-links-directly` | Skips over redirection URLs to external links. | 18.03.36 |
|
||||
| `open-links-externally` | Open links outside of the app directly in your browser. | 18.03.36 |
|
||||
| `premium-heading` | Shows premium branding on the home screen. | all |
|
||||
| `remember-playback-rate` | Adds the ability to remember the playback rate you chose in the video playback rate flyout. | 17.49.37 |
|
||||
| `remember-video-quality` | Adds the ability to remember the video quality you chose in the video quality flyout. | 17.49.37 |
|
||||
| `remove-player-button-background` | Removes the background from the video player buttons. | 17.49.37 |
|
||||
| `return-youtube-dislike` | Shows the dislike count of videos using the Return YouTube Dislike API. | 17.49.37 |
|
||||
| `seekbar-tapping` | Enables tap-to-seek on the seekbar of the video player. | 17.49.37 |
|
||||
| `settings` | Adds settings for ReVanced to YouTube. | all |
|
||||
| `sponsorblock` | Integrate SponsorBlock. | 17.49.37 |
|
||||
| `spoof-app-version` | Tricks YouTube into thinking, you are running an older version of the app. One of the side effects also includes restoring the old UI. | 17.49.37 |
|
||||
| `swipe-controls` | Adds volume and brightness swipe controls. | 17.49.37 |
|
||||
| `tablet-mini-player` | Enables the tablet mini player layout. | 17.49.37 |
|
||||
| `remember-playback-rate` | Adds the ability to remember the playback rate you chose in the video playback rate flyout. | 18.03.36 |
|
||||
| `remember-video-quality` | Adds the ability to remember the video quality you chose in the video quality flyout. | 18.03.36 |
|
||||
| `remove-player-button-background` | Removes the background from the video player buttons. | 18.03.36 |
|
||||
| `return-youtube-dislike` | Shows the dislike count of videos using the Return YouTube Dislike API. | 18.03.36 |
|
||||
| `seekbar-tapping` | Enables tap-to-seek on the seekbar of the video player. | 18.03.36 |
|
||||
| `sponsorblock` | Integrates SponsorBlock which allows skipping video segments such as sponsored content. | 18.03.36 |
|
||||
| `spoof-app-version` | Tricks YouTube into thinking, you are running an older version of the app. One of the side effects also includes restoring the old UI. | 18.03.36 |
|
||||
| `swipe-controls` | Adds volume and brightness swipe controls. | 18.03.36 |
|
||||
| `tablet-mini-player` | Enables the tablet mini player layout. | 18.03.36 |
|
||||
| `theme` | Applies a custom theme. | all |
|
||||
| `video-ads` | Removes ads in the video player. | 17.49.37 |
|
||||
| `video-ads` | Removes ads in the video player. | 18.03.36 |
|
||||
</details>
|
||||
|
||||
### [📦 `com.google.android.apps.youtube.music`](https://play.google.com/store/apps/details?id=com.google.android.apps.youtube.music)
|
||||
@@ -161,7 +160,7 @@ The official Patch bundle provided by ReVanced and the community.
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `remove-bootloader-detection` | Removes the check for an unlocked bootloader. | 2.2.0 |
|
||||
| `remove-root-detection` | Removes the check for root permissions | 2.2.0 |
|
||||
| `remove-root-detection` | Removes the check for root permissions. | 2.2.0 |
|
||||
</details>
|
||||
|
||||
### [📦 `at.gv.oe.app`](https://play.google.com/store/apps/details?id=at.gv.oe.app)
|
||||
@@ -189,6 +188,14 @@ The official Patch bundle provided by ReVanced and the community.
|
||||
| `disable-ads` | Disables ads in HexEditor. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `com.spotify.lite`](https://play.google.com/store/apps/details?id=com.spotify.lite)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `enable-on-demand` | Enables listening to songs on-demand, allowing to play any song from playlists, albums or artists without limitations. This does not remove ads. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `org.citra.citra_emu`](https://play.google.com/store/apps/details?id=org.citra.citra_emu)
|
||||
<details>
|
||||
|
||||
@@ -221,6 +228,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>
|
||||
|
||||
### [📦 `net.binarymode.android.irplus`](https://play.google.com/store/apps/details?id=net.binarymode.android.irplus)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `remove-ads` | Removes all ads from the app. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `com.teslacoilsw.launcher`](https://play.google.com/store/apps/details?id=com.teslacoilsw.launcher)
|
||||
<details>
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
kotlin.code.style = official
|
||||
version = 2.157.0-dev.1
|
||||
version = 2.159.0-dev.1
|
||||
|
||||
@@ -20,14 +20,14 @@ internal class JsonGenerator : PatchesFileGenerator {
|
||||
it.version ?: "0.0.0",
|
||||
!it.include,
|
||||
it.options?.map { option ->
|
||||
Option(
|
||||
JsonPatch.Option(
|
||||
option.key,
|
||||
option.title,
|
||||
option.description,
|
||||
option.required,
|
||||
option.let { lo ->
|
||||
if (lo is PatchOption.ListOption<*>) {
|
||||
lo.options.toMutableList().toTypedArray()
|
||||
option.let { listOption ->
|
||||
if (listOption is PatchOption.ListOption<*>) {
|
||||
listOption.options.toMutableList().toTypedArray()
|
||||
} else null
|
||||
}
|
||||
)
|
||||
@@ -36,7 +36,7 @@ internal class JsonGenerator : PatchesFileGenerator {
|
||||
dep.java.patchName
|
||||
}?.toTypedArray() ?: emptyArray(),
|
||||
it.compatiblePackages?.map { pkg ->
|
||||
CompatiblePackage(pkg.name, pkg.versions)
|
||||
JsonPatch.CompatiblePackage(pkg.name, pkg.versions)
|
||||
}?.toTypedArray() ?: emptyArray()
|
||||
)
|
||||
}
|
||||
@@ -45,7 +45,7 @@ internal class JsonGenerator : PatchesFileGenerator {
|
||||
json.writeText(GsonBuilder().serializeNulls().create().toJson(patches))
|
||||
}
|
||||
|
||||
data class JsonPatch(
|
||||
private class JsonPatch(
|
||||
val name: String,
|
||||
val description: String,
|
||||
val version: String,
|
||||
@@ -53,18 +53,18 @@ internal class JsonGenerator : PatchesFileGenerator {
|
||||
val options: Array<Option>,
|
||||
val dependencies: Array<String>,
|
||||
val compatiblePackages: Array<CompatiblePackage>,
|
||||
)
|
||||
) {
|
||||
class CompatiblePackage(
|
||||
val name: String,
|
||||
val versions: Array<String>,
|
||||
)
|
||||
|
||||
data class CompatiblePackage(
|
||||
val name: String,
|
||||
val versions: Array<String>,
|
||||
)
|
||||
|
||||
data class Option(
|
||||
val key: String,
|
||||
val title: String,
|
||||
val description: String,
|
||||
val required: Boolean,
|
||||
val choices: Array<*>?,
|
||||
)
|
||||
class Option(
|
||||
val key: String,
|
||||
val title: String,
|
||||
val description: String,
|
||||
val required: Boolean,
|
||||
val choices: Array<*>?,
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ import org.jf.dexlib2.iface.reference.MethodReference
|
||||
|
||||
@Patch(false)
|
||||
@Name("remove-screenshot-restriction")
|
||||
@Description("Removes the restriction of making screenshots.")
|
||||
@Description("Removes the restriction of taking screenshots in apps that normally wouldn't allow it.")
|
||||
@Version("0.0.1")
|
||||
class RemoveScreenshotRestrictionPatch : BytecodePatch() {
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import app.revanced.patches.finanzonline.detection.shared.annotations.DetectionC
|
||||
|
||||
@Patch
|
||||
@Name("remove-root-detection")
|
||||
@Description("Removes the check for root permissions")
|
||||
@Description("Removes the check for root permissions.")
|
||||
@DetectionCompatibility
|
||||
@Version("0.0.1")
|
||||
class RootDetectionPatch : BytecodePatch(
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package app.revanced.patches.youtube.misc.settings.annotations
|
||||
package app.revanced.patches.irplus.ad.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility([Package("com.google.android.youtube")])
|
||||
@Compatibility([Package("net.binarymode.android.irplus")])
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class SettingsCompatibility
|
||||
internal annotation class IrplusAdsCompatibility
|
||||
@@ -0,0 +1,12 @@
|
||||
package app.revanced.patches.irplus.ad.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
|
||||
object IrplusAdsFingerprint : MethodFingerprint(
|
||||
"V",
|
||||
AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
||||
listOf("L", "Z"),
|
||||
strings = listOf("TAGGED")
|
||||
)
|
||||
@@ -0,0 +1,33 @@
|
||||
package app.revanced.patches.irplus.ad.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.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.irplus.ad.annotations.IrplusAdsCompatibility
|
||||
import app.revanced.patches.irplus.ad.fingerprints.IrplusAdsFingerprint
|
||||
|
||||
|
||||
@Patch
|
||||
@Name("remove-ads")
|
||||
@Description("Removes all ads from the app.")
|
||||
@IrplusAdsCompatibility
|
||||
@Version("0.0.1")
|
||||
class IrplusAdsPatch : BytecodePatch(
|
||||
listOf(IrplusAdsFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
val method = IrplusAdsFingerprint.result!!.mutableMethod
|
||||
|
||||
// By overwriting the second parameter of the method,
|
||||
// the view which holds the advertisement is removed.
|
||||
method.addInstruction(0, "const/4 p2, 0x0")
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,9 @@ import app.revanced.patcher.annotation.Package
|
||||
"5.34.51",
|
||||
"5.36.51",
|
||||
"5.38.53",
|
||||
"5.39.52"
|
||||
"5.39.52",
|
||||
"5.40.51",
|
||||
"5.41.50"
|
||||
)
|
||||
)]
|
||||
)
|
||||
|
||||
@@ -23,7 +23,9 @@ import app.revanced.patcher.annotation.Package
|
||||
"5.34.51",
|
||||
"5.36.51",
|
||||
"5.38.53",
|
||||
"5.39.52"
|
||||
"5.39.52",
|
||||
"5.40.51",
|
||||
"5.41.50"
|
||||
)
|
||||
)]
|
||||
)
|
||||
|
||||
@@ -23,7 +23,9 @@ import app.revanced.patcher.annotation.Package
|
||||
"5.34.51",
|
||||
"5.36.51",
|
||||
"5.38.53",
|
||||
"5.39.52"
|
||||
"5.39.52",
|
||||
"5.40.51",
|
||||
"5.41.50"
|
||||
)
|
||||
)]
|
||||
)
|
||||
|
||||
@@ -22,7 +22,9 @@ import app.revanced.patcher.annotation.Package
|
||||
"5.34.51",
|
||||
"5.36.51",
|
||||
"5.38.53",
|
||||
"5.39.52"
|
||||
"5.39.52",
|
||||
"5.40.51",
|
||||
"5.41.50"
|
||||
)
|
||||
)]
|
||||
)
|
||||
|
||||
@@ -23,7 +23,9 @@ import app.revanced.patcher.annotation.Package
|
||||
"5.34.51",
|
||||
"5.36.51",
|
||||
"5.38.53",
|
||||
"5.39.52"
|
||||
"5.39.52",
|
||||
"5.40.51",
|
||||
"5.41.50"
|
||||
)
|
||||
)]
|
||||
)
|
||||
|
||||
@@ -25,7 +25,9 @@ import app.revanced.patcher.annotation.Package
|
||||
"5.34.51",
|
||||
"5.36.51",
|
||||
"5.38.53",
|
||||
"5.39.52"
|
||||
"5.39.52",
|
||||
"5.40.51",
|
||||
"5.41.50"
|
||||
)
|
||||
)]
|
||||
)
|
||||
|
||||
@@ -23,7 +23,9 @@ import app.revanced.patcher.annotation.Package
|
||||
"5.34.51",
|
||||
"5.36.51",
|
||||
"5.38.53",
|
||||
"5.39.52"
|
||||
"5.39.52",
|
||||
"5.40.51",
|
||||
"5.41.50"
|
||||
)
|
||||
)]
|
||||
)
|
||||
|
||||
@@ -22,8 +22,10 @@ import app.revanced.patcher.annotation.Package
|
||||
"5.31.50",
|
||||
"5.34.51",
|
||||
"5.36.51",
|
||||
"5.38.53",
|
||||
"5.39.52"
|
||||
"5.38.53",
|
||||
"5.39.52",
|
||||
"5.40.51",
|
||||
"5.41.50"
|
||||
)
|
||||
)]
|
||||
)
|
||||
|
||||
@@ -23,7 +23,9 @@ import app.revanced.patcher.annotation.Package
|
||||
"5.34.51",
|
||||
"5.36.51",
|
||||
"5.38.53",
|
||||
"5.39.52"
|
||||
"5.39.52",
|
||||
"5.40.51",
|
||||
"5.41.50"
|
||||
)
|
||||
)]
|
||||
)
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package app.revanced.patches.spotify.lite.ondemand.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package("com.spotify.lite")]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class OnDemandCompatibility
|
||||
@@ -0,0 +1,25 @@
|
||||
package app.revanced.patches.spotify.lite.ondemand.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@FuzzyPatternScanMethod(2)
|
||||
object OnDemandFingerprint : MethodFingerprint(
|
||||
"L",
|
||||
parameters = listOf(),
|
||||
opcodes = listOf(
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.GOTO,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IPUT,
|
||||
Opcode.RETURN_OBJECT
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,34 @@
|
||||
package app.revanced.patches.spotify.lite.ondemand.patch
|
||||
|
||||
import app.revanced.extensions.toErrorResult
|
||||
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.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.spotify.lite.ondemand.annotations.OnDemandCompatibility
|
||||
import app.revanced.patches.spotify.lite.ondemand.fingerprints.OnDemandFingerprint
|
||||
|
||||
@Patch
|
||||
@Name("enable-on-demand")
|
||||
@Description("Enables listening to songs on-demand, allowing to play any song from playlists, albums or artists without limitations. This does not remove ads.")
|
||||
@OnDemandCompatibility
|
||||
@Version("0.0.1")
|
||||
class OnDemandPatch : BytecodePatch(
|
||||
listOf(
|
||||
OnDemandFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
OnDemandFingerprint.result?.apply {
|
||||
val insertIndex = scanResult.patternScanResult!!.endIndex - 1
|
||||
// Spoof a premium account
|
||||
mutableMethod.addInstruction(insertIndex, "const/4 v0, 0x2")
|
||||
} ?: return OnDemandFingerprint.toErrorResult()
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -197,13 +197,6 @@ class GeneralAdsResourcePatch : ResourcePatch {
|
||||
StringResource("revanced_adremover_paid_content_enabled_summary_on", "Paid content is hidden"),
|
||||
StringResource("revanced_adremover_paid_content_enabled_summary_off", "Paid content is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_adremover_hide_suggestions",
|
||||
StringResource("revanced_adremover_hide_suggestions_enabled_title", "Hide suggestions"),
|
||||
true,
|
||||
StringResource("revanced_adremover_hide_suggestions_enabled_summary_on", "Suggestions are hidden"),
|
||||
StringResource("revanced_adremover_hide_suggestions_enabled_summary_off", "Suggestions are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_adremover_hide_latest_posts",
|
||||
StringResource("revanced_adremover_hide_latest_posts_enabled_title", "Hide latest posts"),
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[
|
||||
Package("com.google.android.youtube", arrayOf("17.49.37"))
|
||||
Package("com.google.android.youtube", arrayOf("17.49.37", "18.03.36"))
|
||||
]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -31,14 +31,14 @@ class CopyVideoUrlResourcePatch : ResourcePatch {
|
||||
StringResource("revanced_copy_video_url_title", "Copy video URL settings"),
|
||||
listOf(
|
||||
SwitchPreference(
|
||||
"revanced_copy_video_url",
|
||||
"revanced_copy_video_url_enabled",
|
||||
StringResource("revanced_copy_video_url_enabled_title", "Show copy video URL button"),
|
||||
true,
|
||||
StringResource("revanced_copy_video_url_enabled_summary_on", "Button is shown, click to copy video URL without timestamp"),
|
||||
StringResource("revanced_copy_video_url_enabled_summary_off", "Button is not shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_copy_video_url_timestamp",
|
||||
"revanced_copy_video_url_timestamp_enabled",
|
||||
StringResource("revanced_copy_video_url_timestamp_enabled_title", "Show copy timestamp URL button"),
|
||||
true,
|
||||
StringResource("revanced_copy_video_url_timestamp_enabled_summary_on", "Button is shown, click to copy video URL with timestamp"),
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -30,7 +30,7 @@ class DownloadsResourcePatch : ResourcePatch {
|
||||
StringResource("revanced_downloads_title", "Download settings"),
|
||||
listOf(
|
||||
SwitchPreference(
|
||||
"revanced_downloads",
|
||||
"revanced_downloads_enabled",
|
||||
StringResource("revanced_downloads_enabled_title", "Show download button"),
|
||||
true,
|
||||
StringResource("revanced_downloads_enabled_summary_on", "Download button is shown"),
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,10 +5,7 @@ import org.jf.dexlib2.Opcode
|
||||
|
||||
object PivotBarCreateButtonViewFingerprint : MethodFingerprint(
|
||||
opcodes = listOf(
|
||||
Opcode.MOVE_OBJECT,
|
||||
Opcode.INVOKE_DIRECT_RANGE, // unique instruction anchor
|
||||
Opcode.CONST_4,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_STATIC
|
||||
)
|
||||
)
|
||||
@@ -22,6 +22,7 @@ import app.revanced.patches.youtube.layout.pivotbar.utils.InjectionUtils.REGISTE
|
||||
import app.revanced.patches.youtube.layout.pivotbar.utils.InjectionUtils.injectHook
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Patch
|
||||
@DependsOn([IntegrationsPatch::class, ResourceMappingPatch::class, SettingsPatch::class, ResolvePivotBarFingerprintsPatch::class])
|
||||
@@ -54,17 +55,24 @@ class CreateButtonRemoverPatch : BytecodePatch() {
|
||||
return PivotBarCreateButtonViewFingerprint.toErrorResult()
|
||||
}
|
||||
|
||||
val createButtonResult = PivotBarCreateButtonViewFingerprint.result!!
|
||||
val insertIndex = createButtonResult.scanResult.patternScanResult!!.endIndex
|
||||
PivotBarCreateButtonViewFingerprint.result!!.apply {
|
||||
val insertIndex = mutableMethod.implementation!!.instructions.let {
|
||||
val scanStart = scanResult.patternScanResult!!.endIndex
|
||||
|
||||
/*
|
||||
* Inject hooks
|
||||
*/
|
||||
scanStart + it.subList(scanStart, it.size - 1).indexOfFirst { instruction ->
|
||||
instruction.opcode == Opcode.INVOKE_STATIC
|
||||
}
|
||||
}
|
||||
|
||||
val hook = "invoke-static { v$REGISTER_TEMPLATE_REPLACEMENT }, " +
|
||||
"$INTEGRATIONS_CLASS_DESCRIPTOR->hideCreateButton(Landroid/view/View;)V"
|
||||
/*
|
||||
* Inject hooks
|
||||
*/
|
||||
val hook = "invoke-static { v$REGISTER_TEMPLATE_REPLACEMENT }, " +
|
||||
"$INTEGRATIONS_CLASS_DESCRIPTOR->hideCreateButton(Landroid/view/View;)V"
|
||||
|
||||
mutableMethod.injectHook(hook, insertIndex)
|
||||
}
|
||||
|
||||
createButtonResult.mutableMethod.injectHook(hook, insertIndex)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[
|
||||
Package("com.google.android.youtube", arrayOf("17.49.37"))
|
||||
Package("com.google.android.youtube", arrayOf("17.49.37", "18.03.36"))
|
||||
]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -4,33 +4,14 @@ import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
|
||||
@FuzzyPatternScanMethod(3)
|
||||
object EngagementPanelControllerFingerprint : MethodFingerprint(
|
||||
"L", AccessFlags.PRIVATE or AccessFlags.FINAL, listOf("L", "L", "Z", "Z", "Z"), listOf(
|
||||
Opcode.MOVE_OBJECT_FROM16,
|
||||
Opcode.MOVE_OBJECT_FROM16,
|
||||
Opcode.MOVE_FROM16,
|
||||
Opcode.IGET_BOOLEAN,
|
||||
Opcode.CONST_4,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.CONST_STRING,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.CONST_STRING,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.RETURN_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.CONST_4,
|
||||
Opcode.CONST_4,
|
||||
Opcode.CONST_4,
|
||||
Opcode.CONST_4,
|
||||
Opcode.CONST_4,
|
||||
Opcode.CONST_4,
|
||||
returnType = "L",
|
||||
access = AccessFlags.PRIVATE or AccessFlags.FINAL,
|
||||
strings = listOf(
|
||||
"EngagementPanelController: cannot show EngagementPanel before EngagementPanelController.init() has been called.",
|
||||
"[EngagementPanel] Cannot show EngagementPanel before EngagementPanelController.init() has been called."
|
||||
)
|
||||
)
|
||||
@@ -1,5 +1,6 @@
|
||||
package app.revanced.patches.youtube.layout.playerpopuppanels.patch
|
||||
|
||||
import app.revanced.extensions.toErrorResult
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
@@ -10,12 +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.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.youtube.layout.playerpopuppanels.annotations.PlayerPopupPanelsCompatibility
|
||||
import app.revanced.patches.youtube.layout.playerpopuppanels.fingerprints.EngagementPanelControllerFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
|
||||
@Patch
|
||||
@DependsOn([IntegrationsPatch::class, SettingsPatch::class])
|
||||
@@ -39,7 +40,8 @@ class PlayerPopupPanelsPatch : BytecodePatch(
|
||||
)
|
||||
)
|
||||
|
||||
val engagementPanelControllerMethod = EngagementPanelControllerFingerprint.result!!.mutableMethod
|
||||
val engagementPanelControllerMethod = EngagementPanelControllerFingerprint
|
||||
.result?.mutableMethod ?: return EngagementPanelControllerFingerprint.toErrorResult()
|
||||
|
||||
engagementPanelControllerMethod.addInstructions(
|
||||
0, """
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -19,17 +19,28 @@ import app.revanced.patches.youtube.layout.returnyoutubedislike.annotations.Retu
|
||||
import app.revanced.patches.youtube.layout.returnyoutubedislike.fingerprints.*
|
||||
import app.revanced.patches.youtube.layout.returnyoutubedislike.resource.patch.ReturnYouTubeDislikeResourcePatch
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch
|
||||
import app.revanced.patches.youtube.misc.video.videoid.patch.VideoIdPatch
|
||||
|
||||
@Patch
|
||||
@DependsOn([IntegrationsPatch::class, VideoIdPatch::class, ReturnYouTubeDislikeResourcePatch::class])
|
||||
@DependsOn(
|
||||
[
|
||||
IntegrationsPatch::class,
|
||||
VideoIdPatch::class,
|
||||
ReturnYouTubeDislikeResourcePatch::class,
|
||||
PlayerTypeHookPatch::class,
|
||||
]
|
||||
)
|
||||
@Name("return-youtube-dislike")
|
||||
@Description("Shows the dislike count of videos using the Return YouTube Dislike API.")
|
||||
@ReturnYouTubeDislikeCompatibility
|
||||
@Version("0.0.1")
|
||||
class ReturnYouTubeDislikePatch : BytecodePatch(
|
||||
listOf(
|
||||
TextComponentSpecParentFingerprint, LikeFingerprint, DislikeFingerprint, RemoveLikeFingerprint
|
||||
TextComponentSpecParentFingerprint,
|
||||
LikeFingerprint,
|
||||
DislikeFingerprint,
|
||||
RemoveLikeFingerprint,
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
package app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints
|
||||
|
||||
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.sponsorblock.resource.patch.SponsorBlockResourcePatch
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
|
||||
|
||||
|
||||
@FuzzyPatternScanMethod(3)
|
||||
object ShortsPlayerConstructorFingerprint : MethodFingerprint(
|
||||
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
||||
opcodes = listOf(
|
||||
Opcode.MOVE_OBJECT_FROM16,
|
||||
Opcode.MOVE_OBJECT_FROM16,
|
||||
Opcode.MOVE_OBJECT_FROM16,
|
||||
Opcode.INVOKE_DIRECT_RANGE,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.CONST_4
|
||||
),
|
||||
customFingerprint = { methodDef ->
|
||||
methodDef.implementation?.instructions?.any { instruction ->
|
||||
instruction.opcode.ordinal == Opcode.CONST.ordinal &&
|
||||
(instruction as? WideLiteralInstruction)?.wideLiteral == SponsorBlockResourcePatch.reelButtonGroupResourceId
|
||||
} == true
|
||||
}
|
||||
)
|
||||
@@ -19,12 +19,12 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.shared.fingerprints.SeekbarFingerprint
|
||||
import app.revanced.patches.shared.fingerprints.SeekbarOnDrawFingerprint
|
||||
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
|
||||
import app.revanced.patches.youtube.layout.autocaptions.fingerprints.StartVideoInformerFingerprint
|
||||
import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility
|
||||
import app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints.*
|
||||
import app.revanced.patches.youtube.layout.sponsorblock.resource.patch.SponsorBlockResourcePatch
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.playercontrols.bytecode.patch.PlayerControlsBytecodePatch
|
||||
import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch
|
||||
import app.revanced.patches.youtube.misc.video.information.patch.VideoInformationPatch
|
||||
import app.revanced.patches.youtube.misc.video.videoid.patch.VideoIdPatch
|
||||
import org.jf.dexlib2.Opcode
|
||||
@@ -39,13 +39,14 @@ import org.jf.dexlib2.iface.reference.StringReference
|
||||
dependencies = [
|
||||
VideoInformationPatch::class, // updates video information and adds method to seek in video
|
||||
PlayerControlsBytecodePatch::class,
|
||||
PlayerTypeHookPatch::class,
|
||||
IntegrationsPatch::class,
|
||||
SponsorBlockResourcePatch::class,
|
||||
VideoIdPatch::class
|
||||
]
|
||||
)
|
||||
@Name("sponsorblock")
|
||||
@Description("Integrate SponsorBlock.")
|
||||
@Description("Integrates SponsorBlock which allows skipping video segments such as sponsored content.")
|
||||
@SponsorBlockCompatibility
|
||||
@Version("0.0.1")
|
||||
class SponsorBlockBytecodePatch : BytecodePatch(
|
||||
@@ -54,8 +55,6 @@ class SponsorBlockBytecodePatch : BytecodePatch(
|
||||
NextGenWatchLayoutFingerprint,
|
||||
AppendTimeFingerprint,
|
||||
PlayerOverlaysLayoutInitFingerprint,
|
||||
ShortsPlayerConstructorFingerprint,
|
||||
StartVideoInformerFingerprint
|
||||
)
|
||||
) {
|
||||
|
||||
@@ -260,32 +259,15 @@ class SponsorBlockBytecodePatch : BytecodePatch(
|
||||
if (it.opcode.ordinal != Opcode.CONST_STRING.ordinal) continue
|
||||
|
||||
when (((it as ReferenceInstruction).reference as StringReference).string) {
|
||||
"replaceMeWithsetSponsorBarRect" ->
|
||||
method.replaceStringInstruction(index, it, rectangleFieldName)
|
||||
|
||||
"replaceMeWithsetMillisecondMethod" ->
|
||||
method.replaceStringInstruction(index, it, "seekHelper")
|
||||
"replaceMeWithsetSponsorBarRect" -> method.replaceStringInstruction(
|
||||
index,
|
||||
it,
|
||||
rectangleFieldName
|
||||
)
|
||||
}
|
||||
}
|
||||
} ?: return PatchResultError("Could not find the method which contains the replaceMeWith* strings")
|
||||
|
||||
val startVideoInformerMethod = StartVideoInformerFingerprint.result!!.mutableMethod
|
||||
startVideoInformerMethod.addInstructions(
|
||||
0, """
|
||||
const/4 v0, 0x0
|
||||
sput-boolean v0, $INTEGRATIONS_PLAYER_CONTROLLER_CLASS_DESCRIPTOR->shorts_playing:Z
|
||||
"""
|
||||
)
|
||||
|
||||
val shortsPlayerConstructorMethod = ShortsPlayerConstructorFingerprint.result!!.mutableMethod
|
||||
|
||||
shortsPlayerConstructorMethod.addInstructions(
|
||||
0, """
|
||||
const/4 v0, 0x1
|
||||
sput-boolean v0, $INTEGRATIONS_PLAYER_CONTROLLER_CLASS_DESCRIPTOR->shorts_playing:Z
|
||||
"""
|
||||
)
|
||||
|
||||
// TODO: isSBChannelWhitelisting implementation
|
||||
|
||||
return PatchResultSuccess()
|
||||
|
||||
@@ -23,9 +23,6 @@ import app.revanced.util.resources.ResourceUtils.mergeStrings
|
||||
@DependsOn([FixLocaleConfigErrorPatch::class, SettingsPatch::class, ResourceMappingPatch::class])
|
||||
@Version("0.0.1")
|
||||
class SponsorBlockResourcePatch : ResourcePatch {
|
||||
companion object {
|
||||
internal var reelButtonGroupResourceId: Long = 0
|
||||
}
|
||||
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
val youtubePackage = "com.google.android.youtube"
|
||||
@@ -107,10 +104,6 @@ class SponsorBlockResourcePatch : ResourcePatch {
|
||||
}
|
||||
}.close() // close afterwards
|
||||
|
||||
reelButtonGroupResourceId = ResourceMappingPatch.resourceMappings.single {
|
||||
it.type == "id" && it.name == "reel_persistent_edu_button_group"
|
||||
}.id
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -29,7 +29,7 @@ class DebuggingPatch : ResourcePatch {
|
||||
listOf(
|
||||
SwitchPreference(
|
||||
"revanced_debug_enabled",
|
||||
StringResource("revanced_debug_enabled_title", "Enable debug logs"),
|
||||
StringResource("revanced_debug_enabled_title", "Debug logging"),
|
||||
false,
|
||||
StringResource("revanced_debug_summary_on", "Debug logs are enabled"),
|
||||
StringResource("revanced_debug_summary_off", "Debug logs are disabled")
|
||||
@@ -38,11 +38,21 @@ class DebuggingPatch : ResourcePatch {
|
||||
"revanced_debug_stacktrace_enabled",
|
||||
StringResource(
|
||||
"revanced_debug_stacktrace_enabled_title",
|
||||
"Print stack traces"
|
||||
"Log stack traces"
|
||||
),
|
||||
false,
|
||||
StringResource("revanced_debug_stacktrace_summary_on", "Enabled printing stack traces"),
|
||||
StringResource("revanced_debug_stacktrace_summary_off", "Disabled printing stack traces")
|
||||
StringResource("revanced_debug_stacktrace_summary_on", "Debug logs include stack trace"),
|
||||
StringResource("revanced_debug_stacktrace_summary_off", "Debug logs do not include stack trace")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_debug_toast_on_error_enabled",
|
||||
StringResource(
|
||||
"revanced_debug_toast_on_error_enabled_title",
|
||||
"Show toast on ReVanced error"
|
||||
),
|
||||
true,
|
||||
StringResource("revanced_debug_toast_on_error_summary_on", "Toast shown if error occurs"),
|
||||
StringResource("revanced_debug_toast_on_error_summary_off", "Toast not shown if error occurs")
|
||||
),
|
||||
),
|
||||
StringResource("revanced_debug_summary", "Enable or disable debugging options")
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
||||
@Patch
|
||||
@DependsOn([IntegrationsPatch::class, SettingsPatch::class])
|
||||
@Name("open-links-directly")
|
||||
@Description("Bypasses https://youtube.com/redirect URLs.")
|
||||
@Description("Skips over redirection URLs to external links.")
|
||||
@OpenLinksDirectlyCompatibility
|
||||
@Version("0.0.1")
|
||||
class OpenLinksDirectlyPatch : BytecodePatch(
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
package app.revanced.patches.youtube.misc.settings.bytecode.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
|
||||
object ThemeConstructorFingerprint : MethodFingerprint(
|
||||
"L",
|
||||
AccessFlags.PUBLIC or AccessFlags.STATIC,
|
||||
listOf("L"),
|
||||
strings = listOf("settings.SettingsActivity", ":android:show_fragment", "settings.GeneralPrefsFragment")
|
||||
)
|
||||
@@ -6,7 +6,10 @@ import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
object ThemeSetterAppFingerprint : MethodFingerprint(
|
||||
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, opcodes = listOf(
|
||||
"L",
|
||||
AccessFlags.PUBLIC or AccessFlags.STATIC,
|
||||
parameters = listOf("L", "L", "L", "L"),
|
||||
opcodes = listOf(
|
||||
Opcode.CONST, //target reference
|
||||
Opcode.GOTO,
|
||||
Opcode.CONST, //target reference
|
||||
|
||||
@@ -7,24 +7,19 @@ import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.addInstruction
|
||||
import app.revanced.patcher.extensions.addInstructions
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||
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.shared.settings.preference.impl.Preference
|
||||
import app.revanced.patches.shared.settings.util.AbstractPreferenceScreen
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
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.ThemeConstructorFingerprint
|
||||
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.resource.patch.SettingsResourcePatch
|
||||
import org.jf.dexlib2.util.MethodUtil
|
||||
|
||||
@Patch
|
||||
@DependsOn(
|
||||
[
|
||||
IntegrationsPatch::class,
|
||||
@@ -33,10 +28,9 @@ import org.jf.dexlib2.util.MethodUtil
|
||||
)
|
||||
@Name("settings")
|
||||
@Description("Adds settings for ReVanced to YouTube.")
|
||||
@SettingsCompatibility
|
||||
@Version("0.0.1")
|
||||
class SettingsPatch : BytecodePatch(
|
||||
listOf(LicenseActivityFingerprint, ThemeSetterSystemFingerprint, ThemeConstructorFingerprint)
|
||||
listOf(LicenseActivityFingerprint, ThemeSetterSystemFingerprint, ThemeSetterAppFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
fun buildInvokeInstructionsString(
|
||||
@@ -60,11 +54,7 @@ class SettingsPatch : BytecodePatch(
|
||||
}
|
||||
|
||||
// set the theme based on the preference of the app
|
||||
with((ThemeConstructorFingerprint.result?.let {
|
||||
ThemeSetterAppFingerprint.apply {
|
||||
if (!resolve(context, it.classDef)) return ThemeSetterAppFingerprint.toErrorResult()
|
||||
}
|
||||
} ?: return ThemeConstructorFingerprint.toErrorResult()).result!!) {
|
||||
ThemeSetterAppFingerprint.result?.apply {
|
||||
fun buildInstructionsString(theme: Int) = """
|
||||
const/4 v0, 0x$theme
|
||||
${buildInvokeInstructionsString(parameters = "I")}
|
||||
@@ -79,7 +69,6 @@ class SettingsPatch : BytecodePatch(
|
||||
addInstructions(
|
||||
patternScanResult.endIndex - 7, buildInstructionsString(0)
|
||||
)
|
||||
|
||||
addInstructions(
|
||||
patternScanResult.endIndex - 9, buildInstructionsString(1)
|
||||
)
|
||||
@@ -87,12 +76,11 @@ class SettingsPatch : BytecodePatch(
|
||||
implementation!!.instructions.size - 2, buildInstructionsString(0)
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
} ?: return ThemeSetterAppFingerprint.toErrorResult()
|
||||
|
||||
// set the theme based on the preference of the device
|
||||
with(LicenseActivityFingerprint.result!!) licenseActivity@{
|
||||
with(mutableMethod) {
|
||||
LicenseActivityFingerprint.result!!.apply licenseActivity@{
|
||||
mutableMethod.apply {
|
||||
fun buildSettingsActivityInvokeString(
|
||||
registers: String = "p0",
|
||||
classDescriptor: String = SETTINGS_ACTIVITY_DESCRIPTOR,
|
||||
@@ -113,7 +101,7 @@ class SettingsPatch : BytecodePatch(
|
||||
}
|
||||
|
||||
// remove method overrides
|
||||
with(mutableClass) {
|
||||
mutableClass.apply {
|
||||
methods.removeIf { it.name != "onCreate" && !MethodUtil.isConstructor(it) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ import app.revanced.patches.shared.settings.preference.impl.Preference
|
||||
import app.revanced.patches.shared.settings.preference.impl.PreferenceScreen
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.resource.patch.AbstractSettingsResourcePatch
|
||||
import app.revanced.patches.youtube.misc.settings.annotations.SettingsCompatibility
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
import app.revanced.util.resources.ResourceUtils
|
||||
import app.revanced.util.resources.ResourceUtils.copyResources
|
||||
@@ -23,7 +22,6 @@ import org.w3c.dom.Node
|
||||
|
||||
@Name("settings-resource-patch")
|
||||
@DependsOn([ResourceMappingPatch::class])
|
||||
@SettingsCompatibility
|
||||
@Description("Applies mandatory patches to implement ReVanced settings into the application.")
|
||||
@Version("0.0.1")
|
||||
class SettingsResourcePatch : AbstractSettingsResourcePatch(
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.49.37")
|
||||
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package app.revanced.patches.youtube.misc.videobuffer.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
object InvokeMaxBufferFingerprint : MethodFingerprint(
|
||||
"Z", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("J", "J", "F"),
|
||||
listOf(Opcode.CONST_WIDE_16),
|
||||
strings = listOf("scl.")
|
||||
)
|
||||
@@ -1,19 +1,8 @@
|
||||
package app.revanced.patches.youtube.misc.videobuffer.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.iface.instruction.NarrowLiteralInstruction
|
||||
|
||||
object MaxBufferFingerprint : MethodFingerprint(
|
||||
"I", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(),
|
||||
listOf(Opcode.SGET_OBJECT, Opcode.IGET, Opcode.IF_EQZ, Opcode.RETURN),
|
||||
customFingerprint = { methodDef ->
|
||||
methodDef.definingClass == "Lcom/google/android/libraries/youtube/innertube/model/media/PlayerConfigModel;"
|
||||
&& methodDef.implementation!!.instructions.any {
|
||||
((it as? NarrowLiteralInstruction)?.narrowLiteral == 120000)
|
||||
&& methodDef.name == "r"
|
||||
}
|
||||
}
|
||||
opcodes = listOf(Opcode.SGET_OBJECT, Opcode.IGET, Opcode.IF_EQZ, Opcode.RETURN),
|
||||
)
|
||||
@@ -1,24 +1,28 @@
|
||||
package app.revanced.patches.youtube.misc.videobuffer.patch
|
||||
|
||||
import app.revanced.extensions.toErrorResult
|
||||
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.data.toMethodWalker
|
||||
import app.revanced.patcher.extensions.addInstructions
|
||||
import app.revanced.patcher.extensions.instruction
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||
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.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.InputType
|
||||
import app.revanced.patches.shared.settings.preference.impl.PreferenceScreen
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.TextPreference
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
import app.revanced.patches.youtube.misc.videobuffer.annotations.CustomVideoBufferCompatibility
|
||||
import app.revanced.patches.youtube.misc.videobuffer.fingerprints.InvokeMaxBufferFingerprint
|
||||
import app.revanced.patches.youtube.misc.videobuffer.fingerprints.MaxBufferFingerprint
|
||||
import app.revanced.patches.youtube.misc.videobuffer.fingerprints.PlaybackBufferFingerprint
|
||||
import app.revanced.patches.youtube.misc.videobuffer.fingerprints.ReBufferFingerprint
|
||||
@@ -32,7 +36,9 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
@Version("0.0.1")
|
||||
class CustomVideoBufferPatch : BytecodePatch(
|
||||
listOf(
|
||||
MaxBufferFingerprint, PlaybackBufferFingerprint, ReBufferFingerprint
|
||||
InvokeMaxBufferFingerprint,
|
||||
PlaybackBufferFingerprint,
|
||||
ReBufferFingerprint,
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
@@ -78,60 +84,118 @@ class CustomVideoBufferPatch : BytecodePatch(
|
||||
StringResource("revanced_custom_video_buffer_summary", "Custom settings for video buffer")
|
||||
)
|
||||
)
|
||||
BufferType.values().forEach { type ->
|
||||
type.hook(context)
|
||||
}
|
||||
|
||||
execMaxBuffer()
|
||||
execPlaybackBuffer()
|
||||
execReBuffer()
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
private fun execMaxBuffer() {
|
||||
val (method, result) = MaxBufferFingerprint.unwrap(true, -1)
|
||||
val (index, register) = result
|
||||
/**
|
||||
* The type of buffer.
|
||||
*
|
||||
* @param patchInfo The corresponding information to patch the buffer type.
|
||||
* @param preparation Optional preparation before patching.
|
||||
*/
|
||||
private enum class BufferType(
|
||||
private val patchInfo: PatchInfo,
|
||||
private val preparation: (BytecodeContext.() -> Unit)? = null,
|
||||
) {
|
||||
|
||||
method.addInstructions(
|
||||
index + 1, """
|
||||
invoke-static {}, Lapp/revanced/integrations/patches/VideoBufferPatch;->getMaxBuffer()I
|
||||
move-result v$register
|
||||
"""
|
||||
)
|
||||
}
|
||||
PLAYBACK(PatchInfo(PlaybackBufferFingerprint, "getPlaybackBuffer")),
|
||||
RE(PatchInfo(ReBufferFingerprint, "getReBuffer")),
|
||||
MAX(
|
||||
PatchInfo(
|
||||
MaxBufferFingerprint,
|
||||
"getMaxBuffer",
|
||||
PatchInfo.UnwrapInfo(true, -1)
|
||||
),
|
||||
preparation@{
|
||||
InvokeMaxBufferFingerprint.result?.apply {
|
||||
val maxBufferMethodCallOffset = 2
|
||||
|
||||
private fun execPlaybackBuffer() {
|
||||
val (method, result) = PlaybackBufferFingerprint.unwrap()
|
||||
val (index, register) = result
|
||||
val maxBufferMethod = this@preparation.toMethodWalker(method)
|
||||
.nextMethod(scanResult.patternScanResult!!.endIndex + maxBufferMethodCallOffset)
|
||||
.getMethod()
|
||||
|
||||
method.addInstructions(
|
||||
index + 1, """
|
||||
invoke-static {}, Lapp/revanced/integrations/patches/VideoBufferPatch;->getPlaybackBuffer()I
|
||||
move-result v$register
|
||||
"""
|
||||
)
|
||||
}
|
||||
if (!MaxBufferFingerprint.resolve(
|
||||
this@preparation,
|
||||
maxBufferMethod,
|
||||
// This is inefficient because toMethodWalker technically already has context about this.
|
||||
// Alternatively you can iterate manually over all classes
|
||||
// instead of relying on toMethodWalker.
|
||||
this@preparation.findClass(maxBufferMethod.definingClass)!!.immutableClass,
|
||||
)
|
||||
) throw MaxBufferFingerprint.toErrorResult()
|
||||
} ?: throw InvokeMaxBufferFingerprint.toErrorResult()
|
||||
});
|
||||
|
||||
private fun execReBuffer() {
|
||||
val (method, result) = ReBufferFingerprint.unwrap()
|
||||
val (index, register) = result
|
||||
/**
|
||||
* Information about a patch.
|
||||
*
|
||||
* @param fingerprint The corresponding [MethodFingerprint] for the patch.
|
||||
* @param integrationsMethodName The corresponding name of the hooking method.
|
||||
* @param unwrapInfo Optional information on how to treat the [MethodFingerprint].
|
||||
*/
|
||||
private class PatchInfo(
|
||||
val fingerprint: MethodFingerprint,
|
||||
val integrationsMethodName: String,
|
||||
val unwrapInfo: UnwrapInfo? = null
|
||||
) {
|
||||
/**
|
||||
* Information on how to treat a [MethodFingerprint].
|
||||
*
|
||||
* @param useEndIndex Whether to retrieve information of the [MethodFingerprint]
|
||||
* from the end index of its pattern scan result.
|
||||
* @param offset An additional offset to [useEndIndex].
|
||||
*/
|
||||
class UnwrapInfo(val useEndIndex: Boolean = false, val offset: Int = 0)
|
||||
}
|
||||
|
||||
method.addInstructions(
|
||||
index + 1, """
|
||||
invoke-static {}, Lapp/revanced/integrations/patches/VideoBufferPatch;->getReBuffer()I
|
||||
move-result v$register
|
||||
"""
|
||||
)
|
||||
}
|
||||
fun hook(context: BytecodeContext) {
|
||||
/**
|
||||
* The resulting instruction info for unwrapping [MethodFingerprint].
|
||||
*
|
||||
* @param index The index of the instruction.
|
||||
* @param register The register of the instruction.
|
||||
*/
|
||||
data class InstructionResult(val index: Int, val register: Int)
|
||||
|
||||
private fun MethodFingerprint.unwrap(
|
||||
forEndIndex: Boolean = false,
|
||||
offset: Int = 0
|
||||
): Pair<MutableMethod, Pair<Int, Int>> {
|
||||
val result = this.result!!
|
||||
val method = result.mutableMethod
|
||||
val scanResult = result.scanResult.patternScanResult!!
|
||||
val index = (if (forEndIndex) scanResult.endIndex else scanResult.startIndex) + offset
|
||||
/***
|
||||
* The result of unwrapping [MethodFingerprint].
|
||||
*
|
||||
* @param method The method which was retrieved from the [MethodFingerprint].
|
||||
* @param instructionResult The resulting instruction info for unwrapping [MethodFingerprint].
|
||||
*/
|
||||
data class UnwrapResult(val method: MutableMethod, val instructionResult: InstructionResult)
|
||||
|
||||
val register = (method.instruction(index) as OneRegisterInstruction).registerA
|
||||
fun MethodFingerprint.unwrap(unwrapInfo: PatchInfo.UnwrapInfo? = null): UnwrapResult {
|
||||
val result = this.result!!
|
||||
val method = result.mutableMethod
|
||||
val scanResult = result.scanResult.patternScanResult!!
|
||||
val index =
|
||||
if (unwrapInfo?.useEndIndex == true) scanResult.endIndex
|
||||
else {
|
||||
scanResult.startIndex
|
||||
} + (unwrapInfo?.offset ?: 0)
|
||||
|
||||
return method to (index to register)
|
||||
val register = (method.instruction(index) as OneRegisterInstruction).registerA
|
||||
|
||||
return UnwrapResult(method, InstructionResult(index, register))
|
||||
}
|
||||
|
||||
preparation?.invoke(context)
|
||||
|
||||
val (method, result) = patchInfo.fingerprint.unwrap(patchInfo.unwrapInfo)
|
||||
val (index, register) = result
|
||||
|
||||
method.addInstructions(
|
||||
index + 1,
|
||||
"""
|
||||
invoke-static {}, Lapp/revanced/integrations/patches/VideoBufferPatch;->${patchInfo.integrationsMethodName}()I
|
||||
move-result v$register
|
||||
"""
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,8 @@ internal object MicroGResourceHelper {
|
||||
* @param context The resource context.
|
||||
* @param stringsHost The file which hosts the strings.
|
||||
*/
|
||||
fun addStrings(context: ResourceContext, stringsHost: String = "microg/host/values/strings.xml") = context.mergeStrings(stringsHost)
|
||||
fun addStrings(context: ResourceContext, stringsHost: String = "microg/host/values/strings.xml") =
|
||||
context.mergeStrings(stringsHost)
|
||||
|
||||
/**
|
||||
* Patch the manifest to work with MicroG.
|
||||
@@ -47,6 +48,9 @@ internal object MicroGResourceHelper {
|
||||
).replace(
|
||||
"$fromPackageName.permission.C2D_MESSAGE",
|
||||
"$toPackageName.permission.C2D_MESSAGE"
|
||||
).replace(
|
||||
"$fromPackageName.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION",
|
||||
"$toPackageName.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION"
|
||||
).replace(
|
||||
"com.google.android.c2dm",
|
||||
"${Constants.MICROG_VENDOR}.android.c2dm"
|
||||
|
||||
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 1.1 KiB |