mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-30 14:11:05 +00:00
Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f57c555395 | ||
|
|
53f1f6fc96 | ||
|
|
b4b8f62c7b | ||
|
|
8b2703273a | ||
|
|
9e2a6eead1 | ||
|
|
5afd49a111 | ||
|
|
e79ad750d4 | ||
|
|
97ea238520 | ||
|
|
700ca5b543 | ||
|
|
b792be5b78 | ||
|
|
025b480175 | ||
|
|
e1b53b214f | ||
|
|
30939e5efe | ||
|
|
4d9c41488d | ||
|
|
2fffcde357 | ||
|
|
7af08e0ba7 | ||
|
|
228834fda8 | ||
|
|
7466aecc5b | ||
|
|
8ee36541b4 | ||
|
|
a4fd6603fe | ||
|
|
510cb8f590 | ||
|
|
c02ebd752c | ||
|
|
b4d7eca5fa | ||
|
|
c6125c071b | ||
|
|
478de297f9 | ||
|
|
ebc4a12cd7 | ||
|
|
b3c0291e70 | ||
|
|
c43588ee40 | ||
|
|
c74b5d4e47 | ||
|
|
91ae954210 | ||
|
|
65172cad4f | ||
|
|
c2122494bc |
74
CHANGELOG.md
74
CHANGELOG.md
@@ -1,3 +1,77 @@
|
|||||||
|
# [2.123.0](https://github.com/revanced/revanced-patches/compare/v2.122.0...v2.123.0) (2022-11-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **windyapp:** `unlock-pro` patch ([#1118](https://github.com/revanced/revanced-patches/issues/1118)) ([d866634](https://github.com/revanced/revanced-patches/commit/d866634f83976df44b26848e0b70e9952d5d06ae))
|
||||||
|
|
||||||
|
# [2.122.0](https://github.com/revanced/revanced-patches/compare/v2.121.0...v2.122.0) (2022-11-25)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **tiktok:** `sim-spoof` patch ([#1088](https://github.com/revanced/revanced-patches/issues/1088)) ([53bb547](https://github.com/revanced/revanced-patches/commit/53bb547cc1003859f1d42db819a897e120b17fbe))
|
||||||
|
|
||||||
|
# [2.121.0](https://github.com/revanced/revanced-patches/compare/v2.120.0...v2.121.0) (2022-11-23)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **anytracker:** remove `unlock-premium` patch ([#1094](https://github.com/revanced/revanced-patches/issues/1094)) ([c3818be](https://github.com/revanced/revanced-patches/commit/c3818befc6e342ff04bc8e9fde84a667c123d7ab))
|
||||||
|
|
||||||
|
# [2.120.0](https://github.com/revanced/revanced-patches/compare/v2.119.0...v2.120.0) (2022-11-23)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **youtube:** `remove-player-button-background` patch ([#855](https://github.com/revanced/revanced-patches/issues/855)) ([9e14817](https://github.com/revanced/revanced-patches/commit/9e14817fd2ef29b9f3ec161d74ab972ba19066b0))
|
||||||
|
|
||||||
|
# [2.119.0](https://github.com/revanced/revanced-patches/compare/v2.118.1...v2.119.0) (2022-11-23)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **twitch:** ˋintegrationsˋ dependency patch ([#1074](https://github.com/revanced/revanced-patches/issues/1074)) ([a84ca7e](https://github.com/revanced/revanced-patches/commit/a84ca7ec04389c3665358a7d239c615214fd327d))
|
||||||
|
|
||||||
|
## [2.118.1](https://github.com/revanced/revanced-patches/compare/v2.118.0...v2.118.1) (2022-11-22)
|
||||||
|
|
||||||
|
# [2.118.0](https://github.com/revanced/revanced-patches/compare/v2.117.1...v2.118.0) (2022-11-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **youtube:** bump patches compatibility to v17.45.36 ([ab7dfd8](https://github.com/revanced/revanced-patches/commit/ab7dfd8ee1d902095811ed91b80aa0ed362ee9c5))
|
||||||
|
|
||||||
|
## [2.117.1](https://github.com/revanced/revanced-patches/compare/v2.117.0...v2.117.1) (2022-11-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **youtube/general-ads:** hide reels shelf ([a436663](https://github.com/revanced/revanced-patches/commit/a436663e7755fc714c735df626d39bbd94f83dbb))
|
||||||
|
|
||||||
|
# [2.117.0](https://github.com/revanced/revanced-patches/compare/v2.116.0...v2.117.0) (2022-11-21)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **tiktok:** `tiktok-web-login` patch ([#593](https://github.com/revanced/revanced-patches/issues/593)) ([233e578](https://github.com/revanced/revanced-patches/commit/233e578b4d1cd5e783369e0c855e8246d158f8ed))
|
||||||
|
|
||||||
|
# [2.116.0](https://github.com/revanced/revanced-patches/compare/v2.115.0...v2.116.0) (2022-11-21)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **youtube/theme:** make amoled the default color for dark theme background" ([2b68ac7](https://github.com/revanced/revanced-patches/commit/2b68ac7796e54ed07c697909a84b3847f4ed7f01))
|
||||||
|
|
||||||
|
# [2.115.0](https://github.com/revanced/revanced-patches/compare/v2.114.2...v2.115.0) (2022-11-21)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **youtube/general-ads:** normalize switch names ([7636180](https://github.com/revanced/revanced-patches/commit/763618002ab6ccd9cd23889275c0e9b23642763e))
|
||||||
|
* **youtube/theme:** exclude the patch by default ([57358ed](https://github.com/revanced/revanced-patches/commit/57358edc4cf3ae6b05cfb51359f66fc94c71cb5c))
|
||||||
|
* **youtube/theme:** make dark the default color for dark theme background ([db44fa6](https://github.com/revanced/revanced-patches/commit/db44fa6f5adad19384970dad58784b2bf5fe1007))
|
||||||
|
|
||||||
## [2.114.2](https://github.com/revanced/revanced-patches/compare/v2.114.1...v2.114.2) (2022-11-20)
|
## [2.114.2](https://github.com/revanced/revanced-patches/compare/v2.114.1...v2.114.2) (2022-11-20)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ The file contains an array of objects, each object representing a patch. The obj
|
|||||||
| `description` | The description of the patch. |
|
| `description` | The description of the patch. |
|
||||||
| `version` | The version of the patch. |
|
| `version` | The version of the patch. |
|
||||||
| `excluded` | Whether the patch is excluded by default. If `true`, the patch must never be included by default. |
|
| `excluded` | Whether the patch is excluded by default. If `true`, the patch must never be included by default. |
|
||||||
| `deprecated` | Whether the patch is deprecated. |
|
|
||||||
| `options` | An array of options for this patch. |
|
| `options` | An array of options for this patch. |
|
||||||
| `options.key` | The key of the option. |
|
| `options.key` | The key of the option. |
|
||||||
| `options.title` | The title of the option. |
|
| `options.title` | The title of the option. |
|
||||||
@@ -39,7 +38,6 @@ Example:
|
|||||||
"description": "Adds the ability to remember the video quality you chose in the video quality flyout.",
|
"description": "Adds the ability to remember the video quality you chose in the video quality flyout.",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"excluded": false,
|
"excluded": false,
|
||||||
"deprecated": false,
|
|
||||||
"options": [],
|
"options": [],
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"integrations",
|
"integrations",
|
||||||
|
|||||||
97
README.md
97
README.md
@@ -21,8 +21,10 @@ The official Patch bundle provided by ReVanced and the community.
|
|||||||
| `tiktok-speed` | Enables the playback speed option for all videos. | all |
|
| `tiktok-speed` | Enables the playback speed option for all videos. | all |
|
||||||
| `tiktok-download` | Removes download restrictions and changes the default path to download to. | all |
|
| `tiktok-download` | Removes download restrictions and changes the default path to download to. | all |
|
||||||
| `tiktok-seekbar` | Show progress bar for all video. | all |
|
| `tiktok-seekbar` | Show progress bar for all video. | all |
|
||||||
| `settings` | Adds settings for ReVanced to TikTok. | all |
|
| `tiktok-settings` | Adds settings for ReVanced to TikTok. | all |
|
||||||
| `tiktok-force-login` | Do not force login. | all |
|
| `tiktok-force-login` | Do not force login. | all |
|
||||||
|
| `tiktok-web-login` | Allows logging in with a Google account. | all |
|
||||||
|
| `sim-spoof` | Spoofs the information which is retrieved from the sim-card. | all |
|
||||||
| `tiktok-feed-filter` | Filters tiktok videos: removing ads, removing livestreams. | all |
|
| `tiktok-feed-filter` | Filters tiktok videos: removing ads, removing livestreams. | all |
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
@@ -35,8 +37,10 @@ The official Patch bundle provided by ReVanced and the community.
|
|||||||
| `tiktok-speed` | Enables the playback speed option for all videos. | all |
|
| `tiktok-speed` | Enables the playback speed option for all videos. | all |
|
||||||
| `tiktok-download` | Removes download restrictions and changes the default path to download to. | all |
|
| `tiktok-download` | Removes download restrictions and changes the default path to download to. | all |
|
||||||
| `tiktok-seekbar` | Show progress bar for all video. | all |
|
| `tiktok-seekbar` | Show progress bar for all video. | all |
|
||||||
| `settings` | Adds settings for ReVanced to TikTok. | all |
|
| `tiktok-settings` | Adds settings for ReVanced to TikTok. | all |
|
||||||
| `tiktok-force-login` | Do not force login. | all |
|
| `tiktok-force-login` | Do not force login. | all |
|
||||||
|
| `tiktok-web-login` | Allows logging in with a Google account. | all |
|
||||||
|
| `sim-spoof` | Spoofs the information which is retrieved from the sim-card. | all |
|
||||||
| `tiktok-feed-filter` | Filters tiktok videos: removing ads, removing livestreams. | all |
|
| `tiktok-feed-filter` | Filters tiktok videos: removing ads, removing livestreams. | all |
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
@@ -81,52 +85,53 @@ The official Patch bundle provided by ReVanced and the community.
|
|||||||
|
|
||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|:--------:|:--------------:|:-----------------:|
|
||||||
| `hide-crowdfunding-box` | Hides the crowdfunding box between the player and video description. | 17.43.36 |
|
| `hide-crowdfunding-box` | Hides the crowdfunding box between the player and video description. | 17.45.36 |
|
||||||
| `hide-time-and-seekbar` | Hides progress bar and time counter on videos. | 17.43.36 |
|
| `hide-time-and-seekbar` | Hides progress bar and time counter on videos. | 17.45.36 |
|
||||||
| `hide-video-buttons` | Adds options to hide action buttons under a video. | 17.43.36 |
|
| `hide-video-buttons` | Adds options to hide action buttons under a video. | 17.45.36 |
|
||||||
| `enable-wide-searchbar` | Replaces the search icon with a wide search bar. This will hide the YouTube logo when active. | 17.43.36 |
|
| `enable-wide-searchbar` | Replaces the search icon with a wide search bar. This will hide the YouTube logo when active. | 17.43.36 |
|
||||||
| `hide-captions-button` | Hides the captions button on video player. | 17.43.36 |
|
| `hide-captions-button` | Hides the captions button on video player. | 17.45.36 |
|
||||||
| `hide-shorts-button` | Hides the shorts button on the navigation bar. | 17.43.36 |
|
| `hide-shorts-button` | Hides the shorts button on the navigation bar. | 17.43.36 |
|
||||||
| `hide-create-button` | Hides the create button in the navigation bar. | 17.43.36 |
|
| `hide-create-button` | Hides the create button in the navigation bar. | 17.43.36 |
|
||||||
| `disable-startup-shorts-player` | Disables playing YouTube Shorts when launching YouTube. | 17.43.36 |
|
| `disable-startup-shorts-player` | Disables playing YouTube Shorts when launching YouTube. | 17.45.36 |
|
||||||
| `hide-endscreen-cards` | Hides the suggested video cards at the end of a video in fullscreen. | 17.43.36 |
|
| `remove-player-button-background` | Removes the background from the video player buttons. | 17.45.36 |
|
||||||
|
| `hide-endscreen-cards` | Hides the suggested video cards at the end of a video in fullscreen. | 17.45.36 |
|
||||||
| `hide-cast-button` | Hides the cast button in the video player. | all |
|
| `hide-cast-button` | Hides the cast button in the video player. | all |
|
||||||
| `sponsorblock` | Integrate SponsorBlock. | 17.43.36 |
|
| `sponsorblock` | Integrate SponsorBlock. | 17.45.36 |
|
||||||
| `hide-autoplay-button` | Hides the autoplay button in the video player. | 17.43.36 |
|
| `hide-autoplay-button` | Hides the autoplay button in the video player. | 17.45.36 |
|
||||||
| `hide-watch-in-vr` | Hides the Watch in VR option from the player settings flyout panel. | 17.43.36 |
|
| `hide-watch-in-vr` | Hides the Watch in VR option from the player settings flyout panel. | 17.45.36 |
|
||||||
| `hide-album-cards` | Hides the album cards below the artist description. | 17.43.36 |
|
| `hide-album-cards` | Hides the album cards below the artist description. | 17.45.36 |
|
||||||
| `disable-auto-player-popup-panels` | Disable automatic popup panels (playlist or live chat) on video player. | 17.43.36 |
|
| `disable-auto-player-popup-panels` | Disable automatic popup panels (playlist or live chat) on video player. | 17.45.36 |
|
||||||
| `disable-auto-captions` | Disable forced captions from being automatically enabled. | 17.43.36 |
|
| `disable-auto-captions` | Disable forced captions from being automatically enabled. | 17.45.36 |
|
||||||
| `disable-fullscreen-panels` | Disables video description and comments panel in fullscreen view. | 17.43.36 |
|
| `disable-fullscreen-panels` | Disables video description and comments panel in fullscreen view. | 17.45.36 |
|
||||||
| `hide-artist-card` | Hides the artist card below the searchbar. | 17.43.36 |
|
| `hide-artist-card` | Hides the artist card below the searchbar. | 17.45.36 |
|
||||||
| `return-youtube-dislike` | Shows the dislike count of videos using the Return YouTube Dislike API. | 17.43.36 |
|
| `return-youtube-dislike` | Shows the dislike count of videos using the Return YouTube Dislike API. | 17.45.36 |
|
||||||
| `comments` | Hides components related to comments. | 17.43.36 |
|
| `comments` | Hides components related to comments. | 17.45.36 |
|
||||||
| `theme` | Applies a custom theme. | all |
|
| `theme` | Applies a custom theme. | all |
|
||||||
| `hide-email-address` | Hides the email address in the account switcher. | 17.43.36 |
|
| `hide-email-address` | Hides the email address in the account switcher. | 17.45.36 |
|
||||||
| `tablet-mini-player` | Enables the tablet mini player layout. | 17.43.36 |
|
| `tablet-mini-player` | Enables the tablet mini player layout. | 17.45.36 |
|
||||||
| `hide-watermark` | Hides creator's watermarks on videos. | 17.43.36 |
|
| `hide-watermark` | Hides creator's watermarks on videos. | 17.45.36 |
|
||||||
| `hide-info-cards` | Hides info-cards in videos. | 17.43.36 |
|
| `hide-info-cards` | Hides info-cards in videos. | 17.45.36 |
|
||||||
| `hide-my-mix` | Hides mix playlists. | 17.43.36 |
|
| `hide-my-mix` | Hides mix playlists. | 17.45.36 |
|
||||||
| `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 |
|
||||||
| `premium-heading` | Shows premium branding on the home screen. | all |
|
| `premium-heading` | Shows premium branding on the home screen. | all |
|
||||||
| `old-quality-layout` | Enables the original quality flyout menu. | 17.43.36 |
|
| `old-quality-layout` | Enables the original quality flyout menu. | 17.45.36 |
|
||||||
| `general-ads` | Removes general ads. | 17.43.36 |
|
| `general-ads` | Removes general ads. | 17.45.36 |
|
||||||
| `video-ads` | Removes ads in the video player. | 17.43.36 |
|
| `video-ads` | Removes ads in the video player. | 17.45.36 |
|
||||||
| `swipe-controls` | Adds volume and brightness swipe controls. | 17.43.36 |
|
| `swipe-controls` | Adds volume and brightness swipe controls. | 17.45.36 |
|
||||||
| `downloads` | Enables downloading music and videos from YouTube. | 17.43.36 |
|
| `downloads` | Enables downloading music and videos from YouTube. | 17.45.36 |
|
||||||
| `seekbar-tapping` | Enables tap-to-seek on the seekbar of the video player. | 17.43.36 |
|
| `seekbar-tapping` | Enables tap-to-seek on the seekbar of the video player. | 17.45.36 |
|
||||||
| `disable-zoom-haptics` | Disables haptics when zooming. | all |
|
| `disable-zoom-haptics` | Disables haptics when zooming. | all |
|
||||||
| `settings` | Adds settings for ReVanced to YouTube. | all |
|
| `settings` | Adds settings for ReVanced to YouTube. | all |
|
||||||
| `open-links-directly` | Bypasses redirect links and allows opening links directly. | 17.43.36 |
|
| `open-links-directly` | Bypasses redirect links and allows opening links directly. | 17.45.36 |
|
||||||
| `microg-support` | Allows YouTube ReVanced to run without root and under a different package name with Vanced MicroG. | 17.43.36 |
|
| `microg-support` | Allows YouTube ReVanced to run without root and under a different package name with Vanced MicroG. | 17.45.36 |
|
||||||
| `custom-video-buffer` | Lets you change the buffers of videos. | 17.43.36 |
|
| `custom-video-buffer` | Lets you change the buffers of videos. | 17.45.36 |
|
||||||
| `debugging` | Adds debugging options. | all |
|
| `debugging` | Adds debugging options. | all |
|
||||||
| `client-spoof` | Spoofs the YouTube or Vanced client to prevent playback issues. | all |
|
| `client-spoof` | Spoofs the YouTube or Vanced client to prevent playback issues. | all |
|
||||||
| `always-autorepeat` | Always repeats the playing video again. | 17.43.36 |
|
| `always-autorepeat` | Always repeats the playing video again. | 17.45.36 |
|
||||||
| `minimized-playback` | Enables minimized and background playback. | 17.43.36 |
|
| `minimized-playback` | Enables minimized and background playback. | 17.45.36 |
|
||||||
| `custom-video-speed` | Adds more video speed options. | 17.43.36 |
|
| `custom-video-speed` | Adds more video speed options. | 17.45.36 |
|
||||||
| `remember-video-quality` | Adds the ability to remember the video quality you chose in the video quality flyout. | 17.43.36 |
|
| `remember-video-quality` | Adds the ability to remember the video quality you chose in the video quality flyout. | 17.45.36 |
|
||||||
| `hdr-auto-brightness` | Makes the brightness of HDR videos follow the system default. | 17.43.36 |
|
| `hdr-auto-brightness` | Makes the brightness of HDR videos follow the system default. | 17.45.36 |
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### 📦 `com.vanced.android.youtube`
|
### 📦 `com.vanced.android.youtube`
|
||||||
@@ -145,14 +150,6 @@ The official Patch bundle provided by ReVanced and the community.
|
|||||||
| `unlock-themes` | Unlocks all themes. | all |
|
| `unlock-themes` | Unlocks all themes. | all |
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### 📦 `com.shervinkoushan.anyTracker`
|
|
||||||
<details>
|
|
||||||
|
|
||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|
||||||
| `unlock-premium` | Unlocks all premium features. | all |
|
|
||||||
</details>
|
|
||||||
|
|
||||||
### 📦 `tv.twitch.android.app`
|
### 📦 `tv.twitch.android.app`
|
||||||
<details>
|
<details>
|
||||||
|
|
||||||
@@ -164,6 +161,14 @@ The official Patch bundle provided by ReVanced and the community.
|
|||||||
| `show-deleted-messages` | Shows deleted chat messages behind a clickable spoiler. | all |
|
| `show-deleted-messages` | Shows deleted chat messages behind a clickable spoiler. | all |
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
### 📦 `co.windyapp.android`
|
||||||
|
<details>
|
||||||
|
|
||||||
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|
|:--------:|:--------------:|:-----------------:|
|
||||||
|
| `unlock-pro` | Unlocks all pro features. | all |
|
||||||
|
</details>
|
||||||
|
|
||||||
### 📦 `com.garzotto.pflotsh.ecmwf_a`
|
### 📦 `com.garzotto.pflotsh.ecmwf_a`
|
||||||
<details>
|
<details>
|
||||||
|
|
||||||
@@ -220,7 +225,6 @@ The file contains an array of objects, each object representing a patch. The obj
|
|||||||
| `description` | The description of the patch. |
|
| `description` | The description of the patch. |
|
||||||
| `version` | The version of the patch. |
|
| `version` | The version of the patch. |
|
||||||
| `excluded` | Whether the patch is excluded by default. If `true`, the patch must never be included by default. |
|
| `excluded` | Whether the patch is excluded by default. If `true`, the patch must never be included by default. |
|
||||||
| `deprecated` | Whether the patch is deprecated. |
|
|
||||||
| `options` | An array of options for this patch. |
|
| `options` | An array of options for this patch. |
|
||||||
| `options.key` | The key of the option. |
|
| `options.key` | The key of the option. |
|
||||||
| `options.title` | The title of the option. |
|
| `options.title` | The title of the option. |
|
||||||
@@ -241,7 +245,6 @@ Example:
|
|||||||
"description": "Adds the ability to remember the video quality you chose in the video quality flyout.",
|
"description": "Adds the ability to remember the video quality you chose in the video quality flyout.",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"excluded": false,
|
"excluded": false,
|
||||||
"deprecated": false,
|
|
||||||
"options": [],
|
"options": [],
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"integrations",
|
"integrations",
|
||||||
|
|||||||
@@ -20,10 +20,10 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("app.revanced:revanced-patcher:6.0.2")
|
implementation("app.revanced:revanced-patcher:6.1.0")
|
||||||
implementation("app.revanced:multidexlib2:2.5.2.r2")
|
implementation("app.revanced:multidexlib2:2.5.2.r2")
|
||||||
// Required for meta
|
// Required for meta
|
||||||
implementation("com.google.code.gson:gson:2.9.1")
|
implementation("com.google.code.gson:gson:2.10")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 2.114.2
|
version = 2.123.0
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,22 +1,21 @@
|
|||||||
package app.revanced.extensions
|
package app.revanced.extensions
|
||||||
|
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.data.ResourceContext
|
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
|
||||||
import app.revanced.patcher.patch.PatchResultError
|
|
||||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableClass
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableClass
|
||||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||||
import app.revanced.patcher.util.smali.toInstruction
|
import org.jf.dexlib2.iface.Method
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.util.MethodUtil
|
||||||
import org.jf.dexlib2.Opcode
|
|
||||||
import org.jf.dexlib2.builder.MutableMethodImplementation
|
|
||||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction11n
|
|
||||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction11x
|
|
||||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction21t
|
|
||||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction35c
|
|
||||||
import org.jf.dexlib2.immutable.reference.ImmutableMethodReference
|
|
||||||
import org.w3c.dom.Node
|
import org.w3c.dom.Node
|
||||||
import java.nio.file.Files
|
|
||||||
|
/**
|
||||||
|
* Find the [MutableMethod] from a given [Method] in a [MutableClass].
|
||||||
|
*
|
||||||
|
* @param method The [Method] to find.
|
||||||
|
* @return The [MutableMethod].
|
||||||
|
*/
|
||||||
|
fun MutableClass.findMutableMethodOf(method: Method) = this.methods.first {
|
||||||
|
MethodUtil.methodSignaturesMatch(it, method)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* traverse the class hierarchy starting from the given root class
|
* traverse the class hierarchy starting from the given root class
|
||||||
@@ -42,160 +41,7 @@ fun MutableClass.transformMethods(transform: MutableMethod.() -> MutableMethod)
|
|||||||
methods.addAll(transformedMethods)
|
methods.addAll(transformedMethods)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Insert an event hook at the top of the method. If the hook returns true, the event is consumed and the method will return with true
|
|
||||||
*
|
|
||||||
* the hook method MUST return a boolean and MUST take two parameters, like so:
|
|
||||||
* fun hook(thisRef: Object, eventData: Object): Boolean {}
|
|
||||||
*
|
|
||||||
* The final injected code will resemble the following logic:
|
|
||||||
* if( YouHook(this, event) ) { return true; }
|
|
||||||
* ...
|
|
||||||
*
|
|
||||||
* @param hookRef reference to the hook method
|
|
||||||
*/
|
|
||||||
internal fun MutableMethod.injectConsumableEventHook(hookRef: ImmutableMethodReference) {
|
|
||||||
val isStaticMethod = AccessFlags.STATIC.isSet(this.accessFlags)
|
|
||||||
this.implementation?.let { impl ->
|
|
||||||
// create label to index 0 to continue to the normal program flow
|
|
||||||
val lblContinueNormalFlow = impl.newLabelForIndex(0)
|
|
||||||
|
|
||||||
// define registers
|
|
||||||
/** V0 */
|
|
||||||
val regV0 = 0
|
|
||||||
|
|
||||||
/** this */
|
|
||||||
val regP0 = impl.registerCount - this.parameters.size - (if (isStaticMethod) 0 else 1)
|
|
||||||
|
|
||||||
/** motionEvent */
|
|
||||||
val regP1 = regP0 + 1
|
|
||||||
|
|
||||||
// insert instructions at the start of the method:
|
|
||||||
// if( Hook(this, event) ) { return true; }
|
|
||||||
impl.addInstructions(
|
|
||||||
0, listOf(
|
|
||||||
// invoke-static { p0, p1 } <hook>
|
|
||||||
BuilderInstruction35c(
|
|
||||||
Opcode.INVOKE_STATIC,
|
|
||||||
2,
|
|
||||||
regP0,
|
|
||||||
regP1,
|
|
||||||
0, 0, 0,
|
|
||||||
hookRef
|
|
||||||
),
|
|
||||||
|
|
||||||
// move-result v0
|
|
||||||
BuilderInstruction11x(
|
|
||||||
Opcode.MOVE_RESULT,
|
|
||||||
regV0
|
|
||||||
),
|
|
||||||
|
|
||||||
// if-eqz v0, :continue_normal_flow
|
|
||||||
BuilderInstruction21t(
|
|
||||||
Opcode.IF_EQZ,
|
|
||||||
regV0,
|
|
||||||
lblContinueNormalFlow
|
|
||||||
),
|
|
||||||
|
|
||||||
// const/4 v0, 0x1
|
|
||||||
BuilderInstruction11n(
|
|
||||||
Opcode.CONST_4,
|
|
||||||
regV0,
|
|
||||||
0x1
|
|
||||||
),
|
|
||||||
|
|
||||||
// return v0
|
|
||||||
BuilderInstruction11x(
|
|
||||||
Opcode.RETURN,
|
|
||||||
regV0
|
|
||||||
)
|
|
||||||
|
|
||||||
// :continue_normal_flow
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* inject resources into the patched app
|
|
||||||
*
|
|
||||||
* @param classLoader classloader to use for loading the resources
|
|
||||||
* @param patchDirectoryPath path to the files. this will be the directory you created under the 'resources' source folder
|
|
||||||
* @param resourceType the resource type, for example 'drawable'. this has to match both the source and the target
|
|
||||||
* @param resourceFileNames names of all resources of this type to inject
|
|
||||||
*/
|
|
||||||
fun ResourceContext.injectResources(
|
|
||||||
classLoader: ClassLoader,
|
|
||||||
patchDirectoryPath: String,
|
|
||||||
resourceType: String,
|
|
||||||
resourceFileNames: List<String>
|
|
||||||
) {
|
|
||||||
resourceFileNames.forEach { name ->
|
|
||||||
val relativePath = "$resourceType/$name"
|
|
||||||
val sourceRes = classLoader.getResourceAsStream("$patchDirectoryPath/$relativePath")
|
|
||||||
?: throw PatchResultError("could not open resource '$patchDirectoryPath/$relativePath'")
|
|
||||||
|
|
||||||
Files.copy(
|
|
||||||
sourceRes,
|
|
||||||
this["res"].resolve(relativePath).toPath()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* inject strings into the patched app
|
|
||||||
*
|
|
||||||
* @param classLoader classloader to use for loading the resources
|
|
||||||
* @param patchDirectoryPath path to the files. this will be the directory you created under the 'resources' source folder
|
|
||||||
* @param languageIdentifier ISO 639-2 two- letter language code identifier (aka the one android uses for values directory)
|
|
||||||
*/
|
|
||||||
fun ResourceContext.injectStrings(
|
|
||||||
classLoader: ClassLoader,
|
|
||||||
patchDirectoryPath: String,
|
|
||||||
languageIdentifier: String? = null,
|
|
||||||
) {
|
|
||||||
val relativePath =
|
|
||||||
if (languageIdentifier.isNullOrBlank()) "values/strings.xml" else "values/strings-$languageIdentifier.xml"
|
|
||||||
|
|
||||||
// open source strings.xml
|
|
||||||
val sourceInputStream = classLoader.getResourceAsStream("$patchDirectoryPath/$relativePath")
|
|
||||||
?: throw PatchResultError("failed to open '$patchDirectoryPath/$relativePath'")
|
|
||||||
xmlEditor[sourceInputStream].use { sourceStringsXml ->
|
|
||||||
val strings = sourceStringsXml.file.getElementsByTagName("resources").item(0).childNodes
|
|
||||||
|
|
||||||
// open target strings.xml
|
|
||||||
xmlEditor["res/$relativePath"].use { targetStringsXml ->
|
|
||||||
val targetFile = targetStringsXml.file
|
|
||||||
val targetRootNode = targetFile.getElementsByTagName("resources").item(0)
|
|
||||||
|
|
||||||
// process all children strings in the source
|
|
||||||
for (i in 0 until strings.length) {
|
|
||||||
// clone the node from source to target
|
|
||||||
val node = strings.item(i).cloneNode(true)
|
|
||||||
targetFile.adoptNode(node)
|
|
||||||
targetRootNode.appendChild(node)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
internal fun Node.doRecursively(action: (Node) -> Unit) {
|
internal fun Node.doRecursively(action: (Node) -> Unit) {
|
||||||
action(this)
|
action(this)
|
||||||
for (i in 0 until this.childNodes.length) this.childNodes.item(i).doRecursively(action)
|
for (i in 0 until this.childNodes.length) this.childNodes.item(i).doRecursively(action)
|
||||||
}
|
}
|
||||||
|
|
||||||
internal fun String.startsWithAny(vararg prefixes: String): Boolean {
|
|
||||||
for (prefix in prefixes)
|
|
||||||
if (this.startsWith(prefix))
|
|
||||||
return true
|
|
||||||
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
internal fun String.equalsAny(vararg other: String): Boolean {
|
|
||||||
for (_other in other)
|
|
||||||
if (this == _other)
|
|
||||||
return true
|
|
||||||
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
@@ -3,7 +3,6 @@ package app.revanced.meta.json
|
|||||||
import app.revanced.meta.Bundle
|
import app.revanced.meta.Bundle
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.compatiblePackages
|
import app.revanced.patcher.extensions.PatchExtensions.compatiblePackages
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.dependencies
|
import app.revanced.patcher.extensions.PatchExtensions.dependencies
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.deprecated
|
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.description
|
import app.revanced.patcher.extensions.PatchExtensions.description
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.include
|
import app.revanced.patcher.extensions.PatchExtensions.include
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.options
|
import app.revanced.patcher.extensions.PatchExtensions.options
|
||||||
@@ -22,7 +21,6 @@ fun generateJson(bundle: Bundle) {
|
|||||||
it.description ?: "This patch has no description.",
|
it.description ?: "This patch has no description.",
|
||||||
it.version ?: "0.0.0",
|
it.version ?: "0.0.0",
|
||||||
!it.include,
|
!it.include,
|
||||||
it.deprecated != null,
|
|
||||||
it.options?.map { option ->
|
it.options?.map { option ->
|
||||||
Option(
|
Option(
|
||||||
option.key,
|
option.key,
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ data class JsonPatch(
|
|||||||
val description: String,
|
val description: String,
|
||||||
val version: String,
|
val version: String,
|
||||||
val excluded: Boolean,
|
val excluded: Boolean,
|
||||||
val deprecated: Boolean,
|
|
||||||
val options: Array<Option>,
|
val options: Array<Option>,
|
||||||
val dependencies: Array<String>,
|
val dependencies: Array<String>,
|
||||||
val compatiblePackages: Array<CompatiblePackage>,
|
val compatiblePackages: Array<CompatiblePackage>,
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
package app.revanced.patches.hexeditor.ad.fingerprints
|
package app.revanced.patches.hexeditor.ad.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.hexeditor.ad.annotations.HexEditorAdsCompatibility
|
|
||||||
|
|
||||||
@Name("ads-fingerprint-primary")
|
|
||||||
@HexEditorAdsCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object PrimaryAdsFingerprint : MethodFingerprint(
|
object PrimaryAdsFingerprint : MethodFingerprint(
|
||||||
customFingerprint = { methodDef ->
|
customFingerprint = { methodDef ->
|
||||||
methodDef.definingClass.endsWith("PreferencesHelper;") && methodDef.name == "isAdsDisabled"
|
methodDef.definingClass.endsWith("PreferencesHelper;") && methodDef.name == "isAdsDisabled"
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
package app.revanced.patches.iconpackstudio.misc.pro.fingerprints
|
package app.revanced.patches.iconpackstudio.misc.pro.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.iconpackstudio.misc.pro.annotations.UnlockProCompatibility
|
|
||||||
|
|
||||||
@Name("check-pro-fingerprint")
|
|
||||||
@UnlockProCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object CheckProFingerprint : MethodFingerprint(
|
object CheckProFingerprint : MethodFingerprint(
|
||||||
"Z",
|
"Z",
|
||||||
customFingerprint = { it.definingClass.endsWith("IPSPurchaseRepository;")}
|
customFingerprint = { it.definingClass.endsWith("IPSPurchaseRepository;")}
|
||||||
|
|||||||
@@ -1,18 +1,11 @@
|
|||||||
package app.revanced.patches.music.ad.video.fingerprints
|
package app.revanced.patches.music.ad.video.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.music.ad.video.annotations.MusicVideoAdsCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("show-video-ads-constructor-fingerprint")
|
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@MusicVideoAdsCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object ShowMusicVideoAdsConstructorFingerprint : MethodFingerprint(
|
object ShowMusicVideoAdsConstructorFingerprint : MethodFingerprint(
|
||||||
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L"), listOf(
|
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L"), listOf(
|
||||||
Opcode.INVOKE_DIRECT,
|
Opcode.INVOKE_DIRECT,
|
||||||
|
|||||||
@@ -1,18 +1,10 @@
|
|||||||
package app.revanced.patches.music.ad.video.fingerprints
|
package app.revanced.patches.music.ad.video.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.music.ad.video.annotations.MusicVideoAdsCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("show-video-ads-method-fingerprint")
|
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
|
||||||
@MusicVideoAdsCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object ShowMusicVideoAdsFingerprint : MethodFingerprint(
|
object ShowMusicVideoAdsFingerprint : MethodFingerprint(
|
||||||
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("Z"), listOf(
|
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("Z"), listOf(
|
||||||
Opcode.IPUT_BOOLEAN,
|
Opcode.IPUT_BOOLEAN,
|
||||||
|
|||||||
@@ -1,18 +1,13 @@
|
|||||||
package app.revanced.patches.music.audio.codecs.fingerprints
|
package app.revanced.patches.music.audio.codecs.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.music.audio.codecs.annotations.CodecsUnlockCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("all-codecs-reference-fingerprint")
|
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@CodecsUnlockCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object AllCodecsReferenceFingerprint : MethodFingerprint(
|
object AllCodecsReferenceFingerprint : MethodFingerprint(
|
||||||
"J", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L"), listOf(
|
"J", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L"), listOf(
|
||||||
Opcode.INVOKE_STATIC,
|
Opcode.INVOKE_STATIC,
|
||||||
|
|||||||
@@ -1,18 +1,13 @@
|
|||||||
package app.revanced.patches.music.audio.codecs.fingerprints
|
package app.revanced.patches.music.audio.codecs.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.music.audio.codecs.annotations.CodecsUnlockCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("codec-lock-fingerprint")
|
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@CodecsUnlockCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object CodecsLockFingerprint : MethodFingerprint(
|
object CodecsLockFingerprint : MethodFingerprint(
|
||||||
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, opcodes = listOf(
|
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, opcodes = listOf(
|
||||||
Opcode.INVOKE_DIRECT,
|
Opcode.INVOKE_DIRECT,
|
||||||
|
|||||||
@@ -1,20 +1,10 @@
|
|||||||
package app.revanced.patches.music.audio.exclusiveaudio.fingerprints
|
package app.revanced.patches.music.audio.exclusiveaudio.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.music.audio.exclusiveaudio.annotations.ExclusiveAudioCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("audio-only-enabler-fingerprint")
|
|
||||||
|
|
||||||
@ExclusiveAudioCompatibility
|
|
||||||
@Version(
|
|
||||||
"0.0.1"
|
|
||||||
)
|
|
||||||
object AudioOnlyEnablerFingerprint: MethodFingerprint(
|
object AudioOnlyEnablerFingerprint: MethodFingerprint(
|
||||||
"Z", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(), listOf(
|
"Z", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(), listOf(
|
||||||
Opcode.IGET_OBJECT,
|
Opcode.IGET_OBJECT,
|
||||||
|
|||||||
@@ -1,18 +1,13 @@
|
|||||||
package app.revanced.patches.music.audio.exclusiveaudio.fingerprints
|
package app.revanced.patches.music.audio.exclusiveaudio.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.music.audio.exclusiveaudio.annotations.ExclusiveAudioCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("exclusive-audio-fingerprints")
|
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@ExclusiveAudioCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object ExclusiveAudioFingerprint : MethodFingerprint(
|
object ExclusiveAudioFingerprint : MethodFingerprint(
|
||||||
"V",
|
"V",
|
||||||
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
|
|||||||
@@ -1,16 +1,10 @@
|
|||||||
package app.revanced.patches.music.layout.compactheader.fingerprints
|
package app.revanced.patches.music.layout.compactheader.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.music.layout.compactheader.annotations.CompactHeaderCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("compact-header-constructor-fingerprint")
|
|
||||||
@CompactHeaderCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object CompactHeaderConstructorFingerprint : MethodFingerprint(
|
object CompactHeaderConstructorFingerprint : MethodFingerprint(
|
||||||
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L", "L", "L"), listOf(
|
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L", "L", "L"), listOf(
|
||||||
Opcode.INVOKE_DIRECT,
|
Opcode.INVOKE_DIRECT,
|
||||||
|
|||||||
@@ -1,16 +1,10 @@
|
|||||||
package app.revanced.patches.music.layout.minimizedplayback.fingerprints
|
package app.revanced.patches.music.layout.minimizedplayback.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.music.layout.minimizedplayback.annotations.MinimizedPlaybackCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("minimized-playback-manager-fingerprint")
|
|
||||||
@MinimizedPlaybackCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object MinimizedPlaybackManagerFingerprint : MethodFingerprint(
|
object MinimizedPlaybackManagerFingerprint : MethodFingerprint(
|
||||||
"V",
|
"V",
|
||||||
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
|
|||||||
@@ -1,16 +1,10 @@
|
|||||||
package app.revanced.patches.music.layout.premium.fingerprints
|
package app.revanced.patches.music.layout.premium.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.music.layout.premium.annotations.HideGetPremiumCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("hide-get-premium-fingerprint")
|
|
||||||
@HideGetPremiumCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object HideGetPremiumFingerprint : MethodFingerprint(
|
object HideGetPremiumFingerprint : MethodFingerprint(
|
||||||
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(), listOf(
|
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(), listOf(
|
||||||
Opcode.IF_NEZ,
|
Opcode.IF_NEZ,
|
||||||
|
|||||||
@@ -1,16 +1,10 @@
|
|||||||
package app.revanced.patches.music.layout.premium.fingerprints
|
package app.revanced.patches.music.layout.premium.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.music.layout.premium.annotations.HideGetPremiumCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("hide-get-premium-parent-fingerprint")
|
|
||||||
@HideGetPremiumCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object HideGetPremiumParentFingerprint : MethodFingerprint(
|
object HideGetPremiumParentFingerprint : MethodFingerprint(
|
||||||
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(), listOf(
|
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(), listOf(
|
||||||
Opcode.IGET_BOOLEAN,
|
Opcode.IGET_BOOLEAN,
|
||||||
|
|||||||
@@ -1,18 +1,13 @@
|
|||||||
package app.revanced.patches.music.layout.tastebuilder.fingerprints
|
package app.revanced.patches.music.layout.tastebuilder.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.music.layout.tastebuilder.annotations.RemoveTasteBuilderCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("taste-builder-constructor-fingerprint")
|
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@RemoveTasteBuilderCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object TasteBuilderConstructorFingerprint : MethodFingerprint(
|
object TasteBuilderConstructorFingerprint : MethodFingerprint(
|
||||||
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L"), listOf(
|
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L"), listOf(
|
||||||
Opcode.INVOKE_DIRECT,
|
Opcode.INVOKE_DIRECT,
|
||||||
|
|||||||
@@ -1,18 +1,13 @@
|
|||||||
package app.revanced.patches.music.layout.upgradebutton.fingerprints
|
package app.revanced.patches.music.layout.upgradebutton.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.music.layout.upgradebutton.annotations.RemoveUpgradeButtonCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("pivot-bar-constructor-fingerprint")
|
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@RemoveUpgradeButtonCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object PivotBarConstructorFingerprint : MethodFingerprint(
|
object PivotBarConstructorFingerprint : MethodFingerprint(
|
||||||
"V",
|
"V",
|
||||||
AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
||||||
|
|||||||
@@ -1,15 +1,8 @@
|
|||||||
package app.revanced.patches.music.misc.microg.fingerprints
|
package app.revanced.patches.music.misc.microg.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
|
||||||
|
|
||||||
@Name("cast-context-fetch-fingerprint")
|
|
||||||
|
|
||||||
@MicroGPatchCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object CastContextFetchFingerprint : MethodFingerprint(
|
object CastContextFetchFingerprint : MethodFingerprint(
|
||||||
strings = listOf("Error fetching CastContext.")
|
strings = listOf("Error fetching CastContext.")
|
||||||
)
|
)
|
||||||
@@ -1,15 +1,8 @@
|
|||||||
package app.revanced.patches.music.misc.microg.fingerprints
|
package app.revanced.patches.music.misc.microg.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
|
||||||
|
|
||||||
@Name("cast-module-fingerprint")
|
|
||||||
|
|
||||||
@MicroGPatchCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object CastDynamiteModuleFingerprint : MethodFingerprint(
|
object CastDynamiteModuleFingerprint : MethodFingerprint(
|
||||||
strings = listOf("com.google.android.gms.cast.framework.internal.CastDynamiteModuleImpl")
|
strings = listOf("com.google.android.gms.cast.framework.internal.CastDynamiteModuleImpl")
|
||||||
)
|
)
|
||||||
@@ -1,15 +1,8 @@
|
|||||||
package app.revanced.patches.music.misc.microg.fingerprints
|
package app.revanced.patches.music.misc.microg.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
|
||||||
|
|
||||||
@Name("cast-context-fetch-fingerprint")
|
|
||||||
|
|
||||||
@MicroGPatchCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object CastDynamiteModuleV2Fingerprint : MethodFingerprint(
|
object CastDynamiteModuleV2Fingerprint : MethodFingerprint(
|
||||||
strings = listOf("Failed to load module via V2: ")
|
strings = listOf("Failed to load module via V2: ")
|
||||||
)
|
)
|
||||||
@@ -1,17 +1,9 @@
|
|||||||
package app.revanced.patches.music.misc.microg.fingerprints
|
package app.revanced.patches.music.misc.microg.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.music.misc.microg.annotations.MusicMicroGPatchCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
|
||||||
@Name("google-play-utility-fingerprint")
|
|
||||||
|
|
||||||
@MusicMicroGPatchCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object GooglePlayUtilityFingerprint : MethodFingerprint(
|
object GooglePlayUtilityFingerprint : MethodFingerprint(
|
||||||
"I",
|
"I",
|
||||||
AccessFlags.PUBLIC or AccessFlags.STATIC,
|
AccessFlags.PUBLIC or AccessFlags.STATIC,
|
||||||
|
|||||||
@@ -1,15 +1,8 @@
|
|||||||
package app.revanced.patches.music.misc.microg.fingerprints
|
package app.revanced.patches.music.misc.microg.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.music.misc.microg.annotations.MusicMicroGPatchCompatibility
|
|
||||||
|
|
||||||
@Name("google-play-prime-fingerprint")
|
|
||||||
|
|
||||||
@MusicMicroGPatchCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object PrimeFingerprint : MethodFingerprint(
|
object PrimeFingerprint : MethodFingerprint(
|
||||||
strings = listOf("com.google.android.GoogleCamera", "com.android.vending")
|
strings = listOf("com.google.android.GoogleCamera", "com.android.vending")
|
||||||
)
|
)
|
||||||
@@ -1,17 +1,12 @@
|
|||||||
package app.revanced.patches.music.misc.microg.fingerprints
|
package app.revanced.patches.music.misc.microg.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.music.misc.microg.annotations.MusicMicroGPatchCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
|
||||||
@Name("google-play-service-checker-fingerprint")
|
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@MusicMicroGPatchCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object ServiceCheckFingerprint : MethodFingerprint(
|
object ServiceCheckFingerprint : MethodFingerprint(
|
||||||
"V",
|
"V",
|
||||||
AccessFlags.PUBLIC or AccessFlags.STATIC,
|
AccessFlags.PUBLIC or AccessFlags.STATIC,
|
||||||
|
|||||||
@@ -1,18 +1,13 @@
|
|||||||
package app.revanced.patches.music.premium.backgroundplay.fingerprints
|
package app.revanced.patches.music.premium.backgroundplay.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.music.premium.backgroundplay.annotations.BackgroundPlayCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("background-playback-disabler-fingerprint")
|
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@BackgroundPlayCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object BackgroundPlaybackDisableFingerprint : MethodFingerprint(
|
object BackgroundPlaybackDisableFingerprint : MethodFingerprint(
|
||||||
"Z", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L"), listOf(
|
"Z", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L"), listOf(
|
||||||
Opcode.CONST_4,
|
Opcode.CONST_4,
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
package app.revanced.patches.nyx.misc.pro.fingerprints
|
package app.revanced.patches.nyx.misc.pro.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.nyx.misc.pro.annotations.UnlockProCompatibility
|
|
||||||
|
|
||||||
@Name("check-pro-fingerprint")
|
|
||||||
@UnlockProCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object CheckProFingerprint : MethodFingerprint(
|
object CheckProFingerprint : MethodFingerprint(
|
||||||
customFingerprint = { methodDef ->
|
customFingerprint = { methodDef ->
|
||||||
methodDef.definingClass.endsWith("BillingManager;") && methodDef.name == "isProVersion"
|
methodDef.definingClass.endsWith("BillingManager;") && methodDef.name == "isProVersion"
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
package app.revanced.patches.reddit.layout.premiumicon.fingerprints
|
package app.revanced.patches.reddit.layout.premiumicon.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.reddit.layout.premiumicon.annotations.PremiumIconCompatibility
|
|
||||||
|
|
||||||
@Name("premium-icon-fingerprint")
|
|
||||||
@PremiumIconCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object PremiumIconFingerprint : MethodFingerprint(
|
object PremiumIconFingerprint : MethodFingerprint(
|
||||||
"Z",
|
"Z",
|
||||||
customFingerprint = { methodDef ->
|
customFingerprint = { methodDef ->
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package app.revanced.patches.shared.fingerprints
|
||||||
|
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
|
||||||
|
object WatchWhileActivityFingerprint : MethodFingerprint(
|
||||||
|
customFingerprint = { methodDef ->
|
||||||
|
methodDef.definingClass.endsWith("WatchWhileActivity;") && methodDef.name == "<init>"
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package app.revanced.patches.shared.integrations.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.addInstruction
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultError
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import org.jf.dexlib2.iface.Method
|
||||||
|
|
||||||
|
@Description("Applies mandatory patches to implement the ReVanced integrations into the application.")
|
||||||
|
@Version("0.0.1")
|
||||||
|
abstract class AbstractIntegrationsPatch(
|
||||||
|
private val integrationsDescriptor: String,
|
||||||
|
private val hooks: Iterable<IntegrationsFingerprint>
|
||||||
|
) : BytecodePatch(hooks) {
|
||||||
|
/**
|
||||||
|
* [MethodFingerprint] for integrations.
|
||||||
|
*
|
||||||
|
* @param contextRegisterResolver A [RegisterResolver] to get the register.
|
||||||
|
* @see MethodFingerprint
|
||||||
|
*/
|
||||||
|
abstract class IntegrationsFingerprint(
|
||||||
|
strings: Iterable<String>? = null,
|
||||||
|
customFingerprint: ((methodDef: Method) -> Boolean)? = null,
|
||||||
|
private val contextRegisterResolver: (Method) -> Int = object : RegisterResolver {}
|
||||||
|
) : MethodFingerprint(strings = strings, customFingerprint = customFingerprint) {
|
||||||
|
fun invoke(integrationsDescriptor: String): PatchResult {
|
||||||
|
result?.mutableMethod?.let { method ->
|
||||||
|
val contextRegister = contextRegisterResolver(method)
|
||||||
|
|
||||||
|
method.addInstruction(
|
||||||
|
0,
|
||||||
|
"sput-object v$contextRegister, " +
|
||||||
|
"$integrationsDescriptor->context:Landroid/content/Context;"
|
||||||
|
)
|
||||||
|
} ?: return PatchResultError("Could not find hook target fingerprint.")
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
|
||||||
|
interface RegisterResolver : (Method) -> Int {
|
||||||
|
override operator fun invoke(method: Method) = method.implementation!!.registerCount - 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
if (context.findClass(integrationsDescriptor) == null) return MISSING_INTEGRATIONS
|
||||||
|
|
||||||
|
for (hook in hooks) hook.invoke(integrationsDescriptor).let {
|
||||||
|
if (it is PatchResultError) return it
|
||||||
|
}
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
|
||||||
|
private companion object {
|
||||||
|
val MISSING_INTEGRATIONS = PatchResultError(
|
||||||
|
"Integrations have not been merged yet. " +
|
||||||
|
"This patch can not succeed without merging the integrations."
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package app.revanced.patches.shared.mapping.patch
|
package app.revanced.patches.shared.mapping.misc.patch
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package app.revanced.patches.shared.settings
|
||||||
|
|
||||||
|
import app.revanced.patches.shared.settings.impl.StringResource
|
||||||
|
import org.w3c.dom.Document
|
||||||
|
import org.w3c.dom.Element
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base preference class for all preferences.
|
||||||
|
*
|
||||||
|
* @param key The key of the preference.
|
||||||
|
* @param title The title of the preference.
|
||||||
|
*/
|
||||||
|
internal abstract class BasePreference(
|
||||||
|
override val key: String,
|
||||||
|
override val title: StringResource,
|
||||||
|
) : IPreference {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
open fun serialize(ownerDocument: Document, resourceCallback: ((IResource) -> Unit)? = null): Element {
|
||||||
|
return ownerDocument.createElement(tag).apply {
|
||||||
|
if(key.isNotEmpty())
|
||||||
|
setAttribute("android:key", key)
|
||||||
|
setAttribute("android:title", "@string/${title.also { resourceCallback?.invoke(it) }.name}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package app.revanced.patches.shared.settings
|
||||||
|
|
||||||
|
import org.w3c.dom.Document
|
||||||
|
import org.w3c.dom.Element
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base resource class for all resources.
|
||||||
|
*
|
||||||
|
* @param name The name of the resource.
|
||||||
|
*/
|
||||||
|
internal abstract class BaseResource(
|
||||||
|
override val name: String
|
||||||
|
) : IResource {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serialize resource 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.
|
||||||
|
*/
|
||||||
|
open fun serialize(ownerDocument: Document, resourceCallback: ((IResource) -> Unit)? = null): Element {
|
||||||
|
return ownerDocument.createElement(tag).apply {
|
||||||
|
setAttribute("name", name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package app.revanced.patches.shared.settings
|
||||||
|
|
||||||
|
import app.revanced.patches.shared.settings.impl.StringResource
|
||||||
|
import org.w3c.dom.Element
|
||||||
|
import org.w3c.dom.Node
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a resource node child
|
||||||
|
*
|
||||||
|
* @param resource The resource to add.
|
||||||
|
* @param resourceCallback Called when a resource has been processed.
|
||||||
|
*/
|
||||||
|
internal fun Node.addResource(resource: BaseResource, resourceCallback: ((IResource) -> Unit)? = null) {
|
||||||
|
appendChild(resource.serialize(ownerDocument, resourceCallback))
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a preference node child to the settings.
|
||||||
|
*
|
||||||
|
* @param preference The preference to add.
|
||||||
|
* @param resourceCallback Called when a resource has been processed.
|
||||||
|
*/
|
||||||
|
internal fun Node.addPreference(preference: BasePreference, resourceCallback: ((IResource) -> Unit)? = null) {
|
||||||
|
appendChild(preference.serialize(ownerDocument, resourceCallback))
|
||||||
|
}
|
||||||
|
|
||||||
|
internal fun Element.addSummary(summaryResource: StringResource?, summaryType: SummaryType = SummaryType.DEFAULT) =
|
||||||
|
summaryResource?.let { summary ->
|
||||||
|
setAttribute("android:${summaryType.type}", "@string/${summary.name}")
|
||||||
|
}
|
||||||
|
|
||||||
|
internal fun <T> Element.addDefault(default: T) {
|
||||||
|
default?.let {
|
||||||
|
setAttribute(
|
||||||
|
"android:defaultValue", when (it) {
|
||||||
|
is Boolean -> if (it) "true" else "false"
|
||||||
|
is String -> it
|
||||||
|
else -> throw IllegalArgumentException("Unsupported default value type: ${it::class.java.name}")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package app.revanced.patches.youtube.misc.settings.framework.components
|
package app.revanced.patches.shared.settings
|
||||||
|
|
||||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
import app.revanced.patches.shared.settings.impl.StringResource
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Preference
|
* Preference
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package app.revanced.patches.shared.settings
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resource
|
||||||
|
*/
|
||||||
|
internal interface IResource {
|
||||||
|
/**
|
||||||
|
* Name of the resource.
|
||||||
|
*/
|
||||||
|
val name: String
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tag name of the resource.
|
||||||
|
*/
|
||||||
|
val tag: String
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package app.revanced.patches.shared.settings
|
||||||
|
|
||||||
|
enum class SummaryType(val type: String) {
|
||||||
|
DEFAULT("summary"), ON("summaryOn"), OFF("summaryOff")
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package app.revanced.patches.shared.settings.impl
|
||||||
|
|
||||||
|
import app.revanced.patches.shared.settings.BaseResource
|
||||||
|
import app.revanced.patches.shared.settings.IResource
|
||||||
|
import org.w3c.dom.Document
|
||||||
|
import org.w3c.dom.Element
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents an array resource.
|
||||||
|
*
|
||||||
|
* @param name The name of the array resource.
|
||||||
|
* @param items The items of the array resource.
|
||||||
|
*/
|
||||||
|
internal data class ArrayResource(
|
||||||
|
override val name: String,
|
||||||
|
val items: List<StringResource>
|
||||||
|
) : BaseResource(name) {
|
||||||
|
override val tag = "string-array"
|
||||||
|
|
||||||
|
override fun serialize(ownerDocument: Document, resourceCallback: ((IResource) -> Unit)?): Element {
|
||||||
|
return super.serialize(ownerDocument, resourceCallback).apply {
|
||||||
|
items.forEach { item ->
|
||||||
|
setAttribute("name", item.also { resourceCallback?.invoke(it) }.name)
|
||||||
|
|
||||||
|
this.appendChild(ownerDocument.createElement("item").also { itemNode ->
|
||||||
|
itemNode.textContent = item.value
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package app.revanced.patches.youtube.misc.settings.framework.components.impl
|
package app.revanced.patches.shared.settings.impl
|
||||||
|
|
||||||
enum class InputType(val type: String) {
|
enum class InputType(val type: String) {
|
||||||
STRING("text"),
|
STRING("text"),
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package app.revanced.patches.shared.settings.impl
|
||||||
|
|
||||||
|
import app.revanced.patches.shared.settings.BasePreference
|
||||||
|
import app.revanced.patches.shared.settings.IResource
|
||||||
|
import app.revanced.patches.shared.settings.addDefault
|
||||||
|
import app.revanced.patches.shared.settings.addSummary
|
||||||
|
import org.w3c.dom.Document
|
||||||
|
import org.w3c.dom.Element
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List preference.
|
||||||
|
*
|
||||||
|
* @param key The key of the list preference.
|
||||||
|
* @param title The title of the list preference.
|
||||||
|
* @param entries The human-readable entries 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.
|
||||||
|
*/
|
||||||
|
internal class ListPreference(
|
||||||
|
key: String,
|
||||||
|
title: StringResource,
|
||||||
|
val entries: ArrayResource,
|
||||||
|
val entryValues: ArrayResource,
|
||||||
|
val default: String? = null,
|
||||||
|
val summary: StringResource? = null
|
||||||
|
) : BasePreference(key, title) {
|
||||||
|
override val tag: String = "ListPreference"
|
||||||
|
|
||||||
|
override fun serialize(ownerDocument: Document, resourceCallback: ((IResource) -> Unit)?): Element {
|
||||||
|
return super.serialize(ownerDocument, resourceCallback).apply {
|
||||||
|
setAttribute("android:entries", "@array/${entries.also { resourceCallback?.invoke(it) }.name}")
|
||||||
|
setAttribute("android:entryValues", "@array/${entryValues.also { resourceCallback?.invoke(it) }.name}")
|
||||||
|
addDefault(default)
|
||||||
|
addSummary(summary)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package app.revanced.patches.shared.settings.impl
|
||||||
|
|
||||||
|
import app.revanced.patches.shared.settings.BasePreference
|
||||||
|
import app.revanced.patches.shared.settings.IResource
|
||||||
|
import app.revanced.patches.shared.settings.addSummary
|
||||||
|
import org.w3c.dom.Document
|
||||||
|
import org.w3c.dom.Element
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A Preference object.
|
||||||
|
*
|
||||||
|
* @param title The title of the preference.
|
||||||
|
* @param intent The intent of the preference.
|
||||||
|
* @param summary The summary of the text preference.
|
||||||
|
*/
|
||||||
|
internal class Preference(
|
||||||
|
key: String,
|
||||||
|
title: StringResource,
|
||||||
|
val intent: Intent,
|
||||||
|
val summary: StringResource? = null
|
||||||
|
) : BasePreference(key, title) {
|
||||||
|
override val tag: String = "Preference"
|
||||||
|
|
||||||
|
/* Key-less constructor */
|
||||||
|
constructor(
|
||||||
|
title: StringResource,
|
||||||
|
intent: Intent,
|
||||||
|
summary: StringResource? = null
|
||||||
|
) : this("", title, intent, summary)
|
||||||
|
|
||||||
|
override fun serialize(ownerDocument: Document, resourceCallback: ((IResource) -> Unit)?): Element {
|
||||||
|
return super.serialize(ownerDocument, resourceCallback).apply {
|
||||||
|
addSummary(summary?.also { resourceCallback?.invoke(it) })
|
||||||
|
|
||||||
|
this.appendChild(ownerDocument.createElement("intent").also { intentNode ->
|
||||||
|
intentNode.setAttribute("android:targetPackage", intent.targetPackage)
|
||||||
|
intentNode.setAttribute("android:data", intent.data)
|
||||||
|
intentNode.setAttribute("android:targetClass", intent.targetClass)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
data class Intent(val targetPackage: String, val data: String, val targetClass: String)
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package app.revanced.patches.shared.settings.impl
|
||||||
|
|
||||||
|
import app.revanced.patches.shared.settings.BasePreference
|
||||||
|
import app.revanced.patches.shared.settings.IResource
|
||||||
|
import org.w3c.dom.Document
|
||||||
|
import org.w3c.dom.Element
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Preference category.
|
||||||
|
*
|
||||||
|
* @param key The key of the preference.
|
||||||
|
* @param title The title of the preference.
|
||||||
|
* @param preferences Child preferences of this category.
|
||||||
|
*/
|
||||||
|
internal open class PreferenceCategory(
|
||||||
|
key: String,
|
||||||
|
title: StringResource,
|
||||||
|
val preferences: List<BasePreference>
|
||||||
|
) : BasePreference(key, title) {
|
||||||
|
override val tag: String = "PreferenceCategory"
|
||||||
|
|
||||||
|
override fun serialize(ownerDocument: Document, resourceCallback: ((IResource) -> Unit)?): Element {
|
||||||
|
return super.serialize(ownerDocument, resourceCallback).apply {
|
||||||
|
for (childPreference in preferences) {
|
||||||
|
this.appendChild(childPreference.serialize(ownerDocument, resourceCallback))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package app.revanced.patches.shared.settings.impl
|
||||||
|
|
||||||
|
import app.revanced.patches.shared.settings.BasePreference
|
||||||
|
import app.revanced.patches.shared.settings.IResource
|
||||||
|
import app.revanced.patches.shared.settings.addSummary
|
||||||
|
import org.w3c.dom.Document
|
||||||
|
import org.w3c.dom.Element
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Preference screen.
|
||||||
|
*
|
||||||
|
* @param key The key of the preference.
|
||||||
|
* @param title The title of the preference.
|
||||||
|
* @param preferences Child preferences of this screen.
|
||||||
|
* @param summary The summary of the text preference.
|
||||||
|
*/
|
||||||
|
internal open class PreferenceScreen(
|
||||||
|
key: String,
|
||||||
|
title: StringResource,
|
||||||
|
val preferences: List<BasePreference>,
|
||||||
|
val summary: StringResource? = null
|
||||||
|
) : BasePreference(key, title) {
|
||||||
|
override val tag: String = "PreferenceScreen"
|
||||||
|
|
||||||
|
override fun serialize(ownerDocument: Document, resourceCallback: ((IResource) -> Unit)?): Element {
|
||||||
|
return super.serialize(ownerDocument, resourceCallback).apply {
|
||||||
|
addSummary(summary?.also { resourceCallback?.invoke(it) })
|
||||||
|
|
||||||
|
for (childPreference in preferences) {
|
||||||
|
this.appendChild(childPreference.serialize(ownerDocument, resourceCallback))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package app.revanced.patches.shared.settings.impl
|
||||||
|
|
||||||
|
import app.revanced.patches.shared.settings.BaseResource
|
||||||
|
import app.revanced.patches.shared.settings.IResource
|
||||||
|
import org.w3c.dom.Document
|
||||||
|
import org.w3c.dom.Element
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a string value in the strings.xml file
|
||||||
|
*
|
||||||
|
* @param name The name of the string
|
||||||
|
* @param value The value of the string
|
||||||
|
* @param formatted If the string is formatted. If false, the attribute will be set
|
||||||
|
*/
|
||||||
|
internal data class StringResource(
|
||||||
|
override val name: String,
|
||||||
|
val value: String,
|
||||||
|
val formatted: Boolean = true
|
||||||
|
) : BaseResource(name) {
|
||||||
|
override val tag = "string"
|
||||||
|
|
||||||
|
override fun serialize(ownerDocument: Document, resourceCallback: ((IResource) -> Unit)?): Element {
|
||||||
|
return super.serialize(ownerDocument, resourceCallback).apply {
|
||||||
|
// if the string is un-formatted, explicitly add the formatted attribute
|
||||||
|
if (!formatted)
|
||||||
|
setAttribute("formatted", "false")
|
||||||
|
|
||||||
|
textContent = value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package app.revanced.patches.shared.settings.impl
|
||||||
|
|
||||||
|
import app.revanced.patches.shared.settings.*
|
||||||
|
import app.revanced.patches.shared.settings.BasePreference
|
||||||
|
import app.revanced.patches.shared.settings.IResource
|
||||||
|
import app.revanced.patches.shared.settings.addDefault
|
||||||
|
import app.revanced.patches.shared.settings.addSummary
|
||||||
|
import org.w3c.dom.Document
|
||||||
|
import org.w3c.dom.Element
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Switch preference.
|
||||||
|
*
|
||||||
|
* @param key The key 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 summaryOff The summary to show when the preference is disabled.
|
||||||
|
*/
|
||||||
|
internal class SwitchPreference(
|
||||||
|
key: String, title: StringResource,
|
||||||
|
val default: Boolean = false,
|
||||||
|
val summaryOn: StringResource? = null,
|
||||||
|
val summaryOff: StringResource? = null
|
||||||
|
) : BasePreference(key, title) {
|
||||||
|
override val tag: String = "SwitchPreference"
|
||||||
|
|
||||||
|
override fun serialize(ownerDocument: Document, resourceCallback: ((IResource) -> Unit)?): Element {
|
||||||
|
return super.serialize(ownerDocument, resourceCallback).apply {
|
||||||
|
addDefault(default)
|
||||||
|
addSummary(summaryOn?.also { resourceCallback?.invoke(it) }, SummaryType.ON)
|
||||||
|
addSummary(summaryOff?.also { resourceCallback?.invoke(it) }, SummaryType.OFF)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package app.revanced.patches.shared.settings.impl
|
||||||
|
|
||||||
|
import app.revanced.patches.shared.settings.BasePreference
|
||||||
|
import app.revanced.patches.shared.settings.IResource
|
||||||
|
import app.revanced.patches.shared.settings.addDefault
|
||||||
|
import app.revanced.patches.shared.settings.addSummary
|
||||||
|
import org.w3c.dom.Document
|
||||||
|
import org.w3c.dom.Element
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Text preference.
|
||||||
|
*
|
||||||
|
* @param key The key of the text preference.
|
||||||
|
* @param title The title 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.
|
||||||
|
*/
|
||||||
|
internal class TextPreference(
|
||||||
|
key: String,
|
||||||
|
title: StringResource,
|
||||||
|
var inputType: InputType = InputType.STRING,
|
||||||
|
val default: String? = null,
|
||||||
|
val summary: StringResource? = null
|
||||||
|
) : BasePreference(key, title) {
|
||||||
|
override val tag: String = "EditTextPreference"
|
||||||
|
|
||||||
|
override fun serialize(ownerDocument: Document, resourceCallback: ((IResource) -> Unit)?): Element {
|
||||||
|
return super.serialize(ownerDocument, resourceCallback).apply {
|
||||||
|
setAttribute("android:inputType", inputType.type)
|
||||||
|
addDefault(default)
|
||||||
|
addSummary(summary?.also { resourceCallback?.invoke(it) })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,15 +1,8 @@
|
|||||||
package app.revanced.patches.spotify.audio.fingerprints
|
package app.revanced.patches.spotify.audio.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.spotify.audio.annotation.DisableCaptureRestrictionCompatibility
|
|
||||||
|
|
||||||
@Name("disable-capture-restriction-audio-driver-fingerprint")
|
|
||||||
|
|
||||||
@DisableCaptureRestrictionCompatibility
|
|
||||||
@Version("0.0.2")
|
|
||||||
object DisableCaptureRestrictionAudioDriverFingerprint : MethodFingerprint(
|
object DisableCaptureRestrictionAudioDriverFingerprint : MethodFingerprint(
|
||||||
customFingerprint = { methodDef ->
|
customFingerprint = { methodDef ->
|
||||||
methodDef.definingClass == "Lcom/spotify/playback/playbacknative/AudioDriver;" && methodDef.name == "constructAudioAttributes"
|
methodDef.definingClass == "Lcom/spotify/playback/playbacknative/AudioDriver;" && methodDef.name == "constructAudioAttributes"
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
package app.revanced.patches.spotify.premium_navbar_tab.fingerprints
|
package app.revanced.patches.spotify.premium_navbar_tab.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.spotify.premium_navbar_tab.annotations.PremiumNavbarTabCompatibility
|
|
||||||
|
|
||||||
@Name("premium-navbar-fingerprint")
|
|
||||||
@Version("0.0.1")
|
|
||||||
@PremiumNavbarTabCompatibility
|
|
||||||
object AddPremiumNavbarTabFingerprint : MethodFingerprint(
|
object AddPremiumNavbarTabFingerprint : MethodFingerprint(
|
||||||
parameters = listOf("L", "L", "L", "L", "L", "L")
|
parameters = listOf("L", "L", "L", "L", "L", "L")
|
||||||
)
|
)
|
||||||
@@ -1,13 +1,7 @@
|
|||||||
package app.revanced.patches.spotify.premium_navbar_tab.fingerprints
|
package app.revanced.patches.spotify.premium_navbar_tab.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.spotify.premium_navbar_tab.annotations.PremiumNavbarTabCompatibility
|
|
||||||
|
|
||||||
@Name("add-premium-navbar-tab-parent-fingerprint")
|
|
||||||
@Version("0.0.1")
|
|
||||||
@PremiumNavbarTabCompatibility
|
|
||||||
object AddPremiumNavbarTabParentFingerprint : MethodFingerprint(
|
object AddPremiumNavbarTabParentFingerprint : MethodFingerprint(
|
||||||
strings = listOf("com.samsung.android.samsungaccount.action.REQUEST_AUTHCODE")
|
strings = listOf("com.samsung.android.samsungaccount.action.REQUEST_AUTHCODE")
|
||||||
)
|
)
|
||||||
@@ -14,7 +14,7 @@ import app.revanced.patcher.patch.annotations.Patch
|
|||||||
import app.revanced.patches.spotify.premium_navbar_tab.annotations.PremiumNavbarTabCompatibility
|
import app.revanced.patches.spotify.premium_navbar_tab.annotations.PremiumNavbarTabCompatibility
|
||||||
import app.revanced.patches.spotify.premium_navbar_tab.fingerprints.AddPremiumNavbarTabFingerprint
|
import app.revanced.patches.spotify.premium_navbar_tab.fingerprints.AddPremiumNavbarTabFingerprint
|
||||||
import app.revanced.patches.spotify.premium_navbar_tab.fingerprints.AddPremiumNavbarTabParentFingerprint
|
import app.revanced.patches.spotify.premium_navbar_tab.fingerprints.AddPremiumNavbarTabParentFingerprint
|
||||||
import app.revanced.patches.shared.mapping.patch.ResourceMappingPatch
|
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
|
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
package app.revanced.patches.ticktick.misc.themeunlock.fingerprints
|
package app.revanced.patches.ticktick.misc.themeunlock.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.ticktick.misc.themeunlock.annotations.UnlockThemesCompatibility
|
|
||||||
|
|
||||||
@Name("check-locked-theme-fingerprint")
|
|
||||||
@UnlockThemesCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object CheckLockedThemesFingerprint : MethodFingerprint(
|
object CheckLockedThemesFingerprint : MethodFingerprint(
|
||||||
customFingerprint = { methodDef ->
|
customFingerprint = { methodDef ->
|
||||||
methodDef.definingClass.endsWith("Theme;") && methodDef.name == "isLockedTheme"
|
methodDef.definingClass.endsWith("Theme;") && methodDef.name == "isLockedTheme"
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
package app.revanced.patches.ticktick.misc.themeunlock.fingerprints
|
package app.revanced.patches.ticktick.misc.themeunlock.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.ticktick.misc.themeunlock.annotations.UnlockThemesCompatibility
|
|
||||||
|
|
||||||
@Name("set-theme-fingerprint")
|
|
||||||
@UnlockThemesCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
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"
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
package app.revanced.patches.tiktok.ad.fingerprints
|
package app.revanced.patches.tiktok.ad.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.tiktok.ad.annotations.TiktokAdsCompatibility
|
|
||||||
|
|
||||||
@Name("convert-help-v2-feeditemlist-fingerprint")
|
|
||||||
@TiktokAdsCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object ConvertHelpFeedItemListFingerprint : MethodFingerprint(
|
object ConvertHelpFeedItemListFingerprint : MethodFingerprint(
|
||||||
customFingerprint = { methodDef ->
|
customFingerprint = { methodDef ->
|
||||||
methodDef.definingClass.endsWith("/ConvertHelp;") &&
|
methodDef.definingClass.endsWith("/ConvertHelp;") &&
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
package app.revanced.patches.tiktok.ad.fingerprints
|
package app.revanced.patches.tiktok.ad.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.tiktok.ad.annotations.TiktokAdsCompatibility
|
|
||||||
|
|
||||||
@Name("feed-item-clone-fingerprint")
|
|
||||||
@TiktokAdsCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object FeedItemListCloneFingerprint : MethodFingerprint(
|
object FeedItemListCloneFingerprint : MethodFingerprint(
|
||||||
customFingerprint = { methodDef ->
|
customFingerprint = { methodDef ->
|
||||||
methodDef.definingClass.endsWith("/FeedItemList;") && methodDef.name == "clone"
|
methodDef.definingClass.endsWith("/FeedItemList;") && methodDef.name == "clone"
|
||||||
|
|||||||
@@ -1,15 +1,9 @@
|
|||||||
package app.revanced.patches.tiktok.feedfilter.fingerprints
|
package app.revanced.patches.tiktok.feedfilter.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.tiktok.feedfilter.annotations.FeedFilterCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
|
||||||
@Name("feed-api-service-fingerprint")
|
|
||||||
@FeedFilterCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object FeedApiServiceLIZFingerprint : MethodFingerprint(
|
object FeedApiServiceLIZFingerprint : MethodFingerprint(
|
||||||
access = AccessFlags.PUBLIC or AccessFlags.STATIC or AccessFlags.FINAL or AccessFlags.SYNTHETIC,
|
access = AccessFlags.PUBLIC or AccessFlags.STATIC or AccessFlags.FINAL or AccessFlags.SYNTHETIC,
|
||||||
customFingerprint = { methodDef ->
|
customFingerprint = { methodDef ->
|
||||||
|
|||||||
@@ -1,15 +1,9 @@
|
|||||||
package app.revanced.patches.tiktok.interaction.downloads.fingerprints
|
package app.revanced.patches.tiktok.interaction.downloads.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.tiktok.interaction.downloads.annotations.DownloadsCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
|
||||||
@Name("acl-common-share-get-code")
|
|
||||||
@DownloadsCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object ACLCommonShareFingerprint : MethodFingerprint(
|
object ACLCommonShareFingerprint : MethodFingerprint(
|
||||||
"I",
|
"I",
|
||||||
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
|
|||||||
@@ -1,15 +1,9 @@
|
|||||||
package app.revanced.patches.tiktok.interaction.downloads.fingerprints
|
package app.revanced.patches.tiktok.interaction.downloads.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.tiktok.interaction.downloads.annotations.DownloadsCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
|
||||||
@Name("download-path-parent-fingerprint")
|
|
||||||
@DownloadsCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object DownloadPathParentFingerprint : MethodFingerprint(
|
object DownloadPathParentFingerprint : MethodFingerprint(
|
||||||
"V",
|
"V",
|
||||||
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
|
|||||||
@@ -1,14 +1,8 @@
|
|||||||
package app.revanced.patches.tiktok.interaction.seekbar.fingerprints
|
package app.revanced.patches.tiktok.interaction.seekbar.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.tiktok.interaction.seekbar.annotations.SeekbarCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
|
||||||
@Name("aweme-get-video-control")
|
|
||||||
@SeekbarCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object AwemeGetVideoControlFingerprint : MethodFingerprint(
|
object AwemeGetVideoControlFingerprint : MethodFingerprint(
|
||||||
"L",
|
"L",
|
||||||
AccessFlags.PUBLIC.value,
|
AccessFlags.PUBLIC.value,
|
||||||
|
|||||||
@@ -1,15 +1,9 @@
|
|||||||
package app.revanced.patches.tiktok.interaction.speed.fingerprints
|
package app.revanced.patches.tiktok.interaction.speed.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.tiktok.interaction.speed.annotations.SpeedCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
|
||||||
@Name("speed-control-parent-fingerprint")
|
|
||||||
@SpeedCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object SpeedControlParentFingerprint : MethodFingerprint(
|
object SpeedControlParentFingerprint : MethodFingerprint(
|
||||||
returnType = "L",
|
returnType = "L",
|
||||||
access = AccessFlags.PRIVATE or AccessFlags.FINAL,
|
access = AccessFlags.PRIVATE or AccessFlags.FINAL,
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
package app.revanced.patches.tiktok.misc.forcelogin.fingerprints
|
package app.revanced.patches.tiktok.misc.forcelogin.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.tiktok.misc.forcelogin.annotations.DisableForceLoginCompatibility
|
|
||||||
|
|
||||||
@Name("mandatory-login-service-fingerprint")
|
|
||||||
@DisableForceLoginCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object MandatoryLoginServiceFingerprint : MethodFingerprint(
|
object MandatoryLoginServiceFingerprint : MethodFingerprint(
|
||||||
customFingerprint = { methodDef ->
|
customFingerprint = { methodDef ->
|
||||||
methodDef.definingClass.endsWith("/MandatoryLoginService;") &&
|
methodDef.definingClass.endsWith("/MandatoryLoginService;") &&
|
||||||
|
|||||||
@@ -1,14 +1,8 @@
|
|||||||
package app.revanced.patches.tiktok.misc.integrations.fingerprints
|
package app.revanced.patches.tiktok.misc.integrations.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patches.shared.integrations.patch.AbstractIntegrationsPatch.IntegrationsFingerprint
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
import app.revanced.patches.tiktok.misc.integrations.annotations.TikTokIntegrationsCompatibility
|
|
||||||
|
|
||||||
@Name("init-fingerprint")
|
object InitFingerprint : IntegrationsFingerprint(
|
||||||
@TikTokIntegrationsCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object InitFingerprint : MethodFingerprint(
|
|
||||||
customFingerprint = { methodDef ->
|
customFingerprint = { methodDef ->
|
||||||
methodDef.definingClass.endsWith("/AwemeHostApplication;") &&
|
methodDef.definingClass.endsWith("/AwemeHostApplication;") &&
|
||||||
methodDef.name == "onCreate"
|
methodDef.name == "onCreate"
|
||||||
|
|||||||
@@ -1,38 +1,13 @@
|
|||||||
package app.revanced.patches.tiktok.misc.integrations.patch
|
package app.revanced.patches.tiktok.misc.integrations.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.data.BytecodeContext
|
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultError
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patches.tiktok.misc.integrations.annotations.TikTokIntegrationsCompatibility
|
import app.revanced.patches.tiktok.misc.integrations.annotations.TikTokIntegrationsCompatibility
|
||||||
import app.revanced.patches.tiktok.misc.integrations.fingerprints.InitFingerprint
|
import app.revanced.patches.tiktok.misc.integrations.fingerprints.InitFingerprint
|
||||||
|
import app.revanced.patches.shared.integrations.patch.AbstractIntegrationsPatch
|
||||||
|
|
||||||
@Name("tiktok-integrations")
|
@Name("tiktok-integrations")
|
||||||
@Description("Applies mandatory patches to implement the ReVanced integrations into the application.")
|
|
||||||
@TikTokIntegrationsCompatibility
|
@TikTokIntegrationsCompatibility
|
||||||
@Version("0.0.1")
|
class TikTokIntegrationsPatch : AbstractIntegrationsPatch(
|
||||||
class TikTokIntegrationsPatch : BytecodePatch(
|
"Lapp/revanced/tiktok/utils/ReVancedUtils;",
|
||||||
listOf(
|
listOf(InitFingerprint)
|
||||||
InitFingerprint
|
)
|
||||||
)
|
|
||||||
) {
|
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
|
||||||
if (context.findClass("Lapp/revanced/tiktok/utils/ReVancedUtils") == null)
|
|
||||||
return PatchResultError("Integrations have not been merged yet. This patch can not succeed without the integrations.")
|
|
||||||
val result = InitFingerprint.result!!
|
|
||||||
|
|
||||||
val method = result.mutableMethod
|
|
||||||
val implementation = method.implementation!!
|
|
||||||
val count = implementation.registerCount - 1
|
|
||||||
|
|
||||||
method.addInstruction(
|
|
||||||
0, "sput-object v$count, Lapp/revanced/tiktok/utils/ReVancedUtils;->context:Landroid/content/Context;"
|
|
||||||
)
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package app.revanced.patches.tiktok.misc.loginfallback.annotations
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
|
@Compatibility(
|
||||||
|
[
|
||||||
|
Package("com.ss.android.ugc.trill"),
|
||||||
|
Package("com.zhiliaoapp.musically")
|
||||||
|
]
|
||||||
|
)
|
||||||
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
|
internal annotation class TikTokWebLoginCompatibility
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package app.revanced.patches.tiktok.misc.loginfallback.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
|
||||||
|
object GoogleAuthAvailableFingerprint : MethodFingerprint(
|
||||||
|
returnType = "Z",
|
||||||
|
access = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
|
parameters = listOf(),
|
||||||
|
customFingerprint = { methodDef ->
|
||||||
|
methodDef.definingClass == "Lcom/bytedance/lobby/google/GoogleAuth;"
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package app.revanced.patches.tiktok.misc.loginfallback.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
|
||||||
|
object GoogleOneTapAuthAvailableFingerprint : MethodFingerprint(
|
||||||
|
returnType = "Z",
|
||||||
|
access = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
|
parameters = listOf(),
|
||||||
|
customFingerprint = { methodDef ->
|
||||||
|
methodDef.definingClass == "Lcom/bytedance/lobby/google/GoogleOneTapAuth;"
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package app.revanced.patches.tiktok.misc.loginfallback.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patches.tiktok.misc.loginfallback.annotations.TikTokWebLoginCompatibility
|
||||||
|
import app.revanced.patches.tiktok.misc.loginfallback.fingerprints.GoogleAuthAvailableFingerprint
|
||||||
|
import app.revanced.patches.tiktok.misc.loginfallback.fingerprints.GoogleOneTapAuthAvailableFingerprint
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Name("tiktok-web-login")
|
||||||
|
@Description("Allows logging in with a Google account.")
|
||||||
|
@TikTokWebLoginCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class TikTokLoginFallbackPatch : BytecodePatch(
|
||||||
|
listOf(
|
||||||
|
GoogleOneTapAuthAvailableFingerprint,
|
||||||
|
GoogleAuthAvailableFingerprint
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
listOf(
|
||||||
|
GoogleOneTapAuthAvailableFingerprint,
|
||||||
|
GoogleAuthAvailableFingerprint
|
||||||
|
).forEach {
|
||||||
|
with(it.result!!.mutableMethod) {
|
||||||
|
addInstructions(
|
||||||
|
0,
|
||||||
|
"""
|
||||||
|
const/4 v0, 0x0
|
||||||
|
return v0
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,13 +1,7 @@
|
|||||||
package app.revanced.patches.tiktok.misc.settings.fingerprints
|
package app.revanced.patches.tiktok.misc.settings.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.tiktok.misc.settings.annotations.TikTokSettingsCompatibility
|
|
||||||
|
|
||||||
@Name("about-onclick-method-fingerprint")
|
|
||||||
@TikTokSettingsCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object AboutOnClickMethodFingerprint : MethodFingerprint(
|
object AboutOnClickMethodFingerprint : MethodFingerprint(
|
||||||
strings = listOf(
|
strings = listOf(
|
||||||
"//setting/about",
|
"//setting/about",
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
package app.revanced.patches.tiktok.misc.settings.fingerprints
|
package app.revanced.patches.tiktok.misc.settings.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.tiktok.misc.settings.annotations.TikTokSettingsCompatibility
|
|
||||||
|
|
||||||
@Name("ad-personalization-activity-on-create-fingerprint")
|
|
||||||
@TikTokSettingsCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object AdPersonalizationActivityOnCreateFingerprint : MethodFingerprint(
|
object AdPersonalizationActivityOnCreateFingerprint : MethodFingerprint(
|
||||||
customFingerprint = { methodDef ->
|
customFingerprint = { methodDef ->
|
||||||
methodDef.definingClass.endsWith("/AdPersonalizationActivity;") &&
|
methodDef.definingClass.endsWith("/AdPersonalizationActivity;") &&
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
package app.revanced.patches.tiktok.misc.settings.fingerprints
|
package app.revanced.patches.tiktok.misc.settings.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.tiktok.misc.settings.annotations.TikTokSettingsCompatibility
|
|
||||||
|
|
||||||
@Name("copyright-settings-string-fingerprint")
|
|
||||||
@TikTokSettingsCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object SettingsOnViewCreatedFingerprint : MethodFingerprint(
|
object SettingsOnViewCreatedFingerprint : MethodFingerprint(
|
||||||
customFingerprint = { methodDef ->
|
customFingerprint = { methodDef ->
|
||||||
methodDef.definingClass.endsWith("/SettingNewVersionFragment;") &&
|
methodDef.definingClass.endsWith("/SettingNewVersionFragment;") &&
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
package app.revanced.patches.tiktok.misc.settings.fingerprints
|
package app.revanced.patches.tiktok.misc.settings.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.tiktok.misc.settings.annotations.TikTokSettingsCompatibility
|
|
||||||
|
|
||||||
@Name("settings-status-load-fingerprint")
|
|
||||||
@TikTokSettingsCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
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;") &&
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import org.jf.dexlib2.iface.reference.TypeReference
|
|||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@DependsOn([TikTokIntegrationsPatch::class])
|
@DependsOn([TikTokIntegrationsPatch::class])
|
||||||
@Name("settings")
|
@Name("tiktok-settings")
|
||||||
@Description("Adds settings for ReVanced to TikTok.")
|
@Description("Adds settings for ReVanced to TikTok.")
|
||||||
@TikTokSettingsCompatibility
|
@TikTokSettingsCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package app.revanced.patches.tiktok.misc.spoof.sim.annotations
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
|
@Compatibility(
|
||||||
|
[
|
||||||
|
Package("com.ss.android.ugc.trill"),
|
||||||
|
Package("com.zhiliaoapp.musically")
|
||||||
|
]
|
||||||
|
)
|
||||||
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
|
internal annotation class SpoofSimCompatibility
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
package app.revanced.patches.tiktok.misc.spoof.sim.patch
|
||||||
|
|
||||||
|
import app.revanced.extensions.findMutableMethodOf
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.addInstruction
|
||||||
|
import app.revanced.patcher.extensions.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.proxy.mutableTypes.MutableMethod
|
||||||
|
import app.revanced.patches.tiktok.misc.integrations.patch.TikTokIntegrationsPatch
|
||||||
|
import app.revanced.patches.tiktok.misc.settings.fingerprints.SettingsStatusLoadFingerprint
|
||||||
|
import app.revanced.patches.tiktok.misc.settings.patch.TikTokSettingsPatch
|
||||||
|
import app.revanced.patches.tiktok.misc.spoof.sim.annotations.SpoofSimCompatibility
|
||||||
|
import org.jf.dexlib2.Opcode
|
||||||
|
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
|
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
||||||
|
import org.jf.dexlib2.iface.reference.MethodReference
|
||||||
|
|
||||||
|
@Patch(false)
|
||||||
|
@DependsOn([TikTokIntegrationsPatch::class, TikTokSettingsPatch::class])
|
||||||
|
@Name("sim-spoof")
|
||||||
|
@Description("Spoofs the information which is retrieved from the sim-card.")
|
||||||
|
@SpoofSimCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class SpoofSimPatch : BytecodePatch() {
|
||||||
|
private companion object {
|
||||||
|
val replacements = hashMapOf(
|
||||||
|
"getSimCountryIso" to "getCountryIso",
|
||||||
|
"getNetworkCountryIso" to "getCountryIso",
|
||||||
|
"getSimOperator" to "getOperator",
|
||||||
|
"getNetworkOperator" to "getOperator",
|
||||||
|
"getSimOperatorName" to "getOperatorName",
|
||||||
|
"getNetworkOperatorName" to "getOperatorName"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
// Find all api call to check sim information
|
||||||
|
buildMap {
|
||||||
|
context.classes.forEach { classDef ->
|
||||||
|
classDef.methods.let { methods ->
|
||||||
|
buildMap methodList@{
|
||||||
|
methods.forEach methods@{ method ->
|
||||||
|
with(method.implementation?.instructions ?: return@methods) {
|
||||||
|
ArrayDeque<Pair<Int, String>>().also { patchIndices ->
|
||||||
|
this.forEachIndexed { index, instruction ->
|
||||||
|
if (instruction.opcode != Opcode.INVOKE_VIRTUAL) return@forEachIndexed
|
||||||
|
|
||||||
|
val methodRef =
|
||||||
|
(instruction as Instruction35c).reference as MethodReference
|
||||||
|
if (methodRef.definingClass != "Landroid/telephony/TelephonyManager;") return@forEachIndexed
|
||||||
|
|
||||||
|
replacements[methodRef.name]?.let { replacement ->
|
||||||
|
patchIndices.add(index to replacement)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.also { if (it.isEmpty()) return@methods }.let { patches ->
|
||||||
|
put(method, patches)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.also { if (it.isEmpty()) return@forEach }.let { methodPatches ->
|
||||||
|
put(classDef, methodPatches)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.forEach { (classDef, methods) ->
|
||||||
|
with(context.proxy(classDef).mutableClass) {
|
||||||
|
methods.forEach { (method, patches) ->
|
||||||
|
with(findMutableMethodOf(method)) {
|
||||||
|
while (!patches.isEmpty()) {
|
||||||
|
val (index, replacement) = patches.removeLast()
|
||||||
|
replaceReference(index, replacement)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Enable patch in settings
|
||||||
|
with(SettingsStatusLoadFingerprint.result!!.mutableMethod) {
|
||||||
|
addInstruction(
|
||||||
|
0,
|
||||||
|
"invoke-static {}, Lapp/revanced/tiktok/settingsmenu/SettingsStatus;->enableSimSpoof()V"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Patch Android API and return fake sim information
|
||||||
|
private fun MutableMethod.replaceReference(index: Int, replacement: String) {
|
||||||
|
val resultReg = (instruction(index + 1) as OneRegisterInstruction).registerA
|
||||||
|
|
||||||
|
addInstructions(
|
||||||
|
index + 2,
|
||||||
|
"""
|
||||||
|
invoke-static {v$resultReg}, Lapp/revanced/tiktok/spoof/sim/SpoofSimPatch;->$replacement(Ljava/lang/String;)Ljava/lang/String;
|
||||||
|
move-result-object v$resultReg
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,14 +1,8 @@
|
|||||||
package app.revanced.patches.twitch.ad.audio.fingerprints
|
package app.revanced.patches.twitch.ad.audio.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.twitch.ad.audio.annotations.AudioAdsCompatibility
|
|
||||||
|
|
||||||
@Name("audio-ads-presenter-play-fingerprint")
|
|
||||||
@AudioAdsCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object AudioAdsPresenterPlayFingerprint : MethodFingerprint(
|
object AudioAdsPresenterPlayFingerprint : MethodFingerprint(
|
||||||
customFingerprint = { method ->
|
customFingerprint = { method ->
|
||||||
method.definingClass.endsWith("AudioAdsPlayerPresenter;") && method.name == "playAd"
|
method.definingClass.endsWith("AudioAdsPlayerPresenter;") && method.name == "playAd"
|
||||||
|
|||||||
@@ -1,14 +1,8 @@
|
|||||||
package app.revanced.patches.twitch.ad.video.fingerprints
|
package app.revanced.patches.twitch.ad.video.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.twitch.ad.video.annotations.VideoAdsCompatibility
|
|
||||||
|
|
||||||
@Name("ads-manager-play-fingerprint")
|
|
||||||
@VideoAdsCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object AdsManagerFingerprint : MethodFingerprint(
|
object AdsManagerFingerprint : MethodFingerprint(
|
||||||
customFingerprint = { method ->
|
customFingerprint = { method ->
|
||||||
method.definingClass.endsWith("AdsManagerImpl;") && method.name == "playAds"
|
method.definingClass.endsWith("AdsManagerImpl;") && method.name == "playAds"
|
||||||
|
|||||||
@@ -1,16 +1,9 @@
|
|||||||
package app.revanced.patches.twitch.ad.video.fingerprints
|
package app.revanced.patches.twitch.ad.video.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.twitch.ad.video.annotations.VideoAdsCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
|
||||||
@Name("check-ad-eligibility-fingerprint")
|
|
||||||
@VideoAdsCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object CheckAdEligibilityLambdaFingerprint : MethodFingerprint(
|
object CheckAdEligibilityLambdaFingerprint : MethodFingerprint(
|
||||||
"L",
|
"L",
|
||||||
AccessFlags.PRIVATE or AccessFlags.FINAL or AccessFlags.STATIC,
|
AccessFlags.PRIVATE or AccessFlags.FINAL or AccessFlags.STATIC,
|
||||||
|
|||||||
@@ -1,14 +1,8 @@
|
|||||||
package app.revanced.patches.twitch.ad.video.fingerprints
|
package app.revanced.patches.twitch.ad.video.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.twitch.ad.video.annotations.VideoAdsCompatibility
|
|
||||||
|
|
||||||
@Name("content-config-show-ads-fingerprint")
|
|
||||||
@VideoAdsCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object ContentConfigShowAdsFingerprint : MethodFingerprint(
|
object ContentConfigShowAdsFingerprint : MethodFingerprint(
|
||||||
customFingerprint = { method ->
|
customFingerprint = { method ->
|
||||||
method.definingClass.endsWith("ContentConfigData;") && method.name == "getShowAds"
|
method.definingClass.endsWith("ContentConfigData;") && method.name == "getShowAds"
|
||||||
|
|||||||
@@ -1,16 +1,9 @@
|
|||||||
package app.revanced.patches.twitch.chat.antidelete.fingerprints
|
package app.revanced.patches.twitch.chat.antidelete.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.twitch.chat.antidelete.annotations.ShowDeletedMessagesCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
|
||||||
@Name("deleted-msg-span-ctor-fingerprint")
|
|
||||||
@ShowDeletedMessagesCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object DeletedMessageClickableSpanCtorFingerprint : MethodFingerprint(
|
object DeletedMessageClickableSpanCtorFingerprint : MethodFingerprint(
|
||||||
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
||||||
customFingerprint = { methodDef ->
|
customFingerprint = { methodDef ->
|
||||||
|
|||||||
@@ -1,14 +1,8 @@
|
|||||||
package app.revanced.patches.twitch.chat.antidelete.fingerprints
|
package app.revanced.patches.twitch.chat.antidelete.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.twitch.chat.antidelete.annotations.ShowDeletedMessagesCompatibility
|
|
||||||
|
|
||||||
@Name("has-mod-access-fingerprint")
|
|
||||||
@ShowDeletedMessagesCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object SetHasModAccessFingerprint : MethodFingerprint(
|
object SetHasModAccessFingerprint : MethodFingerprint(
|
||||||
customFingerprint = { methodDef ->
|
customFingerprint = { methodDef ->
|
||||||
methodDef.definingClass.endsWith("DeletedMessageClickableSpan;") && methodDef.name == "setHasModAccess"
|
methodDef.definingClass.endsWith("DeletedMessageClickableSpan;") && methodDef.name == "setHasModAccess"
|
||||||
|
|||||||
@@ -1,14 +1,8 @@
|
|||||||
package app.revanced.patches.twitch.debug.fingerprints
|
package app.revanced.patches.twitch.debug.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.twitch.debug.annotations.DebugModeCompatibility
|
|
||||||
|
|
||||||
@Name("is-debug-config-enabled-fingerprint")
|
|
||||||
@DebugModeCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object IsDebugConfigEnabledFingerprint : MethodFingerprint(
|
object IsDebugConfigEnabledFingerprint : MethodFingerprint(
|
||||||
customFingerprint = { methodDef ->
|
customFingerprint = { methodDef ->
|
||||||
methodDef.definingClass.endsWith("BuildConfigUtil;") && methodDef.name == "isDebugConfigEnabled"
|
methodDef.definingClass.endsWith("BuildConfigUtil;") && methodDef.name == "isDebugConfigEnabled"
|
||||||
|
|||||||
@@ -1,14 +1,8 @@
|
|||||||
package app.revanced.patches.twitch.debug.fingerprints
|
package app.revanced.patches.twitch.debug.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.twitch.debug.annotations.DebugModeCompatibility
|
|
||||||
|
|
||||||
@Name("is-om-verification-enabled-fingerprint")
|
|
||||||
@DebugModeCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object IsOmVerificationEnabledFingerprint : MethodFingerprint(
|
object IsOmVerificationEnabledFingerprint : MethodFingerprint(
|
||||||
customFingerprint = { methodDef ->
|
customFingerprint = { methodDef ->
|
||||||
methodDef.definingClass.endsWith("BuildConfigUtil;") && methodDef.name == "isOmVerificationEnabled"
|
methodDef.definingClass.endsWith("BuildConfigUtil;") && methodDef.name == "isOmVerificationEnabled"
|
||||||
|
|||||||
@@ -1,14 +1,8 @@
|
|||||||
package app.revanced.patches.twitch.debug.fingerprints
|
package app.revanced.patches.twitch.debug.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.twitch.debug.annotations.DebugModeCompatibility
|
|
||||||
|
|
||||||
@Name("should-show-debug-options-fingerprint")
|
|
||||||
@DebugModeCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object ShouldShowDebugOptionsFingerprint : MethodFingerprint(
|
object ShouldShowDebugOptionsFingerprint : MethodFingerprint(
|
||||||
customFingerprint = { methodDef ->
|
customFingerprint = { methodDef ->
|
||||||
methodDef.definingClass.endsWith("BuildConfigUtil;") && methodDef.name == "shouldShowDebugOptions"
|
methodDef.definingClass.endsWith("BuildConfigUtil;") && methodDef.name == "shouldShowDebugOptions"
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package app.revanced.patches.twitch.misc.integrations.annotations
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
|
@Compatibility([Package("tv.twitch.android.app")])
|
||||||
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
|
internal annotation class IntegrationsCompatibility
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package app.revanced.patches.twitch.misc.integrations.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patches.twitch.misc.integrations.annotations.IntegrationsCompatibility
|
||||||
|
import app.revanced.patches.shared.integrations.patch.AbstractIntegrationsPatch.IntegrationsFingerprint
|
||||||
|
|
||||||
|
@Name("init-fingerprint")
|
||||||
|
@IntegrationsCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
object InitFingerprint : IntegrationsFingerprint(
|
||||||
|
customFingerprint = { methodDef ->
|
||||||
|
methodDef.definingClass.endsWith("/TwitchApplication;") &&
|
||||||
|
methodDef.name == "onCreate"
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package app.revanced.patches.twitch.misc.integrations.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patches.twitch.misc.integrations.fingerprints.InitFingerprint
|
||||||
|
import app.revanced.patches.twitch.misc.integrations.annotations.IntegrationsCompatibility
|
||||||
|
import app.revanced.patches.shared.integrations.patch.AbstractIntegrationsPatch
|
||||||
|
|
||||||
|
@Name("integrations")
|
||||||
|
@IntegrationsCompatibility
|
||||||
|
class IntegrationsPatch : AbstractIntegrationsPatch(
|
||||||
|
"Lapp/revanced/twitch/utils/ReVancedUtils;",
|
||||||
|
listOf(InitFingerprint)
|
||||||
|
)
|
||||||
@@ -1,14 +1,8 @@
|
|||||||
package app.revanced.patches.twitter.ad.timeline.fingerprints
|
package app.revanced.patches.twitter.ad.timeline.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.twitter.ad.timeline.annotations.TimelineAdsCompatibility
|
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("timeline-tweet-json-parser-fingerprint")
|
|
||||||
@TimelineAdsCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object TimelineTweetJsonParserFingerprint : MethodFingerprint(
|
object TimelineTweetJsonParserFingerprint : MethodFingerprint(
|
||||||
opcodes = listOf(
|
opcodes = listOf(
|
||||||
Opcode.IPUT_OBJECT,
|
Opcode.IPUT_OBJECT,
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
package app.revanced.patches.warnwetter.misc.firebasegetcert.fingerprints
|
package app.revanced.patches.warnwetter.misc.firebasegetcert.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.warnwetter.misc.firebasegetcert.annotations.FirebaseGetCertPatchCompatibility
|
|
||||||
|
|
||||||
@Name("messaging-app-certificate-fingerprint")
|
|
||||||
@FirebaseGetCertPatchCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object GetMessagingCertFingerprint : MethodFingerprint(
|
object GetMessagingCertFingerprint : MethodFingerprint(
|
||||||
"Ljava/lang/String;",
|
"Ljava/lang/String;",
|
||||||
strings = listOf(
|
strings = listOf(
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
package app.revanced.patches.warnwetter.misc.firebasegetcert.fingerprints
|
package app.revanced.patches.warnwetter.misc.firebasegetcert.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.warnwetter.misc.firebasegetcert.annotations.FirebaseGetCertPatchCompatibility
|
|
||||||
|
|
||||||
@Name("registration-app-certificate-fingerprint")
|
|
||||||
@FirebaseGetCertPatchCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object GetReqistrationCertFingerprint : MethodFingerprint(
|
object GetReqistrationCertFingerprint : MethodFingerprint(
|
||||||
"Ljava/lang/String;",
|
"Ljava/lang/String;",
|
||||||
strings = listOf(
|
strings = listOf(
|
||||||
|
|||||||
@@ -1,13 +1,6 @@
|
|||||||
package app.revanced.patches.warnwetter.misc.promocode.fingerprints
|
package app.revanced.patches.warnwetter.misc.promocode.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.warnwetter.misc.promocode.annotations.PromoCodeUnlockCompatibility
|
|
||||||
|
|
||||||
@Name("promo-code-unlock-fingerprint")
|
|
||||||
@PromoCodeUnlockCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object PromoCodeUnlockFingerprint : MethodFingerprint(
|
object PromoCodeUnlockFingerprint : MethodFingerprint(
|
||||||
customFingerprint = { methodDef ->
|
customFingerprint = { methodDef ->
|
||||||
methodDef.definingClass.endsWith("PromoTokenVerification;") && methodDef.name == "isValid"
|
methodDef.definingClass.endsWith("PromoTokenVerification;") && methodDef.name == "isValid"
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package app.revanced.patches.windyapp.misc.pro.annotations
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
|
@Compatibility([Package("co.windyapp.android")])
|
||||||
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
|
internal annotation class UnlockProCompatibility
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package app.revanced.patches.windyapp.misc.pro.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
|
||||||
|
object CheckProFingerprint : MethodFingerprint(
|
||||||
|
"I",
|
||||||
|
customFingerprint = { methodDef ->
|
||||||
|
methodDef.definingClass.endsWith("RawUserData;") && methodDef.name == "isPro"
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package app.revanced.patches.windyapp.misc.pro.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
|
import app.revanced.patcher.extensions.removeInstruction
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patches.windyapp.misc.pro.annotations.UnlockProCompatibility
|
||||||
|
import app.revanced.patches.windyapp.misc.pro.fingerprints.CheckProFingerprint
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Name("unlock-pro")
|
||||||
|
@Description("Unlocks all pro features.")
|
||||||
|
@UnlockProCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class UnlockProPatch : BytecodePatch(
|
||||||
|
listOf(
|
||||||
|
CheckProFingerprint
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
val method = CheckProFingerprint.result!!.mutableMethod
|
||||||
|
method.addInstructions(
|
||||||
|
0,
|
||||||
|
"""
|
||||||
|
const/16 v0, 0x1
|
||||||
|
return v0
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36")
|
"com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36", "17.45.36")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package app.revanced.patches.youtube.ad.general.bytecode.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patches.youtube.ad.general.resource.patch.GeneralAdsResourcePatch
|
||||||
|
import org.jf.dexlib2.Opcode
|
||||||
|
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
|
||||||
|
|
||||||
|
object ReelConstructorFingerprint : MethodFingerprint(
|
||||||
|
opcodes = listOf(
|
||||||
|
Opcode.INVOKE_VIRTUAL
|
||||||
|
),
|
||||||
|
customFingerprint = { method ->
|
||||||
|
method.implementation?.instructions?.any {
|
||||||
|
it.opcode == Opcode.CONST && (it as WideLiteralInstruction).wideLiteral == GeneralAdsResourcePatch.reelMultipleItemShelfId
|
||||||
|
} ?: false
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -1,24 +1,25 @@
|
|||||||
package app.revanced.patches.youtube.ad.general.bytecode.patch
|
package app.revanced.patches.youtube.ad.general.bytecode.patch
|
||||||
|
|
||||||
|
import app.revanced.extensions.findMutableMethodOf
|
||||||
import app.revanced.patcher.annotation.Description
|
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.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
import app.revanced.patcher.extensions.addInstruction
|
||||||
import app.revanced.patcher.extensions.softCompareTo
|
import app.revanced.patcher.extensions.instruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultError
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.patch.annotations.DependsOn
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableClass
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||||
import app.revanced.patches.youtube.ad.general.annotation.GeneralAdsCompatibility
|
import app.revanced.patches.youtube.ad.general.annotation.GeneralAdsCompatibility
|
||||||
|
import app.revanced.patches.youtube.ad.general.bytecode.fingerprints.ReelConstructorFingerprint
|
||||||
import app.revanced.patches.youtube.ad.general.resource.patch.GeneralAdsResourcePatch
|
import app.revanced.patches.youtube.ad.general.resource.patch.GeneralAdsResourcePatch
|
||||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.*
|
import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||||
import org.jf.dexlib2.iface.Method
|
|
||||||
import org.jf.dexlib2.iface.instruction.formats.Instruction31i
|
import org.jf.dexlib2.iface.instruction.formats.Instruction31i
|
||||||
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
||||||
import org.jf.dexlib2.immutable.reference.ImmutableMethodReference
|
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
|
|
||||||
@@ -28,20 +29,18 @@ import java.util.*
|
|||||||
@Description("Removes general ads.")
|
@Description("Removes general ads.")
|
||||||
@GeneralAdsCompatibility
|
@GeneralAdsCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class GeneralAdsPatch : BytecodePatch() {
|
class GeneralAdsPatch : BytecodePatch(
|
||||||
internal companion object {
|
listOf(ReelConstructorFingerprint)
|
||||||
private fun MutableClass.findMutableMethodOf(
|
) {
|
||||||
method: Method
|
|
||||||
) = this.methods.first {
|
|
||||||
it.softCompareTo(
|
|
||||||
ImmutableMethodReference(
|
|
||||||
method.definingClass, method.name, method.parameters, method.returnType
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
fun String.buildHideCall(viewRegister: Int) = "invoke-static { v$viewRegister }, " +
|
||||||
|
"Lapp/revanced/integrations/patches/GeneralAdsPatch;" +
|
||||||
|
"->" +
|
||||||
|
"$this(Landroid/view/View;)V"
|
||||||
|
|
||||||
|
fun MutableMethod.injectHideCall(insertIndex: Int, viewRegister: Int, method: String) =
|
||||||
|
this.addInstruction(insertIndex, method.buildHideCall(viewRegister))
|
||||||
|
|
||||||
context.classes.forEach { classDef ->
|
context.classes.forEach { classDef ->
|
||||||
classDef.methods.forEach { method ->
|
classDef.methods.forEach { method ->
|
||||||
with(method.implementation) {
|
with(method.implementation) {
|
||||||
@@ -49,7 +48,7 @@ class GeneralAdsPatch : BytecodePatch() {
|
|||||||
if (instruction.opcode != org.jf.dexlib2.Opcode.CONST)
|
if (instruction.opcode != org.jf.dexlib2.Opcode.CONST)
|
||||||
return@forEachIndexed
|
return@forEachIndexed
|
||||||
// Instruction to store the id adAttribution into a register
|
// Instruction to store the id adAttribution into a register
|
||||||
if ((instruction as Instruction31i).wideLiteral != app.revanced.patches.youtube.ad.general.resource.patch.GeneralAdsResourcePatch.adAttributionId)
|
if ((instruction as Instruction31i).wideLiteral != GeneralAdsResourcePatch.adAttributionId)
|
||||||
return@forEachIndexed
|
return@forEachIndexed
|
||||||
|
|
||||||
val insertIndex = index + 1
|
val insertIndex = index + 1
|
||||||
@@ -61,19 +60,31 @@ class GeneralAdsPatch : BytecodePatch() {
|
|||||||
|
|
||||||
// Hide the view
|
// Hide the view
|
||||||
val viewRegister = (this as Instruction35c).registerC
|
val viewRegister = (this as Instruction35c).registerC
|
||||||
context.proxy(classDef).mutableClass.findMutableMethodOf(method).addInstruction(
|
context.proxy(classDef)
|
||||||
insertIndex,
|
.mutableClass
|
||||||
"invoke-static { v$viewRegister }, " +
|
.findMutableMethodOf(method)
|
||||||
"Lapp/revanced/integrations/patches/GeneralAdsPatch;" +
|
.injectHideCall(insertIndex, viewRegister, "hideAdAttributionView")
|
||||||
"->" +
|
|
||||||
"hideAdAttributionView(Landroid/view/View;)V"
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
with(
|
||||||
|
ReelConstructorFingerprint.result
|
||||||
|
?: return PatchResultError("Could not resolve fingerprint")
|
||||||
|
) {
|
||||||
|
// iput-object v$viewRegister, ...
|
||||||
|
val insertIndex = this.scanResult.patternScanResult!!.startIndex + 2
|
||||||
|
|
||||||
|
with(this.mutableMethod) {
|
||||||
|
val viewRegister = (instruction(insertIndex) as TwoRegisterInstruction).registerA
|
||||||
|
|
||||||
|
injectHideCall(insertIndex, viewRegister, "hideReelView")
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,13 +6,16 @@ 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.patcher.patch.annotations.DependsOn
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
|
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
|
||||||
|
import app.revanced.patches.shared.settings.impl.InputType
|
||||||
|
import app.revanced.patches.shared.settings.impl.StringResource
|
||||||
|
import app.revanced.patches.shared.settings.impl.SwitchPreference
|
||||||
|
import app.revanced.patches.shared.settings.impl.TextPreference
|
||||||
import app.revanced.patches.youtube.ad.general.annotation.GeneralAdsCompatibility
|
import app.revanced.patches.youtube.ad.general.annotation.GeneralAdsCompatibility
|
||||||
import app.revanced.patches.youtube.misc.litho.filter.patch.LithoFilterPatch
|
import app.revanced.patches.youtube.misc.litho.filter.patch.LithoFilterPatch
|
||||||
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
|
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
|
||||||
import app.revanced.patches.shared.mapping.patch.ResourceMappingPatch
|
|
||||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch.PreferenceScreen
|
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch.PreferenceScreen
|
||||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.*
|
|
||||||
|
|
||||||
@DependsOn(dependencies = [
|
@DependsOn(dependencies = [
|
||||||
FixLocaleConfigErrorPatch::class,
|
FixLocaleConfigErrorPatch::class,
|
||||||
@@ -25,69 +28,70 @@ import app.revanced.patches.youtube.misc.settings.framework.components.impl.*
|
|||||||
class GeneralAdsResourcePatch : ResourcePatch {
|
class GeneralAdsResourcePatch : ResourcePatch {
|
||||||
internal companion object {
|
internal companion object {
|
||||||
var adAttributionId: Long = -1
|
var adAttributionId: Long = -1
|
||||||
|
var reelMultipleItemShelfId: Long = -1
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun execute(context: ResourceContext): PatchResult {
|
override fun execute(context: ResourceContext): PatchResult {
|
||||||
PreferenceScreen.ADS.addPreferences(
|
PreferenceScreen.ADS.addPreferences(
|
||||||
SwitchPreference(
|
SwitchPreference(
|
||||||
"revanced_adremover_ad_removal",
|
"revanced_adremover_ad_removal",
|
||||||
StringResource("revanced_adremover_ad_removal_enabled_title", "Remove general ads"),
|
StringResource("revanced_adremover_ad_removal_enabled_title", "Hide general ads"),
|
||||||
true,
|
true,
|
||||||
StringResource("revanced_adremover_ad_removal_enabled_summary_on", "General ads are hidden"),
|
StringResource("revanced_adremover_ad_removal_enabled_summary_on", "General ads are hidden"),
|
||||||
StringResource("revanced_adremover_ad_removal_enabled_summary_off", "General ads are shown")
|
StringResource("revanced_adremover_ad_removal_enabled_summary_off", "General ads are shown")
|
||||||
),
|
),
|
||||||
SwitchPreference(
|
SwitchPreference(
|
||||||
"revanced_adremover_buttoned",
|
"revanced_adremover_buttoned",
|
||||||
StringResource("revanced_adremover_buttoned_enabled_title", "Remove buttoned ad"),
|
StringResource("revanced_adremover_buttoned_enabled_title", "Hide buttoned ad"),
|
||||||
true,
|
true,
|
||||||
StringResource("revanced_adremover_buttoned_enabled_summary_on", "Buttoned ads are hidden"),
|
StringResource("revanced_adremover_buttoned_enabled_summary_on", "Buttoned ads are hidden"),
|
||||||
StringResource("revanced_adremover_buttoned_enabled_summary_off", "Buttoned ads are shown")
|
StringResource("revanced_adremover_buttoned_enabled_summary_off", "Buttoned ads are shown")
|
||||||
),
|
),
|
||||||
SwitchPreference(
|
SwitchPreference(
|
||||||
"revanced_adremover_merchandise",
|
"revanced_adremover_merchandise",
|
||||||
StringResource("revanced_adremover_merchandise_enabled_title", "Remove merchandise banners"),
|
StringResource("revanced_adremover_merchandise_enabled_title", "Hide merchandise banners"),
|
||||||
true,
|
true,
|
||||||
StringResource("revanced_adremover_merchandise_enabled_summary_on", "Merchandise banners are hidden"),
|
StringResource("revanced_adremover_merchandise_enabled_summary_on", "Merchandise banners are hidden"),
|
||||||
StringResource("revanced_adremover_merchandise_enabled_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_adremover_community_posts_removal",
|
||||||
StringResource("revanced_adremover_community_posts_enabled_title", "Remove community posts"),
|
StringResource("revanced_adremover_community_posts_enabled_title", "Hide community posts"),
|
||||||
false,
|
false,
|
||||||
StringResource("revanced_adremover_community_posts_enabled_summary_on", "Community posts are hidden"),
|
StringResource("revanced_adremover_community_posts_enabled_summary_on", "Community posts are hidden"),
|
||||||
StringResource("revanced_adremover_community_posts_enabled_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_adremover_compact_banner_removal",
|
||||||
StringResource("revanced_adremover_compact_banner_enabled_title", "Remove compact banners"),
|
StringResource("revanced_adremover_compact_banner_enabled_title", "Hide compact banners"),
|
||||||
true,
|
true,
|
||||||
StringResource("revanced_adremover_compact_banner_enabled_summary_on", "Compact banners are hidden"),
|
StringResource("revanced_adremover_compact_banner_enabled_summary_on", "Compact banners are hidden"),
|
||||||
StringResource("revanced_adremover_compact_banner_enabled_summary_off", "Compact banners are shown")
|
StringResource("revanced_adremover_compact_banner_enabled_summary_off", "Compact banners are shown")
|
||||||
),
|
),
|
||||||
SwitchPreference(
|
SwitchPreference(
|
||||||
"revanced_adremover_movie",
|
"revanced_adremover_movie",
|
||||||
StringResource("revanced_adremover_movie_enabled_title", "Remove movies section"),
|
StringResource("revanced_adremover_movie_enabled_title", "Hide movies section"),
|
||||||
true,
|
true,
|
||||||
StringResource("revanced_adremover_movie_enabled_summary_on", "Movies section is hidden"),
|
StringResource("revanced_adremover_movie_enabled_summary_on", "Movies section is hidden"),
|
||||||
StringResource("revanced_adremover_movie_enabled_summary_off", "Movies section is shown")
|
StringResource("revanced_adremover_movie_enabled_summary_off", "Movies section is shown")
|
||||||
),
|
),
|
||||||
SwitchPreference(
|
SwitchPreference(
|
||||||
"revanced_adremover_feed_survey",
|
"revanced_adremover_feed_survey",
|
||||||
StringResource("revanced_adremover_feed_survey_enabled_title", "Remove feed surveys"),
|
StringResource("revanced_adremover_feed_survey_enabled_title", "Hide feed surveys"),
|
||||||
true,
|
true,
|
||||||
StringResource("revanced_adremover_feed_survey_enabled_summary_on", "Feed surveys are hidden"),
|
StringResource("revanced_adremover_feed_survey_enabled_summary_on", "Feed surveys are hidden"),
|
||||||
StringResource("revanced_adremover_feed_survey_enabled_summary_off", "Feed surveys are shown")
|
StringResource("revanced_adremover_feed_survey_enabled_summary_off", "Feed surveys are shown")
|
||||||
),
|
),
|
||||||
SwitchPreference(
|
SwitchPreference(
|
||||||
"revanced_adremover_shorts",
|
"revanced_adremover_shorts",
|
||||||
StringResource("revanced_adremover_shorts_enabled_title", "Remove shorts"),
|
StringResource("revanced_adremover_shorts_enabled_title", "Hide shorts"),
|
||||||
true,
|
true,
|
||||||
StringResource("revanced_adremover_shorts_enabled_summary_on", "Shorts are hidden"),
|
StringResource("revanced_adremover_shorts_enabled_summary_on", "Shorts are hidden"),
|
||||||
StringResource("revanced_adremover_shorts_enabled_summary_off", "Shorts are shown")
|
StringResource("revanced_adremover_shorts_enabled_summary_off", "Shorts are shown")
|
||||||
),
|
),
|
||||||
SwitchPreference(
|
SwitchPreference(
|
||||||
"revanced_adremover_community_guidelines",
|
"revanced_adremover_community_guidelines",
|
||||||
StringResource("revanced_adremover_community_guidelines_enabled_title", "Remove community guidelines"),
|
StringResource("revanced_adremover_community_guidelines_enabled_title", "Hide community guidelines"),
|
||||||
true,
|
true,
|
||||||
StringResource(
|
StringResource(
|
||||||
"revanced_adremover_community_guidelines_enabled_summary_on",
|
"revanced_adremover_community_guidelines_enabled_summary_on",
|
||||||
@@ -100,28 +104,28 @@ class GeneralAdsResourcePatch : ResourcePatch {
|
|||||||
),
|
),
|
||||||
SwitchPreference(
|
SwitchPreference(
|
||||||
"revanced_adremover_emergency_box_removal",
|
"revanced_adremover_emergency_box_removal",
|
||||||
StringResource("revanced_adremover_emergency_box_enabled_title", "Remove emergency boxes"),
|
StringResource("revanced_adremover_emergency_box_enabled_title", "Hide emergency boxes"),
|
||||||
true,
|
true,
|
||||||
StringResource("revanced_adremover_emergency_box_enabled_summary_on", "Emergency boxes are hidden"),
|
StringResource("revanced_adremover_emergency_box_enabled_summary_on", "Emergency boxes are hidden"),
|
||||||
StringResource("revanced_adremover_emergency_box_enabled_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_adremover_info_panel",
|
||||||
StringResource("revanced_adremover_info_panel_enabled_title", "Remove info panels"),
|
StringResource("revanced_adremover_info_panel_enabled_title", "Hide info panels"),
|
||||||
true,
|
true,
|
||||||
StringResource("revanced_adremover_info_panel_enabled_summary_on", "Info panels are hidden"),
|
StringResource("revanced_adremover_info_panel_enabled_summary_on", "Info panels are hidden"),
|
||||||
StringResource("revanced_adremover_info_panel_enabled_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_adremover_medical_panel",
|
||||||
StringResource("revanced_adremover_medical_panel_enabled_title", "Remove medical panels"),
|
StringResource("revanced_adremover_medical_panel_enabled_title", "Hide medical panels"),
|
||||||
true,
|
true,
|
||||||
StringResource("revanced_adremover_medical_panel_enabled_summary_on", "Medical panels are hidden"),
|
StringResource("revanced_adremover_medical_panel_enabled_summary_on", "Medical panels are hidden"),
|
||||||
StringResource("revanced_adremover_medical_panel_enabled_summary_off", "Medical panels are shown")
|
StringResource("revanced_adremover_medical_panel_enabled_summary_off", "Medical panels are shown")
|
||||||
),
|
),
|
||||||
SwitchPreference(
|
SwitchPreference(
|
||||||
"revanced_adremover_paid_content",
|
"revanced_adremover_paid_content",
|
||||||
StringResource("revanced_adremover_paid_content_enabled_title", "Remove paid content"),
|
StringResource("revanced_adremover_paid_content_enabled_title", "Hide paid content"),
|
||||||
true,
|
true,
|
||||||
StringResource("revanced_adremover_paid_content_enabled_summary_on", "Paid content is hidden"),
|
StringResource("revanced_adremover_paid_content_enabled_summary_on", "Paid content is hidden"),
|
||||||
StringResource("revanced_adremover_paid_content_enabled_summary_off", "Paid content is shown")
|
StringResource("revanced_adremover_paid_content_enabled_summary_off", "Paid content is shown")
|
||||||
@@ -183,7 +187,7 @@ class GeneralAdsResourcePatch : ResourcePatch {
|
|||||||
"Chapter teasers are shown"
|
"Chapter teasers are shown"
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
PreferenceScreen(
|
app.revanced.patches.shared.settings.impl.PreferenceScreen(
|
||||||
"revanced_adremover_custom",
|
"revanced_adremover_custom",
|
||||||
StringResource("revanced_adremover_custom_title", "Custom filter"),
|
StringResource("revanced_adremover_custom_title", "Custom filter"),
|
||||||
listOf(
|
listOf(
|
||||||
@@ -218,7 +222,11 @@ class GeneralAdsResourcePatch : ResourcePatch {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
adAttributionId = ResourceMappingPatch.resourceMappings.single { it.name == "ad_attribution" }.id
|
fun String.getId() = ResourceMappingPatch.resourceMappings.single { it.name == this }.id
|
||||||
|
|
||||||
|
adAttributionId = "ad_attribution".getId()
|
||||||
|
reelMultipleItemShelfId = "reel_multiple_items_shelf".getId()
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user