Compare commits

...

28 Commits

Author SHA1 Message Date
semantic-release-bot
e4034bc6fd chore(release): 2.174.0-dev.29 [skip ci]
# [2.174.0-dev.29](https://github.com/revanced/revanced-patches/compare/v2.174.0-dev.28...v2.174.0-dev.29) (2023-05-16)

### Features

* **youtube/downloads:** improve patch description ([0b79e89](0b79e8960e))
2023-05-16 02:34:51 +00:00
oSumAtrIX
0b79e8960e feat(youtube/downloads): improve patch description 2023-05-16 04:27:47 +02:00
oSumAtrIX
0b10d5589f refactor: remove unused annotations 2023-05-16 04:27:30 +02:00
semantic-release-bot
8df6aaf087 chore(release): 2.174.0-dev.28 [skip ci]
# [2.174.0-dev.28](https://github.com/revanced/revanced-patches/compare/v2.174.0-dev.27...v2.174.0-dev.28) (2023-05-15)

### Bug Fixes

* **youtube:** add missing compatibility annotations for `theme` and `hide-load-more-button` ([#2150](https://github.com/revanced/revanced-patches/issues/2150)) ([0555cdc](0555cdc54f))

### Features

* **youtube:** import / export of revanced settings ([#2077](https://github.com/revanced/revanced-patches/issues/2077)) ([5ff3215](5ff3215132))
2023-05-15 07:53:27 +00:00
LisoUseInAIKyrios
5ff3215132 feat(youtube): import / export of revanced settings (#2077)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-05-15 11:51:43 +04:00
Dawid K
0555cdc54f fix(youtube): add missing compatibility annotations for theme and hide-load-more-button (#2150) 2023-05-15 11:49:44 +04:00
semantic-release-bot
018bf78e85 chore(release): 2.174.0-dev.27 [skip ci]
# [2.174.0-dev.27](https://github.com/revanced/revanced-patches/compare/v2.174.0-dev.26...v2.174.0-dev.27) (2023-05-14)

### Bug Fixes

* **youtube/video-speed:** add compatibility annotation ([#2156](https://github.com/revanced/revanced-patches/issues/2156)) ([1a72c9b](1a72c9b6b0))
2023-05-14 23:09:19 +00:00
LisoUseInAIKyrios
1a72c9b6b0 fix(youtube/video-speed): add compatibility annotation (#2156) 2023-05-15 03:07:36 +04:00
semantic-release-bot
d72c68e3a0 chore(release): 2.174.0-dev.26 [skip ci]
# [2.174.0-dev.26](https://github.com/revanced/revanced-patches/compare/v2.174.0-dev.25...v2.174.0-dev.26) (2023-05-14)

### Bug Fixes

* **youtube/return-youtube-dislikes:** fix temporarily frozen video after opening a shorts ([#2126](https://github.com/revanced/revanced-patches/issues/2126)) ([074279a](074279ad3d))
2023-05-14 07:30:53 +00:00
LisoUseInAIKyrios
074279ad3d fix(youtube/return-youtube-dislikes): fix temporarily frozen video after opening a shorts (#2126)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-05-14 11:29:07 +04:00
semantic-release-bot
1b8a1ef5b1 chore(release): 2.174.0-dev.25 [skip ci]
# [2.174.0-dev.25](https://github.com/revanced/revanced-patches/compare/v2.174.0-dev.24...v2.174.0-dev.25) (2023-05-14)
2023-05-14 00:05:28 +00:00
oSumAtrIX
3c324bfe3d build(revanced-patcher): bump version 2023-05-14 02:02:43 +02:00
badawoll
386d687ca1 refactor: migrate to changes from ReVanced Patcher 2023-05-14 02:02:43 +02:00
semantic-release-bot
8399eaa288 chore(release): 2.174.0-dev.24 [skip ci]
# [2.174.0-dev.24](https://github.com/revanced/revanced-patches/compare/v2.174.0-dev.23...v2.174.0-dev.24) (2023-05-13)

### Features

* **twitch/auto-claim-channel-points:** use correct casing for "Channel Points" ([#2138](https://github.com/revanced/revanced-patches/issues/2138)) ([6346054](63460542d0))
2023-05-13 13:36:29 +00:00
redphx
63460542d0 feat(twitch/auto-claim-channel-points): use correct casing for "Channel Points" (#2138) 2023-05-13 15:34:00 +02:00
semantic-release-bot
ba52570ad6 chore(release): 2.174.0-dev.23 [skip ci]
# [2.174.0-dev.23](https://github.com/revanced/revanced-patches/compare/v2.174.0-dev.22...v2.174.0-dev.23) (2023-05-13)

### Bug Fixes

* **youtube/custom-video-speed:** add missing class for `video-speeds` patch ([#2137](https://github.com/revanced/revanced-patches/issues/2137)) ([bb30371](bb303713bd))
2023-05-13 12:37:19 +00:00
johnconner122
bb303713bd fix(youtube/custom-video-speed): add missing class for video-speeds patch (#2137)
This has been caused by a recent merge conflict resolution.

Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-05-13 14:35:21 +02:00
semantic-release-bot
1541e73e92 chore(release): 2.174.0-dev.22 [skip ci]
# [2.174.0-dev.22](https://github.com/revanced/revanced-patches/compare/v2.174.0-dev.21...v2.174.0-dev.22) (2023-05-12)

### Features

* **youtube:** move video settings to `Video` settings category ([#2010](https://github.com/revanced/revanced-patches/issues/2010)) ([1d707b0](1d707b07b4))
2023-05-12 23:34:57 +00:00
johnconner122
1d707b07b4 feat(youtube): move video settings to Video settings category (#2010)
Co-authored-by: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-05-13 01:32:41 +02:00
semantic-release-bot
79e36e2b74 chore(release): 2.174.0-dev.21 [skip ci]
# [2.174.0-dev.21](https://github.com/revanced/revanced-patches/compare/v2.174.0-dev.20...v2.174.0-dev.21) (2023-05-12)

### Features

* **twitch:** add `auto-claim-channel-points` patch ([#2131](https://github.com/revanced/revanced-patches/issues/2131)) ([46552a5](46552a5ab8))
2023-05-12 23:22:07 +00:00
redphx
46552a5ab8 feat(twitch): add auto-claim-channel-points patch (#2131)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-05-13 01:19:33 +02:00
semantic-release-bot
529e90d232 chore(release): 2.174.0-dev.20 [skip ci]
# [2.174.0-dev.20](https://github.com/revanced/revanced-patches/compare/v2.174.0-dev.19...v2.174.0-dev.20) (2023-05-12)

### Features

* **youtube:** add `hide-filter-bar` patch ([c72fd1e](c72fd1e2fc))
2023-05-12 23:06:33 +00:00
oSumAtrIX
c72fd1e2fc feat(youtube): add hide-filter-bar patch 2023-05-13 01:03:48 +02:00
semantic-release-bot
48965ace7e chore(release): 2.174.0-dev.19 [skip ci]
# [2.174.0-dev.19](https://github.com/revanced/revanced-patches/compare/v2.174.0-dev.18...v2.174.0-dev.19) (2023-05-11)

### Features

* **youtube/video-speed:** change custom video speeds inside app settings ([#2114](https://github.com/revanced/revanced-patches/issues/2114)) ([08f1702](08f1702b18))
2023-05-11 06:27:32 +00:00
LisoUseInAIKyrios
08f1702b18 feat(youtube/video-speed): change custom video speeds inside app settings (#2114) 2023-05-11 10:25:21 +04:00
semantic-release-bot
45784eceee chore(release): 2.174.0-dev.18 [skip ci]
# [2.174.0-dev.18](https://github.com/revanced/revanced-patches/compare/v2.174.0-dev.17...v2.174.0-dev.18) (2023-05-11)

### Bug Fixes

* **youtube/theme:** apply custom seekbar color to video thumbnails ([#2085](https://github.com/revanced/revanced-patches/issues/2085)) ([f891aa9](f891aa937c))
2023-05-11 06:24:29 +00:00
LisoUseInAIKyrios
f891aa937c fix(youtube/theme): apply custom seekbar color to video thumbnails (#2085) 2023-05-11 10:22:37 +04:00
LisoUseInAIKyrios
aa493c4f67 chore: fix merge 2023-05-09 21:08:12 +04:00
238 changed files with 1530 additions and 1219 deletions

View File

@@ -1,3 +1,87 @@
# [2.174.0-dev.29](https://github.com/revanced/revanced-patches/compare/v2.174.0-dev.28...v2.174.0-dev.29) (2023-05-16)
### Features
* **youtube/downloads:** improve patch description ([e0f6452](https://github.com/revanced/revanced-patches/commit/e0f64520d0235ea219f1965ba34b7e52ded9c1d9))
# [2.174.0-dev.28](https://github.com/revanced/revanced-patches/compare/v2.174.0-dev.27...v2.174.0-dev.28) (2023-05-15)
### Bug Fixes
* **youtube:** add missing compatibility annotations for `theme` and `hide-load-more-button` ([#2150](https://github.com/revanced/revanced-patches/issues/2150)) ([78803f8](https://github.com/revanced/revanced-patches/commit/78803f8ea85684e4c69e75b676fa40bae8760957))
### Features
* **youtube:** import / export of revanced settings ([#2077](https://github.com/revanced/revanced-patches/issues/2077)) ([b59cb3e](https://github.com/revanced/revanced-patches/commit/b59cb3ed60293aaf81067ff3469863add09c6b13))
# [2.174.0-dev.27](https://github.com/revanced/revanced-patches/compare/v2.174.0-dev.26...v2.174.0-dev.27) (2023-05-14)
### Bug Fixes
* **youtube/video-speed:** add compatibility annotation ([#2156](https://github.com/revanced/revanced-patches/issues/2156)) ([ffa2e5d](https://github.com/revanced/revanced-patches/commit/ffa2e5d7eb0b90bb5c7a6854bab4caf9f810d917))
# [2.174.0-dev.26](https://github.com/revanced/revanced-patches/compare/v2.174.0-dev.25...v2.174.0-dev.26) (2023-05-14)
### Bug Fixes
* **youtube/return-youtube-dislikes:** fix temporarily frozen video after opening a shorts ([#2126](https://github.com/revanced/revanced-patches/issues/2126)) ([e0877e3](https://github.com/revanced/revanced-patches/commit/e0877e33814ba396e64e18a577064aa5be952413))
# [2.174.0-dev.25](https://github.com/revanced/revanced-patches/compare/v2.174.0-dev.24...v2.174.0-dev.25) (2023-05-14)
# [2.174.0-dev.24](https://github.com/revanced/revanced-patches/compare/v2.174.0-dev.23...v2.174.0-dev.24) (2023-05-13)
### Features
* **twitch/auto-claim-channel-points:** use correct casing for "Channel Points" ([#2138](https://github.com/revanced/revanced-patches/issues/2138)) ([76a3bf2](https://github.com/revanced/revanced-patches/commit/76a3bf23b5e5591ae635e612af07cbbd78d49f53))
# [2.174.0-dev.23](https://github.com/revanced/revanced-patches/compare/v2.174.0-dev.22...v2.174.0-dev.23) (2023-05-13)
### Bug Fixes
* **youtube/custom-video-speed:** add missing class for `video-speeds` patch ([#2137](https://github.com/revanced/revanced-patches/issues/2137)) ([758ef42](https://github.com/revanced/revanced-patches/commit/758ef42f9cd36d665b1737b67bcdde22d3e3eb98))
# [2.174.0-dev.22](https://github.com/revanced/revanced-patches/compare/v2.174.0-dev.21...v2.174.0-dev.22) (2023-05-12)
### Features
* **youtube:** move video settings to `Video` settings category ([#2010](https://github.com/revanced/revanced-patches/issues/2010)) ([f4b9180](https://github.com/revanced/revanced-patches/commit/f4b918075a70d1a4ed9ac7e9c1f0e0acd1c77404))
# [2.174.0-dev.21](https://github.com/revanced/revanced-patches/compare/v2.174.0-dev.20...v2.174.0-dev.21) (2023-05-12)
### Features
* **twitch:** add `auto-claim-channel-points` patch ([#2131](https://github.com/revanced/revanced-patches/issues/2131)) ([80fb670](https://github.com/revanced/revanced-patches/commit/80fb6701b52a8c6c6bada5546dffe3438f0e4879))
# [2.174.0-dev.20](https://github.com/revanced/revanced-patches/compare/v2.174.0-dev.19...v2.174.0-dev.20) (2023-05-12)
### Features
* **youtube:** add `hide-filter-bar` patch ([6cc5f61](https://github.com/revanced/revanced-patches/commit/6cc5f61e0712fe25cd45b137773decaf4b9bb582))
# [2.174.0-dev.19](https://github.com/revanced/revanced-patches/compare/v2.174.0-dev.18...v2.174.0-dev.19) (2023-05-11)
### Features
* **youtube/video-speed:** change custom video speeds inside app settings ([#2114](https://github.com/revanced/revanced-patches/issues/2114)) ([d97815a](https://github.com/revanced/revanced-patches/commit/d97815af18e645fd0fa087db0174bcc2a771ec72))
# [2.174.0-dev.18](https://github.com/revanced/revanced-patches/compare/v2.174.0-dev.17...v2.174.0-dev.18) (2023-05-11)
### Bug Fixes
* **youtube/theme:** apply custom seekbar color to video thumbnails ([#2085](https://github.com/revanced/revanced-patches/issues/2085)) ([d497027](https://github.com/revanced/revanced-patches/commit/d4970273ad10f62cd9455ef9b847c686147f7dca))
# [2.174.0-dev.17](https://github.com/revanced/revanced-patches/compare/v2.174.0-dev.16...v2.174.0-dev.17) (2023-05-09) # [2.174.0-dev.17](https://github.com/revanced/revanced-patches/compare/v2.174.0-dev.16...v2.174.0-dev.17) (2023-05-09)

View File

@@ -15,13 +15,12 @@ The official ReVanced Patches.
| `copy-video-url` | Adds buttons in player to copy video links. | 18.16.37 | | `copy-video-url` | Adds buttons in player to copy video links. | 18.16.37 |
| `custom-branding` | Changes the YouTube launcher icon and name to your choice (defaults to ReVanced). | all | | `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. | 18.16.37 | | `custom-video-buffer` | Lets you change the buffers of videos. | 18.16.37 |
| `custom-video-speed` | Adds more video speed options. | 18.16.37 |
| `disable-auto-captions` | Disable forced captions from being automatically enabled. | 18.16.37 | | `disable-auto-captions` | Disable forced captions from being automatically enabled. | 18.16.37 |
| `disable-fullscreen-panels` | Disables video description and comments panel in fullscreen view. | 18.16.37 | | `disable-fullscreen-panels` | Disables video description and comments panel in fullscreen view. | 18.16.37 |
| `disable-player-popup-panels` | Disables panels from appearing automatically when going into fullscreen (playlist or live chat). | 18.16.37 | | `disable-player-popup-panels` | Disables panels from appearing automatically when going into fullscreen (playlist or live chat). | 18.16.37 |
| `disable-shorts-on-startup` | Disables playing YouTube Shorts when launching YouTube. | 18.16.37 | | `disable-shorts-on-startup` | Disables playing YouTube Shorts when launching YouTube. | 18.16.37 |
| `disable-zoom-haptics` | Disables haptics when zooming. | all | | `disable-zoom-haptics` | Disables haptics when zooming. | all |
| `downloads` | Enables downloading music and videos from YouTube. | 18.16.37 | | `downloads` | Adds a download button to the YouTube video player. | 18.16.37 |
| `enable-debugging` | Adds debugging options. | all | | `enable-debugging` | Adds debugging options. | all |
| `general-ads` | Removes general ads. | 18.16.37 | | `general-ads` | Removes general ads. | 18.16.37 |
| `hdr-auto-brightness` | Makes the brightness of HDR videos follow the system default. | 18.16.37 | | `hdr-auto-brightness` | Makes the brightness of HDR videos follow the system default. | 18.16.37 |
@@ -34,9 +33,11 @@ The official ReVanced Patches.
| `hide-crowdfunding-box` | Hides the crowdfunding box between the player and video description. | 18.16.37 | | `hide-crowdfunding-box` | Hides the crowdfunding box between the player and video description. | 18.16.37 |
| `hide-email-address` | Hides the email address in the account switcher. | 18.16.37 | | `hide-email-address` | Hides the email address in the account switcher. | 18.16.37 |
| `hide-endscreen-cards` | Hides the suggested video cards at the end of a video in fullscreen. | 18.16.37 | | `hide-endscreen-cards` | Hides the suggested video cards at the end of a video in fullscreen. | 18.16.37 |
| `hide-filter-bar` | Hides the filter bar in video feeds. | 18.16.37 |
| `hide-floating-microphone-button` | Hides the floating microphone button which appears in search. | 18.16.37 | | `hide-floating-microphone-button` | Hides the floating microphone button which appears in search. | 18.16.37 |
| `hide-get-premium` | Hides advertisement for YouTube Premium under the video player. | 18.16.37 | | `hide-get-premium` | Hides advertisement for YouTube Premium under the video player. | 18.16.37 |
| `hide-info-cards` | Hides info cards in videos. | 18.16.37 | | `hide-info-cards` | Hides info cards in videos. | 18.16.37 |
| `hide-load-more-button` | Hides the button under videos that loads similar videos. | 18.16.37 |
| `hide-player-buttons` | Adds the option to hide video player previous and next buttons. | all | | `hide-player-buttons` | Adds the option to hide video player previous and next buttons. | all |
| `hide-player-overlay` | Hides the dark background overlay from the player when player controls are visible. | all | | `hide-player-overlay` | Hides the dark background overlay from the player when player controls are visible. | all |
| `hide-seekbar` | Hides the seekbar. | 18.16.37 | | `hide-seekbar` | Hides the seekbar. | 18.16.37 |
@@ -49,7 +50,6 @@ The official ReVanced Patches.
| `old-quality-layout` | Enables the original video quality flyout in the video player settings | 18.16.37 | | `old-quality-layout` | Enables the original video quality flyout in the video player settings | 18.16.37 |
| `open-links-externally` | Open links outside of the app directly in your browser. | 18.16.37 | | `open-links-externally` | Open links outside of the app directly in your browser. | 18.16.37 |
| `premium-heading` | Shows premium branding on the home screen. | all | | `premium-heading` | Shows premium branding on the home screen. | all |
| `remember-playback-speed` | Adds the ability to remember the playback speed you chose in the video playback speed flyout. | 18.16.37 |
| `remember-video-quality` | Adds the ability to remember the video quality you chose in the video quality flyout. | 18.16.37 | | `remember-video-quality` | Adds the ability to remember the video quality you chose in the video quality flyout. | 18.16.37 |
| `remove-player-button-background` | Removes the background from the video player buttons. | 18.16.37 | | `remove-player-button-background` | Removes the background from the video player buttons. | 18.16.37 |
| `return-youtube-dislike` | Shows the dislike count of videos using the Return YouTube Dislike API. | 18.16.37 | | `return-youtube-dislike` | Shows the dislike count of videos using the Return YouTube Dislike API. | 18.16.37 |
@@ -61,6 +61,7 @@ The official ReVanced Patches.
| `theme` | Applies a custom theme. | all | | `theme` | Applies a custom theme. | all |
| `vanced-microg-support` | Allows YouTube ReVanced to run without root and under a different package name with Vanced MicroG. | 18.16.37 | | `vanced-microg-support` | Allows YouTube ReVanced to run without root and under a different package name with Vanced MicroG. | 18.16.37 |
| `video-ads` | Removes ads in the video player. | 18.16.37 | | `video-ads` | Removes ads in the video player. | 18.16.37 |
| `video-speed` | Adds custom video speeds and ability to remember the playback speed you chose in the video playback speed flyout. | 18.16.37 |
| `wide-searchbar` | Replaces the search icon with a wide search bar. This will hide the YouTube logo when active. | 18.16.37 | | `wide-searchbar` | Replaces the search icon with a wide search bar. This will hide the YouTube logo when active. | 18.16.37 |
</details> </details>
@@ -119,6 +120,7 @@ The official ReVanced Patches.
| 💊 Patch | 📜 Description | 🏹 Target Version | | 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:| |:--------:|:--------------:|:-----------------:|
| `auto-claim-channel-points` | Automatically claim Channel Points. | all |
| `block-audio-ads` | Blocks audio ads in streams and VODs. | 14.6.1 | | `block-audio-ads` | Blocks audio ads in streams and VODs. | 14.6.1 |
| `block-embedded-ads` | Blocks embedded stream ads using services like TTV.lol or PurpleAdBlocker. | 14.6.1 | | `block-embedded-ads` | Blocks embedded stream ads using services like TTV.lol or PurpleAdBlocker. | 14.6.1 |
| `block-video-ads` | Blocks video ads in streams and VODs. | 14.6.1 | | `block-video-ads` | Blocks video ads in streams and VODs. | 14.6.1 |
@@ -313,30 +315,6 @@ The official ReVanced Patches.
| `unlock-prime` | Unlocks Nova Prime and all functions of the app. | all | | `unlock-prime` | Unlocks Nova Prime and all functions of the app. | all |
</details> </details>
### [📦 `co.windyapp.android`](https://play.google.com/store/apps/details?id=co.windyapp.android)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `unlock-pro` | Unlocks all pro features. | all |
</details>
### [📦 `org.totschnig.myexpenses`](https://play.google.com/store/apps/details?id=org.totschnig.myexpenses)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `unlock-pro` | Unlocks all professional features. | 3.4.9 |
</details>
### [📦 `com.zombodroid.MemeGenerator`](https://play.google.com/store/apps/details?id=com.zombodroid.MemeGenerator)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `unlock-pro` | Unlocks pro features. | 4.6377 |
</details>
### [📦 `com.ithebk.expensemanager`](https://play.google.com/store/apps/details?id=com.ithebk.expensemanager) ### [📦 `com.ithebk.expensemanager`](https://play.google.com/store/apps/details?id=com.ithebk.expensemanager)
<details> <details>
@@ -345,6 +323,14 @@ The official ReVanced Patches.
| `unlock-pro` | Unlocks pro features. | all | | `unlock-pro` | Unlocks pro features. | all |
</details> </details>
### [📦 `com.awedea.nyx`](https://play.google.com/store/apps/details?id=com.awedea.nyx)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `unlock-pro` | Unlocks all pro features. | all |
</details>
### [📦 `ginlemon.iconpackstudio`](https://play.google.com/store/apps/details?id=ginlemon.iconpackstudio) ### [📦 `ginlemon.iconpackstudio`](https://play.google.com/store/apps/details?id=ginlemon.iconpackstudio)
<details> <details>
@@ -353,7 +339,7 @@ The official ReVanced Patches.
| `unlock-pro` | Unlocks all pro features. | all | | `unlock-pro` | Unlocks all pro features. | all |
</details> </details>
### [📦 `com.awedea.nyx`](https://play.google.com/store/apps/details?id=com.awedea.nyx) ### [📦 `co.windyapp.android`](https://play.google.com/store/apps/details?id=co.windyapp.android)
<details> <details>
| 💊 Patch | 📜 Description | 🏹 Target Version | | 💊 Patch | 📜 Description | 🏹 Target Version |
@@ -361,6 +347,22 @@ The official ReVanced Patches.
| `unlock-pro` | Unlocks all pro features. | all | | `unlock-pro` | Unlocks all pro features. | all |
</details> </details>
### [📦 `com.zombodroid.MemeGenerator`](https://play.google.com/store/apps/details?id=com.zombodroid.MemeGenerator)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `unlock-pro` | Unlocks pro features. | 4.6377 |
</details>
### [📦 `org.totschnig.myexpenses`](https://play.google.com/store/apps/details?id=org.totschnig.myexpenses)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `unlock-pro` | Unlocks all professional features. | 3.4.9 |
</details>
### [📦 `com.ticktick.task`](https://play.google.com/store/apps/details?id=com.ticktick.task) ### [📦 `com.ticktick.task`](https://play.google.com/store/apps/details?id=com.ticktick.task)
<details> <details>

View File

@@ -27,7 +27,7 @@ repositories {
} }
dependencies { dependencies {
implementation("app.revanced:revanced-patcher:7.1.1") implementation("app.revanced:revanced-patcher:8.0.0")
implementation("app.revanced:multidexlib2:2.5.3-a3836654") implementation("app.revanced:multidexlib2:2.5.3-a3836654")
// Required for meta // Required for meta
implementation("com.google.code.gson:gson:2.10.1") implementation("com.google.code.gson:gson:2.10.1")

View File

@@ -1,2 +1,2 @@
kotlin.code.style = official kotlin.code.style = official
version = 2.174.0-dev.17 version = 2.174.0-dev.29

File diff suppressed because one or more lines are too long

View File

@@ -11,5 +11,8 @@ object ProUnlockFingerprint : MethodFingerprint(
Opcode.MOVE_RESULT, Opcode.MOVE_RESULT,
Opcode.IF_EQZ Opcode.IF_EQZ
), ),
customFingerprint = { it.definingClass == "Lcom/backdrops/wallpapers/data/local/DatabaseHandlerIAB;" && it.name == "lambda\$existPurchase\$0" } customFingerprint = { methodDef, _ ->
methodDef.definingClass == "Lcom/backdrops/wallpapers/data/local/DatabaseHandlerIAB;"
&& methodDef.name == "lambda\$existPurchase\$0"
}
) )

View File

@@ -3,5 +3,7 @@ package app.revanced.patches.citra.misc.premium.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object PremiumUnlockFingerprint : MethodFingerprint( object PremiumUnlockFingerprint : MethodFingerprint(
customFingerprint = { it.definingClass == "Lorg/citra/citra_emu/ui/main/MainActivity;" && it.name == "isPremiumActive" } customFingerprint = { methodDef, _ ->
methodDef.definingClass == "Lorg/citra/citra_emu/ui/main/MainActivity;" && methodDef.name == "isPremiumActive"
}
) )

View File

@@ -7,7 +7,7 @@ object BootStateFingerprint : MethodFingerprint(
"Z", "Z",
access = AccessFlags.PUBLIC.value, access = AccessFlags.PUBLIC.value,
strings = listOf("Boot state of device: %s"), strings = listOf("Boot state of device: %s"),
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/AttestationHelper;") methodDef.definingClass.endsWith("/AttestationHelper;")
} }
) )

View File

@@ -7,7 +7,7 @@ object BootloaderDetectionFingerprint : MethodFingerprint(
"Z", "Z",
access = AccessFlags.PUBLIC.value, access = AccessFlags.PUBLIC.value,
strings = listOf("Creation of attestation key succeeded", "Creation of attestation key failed"), strings = listOf("Creation of attestation key succeeded", "Creation of attestation key failed"),
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/AttestationHelper;") methodDef.definingClass.endsWith("/AttestationHelper;")
} }
) )

View File

@@ -4,7 +4,7 @@ import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object RootDetectionFingerprint : MethodFingerprint( object RootDetectionFingerprint : MethodFingerprint(
"L", "L",
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass == "Lat/gv/bmf/bmf2go/tools/utils/z;" methodDef.definingClass == "Lat/gv/bmf/bmf2go/tools/utils/z;"
} }
) )

View File

@@ -3,7 +3,7 @@ package app.revanced.patches.hexeditor.ad.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object PrimaryAdsFingerprint : MethodFingerprint( object PrimaryAdsFingerprint : MethodFingerprint(
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("PreferencesHelper;") && methodDef.name == "isAdsDisabled" methodDef.definingClass.endsWith("PreferencesHelper;") && methodDef.name == "isAdsDisabled"
} }
) )

View File

@@ -4,5 +4,5 @@ import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object CheckProFingerprint : MethodFingerprint( object CheckProFingerprint : MethodFingerprint(
"Z", "Z",
customFingerprint = { it.definingClass.endsWith("IPSPurchaseRepository;")} customFingerprint = { methodDef, _ -> methodDef.definingClass.endsWith("IPSPurchaseRepository;")}
) )

View File

@@ -6,7 +6,7 @@ import org.jf.dexlib2.AccessFlags
object RootDetectionFingerprint : MethodFingerprint( object RootDetectionFingerprint : MethodFingerprint(
"V", "V",
access = AccessFlags.PUBLIC.value, access = AccessFlags.PUBLIC.value,
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/DeviceIntegrityCheck;") methodDef.definingClass.endsWith("/DeviceIntegrityCheck;")
} }
) )

View File

@@ -7,7 +7,7 @@ object SpoofSignatureFingerprint : MethodFingerprint(
"L", "L",
parameters = listOf("L"), parameters = listOf("L"),
access = AccessFlags.PRIVATE.value, access = AccessFlags.PRIVATE.value,
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/SL2Step1Task;") && methodDef.name == "getPubKey" methodDef.definingClass.endsWith("/SL2Step1Task;") && methodDef.name == "getPubKey"
} }
) )

View File

@@ -4,6 +4,7 @@ import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.AccessFlags import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode import org.jf.dexlib2.Opcode
import org.jf.dexlib2.iface.ClassDef
import org.jf.dexlib2.iface.Method import org.jf.dexlib2.iface.Method
abstract class MediaAdFingerprint( abstract class MediaAdFingerprint(
@@ -11,7 +12,7 @@ abstract class MediaAdFingerprint(
access: Int? = AccessFlags.PUBLIC or AccessFlags.FINAL, access: Int? = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters: Iterable<String>? = listOf(), parameters: Iterable<String>? = listOf(),
opcodes: Iterable<Opcode>?, opcodes: Iterable<Opcode>?,
customFingerprint: ((methodDef: Method) -> Boolean)? = null customFingerprint: ((methodDef: Method, classDef: ClassDef) -> Boolean)? = null
) : MethodFingerprint( ) : MethodFingerprint(
returnType, returnType,
access, access,

View File

@@ -14,7 +14,7 @@ object PaidPartnershipAdFingerprint : MediaAdFingerprint(
Opcode.IPUT_BOOLEAN, Opcode.IPUT_BOOLEAN,
Opcode.IPUT_BOOLEAN Opcode.IPUT_BOOLEAN
), ),
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("ClipsEditMetadataController;") methodDef.definingClass.endsWith("ClipsEditMetadataController;")
} }
) { ) {

View File

@@ -11,8 +11,8 @@ object LoadInboxAdsFingerprint : MethodFingerprint(
"inbox_ads_fetch_start" "inbox_ads_fetch_start"
), ),
access = AccessFlags.PUBLIC or AccessFlags.STATIC, access = AccessFlags.PUBLIC or AccessFlags.STATIC,
customFingerprint = { customFingerprint = { methodDef, _ ->
it.definingClass == "Lcom/facebook/messaging/business/inboxads/plugins/inboxads/itemsupplier/InboxAdsItemSupplierImplementation;" methodDef.definingClass == "Lcom/facebook/messaging/business/inboxads/plugins/inboxads/itemsupplier/InboxAdsItemSupplierImplementation;"
} }
) )

View File

@@ -13,7 +13,7 @@ object UnlockProFingerprint : MethodFingerprint(
Opcode.IGET_BOOLEAN, Opcode.IGET_BOOLEAN,
Opcode.RETURN Opcode.RETURN
), ),
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("MainActivity;") methodDef.definingClass.endsWith("MainActivity;")
} }
) )

View File

@@ -3,7 +3,7 @@ package app.revanced.patches.nyx.misc.pro.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object CheckProFingerprint : MethodFingerprint( object CheckProFingerprint : MethodFingerprint(
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("BillingManager;") && methodDef.name == "isProVersion" methodDef.definingClass.endsWith("BillingManager;") && methodDef.name == "isProVersion"
} }
) )

View File

@@ -8,10 +8,10 @@ import org.jf.dexlib2.Opcode
object CheckSignatureFingerprint : MethodFingerprint( object CheckSignatureFingerprint : MethodFingerprint(
returnType = "V", returnType = "V",
access = AccessFlags.PUBLIC or AccessFlags.FINAL, access = AccessFlags.PUBLIC or AccessFlags.FINAL,
customFingerprint = { customFingerprint = { methodDef, _ ->
(it.definingClass == "Lcom/microblink/photomath/main/activity/LauncherActivity;" || (methodDef.definingClass == "Lcom/microblink/photomath/main/activity/LauncherActivity;" ||
it.definingClass == "Lcom/microblink/photomath/PhotoMath;") && methodDef.definingClass == "Lcom/microblink/photomath/PhotoMath;") &&
it.name == "onCreate" methodDef.name == "onCreate"
}, },
strings = listOf( strings = listOf(
"currentSignature" "currentSignature"

View File

@@ -11,6 +11,6 @@ object IsPlusUnlockedFingerprint : MethodFingerprint(
"genius" "genius"
), ),
customFingerprint = { customFingerprint = {
methodDef -> methodDef.definingClass.endsWith("/User;") methodDef, _ -> methodDef.definingClass.endsWith("/User;")
} }
) )

View File

@@ -4,7 +4,7 @@ import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object PremiumIconFingerprint : MethodFingerprint( object PremiumIconFingerprint : MethodFingerprint(
"Z", "Z",
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("MyAccount;") && methodDef.name == "isPremiumSubscriber" methodDef.definingClass.endsWith("MyAccount;") && methodDef.name == "isPremiumSubscriber"
} }
) )

View File

@@ -4,5 +4,5 @@ package app.revanced.patches.shared.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object SeekbarOnDrawFingerprint : MethodFingerprint( object SeekbarOnDrawFingerprint : MethodFingerprint(
customFingerprint = { it.name == "onDraw" } customFingerprint = { methodDef, _ -> methodDef.name == "onDraw" }
) )

View File

@@ -4,7 +4,7 @@ package app.revanced.patches.shared.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object WatchWhileActivityFingerprint : MethodFingerprint( object WatchWhileActivityFingerprint : MethodFingerprint(
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("WatchWhileActivity;") && methodDef.name == "<init>" methodDef.definingClass.endsWith("WatchWhileActivity;") && methodDef.name == "<init>"
} }
) )

View File

@@ -10,6 +10,7 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import org.jf.dexlib2.Opcode import org.jf.dexlib2.Opcode
import org.jf.dexlib2.iface.ClassDef
import org.jf.dexlib2.iface.Method import org.jf.dexlib2.iface.Method
@Description("Applies mandatory patches to implement the ReVanced integrations into the application.") @Description("Applies mandatory patches to implement the ReVanced integrations into the application.")
@@ -30,7 +31,7 @@ abstract class AbstractIntegrationsPatch(
parameters: Iterable<String>? = null, parameters: Iterable<String>? = null,
opcodes: Iterable<Opcode?>? = null, opcodes: Iterable<Opcode?>? = null,
strings: Iterable<String>? = null, strings: Iterable<String>? = null,
customFingerprint: ((methodDef: Method) -> Boolean)? = null, customFingerprint: ((methodDef: Method, classDef: ClassDef) -> Boolean)? = null,
private val contextRegisterResolver: (Method) -> Int = object : RegisterResolver {} private val contextRegisterResolver: (Method) -> Int = object : RegisterResolver {}
) : MethodFingerprint( ) : MethodFingerprint(
returnType, returnType,

View File

@@ -13,5 +13,5 @@ object CanScrollVerticallyFingerprint : MethodFingerprint(
Opcode.INVOKE_VIRTUAL, Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT, Opcode.MOVE_RESULT,
), ),
customFingerprint = { methodDef -> methodDef.definingClass.endsWith("SwipeRefreshLayout;") } customFingerprint = { methodDef, _ -> methodDef.definingClass.endsWith("SwipeRefreshLayout;") }
) )

View File

@@ -9,23 +9,26 @@ import org.w3c.dom.Element
* *
* @param key The key of the preference. * @param key The key of the preference.
* @param title The title of the preference. * @param title The title of the preference.
* @param tag The tag of the preference.
* @param summary The summary of the preference.
*/ */
internal abstract class BasePreference( internal abstract class BasePreference(
override val key: String, val key: String?,
override val title: StringResource, val title: StringResource,
) : IPreference { val summary: StringResource? = null,
val tag: String
) {
/** /**
* Serialize preference element to XML. * Serialize preference element to XML.
* Overriding methods should invoke super and operate on its return value. * Overriding methods should invoke super and operate on its return value.
* @param ownerDocument Target document to create elements from. * @param ownerDocument Target document to create elements from.
* @param resourceCallback Called when a resource has been processed. * @param resourceCallback Called when a resource has been processed.
* @return The serialized element.
*/ */
open fun serialize(ownerDocument: Document, resourceCallback: ((IResource) -> Unit)? = null): Element { open fun serialize(ownerDocument: Document, resourceCallback: (BaseResource) -> Unit): Element =
return ownerDocument.createElement(tag).apply { ownerDocument.createElement(tag).apply {
if(key.isNotEmpty()) if (key != null) setAttribute("android:key", key)
setAttribute("android:key", key) setAttribute("android:title", "@string/${title.also { resourceCallback.invoke(it) }.name}")
setAttribute("android:title", "@string/${title.also { resourceCallback?.invoke(it) }.name}") addSummary(summary?.also { resourceCallback.invoke(it) })
} }
}
} }

View File

@@ -7,18 +7,19 @@ import org.w3c.dom.Element
* Base resource class for all resources. * Base resource class for all resources.
* *
* @param name The name of the resource. * @param name The name of the resource.
* @param tag The tag of the resource.
*/ */
internal abstract class BaseResource( internal abstract class BaseResource(
override val name: String val name: String,
) : IResource { val tag: String
) {
/** /**
* Serialize resource element to XML. * Serialize resource element to XML.
* Overriding methods should invoke super and operate on its return value. * Overriding methods should invoke super and operate on its return value.
* @param ownerDocument Target document to create elements from. * @param ownerDocument Target document to create elements from.
* @param resourceCallback Called when a resource has been processed. * @param resourceCallback Called when a resource has been processed.
*/ */
open fun serialize(ownerDocument: Document, resourceCallback: ((IResource) -> Unit)? = null): Element { open fun serialize(ownerDocument: Document, resourceCallback: (BaseResource) -> Unit = { }): Element {
return ownerDocument.createElement(tag).apply { return ownerDocument.createElement(tag).apply {
setAttribute("name", name) setAttribute("name", name)
} }

View File

@@ -10,7 +10,7 @@ import org.w3c.dom.Node
* @param resource The resource to add. * @param resource The resource to add.
* @param resourceCallback Called when a resource has been processed. * @param resourceCallback Called when a resource has been processed.
*/ */
internal fun Node.addResource(resource: BaseResource, resourceCallback: ((IResource) -> Unit)? = null) { internal fun Node.addResource(resource: BaseResource, resourceCallback: (BaseResource) -> Unit = { }) {
appendChild(resource.serialize(ownerDocument, resourceCallback)) appendChild(resource.serialize(ownerDocument, resourceCallback))
} }
@@ -20,7 +20,7 @@ internal fun Node.addResource(resource: BaseResource, resourceCallback: ((IResou
* @param preference The preference to add. * @param preference The preference to add.
* @param resourceCallback Called when a resource has been processed. * @param resourceCallback Called when a resource has been processed.
*/ */
internal fun Node.addPreference(preference: BasePreference, resourceCallback: ((IResource) -> Unit)? = null) { internal fun Node.addPreference(preference: BasePreference, resourceCallback: ((BaseResource) -> Unit) = { }) {
appendChild(preference.serialize(ownerDocument, resourceCallback)) appendChild(preference.serialize(ownerDocument, resourceCallback))
} }
@@ -30,10 +30,11 @@ internal fun Element.addSummary(summaryResource: StringResource?, summaryType: S
} }
internal fun <T> Element.addDefault(default: T) { internal fun <T> Element.addDefault(default: T) {
if (default is Boolean && !(default as Boolean)) return // No need to include the default, as no value already means 'false'
default?.let { default?.let {
setAttribute( setAttribute(
"android:defaultValue", when (it) { "android:defaultValue", when (it) {
is Boolean -> if (it) "true" else "false" is Boolean -> it.toString()
is String -> it is String -> it
else -> throw IllegalArgumentException("Unsupported default value type: ${it::class.java.name}") else -> throw IllegalArgumentException("Unsupported default value type: ${it::class.java.name}")
} }

View File

@@ -0,0 +1,32 @@
package app.revanced.patches.shared.settings.preference
import app.revanced.patches.shared.settings.preference.impl.StringResource
import org.w3c.dom.Document
/**
* Base preference class that also has a default value.
*
* @param key The key of the preference.
* @param title The title of the preference.
* @param tag The tag of the preference.
* @param summary The summary of the preference.
* @param default The default value of the preference.
*/
internal abstract class DefaultBasePreference<T>(
key: String?,
title: StringResource,
summary: StringResource? = null,
tag: String,
val default: T? = null,
) : BasePreference(key, title, summary, tag) {
/**
* Serialize preference element to XML.
* Overriding methods should invoke super and operate on its return value.
* @param ownerDocument Target document to create elements from.
* @param resourceCallback Called when a resource has been processed.
* @return The serialized element.
*/
override fun serialize(ownerDocument: Document, resourceCallback: (BaseResource) -> Unit) =
super.serialize(ownerDocument, resourceCallback).apply { addDefault(default) }
}

View File

@@ -1,23 +0,0 @@
package app.revanced.patches.shared.settings.preference
import app.revanced.patches.shared.settings.preference.impl.StringResource
/**
* Preference
*/
internal interface IPreference {
/**
* Key of the preference.
*/
val key: String
/**
* Title of the preference.
*/
val title: StringResource
/**
* Tag name of the preference.
*/
val tag: String
}

View File

@@ -1,16 +0,0 @@
package app.revanced.patches.shared.settings.preference
/**
* Resource
*/
internal interface IResource {
/**
* Name of the resource.
*/
val name: String
/**
* Tag name of the resource.
*/
val tag: String
}

View File

@@ -1,34 +1,29 @@
package app.revanced.patches.shared.settings.preference.impl package app.revanced.patches.shared.settings.preference.impl
import app.revanced.patches.shared.settings.preference.BaseResource import app.revanced.patches.shared.settings.preference.BaseResource
import app.revanced.patches.shared.settings.preference.IResource
import org.w3c.dom.Document import org.w3c.dom.Document
import org.w3c.dom.Element
// TODO: allow specifying an array resource file instead of using a list of StringResources
/** /**
* Represents an array resource. * An array resource.
* *
* @param name The name of the array resource. * @param name The name of the array resource.
* @param items The items of the array resource. * @param items The items of the array resource.
*/ */
// TODO: allow specifying an array resource file instead of using a list of StringResources internal class ArrayResource(
internal data class ArrayResource( name: String,
override val name: String,
val items: List<StringResource> val items: List<StringResource>
) : BaseResource(name) { ) : BaseResource(name, "string-array") {
override val tag = "string-array" override fun serialize(ownerDocument: Document, resourceCallback: (BaseResource) -> Unit) =
super.serialize(ownerDocument, resourceCallback).apply {
override fun serialize(ownerDocument: Document, resourceCallback: ((IResource) -> Unit)?): Element {
return super.serialize(ownerDocument, resourceCallback).apply {
setAttribute("name", name) setAttribute("name", name)
items.forEach { item -> items.forEach { item ->
resourceCallback?.invoke(item) resourceCallback.invoke(item)
this.appendChild(ownerDocument.createElement("item").also { itemNode -> this.appendChild(ownerDocument.createElement("item").also { itemNode ->
itemNode.textContent = "@string/${item.name}" itemNode.textContent = "@string/${item.name}"
}) })
} }
} }
}
} }

View File

@@ -1,6 +1,8 @@
package app.revanced.patches.shared.settings.preference.impl package app.revanced.patches.shared.settings.preference.impl
enum class InputType(val type: String) { enum class InputType(val type: String) {
STRING("text"), TEXT("text"),
TEXT_CAP_CHARACTERS("textCapCharacters"),
TEXT_MULTI_LINE("textMultiLine"),
NUMBER("number"), NUMBER("number"),
} }

View File

@@ -1,11 +1,9 @@
package app.revanced.patches.shared.settings.preference.impl package app.revanced.patches.shared.settings.preference.impl
import app.revanced.patches.shared.settings.preference.BasePreference import app.revanced.patches.shared.settings.preference.BaseResource
import app.revanced.patches.shared.settings.preference.IResource import app.revanced.patches.shared.settings.preference.DefaultBasePreference
import app.revanced.patches.shared.settings.preference.addDefault
import app.revanced.patches.shared.settings.preference.addSummary import app.revanced.patches.shared.settings.preference.addSummary
import org.w3c.dom.Document import org.w3c.dom.Document
import org.w3c.dom.Element
/** /**
* List preference. * List preference.
@@ -14,25 +12,21 @@ import org.w3c.dom.Element
* @param title The title of the list preference. * @param title The title of the list preference.
* @param entries The human-readable entries of the list preference. * @param entries The human-readable entries of the list preference.
* @param entryValues The entry values of the list preference. * @param entryValues The entry values of the list preference.
* @param default The default entry value of the list preference.
* @param summary The summary of the list preference. * @param summary The summary of the list preference.
* @param default The default entry value of the list preference.
*/ */
internal class ListPreference( internal class ListPreference(
key: String, key: String,
title: StringResource, title: StringResource,
val entries: ArrayResource, val entries: ArrayResource,
val entryValues: ArrayResource, val entryValues: ArrayResource,
val default: String? = null, summary: StringResource? = null,
val summary: StringResource? = null default: String? = null,
) : BasePreference(key, title) { ) : DefaultBasePreference<String>(key, title, summary, "ListPreference", default) {
override val tag: String = "ListPreference" override fun serialize(ownerDocument: Document, resourceCallback: (BaseResource) -> Unit) =
super.serialize(ownerDocument, resourceCallback).apply {
override fun serialize(ownerDocument: Document, resourceCallback: ((IResource) -> Unit)?): Element { setAttribute("android:entries", "@array/${entries.also { resourceCallback.invoke(it) }.name}")
return super.serialize(ownerDocument, resourceCallback).apply { setAttribute("android:entryValues", "@array/${entryValues.also { resourceCallback.invoke(it) }.name}")
setAttribute("android:entries", "@array/${entries.also { resourceCallback?.invoke(it) }.name}")
setAttribute("android:entryValues", "@array/${entryValues.also { resourceCallback?.invoke(it) }.name}")
addDefault(default)
addSummary(summary) addSummary(summary)
} }
}
} }

View File

@@ -1,24 +1,27 @@
package app.revanced.patches.shared.settings.preference.impl package app.revanced.patches.shared.settings.preference.impl
import app.revanced.patches.shared.settings.preference.BasePreference import app.revanced.patches.shared.settings.preference.BasePreference
import app.revanced.patches.shared.settings.preference.IResource import app.revanced.patches.shared.settings.preference.BaseResource
import app.revanced.patches.shared.settings.preference.addSummary import app.revanced.patches.shared.settings.preference.addSummary
import org.w3c.dom.Document import org.w3c.dom.Document
import org.w3c.dom.Element import org.w3c.dom.Element
/** /**
* A simple static title and summary that is not backed by any preference key/value, * A non interactive preference.
* and cannot be changed by or interacted with by the user, *
* Not backed by any preference key/value,
* and cannot be changed by or interacted with by the user.
*
* @param title The title of the preference.
* @param summary The summary of the text preference.
*/ */
internal class NonInteractivePreference( internal class NonInteractivePreference(
title: StringResource, title: StringResource,
val summary: StringResource, summary: StringResource,
) : BasePreference("", title) { ) : BasePreference(null, title, summary, "Preference") {
override val tag: String = "Preference" override fun serialize(ownerDocument: Document, resourceCallback: (BaseResource) -> Unit): Element {
override fun serialize(ownerDocument: Document, resourceCallback: ((IResource) -> Unit)?): Element {
return super.serialize(ownerDocument, resourceCallback).apply { return super.serialize(ownerDocument, resourceCallback).apply {
addSummary(summary.also { resourceCallback?.invoke(it) addSummary(summary?.also { resourceCallback.invoke(it)
setAttribute("android:selectable", false.toString()) setAttribute("android:selectable", false.toString())
}) })
} }

View File

@@ -1,44 +1,41 @@
package app.revanced.patches.shared.settings.preference.impl package app.revanced.patches.shared.settings.preference.impl
import app.revanced.patches.shared.settings.preference.BasePreference import app.revanced.patches.shared.settings.preference.BasePreference
import app.revanced.patches.shared.settings.preference.IResource import app.revanced.patches.shared.settings.preference.BaseResource
import app.revanced.patches.shared.settings.preference.addSummary
import org.w3c.dom.Document import org.w3c.dom.Document
import org.w3c.dom.Element
/** /**
* A Preference object. * A preference object.
* *
* @param key The key of the preference.
* @param title The title of the preference. * @param title The title of the preference.
* @param intent The intent of the preference.
* @param summary The summary of the text preference. * @param summary The summary of the text preference.
* @param intent The intent of the preference.
*/ */
internal class Preference( internal class Preference(
key: String, key: String,
title: StringResource, title: StringResource,
val intent: Intent, summary: StringResource,
val summary: StringResource? = null val intent: Intent
) : BasePreference(key, title) { ) : BasePreference(key, title, summary, "Preference") {
override val tag: String = "Preference"
/* Key-less constructor */
constructor( constructor(
title: StringResource, title: StringResource,
intent: Intent, summary: StringResource,
summary: StringResource? = null intent: Intent
) : this("", title, intent, summary) ) : this("", title, summary, intent)
override fun serialize(ownerDocument: Document, resourceCallback: ((IResource) -> Unit)?): Element {
return super.serialize(ownerDocument, resourceCallback).apply {
addSummary(summary?.also { resourceCallback?.invoke(it) })
override fun serialize(ownerDocument: Document, resourceCallback: (BaseResource) -> Unit) =
super.serialize(ownerDocument, resourceCallback).apply {
this.appendChild(ownerDocument.createElement("intent").also { intentNode -> this.appendChild(ownerDocument.createElement("intent").also { intentNode ->
intentNode.setAttribute("android:targetPackage", intent.targetPackage) intentNode.setAttribute("android:targetPackage", intent.targetPackage)
intentNode.setAttribute("android:data", intent.data) intentNode.setAttribute("android:data", intent.data)
intentNode.setAttribute("android:targetClass", intent.targetClass) intentNode.setAttribute("android:targetClass", intent.targetClass)
}) })
} }
}
data class Intent(val targetPackage: String, val data: String, val targetClass: String) internal class Intent(
internal val targetPackage: String,
internal val data: String,
internal val targetClass: String
)
} }

View File

@@ -1,12 +1,11 @@
package app.revanced.patches.shared.settings.preference.impl package app.revanced.patches.shared.settings.preference.impl
import app.revanced.patches.shared.settings.preference.BasePreference import app.revanced.patches.shared.settings.preference.BasePreference
import app.revanced.patches.shared.settings.preference.IResource import app.revanced.patches.shared.settings.preference.BaseResource
import org.w3c.dom.Document import org.w3c.dom.Document
import org.w3c.dom.Element
/** /**
* Preference category. * A preference category.
* *
* @param key The key of the preference. * @param key The key of the preference.
* @param title The title of the preference. * @param title The title of the preference.
@@ -15,15 +14,13 @@ import org.w3c.dom.Element
internal open class PreferenceCategory( internal open class PreferenceCategory(
key: String, key: String,
title: StringResource, title: StringResource,
var preferences: List<BasePreference> var preferences: List<BasePreference>,
) : BasePreference(key, title) { tag: String = "PreferenceCategory"
override val tag: String = "PreferenceCategory" ) : BasePreference(key, title, null, tag) {
override fun serialize(ownerDocument: Document, resourceCallback: (BaseResource) -> Unit) =
override fun serialize(ownerDocument: Document, resourceCallback: ((IResource) -> Unit)?): Element { super.serialize(ownerDocument, resourceCallback).apply {
return super.serialize(ownerDocument, resourceCallback).apply {
for (childPreference in preferences) { for (childPreference in preferences) {
this.appendChild(childPreference.serialize(ownerDocument, resourceCallback)) this.appendChild(childPreference.serialize(ownerDocument, resourceCallback))
} }
} }
}
} }

View File

@@ -1,13 +1,12 @@
package app.revanced.patches.shared.settings.preference.impl package app.revanced.patches.shared.settings.preference.impl
import app.revanced.patches.shared.settings.preference.BasePreference import app.revanced.patches.shared.settings.preference.BasePreference
import app.revanced.patches.shared.settings.preference.IResource import app.revanced.patches.shared.settings.preference.BaseResource
import app.revanced.patches.shared.settings.preference.addSummary import app.revanced.patches.shared.settings.preference.addSummary
import org.w3c.dom.Document import org.w3c.dom.Document
import org.w3c.dom.Element
/** /**
* Preference screen. * A preference screen.
* *
* @param key The key of the preference. * @param key The key of the preference.
* @param title The title of the preference. * @param title The title of the preference.
@@ -18,17 +17,13 @@ internal open class PreferenceScreen(
key: String, key: String,
title: StringResource, title: StringResource,
var preferences: List<BasePreference>, var preferences: List<BasePreference>,
val summary: StringResource? = null summary: StringResource? = null
) : BasePreference(key, title) { ) : BasePreference(key, title, summary, "PreferenceScreen") {
override val tag: String = "PreferenceScreen" override fun serialize(ownerDocument: Document, resourceCallback: (BaseResource) -> Unit) =
super.serialize(ownerDocument, resourceCallback).apply {
addSummary(summary?.also { resourceCallback.invoke(it) })
override fun serialize(ownerDocument: Document, resourceCallback: ((IResource) -> Unit)?): Element { for (childPreference in preferences)
return super.serialize(ownerDocument, resourceCallback).apply {
addSummary(summary?.also { resourceCallback?.invoke(it) })
for (childPreference in preferences) {
this.appendChild(childPreference.serialize(ownerDocument, resourceCallback)) this.appendChild(childPreference.serialize(ownerDocument, resourceCallback))
}
} }
}
} }

View File

@@ -1,31 +1,27 @@
package app.revanced.patches.shared.settings.preference.impl package app.revanced.patches.shared.settings.preference.impl
import app.revanced.patches.shared.settings.preference.BaseResource import app.revanced.patches.shared.settings.preference.BaseResource
import app.revanced.patches.shared.settings.preference.IResource
import org.w3c.dom.Document import org.w3c.dom.Document
import org.w3c.dom.Element
/** /**
* Represents a string value in the strings.xml file * A string value.
* Represets a string in the strings.xml file.
* *
* @param name The name of the string * @param name The name of the string.
* @param value The value of the string * @param value The value of the string.
* @param formatted If the string is formatted. If false, the attribute will be set * @param formatted If the string is formatted. If false, the attribute will be set.
*/ */
internal data class StringResource( internal class StringResource(
override val name: String, name: String,
val value: String, val value: String,
val formatted: Boolean = true val formatted: Boolean = true
) : BaseResource(name) { ) : BaseResource(name, "string") {
override val tag = "string"
override fun serialize(ownerDocument: Document, resourceCallback: ((IResource) -> Unit)?): Element { override fun serialize(ownerDocument: Document, resourceCallback: (BaseResource) -> Unit) =
return super.serialize(ownerDocument, resourceCallback).apply { super.serialize(ownerDocument, resourceCallback).apply {
// if the string is un-formatted, explicitly add the formatted attribute // if the string is un-formatted, explicitly add the formatted attribute
if (!formatted) if (!formatted) setAttribute("formatted", "false")
setAttribute("formatted", "false")
textContent = value textContent = value
} }
}
} }

View File

@@ -1,37 +1,36 @@
package app.revanced.patches.shared.settings.preference.impl package app.revanced.patches.shared.settings.preference.impl
import app.revanced.patches.shared.settings.preference.* import app.revanced.patches.shared.settings.preference.BaseResource
import app.revanced.patches.shared.settings.preference.DefaultBasePreference
import app.revanced.patches.shared.settings.preference.SummaryType
import app.revanced.patches.shared.settings.preference.addSummary
import app.revanced.patches.shared.settings.resource.patch.AbstractSettingsResourcePatch.Companion.include import app.revanced.patches.shared.settings.resource.patch.AbstractSettingsResourcePatch.Companion.include
import org.w3c.dom.Document import org.w3c.dom.Document
import org.w3c.dom.Element import org.w3c.dom.Element
/** /**
* Switch preference. * A switch preference.
* *
* @param key The key of the switch. * @param key The key of the switch.
* @param title The title of the switch. * @param title The title of the switch.
* @param default The default value of the switch.
* @param summaryOn The summary to show when the preference is enabled. * @param summaryOn The summary to show when the preference is enabled.
* @param summaryOff The summary to show when the preference is disabled. * @param summaryOff The summary to show when the preference is disabled.
* @param userDialogMessage The message to show in a dialog when the user toggles the preference. * @param userDialogMessage The message to show in a dialog when the user toggles the preference.
* @param default The default value of the switch.
*/ */
internal class SwitchPreference( internal class SwitchPreference(
key: String, title: StringResource, key: String, title: StringResource,
val default: Boolean = false, val summaryOn: StringResource,
val summaryOn: StringResource? = null, val summaryOff: StringResource,
val summaryOff: StringResource? = null, val userDialogMessage: StringResource? = null,
val userDialogMessage: StringResource? = null default: Boolean = false,
) : BasePreference(key, title) { ) : DefaultBasePreference<Boolean>( key, title, null, "SwitchPreference", default) {
override val tag: String = "SwitchPreference" override fun serialize(ownerDocument: Document, resourceCallback: (BaseResource) -> Unit): Element {
override fun serialize(ownerDocument: Document, resourceCallback: ((IResource) -> Unit)?): Element {
// dialog message is stored as a regular string and later referenced by SettingsEnum
userDialogMessage?.include() userDialogMessage?.include()
return super.serialize(ownerDocument, resourceCallback).apply { return super.serialize(ownerDocument, resourceCallback).apply {
addDefault(default) addSummary(summaryOn.also { resourceCallback.invoke(it) }, SummaryType.ON)
addSummary(summaryOn?.also { resourceCallback?.invoke(it) }, SummaryType.ON) addSummary(summaryOff.also { resourceCallback.invoke(it) }, SummaryType.OFF)
addSummary(summaryOff?.also { resourceCallback?.invoke(it) }, SummaryType.OFF)
} }
} }
} }

View File

@@ -1,35 +1,29 @@
package app.revanced.patches.shared.settings.preference.impl package app.revanced.patches.shared.settings.preference.impl
import app.revanced.patches.shared.settings.preference.BasePreference import app.revanced.patches.shared.settings.preference.BaseResource
import app.revanced.patches.shared.settings.preference.IResource import app.revanced.patches.shared.settings.preference.DefaultBasePreference
import app.revanced.patches.shared.settings.preference.addDefault
import app.revanced.patches.shared.settings.preference.addSummary
import org.w3c.dom.Document import org.w3c.dom.Document
import org.w3c.dom.Element
/** /**
* Text preference. * A text preference.
* *
* @param key The key of the text preference. * @param key The key of the text preference.
* @param title The title of the text preference. * @param title The title of the text preference.
* @param inputType The input type of the text preference. * @param inputType The input type of the text preference.
* @param default The default value of the text preference.
* @param summary The summary of the text preference. * @param summary The summary of the text preference.
* @param default The default value of the text preference.
*/ */
internal class TextPreference( internal class TextPreference(
key: String, key: String?,
title: StringResource, title: StringResource,
var inputType: InputType = InputType.STRING, summary: StringResource?,
val default: String? = null, val inputType: InputType = InputType.TEXT,
val summary: StringResource? = null default: String? = null,
) : BasePreference(key, title) { tag: String = "app.revanced.integrations.settingsmenu.ResettableEditTextPreference"
override val tag: String = "app.revanced.integrations.settingsmenu.ResettableEditTextPreference" ) : DefaultBasePreference<String>(key, title, summary, tag, default) {
override fun serialize(ownerDocument: Document, resourceCallback: ((IResource) -> Unit)?): Element { override fun serialize(ownerDocument: Document, resourceCallback: (BaseResource) -> Unit) =
return super.serialize(ownerDocument, resourceCallback).apply { super.serialize(ownerDocument, resourceCallback).apply {
setAttribute("android:inputType", inputType.type) setAttribute("android:inputType", inputType.type)
addDefault(default)
addSummary(summary?.also { resourceCallback?.invoke(it) })
} }
}
} }

View File

@@ -6,7 +6,7 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patches.shared.settings.preference.BasePreference import app.revanced.patches.shared.settings.preference.BasePreference
import app.revanced.patches.shared.settings.preference.IResource import app.revanced.patches.shared.settings.preference.BaseResource
import app.revanced.patches.shared.settings.preference.addPreference import app.revanced.patches.shared.settings.preference.addPreference
import app.revanced.patches.shared.settings.preference.addResource import app.revanced.patches.shared.settings.preference.addResource
import app.revanced.patches.shared.settings.preference.impl.ArrayResource import app.revanced.patches.shared.settings.preference.impl.ArrayResource
@@ -108,7 +108,7 @@ abstract class AbstractSettingsResourcePatch(
* *
* @throws IllegalArgumentException if the resource already exists. * @throws IllegalArgumentException if the resource already exists.
*/ */
internal fun IResource.include() { internal fun BaseResource.include() {
when (this) { when (this) {
is StringResource -> { is StringResource -> {
if (strings.any { it.name == name }) return if (strings.any { it.name == name }) return

View File

@@ -18,7 +18,7 @@ object DisableCaptureRestrictionAudioDriverFingerprint : MethodFingerprint(
Opcode.MOVE_RESULT_OBJECT, Opcode.MOVE_RESULT_OBJECT,
Opcode.RETURN_OBJECT Opcode.RETURN_OBJECT
), ),
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
// Check for method call to AudioAttributes$Builder.setAllowedCapturePolicy Android API // Check for method call to AudioAttributes$Builder.setAllowedCapturePolicy Android API
methodDef.implementation?.instructions?.any { methodDef.implementation?.instructions?.any {
((it as? ReferenceInstruction)?.reference as? MethodReference)?.name == "setAllowedCapturePolicy" ((it as? ReferenceInstruction)?.reference as? MethodReference)?.name == "setAllowedCapturePolicy"

View File

@@ -17,7 +17,7 @@ object PiracyDetectionFingerprint : MethodFingerprint(
Opcode.INVOKE_DIRECT, Opcode.INVOKE_DIRECT,
Opcode.INVOKE_VIRTUAL Opcode.INVOKE_VIRTUAL
), ),
customFingerprint = { method -> customFingerprint = { method, _ ->
method.implementation?.instructions?.any { method.implementation?.instructions?.any {
if (it.opcode != Opcode.NEW_INSTANCE) return@any false if (it.opcode != Opcode.NEW_INSTANCE) return@any false

View File

@@ -3,7 +3,7 @@ package app.revanced.patches.ticktick.misc.themeunlock.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object CheckLockedThemesFingerprint : MethodFingerprint( object CheckLockedThemesFingerprint : MethodFingerprint(
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("Theme;") && methodDef.name == "isLockedTheme" methodDef.definingClass.endsWith("Theme;") && methodDef.name == "isLockedTheme"
} }
) )

View File

@@ -3,7 +3,7 @@ package app.revanced.patches.ticktick.misc.themeunlock.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object SetThemeFingerprint : MethodFingerprint( object SetThemeFingerprint : MethodFingerprint(
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("ThemePreviewActivity;") && methodDef.name == "lambda\$updateUserBtn\$1" methodDef.definingClass.endsWith("ThemePreviewActivity;") && methodDef.name == "lambda\$updateUserBtn\$1"
} }
) )

View File

@@ -3,7 +3,7 @@ package app.revanced.patches.tiktok.ad.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object ConvertHelpFeedItemListFingerprint : MethodFingerprint( object ConvertHelpFeedItemListFingerprint : MethodFingerprint(
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/ConvertHelp;") && methodDef.definingClass.endsWith("/ConvertHelp;") &&
methodDef.name.endsWith("${'$'}FeedItemList") methodDef.name.endsWith("${'$'}FeedItemList")
} }

View File

@@ -3,7 +3,7 @@ package app.revanced.patches.tiktok.ad.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object FeedItemListCloneFingerprint : MethodFingerprint( object FeedItemListCloneFingerprint : MethodFingerprint(
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/FeedItemList;") && methodDef.name == "clone" methodDef.definingClass.endsWith("/FeedItemList;") && methodDef.name == "clone"
} }
) )

View File

@@ -6,7 +6,7 @@ import org.jf.dexlib2.AccessFlags
object FeedApiServiceLIZFingerprint : MethodFingerprint( object FeedApiServiceLIZFingerprint : MethodFingerprint(
access = AccessFlags.PUBLIC or AccessFlags.STATIC or AccessFlags.SYNTHETIC, access = AccessFlags.PUBLIC or AccessFlags.STATIC or AccessFlags.SYNTHETIC,
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/FeedApiService;") && methodDef.name == "LIZ" methodDef.definingClass.endsWith("/FeedApiService;") && methodDef.name == "LIZ"
} }
) )

View File

@@ -7,7 +7,7 @@ import org.jf.dexlib2.AccessFlags
object ACLCommonShareFingerprint : MethodFingerprint( object ACLCommonShareFingerprint : MethodFingerprint(
"I", "I",
AccessFlags.PUBLIC or AccessFlags.FINAL, AccessFlags.PUBLIC or AccessFlags.FINAL,
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/ACLCommonShare;") && methodDef.definingClass.endsWith("/ACLCommonShare;") &&
methodDef.name == "getCode" methodDef.name == "getCode"
} }

View File

@@ -13,7 +13,7 @@ import org.jf.dexlib2.AccessFlags
object ACLCommonShareFingerprint2 : MethodFingerprint( object ACLCommonShareFingerprint2 : MethodFingerprint(
"I", "I",
AccessFlags.PUBLIC or AccessFlags.FINAL, AccessFlags.PUBLIC or AccessFlags.FINAL,
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/ACLCommonShare;") && methodDef.definingClass.endsWith("/ACLCommonShare;") &&
methodDef.name == "getShowType" methodDef.name == "getShowType"
} }

View File

@@ -13,7 +13,7 @@ import org.jf.dexlib2.AccessFlags
object ACLCommonShareFingerprint3 : MethodFingerprint( object ACLCommonShareFingerprint3 : MethodFingerprint(
"I", "I",
AccessFlags.PUBLIC or AccessFlags.FINAL, AccessFlags.PUBLIC or AccessFlags.FINAL,
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/ACLCommonShare;") && methodDef.definingClass.endsWith("/ACLCommonShare;") &&
methodDef.name == "getTranscode" methodDef.name == "getTranscode"
} }

View File

@@ -6,7 +6,7 @@ import org.jf.dexlib2.AccessFlags
object AwemeGetVideoControlFingerprint : MethodFingerprint( object AwemeGetVideoControlFingerprint : MethodFingerprint(
"L", "L",
AccessFlags.PUBLIC.value, AccessFlags.PUBLIC.value,
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/Aweme;") && methodDef.name == "getVideoControl" methodDef.definingClass.endsWith("/Aweme;") && methodDef.name == "getVideoControl"
} }
) )

View File

@@ -3,7 +3,7 @@ package app.revanced.patches.tiktok.misc.integrations.fingerprints
import app.revanced.patches.shared.integrations.patch.AbstractIntegrationsPatch.IntegrationsFingerprint import app.revanced.patches.shared.integrations.patch.AbstractIntegrationsPatch.IntegrationsFingerprint
object InitFingerprint : IntegrationsFingerprint( object InitFingerprint : IntegrationsFingerprint(
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/AwemeHostApplication;") && methodDef.definingClass.endsWith("/AwemeHostApplication;") &&
methodDef.name == "onCreate" methodDef.name == "onCreate"
} }

View File

@@ -2,7 +2,7 @@ package app.revanced.patches.tiktok.misc.login.disablerequirement.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object MandatoryLoginServiceFingerprint : MethodFingerprint( object MandatoryLoginServiceFingerprint : MethodFingerprint(
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/MandatoryLoginService;") && methodDef.definingClass.endsWith("/MandatoryLoginService;") &&
methodDef.name == "enableForcedLogin" methodDef.name == "enableForcedLogin"
} }

View File

@@ -9,7 +9,7 @@ import app.revanced.patches.tiktok.misc.login.disablerequirement.annotations.Dis
@DisableLoginRequirementCompatibility @DisableLoginRequirementCompatibility
@Version("0.0.1") @Version("0.0.1")
object MandatoryLoginServiceFingerprint2 : MethodFingerprint( object MandatoryLoginServiceFingerprint2 : MethodFingerprint(
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/MandatoryLoginService;") && methodDef.definingClass.endsWith("/MandatoryLoginService;") &&
methodDef.name == "shouldShowForcedLogin" methodDef.name == "shouldShowForcedLogin"
} }

View File

@@ -8,7 +8,7 @@ object GoogleAuthAvailableFingerprint : MethodFingerprint(
returnType = "Z", returnType = "Z",
access = AccessFlags.PUBLIC or AccessFlags.FINAL, access = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = listOf(), parameters = listOf(),
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass == "Lcom/bytedance/lobby/google/GoogleAuth;" methodDef.definingClass == "Lcom/bytedance/lobby/google/GoogleAuth;"
} }
) )

View File

@@ -8,7 +8,7 @@ object GoogleOneTapAuthAvailableFingerprint : MethodFingerprint(
returnType = "Z", returnType = "Z",
access = AccessFlags.PUBLIC or AccessFlags.FINAL, access = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = listOf(), parameters = listOf(),
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass == "Lcom/bytedance/lobby/google/GoogleOneTapAuth;" methodDef.definingClass == "Lcom/bytedance/lobby/google/GoogleOneTapAuth;"
} }
) )

View File

@@ -3,7 +3,7 @@ package app.revanced.patches.tiktok.misc.settings.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object AdPersonalizationActivityOnCreateFingerprint : MethodFingerprint( object AdPersonalizationActivityOnCreateFingerprint : MethodFingerprint(
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/AdPersonalizationActivity;") && methodDef.definingClass.endsWith("/AdPersonalizationActivity;") &&
methodDef.name == "onCreate" methodDef.name == "onCreate"
} }

View File

@@ -3,7 +3,7 @@ package app.revanced.patches.tiktok.misc.settings.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object SettingsOnViewCreatedFingerprint : MethodFingerprint( object SettingsOnViewCreatedFingerprint : MethodFingerprint(
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/SettingNewVersionFragment;") && methodDef.definingClass.endsWith("/SettingNewVersionFragment;") &&
methodDef.name == "onViewCreated" methodDef.name == "onViewCreated"
} }

View File

@@ -3,7 +3,7 @@ package app.revanced.patches.tiktok.misc.settings.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object SettingsStatusLoadFingerprint : MethodFingerprint( object SettingsStatusLoadFingerprint : MethodFingerprint(
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("Lapp/revanced/tiktok/settingsmenu/SettingsStatus;") && methodDef.definingClass.endsWith("Lapp/revanced/tiktok/settingsmenu/SettingsStatus;") &&
methodDef.name == "load" methodDef.name == "load"
} }

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
abstract class MethodUnlockFingerprint(private val className: String) : MethodFingerprint( abstract class MethodUnlockFingerprint(private val className: String) : MethodFingerprint(
"L", "L",
strings = listOf("binding.addButton"), strings = listOf("binding.addButton"),
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/$className;") methodDef.definingClass.endsWith("/$className;")
} }
) )

View File

@@ -4,7 +4,7 @@ package app.revanced.patches.twitch.ad.audio.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object AudioAdsPresenterPlayFingerprint : MethodFingerprint( object AudioAdsPresenterPlayFingerprint : MethodFingerprint(
customFingerprint = { method -> customFingerprint = { method, _ ->
method.definingClass.endsWith("AudioAdsPlayerPresenter;") && method.name == "playAd" method.definingClass.endsWith("AudioAdsPlayerPresenter;") && method.name == "playAd"
} }
) )

View File

@@ -50,7 +50,6 @@ class AudioAdsPatch : BytecodePatch(
"revanced_block_audio_ads", "revanced_block_audio_ads",
"Block audio ads" "Block audio ads"
), ),
true,
StringResource( StringResource(
"revanced_block_audio_ads_on", "revanced_block_audio_ads_on",
"Audio ads are blocked" "Audio ads are blocked"
@@ -59,6 +58,7 @@ class AudioAdsPatch : BytecodePatch(
"revanced_block_audio_ads_off", "revanced_block_audio_ads_off",
"Audio ads are unblocked" "Audio ads are unblocked"
), ),
default = true,
) )
) )

View File

@@ -3,7 +3,7 @@ package app.revanced.patches.twitch.ad.embedded.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object CreateUsherClientFingerprint : MethodFingerprint( object CreateUsherClientFingerprint : MethodFingerprint(
customFingerprint = { method -> customFingerprint = { method, _ ->
method.definingClass.endsWith("Ltv/twitch/android/network/OkHttpClientFactory;") && method.name == "buildOkHttpClient" method.definingClass.endsWith("Ltv/twitch/android/network/OkHttpClientFactory;") && method.name == "buildOkHttpClient"
} }
) )

View File

@@ -66,7 +66,7 @@ class EmbeddedAdsPatch : BytecodePatch(
StringResource("key_revanced_proxy_purpleadblock", "purpleadblock") StringResource("key_revanced_proxy_purpleadblock", "purpleadblock")
) )
), ),
"ttv-lol" default = "ttv-lol"
) )
) )

View File

@@ -8,7 +8,7 @@ object CheckAdEligibilityLambdaFingerprint : MethodFingerprint(
"L", "L",
AccessFlags.PRIVATE or AccessFlags.FINAL or AccessFlags.STATIC, AccessFlags.PRIVATE or AccessFlags.FINAL or AccessFlags.STATIC,
listOf("L", "L", "L"), listOf("L", "L", "L"),
customFingerprint = { method -> customFingerprint = { method, _ ->
method.definingClass.endsWith("AdEligibilityFetcher;") && method.definingClass.endsWith("AdEligibilityFetcher;") &&
method.name.contains("shouldRequestAd") method.name.contains("shouldRequestAd")
} }

View File

@@ -4,7 +4,7 @@ package app.revanced.patches.twitch.ad.video.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object ContentConfigShowAdsFingerprint : MethodFingerprint( object ContentConfigShowAdsFingerprint : MethodFingerprint(
customFingerprint = { method -> customFingerprint = { method, _ ->
method.definingClass.endsWith("ContentConfigData;") && method.name == "getShowAds" method.definingClass.endsWith("ContentConfigData;") && method.name == "getShowAds"
} }
) )

View File

@@ -3,7 +3,7 @@ package app.revanced.patches.twitch.ad.video.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object GetReadyToShowAdFingerprint : MethodFingerprint( object GetReadyToShowAdFingerprint : MethodFingerprint(
customFingerprint = { method -> customFingerprint = { method, _ ->
method.definingClass.endsWith("/StreamDisplayAdsPresenter;") && method.name == "getReadyToShowAdOrAbort" method.definingClass.endsWith("/StreamDisplayAdsPresenter;") && method.name == "getReadyToShowAdOrAbort"
} }
) )

View File

@@ -132,7 +132,6 @@ class VideoAdsPatch : AbstractAdPatch(
"revanced_block_video_ads", "revanced_block_video_ads",
"Block video ads" "Block video ads"
), ),
true,
StringResource( StringResource(
"revanced_block_video_ads_on", "revanced_block_video_ads_on",
"Video ads are blocked" "Video ads are blocked"
@@ -141,6 +140,7 @@ class VideoAdsPatch : AbstractAdPatch(
"revanced_block_video_ads_off", "revanced_block_video_ads_off",
"Video ads are unblocked" "Video ads are unblocked"
), ),
default = true
) )
) )

View File

@@ -3,7 +3,7 @@ package app.revanced.patches.twitch.chat.antidelete.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object ChatUtilCreateDeletedSpanFingerprint : MethodFingerprint( object ChatUtilCreateDeletedSpanFingerprint : MethodFingerprint(
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/ChatUtil\$Companion;") && methodDef.name == "createDeletedSpanFromChatMessageSpan" methodDef.definingClass.endsWith("/ChatUtil\$Companion;") && methodDef.name == "createDeletedSpanFromChatMessageSpan"
} }
) )

View File

@@ -6,7 +6,7 @@ import org.jf.dexlib2.AccessFlags
object DeletedMessageClickableSpanCtorFingerprint : MethodFingerprint( object DeletedMessageClickableSpanCtorFingerprint : MethodFingerprint(
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, "V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("DeletedMessageClickableSpan;") methodDef.definingClass.endsWith("DeletedMessageClickableSpan;")
} }
) )

View File

@@ -4,7 +4,7 @@ package app.revanced.patches.twitch.chat.antidelete.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object SetHasModAccessFingerprint : MethodFingerprint( object SetHasModAccessFingerprint : MethodFingerprint(
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("DeletedMessageClickableSpan;") && methodDef.name == "setHasModAccess" methodDef.definingClass.endsWith("DeletedMessageClickableSpan;") && methodDef.name == "setHasModAccess"
} }
) )

View File

@@ -98,7 +98,7 @@ class ShowDeletedMessagesPatch : BytecodePatch(
StringResource("key_revanced_deleted_messages_cross_out", "cross-out") StringResource("key_revanced_deleted_messages_cross_out", "cross-out")
) )
), ),
"cross-out" default = "cross-out"
) )
) )

View File

@@ -0,0 +1,8 @@
package app.revanced.patches.twitch.chat.autoclaim.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility([Package("tv.twitch.android.app")])
@Target(AnnotationTarget.CLASS)
internal annotation class AutoClaimChannelPointsCompatibility

View File

@@ -0,0 +1,10 @@
package app.revanced.patches.twitch.chat.autoclaim.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object CommunityPointsButtonViewDelegateFingerprint : MethodFingerprint(
customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("CommunityPointsButtonViewDelegate;")
&& methodDef.name == "showClaimAvailable"
}
)

View File

@@ -0,0 +1,70 @@
package app.revanced.patches.twitch.chat.autoclaim.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.addInstructions
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.patcher.util.smali.ExternalLabel
import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
import app.revanced.patches.twitch.chat.autoclaim.annotations.AutoClaimChannelPointsCompatibility
import app.revanced.patches.twitch.chat.autoclaim.fingerprints.CommunityPointsButtonViewDelegateFingerprint
import app.revanced.patches.twitch.misc.settings.bytecode.patch.SettingsPatch
@Patch
@DependsOn([SettingsPatch::class])
@Name("auto-claim-channel-points")
@Description("Automatically claim Channel Points.")
@AutoClaimChannelPointsCompatibility
@Version("0.0.1")
class AutoClaimChannelPointPatch : BytecodePatch(
listOf(CommunityPointsButtonViewDelegateFingerprint)
) {
override fun execute(context: BytecodeContext): PatchResult {
SettingsPatch.PreferenceScreen.CHAT.GENERAL.addPreferences(
SwitchPreference(
"revanced_auto_claim_channel_points",
StringResource(
"revanced_auto_claim_channel_points",
"Automatically claim Channel Points"
),
StringResource(
"revanced_auto_claim_channel_points_on",
"Channel Points are claimed automatically"
),
StringResource(
"revanced_auto_claim_channel_points_off",
"Channel Points are not claimed automatically"
),
default = true
)
)
CommunityPointsButtonViewDelegateFingerprint.result?.mutableMethod?.apply {
val lastIndex = implementation!!.instructions.lastIndex
addInstructions(
lastIndex, // place in front of return-void
"""
invoke-static {}, Lapp/revanced/twitch/patches/AutoClaimChannelPointsPatch;->shouldAutoClaim()Z
move-result v0
if-eqz v0, :auto_claim
# Claim by calling the button's onClick method
iget-object v0, p0, Ltv/twitch/android/shared/community/points/viewdelegate/CommunityPointsButtonViewDelegate;->buttonLayout:Landroid/view/ViewGroup;
invoke-virtual { v0 }, Landroid/view/View;->callOnClick()Z
""",
listOf(ExternalLabel("auto_claim", instruction(lastIndex)))
)
} ?: return CommunityPointsButtonViewDelegateFingerprint.toErrorResult()
return PatchResultSuccess()
}
}

View File

@@ -4,7 +4,7 @@ package app.revanced.patches.twitch.debug.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object IsDebugConfigEnabledFingerprint : MethodFingerprint( object IsDebugConfigEnabledFingerprint : MethodFingerprint(
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("BuildConfigUtil;") && methodDef.name == "isDebugConfigEnabled" methodDef.definingClass.endsWith("BuildConfigUtil;") && methodDef.name == "isDebugConfigEnabled"
} }
) )

View File

@@ -4,7 +4,7 @@ package app.revanced.patches.twitch.debug.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object IsOmVerificationEnabledFingerprint : MethodFingerprint( object IsOmVerificationEnabledFingerprint : MethodFingerprint(
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("BuildConfigUtil;") && methodDef.name == "isOmVerificationEnabled" methodDef.definingClass.endsWith("BuildConfigUtil;") && methodDef.name == "isOmVerificationEnabled"
} }
) )

View File

@@ -4,7 +4,7 @@ package app.revanced.patches.twitch.debug.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object ShouldShowDebugOptionsFingerprint : MethodFingerprint( object ShouldShowDebugOptionsFingerprint : MethodFingerprint(
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("BuildConfigUtil;") && methodDef.name == "shouldShowDebugOptions" methodDef.definingClass.endsWith("BuildConfigUtil;") && methodDef.name == "shouldShowDebugOptions"
} }
) )

View File

@@ -59,7 +59,6 @@ class DebugModePatch : BytecodePatch(
"revanced_debug_mode_enable", "revanced_debug_mode_enable",
"Enable debug mode" "Enable debug mode"
), ),
false,
StringResource( StringResource(
"revanced_debug_mode_on", "revanced_debug_mode_on",
"Debug mode is enabled (not recommended)" "Debug mode is enabled (not recommended)"
@@ -68,6 +67,7 @@ class DebugModePatch : BytecodePatch(
"revanced_debug_mode_off", "revanced_debug_mode_off",
"Debug mode is disabled" "Debug mode is disabled"
), ),
default = false,
) )
) )

View File

@@ -9,7 +9,7 @@ import app.revanced.patches.shared.integrations.patch.AbstractIntegrationsPatch.
@IntegrationsCompatibility @IntegrationsCompatibility
@Version("0.0.1") @Version("0.0.1")
object InitFingerprint : IntegrationsFingerprint( object InitFingerprint : IntegrationsFingerprint(
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/TwitchApplication;") && methodDef.definingClass.endsWith("/TwitchApplication;") &&
methodDef.name == "onCreate" methodDef.name == "onCreate"
} }

View File

@@ -20,7 +20,6 @@ import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.util.AbstractPreferenceScreen import app.revanced.patches.shared.settings.util.AbstractPreferenceScreen
import app.revanced.patches.twitch.misc.integrations.patch.IntegrationsPatch import app.revanced.patches.twitch.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.twitch.misc.settings.annotations.SettingsCompatibility import app.revanced.patches.twitch.misc.settings.annotations.SettingsCompatibility
import app.revanced.patches.twitch.misc.settings.components.CustomPreferenceCategory
import app.revanced.patches.twitch.misc.settings.fingerprints.MenuGroupsOnClickFingerprint import app.revanced.patches.twitch.misc.settings.fingerprints.MenuGroupsOnClickFingerprint
import app.revanced.patches.twitch.misc.settings.fingerprints.MenuGroupsUpdatedFingerprint import app.revanced.patches.twitch.misc.settings.fingerprints.MenuGroupsUpdatedFingerprint
import app.revanced.patches.twitch.misc.settings.fingerprints.SettingsActivityOnCreateFingerprint import app.revanced.patches.twitch.misc.settings.fingerprints.SettingsActivityOnCreateFingerprint
@@ -183,10 +182,11 @@ class SettingsPatch : BytecodePatch(
internal inner class CustomCategory(key: String, title: String) : Screen.Category(key, title) { internal inner class CustomCategory(key: String, title: String) : Screen.Category(key, title) {
/* For Twitch, we need to load our CustomPreferenceCategory class instead of the default one. */ /* For Twitch, we need to load our CustomPreferenceCategory class instead of the default one. */
override fun transform(): PreferenceCategory { override fun transform(): PreferenceCategory {
return CustomPreferenceCategory( return PreferenceCategory(
key, key,
StringResource("${key}_title", title), StringResource("${key}_title", title),
preferences.sortedBy { it.title.value } preferences.sortedBy { it.title.value },
"app.revanced.twitch.settingsmenu.preference.CustomPreferenceCategory"
) )
} }
} }

View File

@@ -1,20 +0,0 @@
package app.revanced.patches.twitch.misc.settings.components
import app.revanced.patches.shared.settings.preference.BasePreference
import app.revanced.patches.shared.settings.preference.impl.PreferenceCategory
import app.revanced.patches.shared.settings.preference.impl.StringResource
/**
* Customized preference category for Twitch.
*
* @param key The key of the preference.
* @param title The title of the preference.
* @param preferences Child preferences of this category.
*/
internal open class CustomPreferenceCategory(
key: String,
title: StringResource,
preferences: List<BasePreference>
) : PreferenceCategory(key, title, preferences) {
override val tag: String = "app.revanced.twitch.settingsmenu.preference.CustomPreferenceCategory"
}

View File

@@ -8,7 +8,7 @@ object MenuGroupsOnClickFingerprint : MethodFingerprint(
"V", "V",
AccessFlags.PRIVATE or AccessFlags.STATIC or AccessFlags.FINAL, AccessFlags.PRIVATE or AccessFlags.STATIC or AccessFlags.FINAL,
listOf("L", "L", "L"), listOf("L", "L", "L"),
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/SettingsMenuViewDelegate;") methodDef.definingClass.endsWith("/SettingsMenuViewDelegate;")
&& methodDef.name.contains("render") && methodDef.name.contains("render")
} }

View File

@@ -3,7 +3,7 @@ package app.revanced.patches.twitch.misc.settings.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object MenuGroupsUpdatedFingerprint : MethodFingerprint( object MenuGroupsUpdatedFingerprint : MethodFingerprint(
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/SettingsMenuPresenter\$Event\$MenuGroupsUpdated;") methodDef.definingClass.endsWith("/SettingsMenuPresenter\$Event\$MenuGroupsUpdated;")
&& methodDef.name == "<init>" && methodDef.name == "<init>"
} }

View File

@@ -3,7 +3,7 @@ package app.revanced.patches.twitch.misc.settings.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object SettingsActivityOnCreateFingerprint : MethodFingerprint( object SettingsActivityOnCreateFingerprint : MethodFingerprint(
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/SettingsActivity;") && methodDef.definingClass.endsWith("/SettingsActivity;") &&
methodDef.name == "onCreate" methodDef.name == "onCreate"
} }

View File

@@ -3,7 +3,7 @@ package app.revanced.patches.twitch.misc.settings.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object SettingsMenuItemEnumFingerprint : MethodFingerprint( object SettingsMenuItemEnumFingerprint : MethodFingerprint(
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/SettingsMenuItem;") && methodDef.name == "<clinit>" methodDef.definingClass.endsWith("/SettingsMenuItem;") && methodDef.name == "<clinit>"
} }
) )

View File

@@ -4,6 +4,6 @@ import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.Opcode import org.jf.dexlib2.Opcode
object JsonHookPatchFingerprint : MethodFingerprint( object JsonHookPatchFingerprint : MethodFingerprint(
customFingerprint = { methodDef -> methodDef.name == "<clinit>" }, customFingerprint = { methodDef, _ -> methodDef.name == "<clinit>" },
opcodes = listOf(Opcode.IGET_OBJECT) opcodes = listOf(Opcode.IGET_OBJECT)
) )

View File

@@ -3,7 +3,7 @@ package app.revanced.patches.twitter.misc.hook.json.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object JsonInputStreamFingerprint : MethodFingerprint( object JsonInputStreamFingerprint : MethodFingerprint(
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
if (methodDef.parameterTypes.size == 0) false if (methodDef.parameterTypes.size == 0) false
else methodDef.parameterTypes.first() == "Ljava/io/InputStream;" else methodDef.parameterTypes.first() == "Ljava/io/InputStream;"
} }

View File

@@ -3,5 +3,5 @@ package app.revanced.patches.twitter.misc.hook.json.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object LoganSquareFingerprint : MethodFingerprint( object LoganSquareFingerprint : MethodFingerprint(
customFingerprint = { methodDef -> methodDef.definingClass.endsWith("LoganSquare;") } customFingerprint = { methodDef, _ -> methodDef.definingClass.endsWith("LoganSquare;") }
) )

View File

@@ -2,7 +2,7 @@ package app.revanced.patches.warnwetter.misc.promocode.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object PromoCodeUnlockFingerprint : MethodFingerprint( object PromoCodeUnlockFingerprint : MethodFingerprint(
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("PromoTokenVerification;") && methodDef.name == "isValid" methodDef.definingClass.endsWith("PromoTokenVerification;") && methodDef.name == "isValid"
} }
) )

View File

@@ -4,7 +4,7 @@ import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object CheckProFingerprint : MethodFingerprint( object CheckProFingerprint : MethodFingerprint(
"I", "I",
customFingerprint = { methodDef -> customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("RawUserData;") && methodDef.name == "isPro" methodDef.definingClass.endsWith("RawUserData;") && methodDef.name == "isPro"
} }
) )

View File

@@ -9,7 +9,7 @@ object ReelConstructorFingerprint : MethodFingerprint(
opcodes = listOf( opcodes = listOf(
Opcode.INVOKE_VIRTUAL Opcode.INVOKE_VIRTUAL
), ),
customFingerprint = { method -> customFingerprint = { method, _ ->
method.implementation?.instructions?.any { method.implementation?.instructions?.any {
it.opcode == Opcode.CONST && (it as WideLiteralInstruction).wideLiteral == GeneralAdsResourcePatch.reelMultipleItemShelfId it.opcode == Opcode.CONST && (it as WideLiteralInstruction).wideLiteral == GeneralAdsResourcePatch.reelMultipleItemShelfId
} ?: false } ?: false

View File

@@ -31,192 +31,170 @@ class GeneralAdsResourcePatch : ResourcePatch {
override fun execute(context: ResourceContext): PatchResult { override fun execute(context: ResourceContext): PatchResult {
PreferenceScreen.LAYOUT.addPreferences( PreferenceScreen.LAYOUT.addPreferences(
SwitchPreference( SwitchPreference(
"revanced_adremover_separator", "revanced_hide_gray_separator",
StringResource("revanced_adremover_separator_title", "Hide gray separator"), StringResource("revanced_hide_gray_separator_title", "Hide gray separator"),
true, StringResource("revanced_hide_gray_separator_summary_on", "Gray separators are hidden"),
StringResource("revanced_adremover_separator_summary_on", "Gray separators are hidden"), StringResource("revanced_hide_gray_separator_summary_off", "Gray separators are shown")
StringResource("revanced_adremover_separator_summary_off", "Gray separators are shown")
), ),
SwitchPreference( SwitchPreference(
"revanced_adremover_hide_channel_guidelines", "revanced_hide_channel_guidelines",
StringResource("revanced_adremover_hide_channel_guidelines_enabled_title", "Hide channel guidelines"), StringResource("revanced_hide_channel_guidelines_title", "Hide channel guidelines"),
true,
StringResource( StringResource(
"revanced_adremover_hide_channel_guidelines_enabled_summary_on", "revanced_hide_channel_guidelines_summary_on",
"Channel guidelines are hidden" "Channel guidelines are hidden"
), ),
StringResource( StringResource(
"revanced_adremover_hide_channel_guidelines_enabled_summary_off", "revanced_hide_channel_guidelines_summary_off",
"Channel guidelines are shown" "Channel guidelines are shown"
) )
), ),
SwitchPreference( SwitchPreference(
"revanced_adremover_chapter_teaser", "revanced_hide_chapter_teaser",
StringResource( StringResource(
"revanced_adremover_chapter_teaser_enabled_title", "revanced_hide_chapter_teaser_title",
"Hide chapter teaser under videos" "Hide chapter teaser under videos"
), ),
true,
StringResource( StringResource(
"revanced_adremover_chapter_teaser_enabled_summary_on", "revanced_hide_chapter_teaser_summary_on",
"Chapter teasers are hidden" "Chapter teasers are hidden"
), ),
StringResource( StringResource(
"revanced_adremover_chapter_teaser_enabled_summary_off", "revanced_hide_chapter_teaser_summary_off",
"Chapter teasers are shown" "Chapter teasers are shown"
) )
), ),
SwitchPreference( SwitchPreference(
"revanced_adremover_merchandise", "revanced_hide_merchandise_banners",
StringResource("revanced_adremover_merchandise_enabled_title", "Hide merchandise banners"), StringResource("revanced_hide_merchandise_banners_title", "Hide merchandise banners"),
true, StringResource("revanced_hide_merchandise_banners_summary_on", "Merchandise banners are hidden"),
StringResource("revanced_adremover_merchandise_enabled_summary_on", "Merchandise banners are hidden"), StringResource("revanced_hide_merchandise_banners_summary_off", "Merchandise banners are shown")
StringResource("revanced_adremover_merchandise_enabled_summary_off", "Merchandise banners are shown")
), ),
SwitchPreference( SwitchPreference(
"revanced_adremover_community_posts_removal", "revanced_hide_community_posts",
StringResource("revanced_adremover_community_posts_enabled_title", "Hide community posts"), StringResource("revanced_hide_community_posts_title", "Hide community posts"),
false, StringResource("revanced_hide_community_posts_summary_on", "Community posts are hidden"),
StringResource("revanced_adremover_community_posts_enabled_summary_on", "Community posts are hidden"), StringResource("revanced_hide_community_posts_summary_off", "Community posts are shown")
StringResource("revanced_adremover_community_posts_enabled_summary_off", "Community posts are shown")
), ),
SwitchPreference( SwitchPreference(
"revanced_adremover_compact_banner_removal", "revanced_hide_compact_banner",
StringResource("revanced_adremover_compact_banner_enabled_title", "Hide compact banners"), StringResource("revanced_hide_compact_banner_title", "Hide compact banners"),
true, StringResource("revanced_hide_compact_banner_summary_on", "Compact banners are hidden"),
StringResource("revanced_adremover_compact_banner_enabled_summary_on", "Compact banners are hidden"), StringResource("revanced_hide_compact_banner_summary_off", "Compact banners are shown")
StringResource("revanced_adremover_compact_banner_enabled_summary_off", "Compact banners are shown")
), ),
SwitchPreference( SwitchPreference(
"revanced_adremover_view_products", "revanced_hide_products_banner",
StringResource("revanced_adremover_view_products_title", "Hide banner to view products"), StringResource("revanced_hide_products_banner_title", "Hide banner to view products"),
true, StringResource("revanced_hide_products_banner_summary_on", "Banner is hidden"),
StringResource("revanced_adremover_view_products_summary_on", "Banner is hidden"), StringResource("revanced_hide_products_banner_summary_off", "Banner is shown")
StringResource("revanced_adremover_view_products_summary_off", "Banner is shown")
), ),
SwitchPreference( SwitchPreference(
"revanced_adremover_web_search_result", "revanced_hide_web_search_results",
StringResource("revanced_adremover_web_search_result_panel_title", "Hide web search results"), StringResource("revanced_hide_web_search_results_title", "Hide web search results"),
true, StringResource("revanced_hide_web_search_results_summary_on", "Web search results are hidden"),
StringResource("revanced_adremover_web_search_result_summary_on", "Web search results are hidden"), StringResource("revanced_hide_web_search_results_summary_off", "Web search results are shown")
StringResource("revanced_adremover_web_search_result_summary_off", "Web search results are shown")
), ),
SwitchPreference( SwitchPreference(
"revanced_adremover_movie", "revanced_hide_movies_section",
StringResource("revanced_adremover_movie_enabled_title", "Hide movies section"), StringResource("revanced_hide_movies_section_title", "Hide movies section"),
true, StringResource("revanced_hide_movies_section_summary_on", "Movies section is hidden"),
StringResource("revanced_adremover_movie_enabled_summary_on", "Movies section is hidden"), StringResource("revanced_hide_movies_section_summary_off", "Movies section is shown")
StringResource("revanced_adremover_movie_enabled_summary_off", "Movies section is shown")
), ),
SwitchPreference( SwitchPreference(
"revanced_adremover_feed_survey", "revanced_hide_feed_survey",
StringResource("revanced_adremover_feed_survey_enabled_title", "Hide feed surveys"), StringResource("revanced_hide_feed_survey_title", "Hide feed surveys"),
true, StringResource("revanced_hide_feed_survey_summary_on", "Feed surveys are hidden"),
StringResource("revanced_adremover_feed_survey_enabled_summary_on", "Feed surveys are hidden"), StringResource("revanced_hide_feed_survey_summary_off", "Feed surveys are shown")
StringResource("revanced_adremover_feed_survey_enabled_summary_off", "Feed surveys are shown")
), ),
SwitchPreference( SwitchPreference(
"revanced_adremover_shorts", "revanced_hide_shorts",
StringResource("revanced_adremover_shorts_enabled_title", "Hide shorts"), StringResource("revanced_hide_shorts_title", "Hide shorts"),
true, StringResource("revanced_hide_shorts_summary_on", "Shorts are hidden"),
StringResource("revanced_adremover_shorts_enabled_summary_on", "Shorts are hidden"), StringResource("revanced_hide_shorts_summary_off", "Shorts are shown")
StringResource("revanced_adremover_shorts_enabled_summary_off", "Shorts are shown")
), ),
SwitchPreference( SwitchPreference(
"revanced_adremover_community_guidelines", "revanced_hide_community_guidelines",
StringResource("revanced_adremover_community_guidelines_enabled_title", "Hide community guidelines"), StringResource("revanced_hide_community_guidelines_title", "Hide community guidelines"),
true,
StringResource( StringResource(
"revanced_adremover_community_guidelines_enabled_summary_on", "revanced_hide_community_guidelines_summary_on",
"Community guidelines are hidden" "Community guidelines are hidden"
), ),
StringResource( StringResource(
"revanced_adremover_community_guidelines_enabled_summary_off", "revanced_hide_community_guidelines_summary_off",
"Community guidelines are shown" "Community guidelines are shown"
) )
), ),
SwitchPreference( SwitchPreference(
"revanced_adremover_subscribers_community_guidelines_removal", "revanced_hide_subscribers_community_guidelines",
StringResource( StringResource(
"revanced_adremover_subscribers_community_guidelines_enabled_title", "revanced_hide_subscribers_community_guidelines_title",
"Hide subscribers community guidelines" "Hide subscribers community guidelines"
), ),
true,
StringResource( StringResource(
"revanced_adremover_subscribers_community_guidelines_enabled_summary_on", "revanced_hide_subscribers_community_guidelines_summary_on",
"Subscribers community guidelines are hidden" "Subscribers community guidelines are hidden"
), ),
StringResource( StringResource(
"revanced_adremover_subscribers_community_guidelines_enabled_summary_off", "revanced_hide_subscribers_community_guidelines_summary_off",
"Subscribers community guidelines are shown" "Subscribers community guidelines are shown"
) )
), ),
SwitchPreference( SwitchPreference(
"revanced_adremover_channel_member_shelf_removal", "revanced_hide_channel_member_shelf",
StringResource("revanced_adremover_channel_member_shelf_enabled_title", "Hide channel member shelf"), StringResource("revanced_hide_channel_member_shelf_title", "Hide channel member shelf"),
true,
StringResource( StringResource(
"revanced_adremover_channel_member_shelf_enabled_summary_on", "revanced_hide_channel_member_shelf_summary_on",
"Channel member shelf is hidden" "Channel member shelf is hidden"
), ),
StringResource( StringResource(
"revanced_adremover_channel_member_shelf_enabled_summary_off", "revanced_hide_channel_member_shelf_summary_off",
"Channel member shelf is shown" "Channel member shelf is shown"
) )
), ),
SwitchPreference( SwitchPreference(
"revanced_adremover_emergency_box_removal", "revanced_hide_emergency_box",
StringResource("revanced_adremover_emergency_box_enabled_title", "Hide emergency boxes"), StringResource("revanced_hide_emergency_box_title", "Hide emergency boxes"),
true, StringResource("revanced_hide_emergency_box_summary_on", "Emergency boxes are hidden"),
StringResource("revanced_adremover_emergency_box_enabled_summary_on", "Emergency boxes are hidden"), StringResource("revanced_hide_emergency_box_summary_off", "Emergency boxes are shown")
StringResource("revanced_adremover_emergency_box_enabled_summary_off", "Emergency boxes are shown")
), ),
SwitchPreference( SwitchPreference(
"revanced_adremover_info_panel", "revanced_hide_info_panels",
StringResource("revanced_adremover_info_panel_enabled_title", "Hide info panels"), StringResource("revanced_hide_info_panels_title", "Hide info panels"),
true, StringResource("revanced_hide_info_panels_summary_on", "Info panels are hidden"),
StringResource("revanced_adremover_info_panel_enabled_summary_on", "Info panels are hidden"), StringResource("revanced_hide_info_panels_summary_off", "Info panels are shown")
StringResource("revanced_adremover_info_panel_enabled_summary_off", "Info panels are shown")
), ),
SwitchPreference( SwitchPreference(
"revanced_adremover_medical_panel", "revanced_hide_medical_panels",
StringResource("revanced_adremover_medical_panel_enabled_title", "Hide medical panels"), StringResource("revanced_hide_medical_panels_title", "Hide medical panels"),
true, StringResource("revanced_hide_medical_panels_summary_on", "Medical panels are hidden"),
StringResource("revanced_adremover_medical_panel_enabled_summary_on", "Medical panels are hidden"), StringResource("revanced_hide_medical_panels_summary_off", "Medical panels are shown")
StringResource("revanced_adremover_medical_panel_enabled_summary_off", "Medical panels are shown")
), ),
SwitchPreference( SwitchPreference(
"revanced_hide_channel_bar", "revanced_hide_channel_bar",
StringResource("revanced_hide_channel_bar_title", "Hide channel bar"), StringResource("revanced_hide_channel_bar_title", "Hide channel bar"),
false,
StringResource("revanced_hide_channel_bar_summary_on", "Channel bar is hidden"), StringResource("revanced_hide_channel_bar_summary_on", "Channel bar is hidden"),
StringResource("revanced_hide_channel_bar_summary_off", "Channel bar is shown") StringResource("revanced_hide_channel_bar_summary_off", "Channel bar is shown")
), ),
SwitchPreference( SwitchPreference(
"revanced_hide_quick_actions", "revanced_hide_quick_actions",
StringResource("revanced_hide_quick_actions_title", "Hide quick actions in fullscreen"), StringResource("revanced_hide_quick_actions_title", "Hide quick actions in fullscreen"),
false,
StringResource("revanced_hide_quick_actions_summary_on", "Quick actions are hidden"), StringResource("revanced_hide_quick_actions_summary_on", "Quick actions are hidden"),
StringResource("revanced_hide_quick_actions_summary_off", "Quick actions are shown") StringResource("revanced_hide_quick_actions_summary_off", "Quick actions are shown")
), ),
SwitchPreference( SwitchPreference(
"revanced_hide_related_videos", "revanced_hide_related_videos",
StringResource("revanced_hide_related_videos_title", "Hide related videos in quick actions"), StringResource("revanced_hide_related_videos_title", "Hide related videos in quick actions"),
false,
StringResource("revanced_hide_related_videos_summary_on", "Related videos are hidden"), StringResource("revanced_hide_related_videos_summary_on", "Related videos are hidden"),
StringResource("revanced_hide_related_videos_summary_off", "Related videos are shown") StringResource("revanced_hide_related_videos_summary_off", "Related videos are shown")
), ),
SwitchPreference( SwitchPreference(
"revanced_hide_image_shelf", "revanced_hide_image_shelf",
StringResource("revanced_hide_image_shelf", "Hide image shelf in search results"), StringResource("revanced_hide_image_shelf", "Hide image shelf in search results"),
true,
StringResource("revanced_hide_image_shelf_summary_on", "Image shelf is hidden"), StringResource("revanced_hide_image_shelf_summary_on", "Image shelf is hidden"),
StringResource("revanced_hide_image_shelf_summary_off", "Image shelf is shown") StringResource("revanced_hide_image_shelf_summary_off", "Image shelf is shown")
), ),
SwitchPreference( SwitchPreference(
"revanced_hide_audio_track_button", "revanced_hide_audio_track_button",
StringResource("revanced_hide_audio_track_button_title", "Hide audio track button"), StringResource("revanced_hide_audio_track_button_title", "Hide audio track button"),
false,
StringResource("revanced_hide_audio_track_button_on", "Audio track button is hidden"), StringResource("revanced_hide_audio_track_button_on", "Audio track button is hidden"),
StringResource("revanced_hide_audio_track_button_off", "Audio track button is shown") StringResource("revanced_hide_audio_track_button_off", "Audio track button is shown")
) )
@@ -224,68 +202,60 @@ class GeneralAdsResourcePatch : ResourcePatch {
PreferenceScreen.ADS.addPreferences( PreferenceScreen.ADS.addPreferences(
SwitchPreference( SwitchPreference(
"revanced_adremover_ad_removal", "revanced_hide_general_ads",
StringResource("revanced_adremover_ad_removal_enabled_title", "Hide general ads"), StringResource("revanced_hide_general_ads_title", "Hide general ads"),
true, StringResource("revanced_hide_general_ads_summary_on", "General ads are hidden"),
StringResource("revanced_adremover_ad_removal_enabled_summary_on", "General ads are hidden"), StringResource("revanced_hide_general_ads_summary_off", "General ads are shown")
StringResource("revanced_adremover_ad_removal_enabled_summary_off", "General ads are shown")
), ),
SwitchPreference( SwitchPreference(
"revanced_adremover_buttoned", "revanced_hide_buttoned_ads",
StringResource("revanced_adremover_buttoned_enabled_title", "Hide buttoned ad"), StringResource("revanced_hide_buttoned_ads_title", "Hide buttoned ad"),
true, StringResource("revanced_hide_buttoned_ads_summary_on", "Buttoned ads are hidden"),
StringResource("revanced_adremover_buttoned_enabled_summary_on", "Buttoned ads are hidden"), StringResource("revanced_hide_buttoned_ads_summary_off", "Buttoned ads are shown")
StringResource("revanced_adremover_buttoned_enabled_summary_off", "Buttoned ads are shown")
), ),
SwitchPreference( SwitchPreference(
"revanced_adremover_paid_content", "revanced_hide_paid_content_ads",
StringResource("revanced_adremover_paid_content_enabled_title", "Hide paid content"), StringResource("revanced_hide_paid_content_ads_title", "Hide paid content"),
true, StringResource("revanced_hide_paid_content_ads_summary_on", "Paid content is hidden"),
StringResource("revanced_adremover_paid_content_enabled_summary_on", "Paid content is hidden"), StringResource("revanced_hide_paid_content_ads_summary_off", "Paid content is shown")
StringResource("revanced_adremover_paid_content_enabled_summary_off", "Paid content is shown")
), ),
SwitchPreference( SwitchPreference(
"revanced_adremover_hide_latest_posts", "revanced_hide_latest_posts_ads",
StringResource("revanced_adremover_hide_latest_posts_enabled_title", "Hide latest posts"), StringResource("revanced_hide_latest_posts_ads_title", "Hide latest posts"),
true, StringResource("revanced_hide_latest_posts_ads_summary_on", "Latest posts are hidden"),
StringResource("revanced_adremover_hide_latest_posts_enabled_summary_on", "Latest posts are hidden"), StringResource("revanced_hide_latest_posts_ads_summary_off", "Latest posts are shown")
StringResource("revanced_adremover_hide_latest_posts_enabled_summary_off", "Latest posts are shown")
), ),
SwitchPreference( SwitchPreference(
"revanced_adremover_self_sponsor", "revanced_hide_self_sponsor_ads",
StringResource("revanced_adremover_self_sponsor_enabled_title", "Hide self sponsored cards"), StringResource("revanced_hide_self_sponsor_ads_title", "Hide self sponsored cards"),
true, StringResource("revanced_hide_self_sponsor_ads_summary_on", "Self sponsored cards are hidden"),
StringResource("revanced_adremover_self_sponsor_enabled_summary_on", "Self sponsored cards are hidden"), StringResource("revanced_hide_self_sponsor_ads_summary_off", "Self sponsored cards are shown")
StringResource("revanced_adremover_self_sponsor_enabled_summary_off", "Self sponsored cards are shown")
), ),
PreferenceScreen( PreferenceScreen(
"revanced_adremover_custom", "revanced_custom_filter_preference_screen",
StringResource("revanced_adremover_custom_title", "Custom filter"), StringResource("revanced_custom_filter_preference_screen_title", "Custom filter"),
listOf( listOf(
SwitchPreference( SwitchPreference(
"revanced_adremover_custom_enabled", "revanced_custom_filter",
StringResource( StringResource(
"revanced_adremover_custom_enabled_title", "revanced_custom_filter_title",
"Enable custom filter" "Enable custom filter"
), ),
false,
StringResource( StringResource(
"revanced_adremover_custom_enabled_summary_on", "revanced_custom_filter_summary_on",
"Custom filter is enabled" "Custom filter is enabled"
), ),
StringResource( StringResource(
"revanced_adremover_custom_enabled_summary_off", "revanced_custom_filter_summary_off",
"Custom filter is disabled" "Custom filter is disabled"
) )
), ),
// TODO: This should be a dynamic ListPreference, which does not exist yet // TODO: This should be a dynamic ListPreference, which does not exist yet
TextPreference( TextPreference(
"revanced_adremover_custom_strings", "revanced_custom_filter_strings",
StringResource("revanced_adremover_custom_strings_title", "Custom filter"), StringResource("revanced_custom_filter_strings_title", "Custom filter"),
InputType.STRING,
"",
StringResource( StringResource(
"revanced_adremover_custom_strings_summary", "revanced_custom_filter_strings_summary",
"Filter components by their name separated by a comma" "Filter components by their name separated by a comma"
) )
) )

View File

@@ -33,11 +33,10 @@ class VideoAdsPatch : BytecodePatch(
override fun execute(context: BytecodeContext): PatchResult { override fun execute(context: BytecodeContext): PatchResult {
SettingsPatch.PreferenceScreen.ADS.addPreferences( SettingsPatch.PreferenceScreen.ADS.addPreferences(
SwitchPreference( SwitchPreference(
"revanced_video_ads_removal", "revanced_hide_video_ads",
StringResource("revanced_video_ads_removal_title", "Hide video ads"), StringResource("revanced_hide_video_ads_title", "Hide video ads"),
true, StringResource("revanced_hide_video_ads_summary_on", "Video ads are hidden"),
StringResource("revanced_video_ads_removal_summary_on", "Video ads are hidden"), StringResource("revanced_hide_video_ads_summary_off", "Video ads are shown")
StringResource("revanced_video_ads_removal_summary_off", "Video ads are shown")
) )
) )

View File

@@ -12,7 +12,7 @@ import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.youtube.interaction.copyvideourl.annotation.CopyVideoUrlCompatibility import app.revanced.patches.youtube.interaction.copyvideourl.annotation.CopyVideoUrlCompatibility
import app.revanced.patches.youtube.interaction.copyvideourl.resource.patch.CopyVideoUrlResourcePatch import app.revanced.patches.youtube.interaction.copyvideourl.resource.patch.CopyVideoUrlResourcePatch
import app.revanced.patches.youtube.misc.playercontrols.bytecode.patch.PlayerControlsBytecodePatch import app.revanced.patches.youtube.misc.playercontrols.bytecode.patch.PlayerControlsBytecodePatch
import app.revanced.patches.youtube.misc.video.information.patch.VideoInformationPatch import app.revanced.patches.youtube.video.information.patch.VideoInformationPatch
@Patch @Patch
@Name("copy-video-url") @Name("copy-video-url")

View File

@@ -1,6 +1,5 @@
package app.revanced.patches.youtube.interaction.copyvideourl.resource.patch package app.revanced.patches.youtube.interaction.copyvideourl.resource.patch
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.data.ResourceContext
@@ -11,40 +10,35 @@ import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patches.shared.settings.preference.impl.PreferenceScreen 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.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
import app.revanced.patches.youtube.interaction.copyvideourl.annotation.CopyVideoUrlCompatibility
import app.revanced.patches.youtube.misc.playercontrols.resource.patch.BottomControlsResourcePatch import app.revanced.patches.youtube.misc.playercontrols.resource.patch.BottomControlsResourcePatch
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
import app.revanced.util.resources.ResourceUtils import app.revanced.util.resources.ResourceUtils
import app.revanced.util.resources.ResourceUtils.copyResources import app.revanced.util.resources.ResourceUtils.copyResources
@Name("copy-video-url-resource") @Name("copy-video-url-resource")
@Description("Makes necessary changes to resources for copy video link buttons.")
@DependsOn([BottomControlsResourcePatch::class, SettingsPatch::class]) @DependsOn([BottomControlsResourcePatch::class, SettingsPatch::class])
@CopyVideoUrlCompatibility
@Version("0.0.1") @Version("0.0.1")
class CopyVideoUrlResourcePatch : ResourcePatch { class CopyVideoUrlResourcePatch : ResourcePatch {
override fun execute(context: ResourceContext): PatchResult { override fun execute(context: ResourceContext): PatchResult {
SettingsPatch.PreferenceScreen.INTERACTIONS.addPreferences( SettingsPatch.PreferenceScreen.INTERACTIONS.addPreferences(
PreferenceScreen( PreferenceScreen(
"revanced_copy_video_url", "revanced_copy_video_url_preference_screen",
StringResource("revanced_copy_video_url_title", "Copy video URL settings"), StringResource("revanced_copy_video_url_preference_screen_title", "Copy video URL settings"),
listOf( listOf(
SwitchPreference( SwitchPreference(
"revanced_copy_video_url_enabled", "revanced_copy_video_url",
StringResource("revanced_copy_video_url_enabled_title", "Show copy video URL button"), StringResource("revanced_copy_video_url_title", "Show copy video URL button"),
true, StringResource("revanced_copy_video_url_summary_on", "Button is shown, click to copy video URL without timestamp"),
StringResource("revanced_copy_video_url_enabled_summary_on", "Button is shown, click to copy video URL without timestamp"), StringResource("revanced_copy_video_url_summary_off", "Button is not shown")
StringResource("revanced_copy_video_url_enabled_summary_off", "Button is not shown")
), ),
SwitchPreference( SwitchPreference(
"revanced_copy_video_url_timestamp_enabled", "revanced_copy_video_url_timestamp",
StringResource("revanced_copy_video_url_timestamp_enabled_title", "Show copy timestamp URL button"), StringResource("revanced_copy_video_url_timestamp_title", "Show copy timestamp URL button"),
true, StringResource("revanced_copy_video_url_timestamp_summary_on", "Button is shown, click to copy video URL with timestamp"),
StringResource("revanced_copy_video_url_timestamp_enabled_summary_on", "Button is shown, click to copy video URL with timestamp"), StringResource("revanced_copy_video_url_timestamp_summary_off", "Button is not shown")
StringResource("revanced_copy_video_url_timestamp_enabled_summary_off", "Button is not shown")
) )
), ),
StringResource("revanced_copy_video_url_summary", "Settings related to copy URL buttons in video player") StringResource("revanced_copy_video_url_preference_screen_summary", "Settings related to copy URL buttons in video player")
) )
) )

View File

@@ -12,12 +12,12 @@ import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.youtube.interaction.downloads.annotation.DownloadsCompatibility import app.revanced.patches.youtube.interaction.downloads.annotation.DownloadsCompatibility
import app.revanced.patches.youtube.interaction.downloads.resource.patch.DownloadsResourcePatch import app.revanced.patches.youtube.interaction.downloads.resource.patch.DownloadsResourcePatch
import app.revanced.patches.youtube.misc.playercontrols.bytecode.patch.PlayerControlsBytecodePatch import app.revanced.patches.youtube.misc.playercontrols.bytecode.patch.PlayerControlsBytecodePatch
import app.revanced.patches.youtube.misc.video.information.patch.VideoInformationPatch import app.revanced.patches.youtube.video.information.patch.VideoInformationPatch
@Patch @Patch
@Name("downloads") @Name("downloads")
@DependsOn([DownloadsResourcePatch::class, PlayerControlsBytecodePatch::class, VideoInformationPatch::class]) @DependsOn([DownloadsResourcePatch::class, PlayerControlsBytecodePatch::class, VideoInformationPatch::class])
@Description("Enables downloading music and videos from YouTube.") @Description("Adds a download button to the YouTube video player.")
@DownloadsCompatibility @DownloadsCompatibility
@Version("0.0.1") @Version("0.0.1")
class DownloadsBytecodePatch : BytecodePatch() { class DownloadsBytecodePatch : BytecodePatch() {

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