mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-24 11:11:03 +00:00
Compare commits
2 Commits
v2.165.0-d
...
v2.163.0-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3da4a85f63 | ||
|
|
1241701ac7 |
@@ -39,7 +39,7 @@
|
|||||||
[
|
[
|
||||||
"@saithodev/semantic-release-backmerge",
|
"@saithodev/semantic-release-backmerge",
|
||||||
{
|
{
|
||||||
backmergeBranches: [{"from": "main", "to": "dev"}],
|
backmergeBranches: [{"from": "dev", "to": "main"}],
|
||||||
clearWorkspace: true
|
clearWorkspace: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
107
CHANGELOG.md
107
CHANGELOG.md
@@ -1,112 +1,9 @@
|
|||||||
# [2.165.0-dev.7](https://github.com/revanced/revanced-patches/compare/v2.165.0-dev.6...v2.165.0-dev.7) (2023-02-26)
|
# [2.163.0-dev.6](https://github.com/revanced/revanced-patches/compare/v2.163.0-dev.5...v2.163.0-dev.6) (2023-02-22)
|
||||||
|
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* **youtube/hide-autoplay-button:** do not disable autoplay button when hidden ([7bc6a5b](https://github.com/revanced/revanced-patches/commit/7bc6a5ba2505e368e7590fe429b682ae435dba83))
|
* **photomath:** `unlock-plus` patch ([#1633](https://github.com/revanced/revanced-patches/issues/1633)) ([a7f5330](https://github.com/revanced/revanced-patches/commit/a7f5330e602c36492e329000dc9f0a1eda218770))
|
||||||
* **youtube:** `hide-floating-microphone-button` patch ([c684bed](https://github.com/revanced/revanced-patches/commit/c684bed5054beb5361fed5fe404cf68033927a27))
|
|
||||||
|
|
||||||
# [2.165.0-dev.6](https://github.com/revanced/revanced-patches/compare/v2.165.0-dev.5...v2.165.0-dev.6) (2023-02-26)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* **backdrops/pro-unlock:** constrain to most recent working app version ([#1677](https://github.com/revanced/revanced-patches/issues/1677)) ([331fe04](https://github.com/revanced/revanced-patches/commit/331fe04f142e3f1f7f6066271261a55d0bee33c4))
|
|
||||||
|
|
||||||
# [2.165.0-dev.5](https://github.com/revanced/revanced-patches/compare/v2.165.0-dev.4...v2.165.0-dev.5) (2023-02-24)
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* **youtube/general-ads:** do not hide components in library tab ([a8b597a](https://github.com/revanced/revanced-patches/commit/a8b597a1ba2fa6f6e37d3792e85296c1f07da630))
|
|
||||||
|
|
||||||
# [2.165.0-dev.4](https://github.com/revanced/revanced-patches/compare/v2.165.0-dev.3...v2.165.0-dev.4) (2023-02-24)
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* **youtube/disable-player-popup-panels:** use better patch description ([eda4ed3](https://github.com/revanced/revanced-patches/commit/eda4ed3a3e83b5a0e97740547494708f4e6536c2))
|
|
||||||
|
|
||||||
# [2.165.0-dev.3](https://github.com/revanced/revanced-patches/compare/v2.165.0-dev.2...v2.165.0-dev.3) (2023-02-24)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* **instagram/hide-timeline-ads:** fix compatibility with newer versions ([#1672](https://github.com/revanced/revanced-patches/issues/1672)) ([9a295a9](https://github.com/revanced/revanced-patches/commit/9a295a9aa1ca40e2afde22ea199805e8fbe93832))
|
|
||||||
|
|
||||||
# [2.165.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.165.0-dev.1...v2.165.0-dev.2) (2023-02-24)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* **youtube/general-ads:** remove duplicate preference ([cd7a728](https://github.com/revanced/revanced-patches/commit/cd7a728f52cd29c76a24b37c07c0e4d4c5485b07))
|
|
||||||
|
|
||||||
# [2.165.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.164.0...v2.165.0-dev.1) (2023-02-24)
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* **youtube/general-ads:** hide image shelf from search results ([e29230f](https://github.com/revanced/revanced-patches/commit/e29230f44930a9928c3f97222fe05b5493ef1710))
|
|
||||||
|
|
||||||
# [2.164.0](https://github.com/revanced/revanced-patches/compare/v2.163.0...v2.164.0) (2023-02-24)
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* **photomath:** `unlock-plus` patch ([#1633](https://github.com/revanced/revanced-patches/issues/1633)) ([a673514](https://github.com/revanced/revanced-patches/commit/a673514f848e583513924a6a9b8cfbb56153cc3a))
|
|
||||||
* **youtube/general-ads:** hide quick actions in fullscreen ([fff9670](https://github.com/revanced/revanced-patches/commit/fff9670a81108b8343d0b7913953fc6c2bb4a6f0))
|
|
||||||
* **youtube/general-ads:** hide related videos in quick action ([d23c31a](https://github.com/revanced/revanced-patches/commit/d23c31a9ec39189e08474044ac5ca06d974add76))
|
|
||||||
* **youtube/return-youtube-dislike:** support for shorts ([#1596](https://github.com/revanced/revanced-patches/issues/1596)) ([967c1cb](https://github.com/revanced/revanced-patches/commit/967c1cbd4b340a382a355f13d236d2881bafddbf))
|
|
||||||
* **youtube:** remove patch `open-links-directly` ([79291a0](https://github.com/revanced/revanced-patches/commit/79291a0d34bd9514cbef5d97c21c59dfbffad287))
|
|
||||||
|
|
||||||
# [2.164.0-dev.3](https://github.com/revanced/revanced-patches/compare/v2.164.0-dev.2...v2.164.0-dev.3) (2023-02-24)
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* **youtube/return-youtube-dislike:** support for shorts ([#1596](https://github.com/revanced/revanced-patches/issues/1596)) ([967c1cb](https://github.com/revanced/revanced-patches/commit/967c1cbd4b340a382a355f13d236d2881bafddbf))
|
|
||||||
|
|
||||||
# [2.164.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.164.0-dev.1...v2.164.0-dev.2) (2023-02-23)
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* **youtube/general-ads:** hide quick actions in fullscreen ([fff9670](https://github.com/revanced/revanced-patches/commit/fff9670a81108b8343d0b7913953fc6c2bb4a6f0))
|
|
||||||
* **youtube/general-ads:** hide related videos in quick action ([d23c31a](https://github.com/revanced/revanced-patches/commit/d23c31a9ec39189e08474044ac5ca06d974add76))
|
|
||||||
|
|
||||||
# [2.164.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.163.0...v2.164.0-dev.1) (2023-02-22)
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* **photomath:** `unlock-plus` patch ([#1633](https://github.com/revanced/revanced-patches/issues/1633)) ([a673514](https://github.com/revanced/revanced-patches/commit/a673514f848e583513924a6a9b8cfbb56153cc3a))
|
|
||||||
* **youtube:** remove patch `open-links-directly` ([79291a0](https://github.com/revanced/revanced-patches/commit/79291a0d34bd9514cbef5d97c21c59dfbffad287))
|
|
||||||
|
|
||||||
# [2.163.0](https://github.com/revanced/revanced-patches/compare/v2.162.0...v2.163.0) (2023-02-22)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* **tiktok/show-seekbar:** fix crash when showing seekbar ([#1643](https://github.com/revanced/revanced-patches/issues/1643)) ([160b716](https://github.com/revanced/revanced-patches/commit/160b71644dfdf8efd1f19cdf8e9f572fe1b86d9d))
|
|
||||||
* **twitter:** make `hide-promoted-ads` patch compatible with any version ([3dbc5ff](https://github.com/revanced/revanced-patches/commit/3dbc5ff2722559211232999ae29e7fabafe3b857))
|
|
||||||
* use correct fingerprint ([84fe9c3](https://github.com/revanced/revanced-patches/commit/84fe9c36461586f25ace146e0e29597e3dfc99ca))
|
|
||||||
* **youtube/disable-fullscreen-panels-auto-popup:** use proper descriptions ([4c82487](https://github.com/revanced/revanced-patches/commit/4c824876b45e32c5b79a9817b0a362f31bd13879))
|
|
||||||
* **youtube/general-ads:** fix switch description wording ([9003977](https://github.com/revanced/revanced-patches/commit/9003977c00d8056c38fd31476d2e367fb3aa9030))
|
|
||||||
* **youtube/hide-time:** use correct integrations class ([539ccf4](https://github.com/revanced/revanced-patches/commit/539ccf43a884ab3ff812884279aa75f42ba872d5))
|
|
||||||
* **youtube/hide-watch-in-vr:** fix descriptions ([f261e64](https://github.com/revanced/revanced-patches/commit/f261e64b10db9cddee2a850feab16c8c7092c333))
|
|
||||||
* **youtube/open-links-directly:** reference correct integrations method ([e14893e](https://github.com/revanced/revanced-patches/commit/e14893ec89d002287123196396946fff557b7ef4))
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* **androidtwelvewidgets:** `unlock-paid-widgets` patch ([#1641](https://github.com/revanced/revanced-patches/issues/1641)) ([44b74ae](https://github.com/revanced/revanced-patches/commit/44b74ae268c3f534dbaecc0adc00767e9b9c0e51))
|
|
||||||
* **music:** remove patches constraint on app version ([#1638](https://github.com/revanced/revanced-patches/issues/1638)) ([fe64881](https://github.com/revanced/revanced-patches/commit/fe64881c83a7dd42761dbd67689fbc0ddcb73d78))
|
|
||||||
* **twitter:** `hide-recommended-users` patch ([e8c9a91](https://github.com/revanced/revanced-patches/commit/e8c9a91a92fafcc79ce521f62c3865827df55d0f))
|
|
||||||
* **twitter:** constrain patches compatibility to working versions ([#1646](https://github.com/revanced/revanced-patches/issues/1646)) ([d984bdc](https://github.com/revanced/revanced-patches/commit/d984bdc8b17dea127880b696ee1bed1503762707))
|
|
||||||
* use better patch descriptions ([931aa0f](https://github.com/revanced/revanced-patches/commit/931aa0fba631d1740986131219eff94c4c1b2306))
|
|
||||||
* **youtube/general-ads:** hide channel bar ([c74c77d](https://github.com/revanced/revanced-patches/commit/c74c77d12568dda54d971d1998f7e73a45543a3b))
|
|
||||||
* **youtube/general-ads:** hide horizontal video shelf ([169e2ba](https://github.com/revanced/revanced-patches/commit/169e2ba67024210450ef6cc74e734d3e7f162cbe))
|
|
||||||
* **youtube/open-links-directly:** skip every redirect url ([f155e26](https://github.com/revanced/revanced-patches/commit/f155e261d4973d304c57e0144ddd8e115e6103ee))
|
|
||||||
|
|
||||||
# [2.163.0-dev.5](https://github.com/revanced/revanced-patches/compare/v2.163.0-dev.4...v2.163.0-dev.5) (2023-02-22)
|
# [2.163.0-dev.5](https://github.com/revanced/revanced-patches/compare/v2.163.0-dev.4...v2.163.0-dev.5) (2023-02-22)
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ The official Patch bundle provided by ReVanced and the community.
|
|||||||
| `debugging` | Adds debugging options. | all |
|
| `debugging` | Adds debugging options. | all |
|
||||||
| `disable-auto-captions` | Disable forced captions from being automatically enabled. | 18.03.36 |
|
| `disable-auto-captions` | Disable forced captions from being automatically enabled. | 18.03.36 |
|
||||||
| `disable-fullscreen-panels` | Disables video description and comments panel in fullscreen view. | 18.03.36 |
|
| `disable-fullscreen-panels` | Disables video description and comments panel in fullscreen view. | 18.03.36 |
|
||||||
| `disable-player-popup-panels` | Disables panels from appearing automatically when going into fullscreen (playlist or live chat). | 18.03.36 |
|
| `disable-fullscreen-panels-auto-popup` | Disables fullscreen panels from appearing automatically when going fullscreen (playlist or live chat). | 18.03.36 |
|
||||||
| `disable-shorts-on-startup` | Disables playing YouTube Shorts when launching YouTube. | 18.03.36 |
|
| `disable-shorts-on-startup` | Disables playing YouTube Shorts when launching YouTube. | 18.03.36 |
|
||||||
| `disable-zoom-haptics` | Disables haptics when zooming. | all |
|
| `disable-zoom-haptics` | Disables haptics when zooming. | all |
|
||||||
| `downloads` | Enables downloading music and videos from YouTube. | 18.03.36 |
|
| `downloads` | Enables downloading music and videos from YouTube. | 18.03.36 |
|
||||||
@@ -36,19 +36,19 @@ The official Patch bundle provided by ReVanced and the community.
|
|||||||
| `hide-crowdfunding-box` | Hides the crowdfunding box between the player and video description. | 18.03.36 |
|
| `hide-crowdfunding-box` | Hides the crowdfunding box between the player and video description. | 18.03.36 |
|
||||||
| `hide-email-address` | Hides the email address in the account switcher. | 18.03.36 |
|
| `hide-email-address` | Hides the email address in the account switcher. | 18.03.36 |
|
||||||
| `hide-endscreen-cards` | Hides the suggested video cards at the end of a video in fullscreen. | 18.03.36 |
|
| `hide-endscreen-cards` | Hides the suggested video cards at the end of a video in fullscreen. | 18.03.36 |
|
||||||
| `hide-floating-microphone-button` | Hides the floating microphone button which appears in search. | 18.03.36 |
|
|
||||||
| `hide-info-cards` | Hides info cards in videos. | 18.03.36 |
|
| `hide-info-cards` | Hides info cards in videos. | 18.03.36 |
|
||||||
| `hide-my-mix` | Hides mix playlists. | 18.03.36 |
|
| `hide-my-mix` | Hides mix playlists. | 18.03.36 |
|
||||||
| `hide-player-buttons` | Adds the option to hide video player previous and next buttons. | all |
|
| `hide-player-buttons` | Adds the option to hide video player previous and next buttons. | all |
|
||||||
| `hide-seekbar` | Hides the seekbar. | 18.03.36 |
|
| `hide-seekbar` | Hides the seekbar. | 18.03.36 |
|
||||||
| `hide-shorts-button` | Hides the shorts button on the navigation bar. | 18.03.36 |
|
| `hide-shorts-button` | Hides the shorts button on the navigation bar. | 18.03.36 |
|
||||||
| `hide-timestamp` | Hides timestamp in video player. | 18.03.36 |
|
| `hide-time` | Hides the videos time. | 18.03.36 |
|
||||||
| `hide-video-action-buttons` | Adds the options to hide action buttons under a video. | 18.03.36 |
|
| `hide-video-action-buttons` | Adds the options to hide action buttons under a video. | 18.03.36 |
|
||||||
| `hide-watch-in-vr` | Hides the option to watch in VR from the player settings flyout panel. | 18.03.36 |
|
| `hide-watch-in-vr` | Hides the option to watch in VR from the player settings flyout panel. | 18.03.36 |
|
||||||
| `hide-watermark` | Hides creator's watermarks on videos. | 18.03.36 |
|
| `hide-watermark` | Hides creator's watermarks on videos. | 18.03.36 |
|
||||||
| `microg-support` | Allows YouTube ReVanced to run without root and under a different package name with Vanced MicroG. | 18.03.36 |
|
| `microg-support` | Allows YouTube ReVanced to run without root and under a different package name with Vanced MicroG. | 18.03.36 |
|
||||||
| `minimized-playback` | Enables minimized and background playback. | 18.03.36 |
|
| `minimized-playback` | Enables minimized and background playback. | 18.03.36 |
|
||||||
| `old-quality-layout` | Enables the original video quality flyout in the video player settings | 18.03.36 |
|
| `old-quality-layout` | Enables the original video quality flyout in the video player settings | 18.03.36 |
|
||||||
|
| `open-links-directly` | Skips over redirection URLs to external links. | 18.03.36 |
|
||||||
| `open-links-externally` | Open links outside of the app directly in your browser. | 18.03.36 |
|
| `open-links-externally` | Open links outside of the app directly in your browser. | 18.03.36 |
|
||||||
| `premium-heading` | Shows premium branding on the home screen. | all |
|
| `premium-heading` | Shows premium branding on the home screen. | all |
|
||||||
| `remember-playback-rate` | Adds the ability to remember the playback rate you chose in the video playback rate flyout. | 18.03.36 |
|
| `remember-playback-rate` | Adds the ability to remember the playback rate you chose in the video playback rate flyout. | 18.03.36 |
|
||||||
@@ -229,7 +229,7 @@ The official Patch bundle provided by ReVanced and the community.
|
|||||||
|
|
||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|:--------:|:--------------:|:-----------------:|
|
||||||
| `pro-unlock` | Unlocks pro-only functions. | 4.52 |
|
| `pro-unlock` | Unlocks pro-only functions. | all |
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### [📦 `de.dwd.warnapp`](https://play.google.com/store/apps/details?id=de.dwd.warnapp)
|
### [📦 `de.dwd.warnapp`](https://play.google.com/store/apps/details?id=de.dwd.warnapp)
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 2.165.0-dev.7
|
version = 2.163.0-dev.6
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -3,5 +3,5 @@ package app.revanced.patches.backdrops.misc.pro.annotations
|
|||||||
import app.revanced.patcher.annotation.Compatibility
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
import app.revanced.patcher.annotation.Package
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
@Compatibility([Package("com.backdrops.wallpapers", arrayOf("4.52"))])
|
@Compatibility([Package("com.backdrops.wallpapers")])
|
||||||
internal annotation class ProUnlockCompatibility
|
internal annotation class ProUnlockCompatibility
|
||||||
@@ -21,5 +21,6 @@ object ShowAdFingerprint : MethodFingerprint(
|
|||||||
Opcode.CONST_4,
|
Opcode.CONST_4,
|
||||||
Opcode.GOTO,
|
Opcode.GOTO,
|
||||||
Opcode.CONST_4,
|
Opcode.CONST_4,
|
||||||
|
Opcode.RETURN,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -37,6 +37,13 @@ class GeneralAdsResourcePatch : ResourcePatch {
|
|||||||
StringResource("revanced_adremover_separator_summary_on", "Gray separators are hidden"),
|
StringResource("revanced_adremover_separator_summary_on", "Gray separators are hidden"),
|
||||||
StringResource("revanced_adremover_separator_summary_off", "Gray separators are shown")
|
StringResource("revanced_adremover_separator_summary_off", "Gray separators are shown")
|
||||||
),
|
),
|
||||||
|
SwitchPreference(
|
||||||
|
"revanced_horizontal_video_shelf",
|
||||||
|
StringResource("revanced_horizontal_video_shelf_title", "Hide horizontal video shelf"),
|
||||||
|
true,
|
||||||
|
StringResource("revanced_horizontal_video_shelf_summary_on", "Shelf is hidden"),
|
||||||
|
StringResource("revanced_horizontal_video_shelf_summary_off", "Shelf is shown")
|
||||||
|
),
|
||||||
SwitchPreference(
|
SwitchPreference(
|
||||||
"revanced_adremover_hide_channel_guidelines",
|
"revanced_adremover_hide_channel_guidelines",
|
||||||
StringResource("revanced_adremover_hide_channel_guidelines_enabled_title", "Hide channel guidelines"),
|
StringResource("revanced_adremover_hide_channel_guidelines_enabled_title", "Hide channel guidelines"),
|
||||||
@@ -192,27 +199,6 @@ class GeneralAdsResourcePatch : ResourcePatch {
|
|||||||
StringResource("revanced_hide_channel_bar_summary_on", "Channel bar is hidden"),
|
StringResource("revanced_hide_channel_bar_summary_on", "Channel bar is hidden"),
|
||||||
StringResource("revanced_hide_channel_bar_summary_off", "Channel bar is shown")
|
StringResource("revanced_hide_channel_bar_summary_off", "Channel bar is shown")
|
||||||
),
|
),
|
||||||
SwitchPreference(
|
|
||||||
"revanced_hide_quick_actions",
|
|
||||||
StringResource("revanced_hide_quick_actions_title", "Hide quick actions in fullscreen"),
|
|
||||||
false,
|
|
||||||
StringResource("revanced_hide_quick_actions_summary_on", "Quick actions are hidden"),
|
|
||||||
StringResource("revanced_hide_quick_actions_summary_off", "Quick actions are shown")
|
|
||||||
),
|
|
||||||
SwitchPreference(
|
|
||||||
"revanced_hide_related_videos",
|
|
||||||
StringResource("revanced_hide_related_videos_title", "Hide related videos in quick actions"),
|
|
||||||
false,
|
|
||||||
StringResource("revanced_hide_related_videos_summary_on", "Related videos are hidden"),
|
|
||||||
StringResource("revanced_hide_related_videos_summary_off", "Related videos are shown")
|
|
||||||
),
|
|
||||||
SwitchPreference(
|
|
||||||
"revanced_hide_image_shelf",
|
|
||||||
StringResource("revanced_hide_image_shelf", "Hide image shelf in search results"),
|
|
||||||
true,
|
|
||||||
StringResource("revanced_hide_image_shelf_summary_on", "Image shelf is hidden"),
|
|
||||||
StringResource("revanced_hide_image_shelf_summary_off", "Image shelf is shown")
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
PreferenceScreen.ADS.addPreferences(
|
PreferenceScreen.ADS.addPreferences(
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.buttons.autoplay.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
|
object AutoNavInformerFingerprint : MethodFingerprint(
|
||||||
|
"Z",
|
||||||
|
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
|
opcodes = listOf(
|
||||||
|
Opcode.IGET_OBJECT,
|
||||||
|
Opcode.INVOKE_INTERFACE,
|
||||||
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
|
Opcode.CHECK_CAST,
|
||||||
|
Opcode.INVOKE_VIRTUAL,
|
||||||
|
Opcode.MOVE_RESULT,
|
||||||
|
),
|
||||||
|
customFingerprint = { it.definingClass.endsWith("WillAutonavInformer;") }
|
||||||
|
)
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
package app.revanced.patches.youtube.layout.buttons.autoplay.patch
|
package app.revanced.patches.youtube.layout.buttons.autoplay.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
|
||||||
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
|
||||||
@@ -16,6 +15,7 @@ import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
|
|||||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||||
import app.revanced.patches.youtube.layout.buttons.autoplay.annotations.AutoplayButtonCompatibility
|
import app.revanced.patches.youtube.layout.buttons.autoplay.annotations.AutoplayButtonCompatibility
|
||||||
|
import app.revanced.patches.youtube.layout.buttons.autoplay.fingerprints.AutoNavInformerFingerprint
|
||||||
import app.revanced.patches.youtube.layout.buttons.autoplay.fingerprints.LayoutConstructorFingerprint
|
import app.revanced.patches.youtube.layout.buttons.autoplay.fingerprints.LayoutConstructorFingerprint
|
||||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||||
@@ -31,7 +31,9 @@ import org.jf.dexlib2.iface.reference.MethodReference
|
|||||||
@AutoplayButtonCompatibility
|
@AutoplayButtonCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class HideAutoplayButtonPatch : BytecodePatch(
|
class HideAutoplayButtonPatch : BytecodePatch(
|
||||||
listOf(LayoutConstructorFingerprint)
|
listOf(
|
||||||
|
LayoutConstructorFingerprint, AutoNavInformerFingerprint
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||||
@@ -41,40 +43,49 @@ class HideAutoplayButtonPatch : BytecodePatch(
|
|||||||
true,
|
true,
|
||||||
StringResource("revanced_hide_autoplay_button_summary_on", "Autoplay button is hidden"),
|
StringResource("revanced_hide_autoplay_button_summary_on", "Autoplay button is hidden"),
|
||||||
StringResource("revanced_hide_autoplay_button_summary_off", "Autoplay button is shown")
|
StringResource("revanced_hide_autoplay_button_summary_off", "Autoplay button is shown")
|
||||||
),
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
LayoutConstructorFingerprint.result?.mutableMethod?.apply {
|
val autoNavInformerMethod = AutoNavInformerFingerprint.result!!.mutableMethod
|
||||||
val layoutGenMethodInstructions = implementation!!.instructions
|
|
||||||
|
|
||||||
// resolve the offsets such as ...
|
val layoutGenMethodResult = LayoutConstructorFingerprint.result!!
|
||||||
val autoNavPreviewStubId = ResourceMappingPatch.resourceMappings.single {
|
val layoutGenMethod = layoutGenMethodResult.mutableMethod
|
||||||
it.name == "autonav_preview_stub"
|
val layoutGenMethodInstructions = layoutGenMethod.implementation!!.instructions
|
||||||
}.id
|
|
||||||
|
|
||||||
// where to insert the branch instructions and ...
|
// resolve the offsets such as ...
|
||||||
val insertIndex = layoutGenMethodInstructions.indexOfFirst {
|
val autoNavPreviewStubId = ResourceMappingPatch.resourceMappings.single {
|
||||||
(it as? WideLiteralInstruction)?.wideLiteral == autoNavPreviewStubId
|
it.name == "autonav_preview_stub"
|
||||||
}
|
}.id
|
||||||
|
// where to insert the branch instructions and ...
|
||||||
|
val insertIndex = layoutGenMethodInstructions.indexOfFirst {
|
||||||
|
(it as? WideLiteralInstruction)?.wideLiteral == autoNavPreviewStubId
|
||||||
|
}
|
||||||
|
// where to branch away
|
||||||
|
val branchIndex = layoutGenMethodInstructions.subList(insertIndex + 1, layoutGenMethodInstructions.size - 1).indexOfFirst {
|
||||||
|
((it as? ReferenceInstruction)?.reference as? MethodReference)?.name == "addOnLayoutChangeListener"
|
||||||
|
} + 2
|
||||||
|
|
||||||
// where to branch away
|
val jumpInstruction = layoutGenMethodInstructions[insertIndex + branchIndex] as Instruction
|
||||||
val branchIndex =
|
layoutGenMethod.addInstructions(
|
||||||
layoutGenMethodInstructions.subList(insertIndex + 1, layoutGenMethodInstructions.size - 1)
|
insertIndex, """
|
||||||
.indexOfFirst {
|
|
||||||
((it as? ReferenceInstruction)?.reference as? MethodReference)?.name == "addOnLayoutChangeListener"
|
|
||||||
} + 2
|
|
||||||
|
|
||||||
val jumpInstruction = layoutGenMethodInstructions[insertIndex + branchIndex] as Instruction
|
|
||||||
|
|
||||||
addInstructions(
|
|
||||||
insertIndex,
|
|
||||||
"""
|
|
||||||
invoke-static {}, Lapp/revanced/integrations/patches/HideAutoplayButtonPatch;->isButtonShown()Z
|
invoke-static {}, Lapp/revanced/integrations/patches/HideAutoplayButtonPatch;->isButtonShown()Z
|
||||||
move-result v11
|
move-result v11
|
||||||
if-eqz v11, :hidden
|
if-eqz v11, :hidden
|
||||||
""", listOf(ExternalLabel("hidden", jumpInstruction))
|
""", listOf(ExternalLabel("hidden", jumpInstruction))
|
||||||
)
|
)
|
||||||
} ?: return LayoutConstructorFingerprint.toErrorResult()
|
|
||||||
|
//force disable autoplay since it's hard to do without the button
|
||||||
|
autoNavInformerMethod.addInstructions(
|
||||||
|
0, """
|
||||||
|
invoke-static {}, Lapp/revanced/integrations/patches/HideAutoplayButtonPatch;->isButtonShown()Z
|
||||||
|
move-result v0
|
||||||
|
if-nez v0, :hidden
|
||||||
|
const/4 v0, 0x0
|
||||||
|
return v0
|
||||||
|
:hidden
|
||||||
|
nop
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
package app.revanced.patches.youtube.layout.hide.floatingmicrophone.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
import app.revanced.patches.youtube.layout.hide.floatingmicrophone.patch.HideFloatingMicrophoneButtonResourcePatch
|
|
||||||
import org.jf.dexlib2.Opcode
|
|
||||||
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
|
|
||||||
|
|
||||||
object ShowFloatingMicrophoneButtonFingerprint : MethodFingerprint(
|
|
||||||
opcodes = listOf(
|
|
||||||
Opcode.IGET_BOOLEAN,
|
|
||||||
Opcode.IF_EQZ,
|
|
||||||
Opcode.RETURN_VOID
|
|
||||||
),
|
|
||||||
customFingerprint = { methodDef ->
|
|
||||||
methodDef.implementation?.instructions?.any {
|
|
||||||
(it as? WideLiteralInstruction)?.wideLiteral == HideFloatingMicrophoneButtonResourcePatch.fabButtonId
|
|
||||||
} == true
|
|
||||||
}
|
|
||||||
)
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
package app.revanced.patches.youtube.layout.hide.floatingmicrophone.patch
|
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
|
||||||
import app.revanced.patcher.annotation.Description
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
|
||||||
import app.revanced.patcher.extensions.instruction
|
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.annotations.DependsOn
|
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
|
||||||
import app.revanced.patches.youtube.layout.hide.floatingmicrophone.annotations.HideFloatingMicrophoneButtonCompatibility
|
|
||||||
import app.revanced.patches.youtube.layout.hide.floatingmicrophone.fingerprints.ShowFloatingMicrophoneButtonFingerprint
|
|
||||||
import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction
|
|
||||||
|
|
||||||
@Patch
|
|
||||||
@Name("hide-floating-microphone-button")
|
|
||||||
@Description("Hides the floating microphone button which appears in search.")
|
|
||||||
@DependsOn([HideFloatingMicrophoneButtonResourcePatch::class])
|
|
||||||
@HideFloatingMicrophoneButtonCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
class HideFloatingMicrophoneButtonPatch : BytecodePatch(
|
|
||||||
listOf(ShowFloatingMicrophoneButtonFingerprint)
|
|
||||||
) {
|
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
|
||||||
ShowFloatingMicrophoneButtonFingerprint.result?.let { result ->
|
|
||||||
with(result.mutableMethod) {
|
|
||||||
val insertIndex = result.scanResult.patternScanResult!!.startIndex + 1
|
|
||||||
val showButtonRegister = (instruction(insertIndex - 1) as TwoRegisterInstruction).registerA
|
|
||||||
|
|
||||||
addInstructions(
|
|
||||||
insertIndex,
|
|
||||||
"""
|
|
||||||
invoke-static {v$showButtonRegister}, $INTEGRATIONS_CLASS_DESCRIPTOR->hideFloatingMicrophoneButton(Z)Z
|
|
||||||
move-result v$showButtonRegister
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
}
|
|
||||||
} ?: return ShowFloatingMicrophoneButtonFingerprint.toErrorResult()
|
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
|
|
||||||
private companion object {
|
|
||||||
const val INTEGRATIONS_CLASS_DESCRIPTOR =
|
|
||||||
"Lapp/revanced/integrations/patches/HideFloatingMicrophoneButtonPatch;"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package app.revanced.patches.youtube.layout.hide.floatingmicrophone.patch
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.data.ResourceContext
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultError
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.ResourcePatch
|
|
||||||
import app.revanced.patcher.patch.annotations.DependsOn
|
|
||||||
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
|
|
||||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
|
||||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
|
||||||
import app.revanced.patches.youtube.layout.hide.floatingmicrophone.annotations.HideFloatingMicrophoneButtonCompatibility
|
|
||||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
|
||||||
|
|
||||||
@DependsOn([SettingsPatch::class, ResourceMappingPatch::class])
|
|
||||||
@HideFloatingMicrophoneButtonCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
class HideFloatingMicrophoneButtonResourcePatch : ResourcePatch {
|
|
||||||
override fun execute(context: ResourceContext): PatchResult {
|
|
||||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
|
||||||
SwitchPreference(
|
|
||||||
"revanced_hide_floating_microphone_button",
|
|
||||||
StringResource(
|
|
||||||
"revanced_hide_floating_microphone_button_enabled_title",
|
|
||||||
"Hide floating microphone button"
|
|
||||||
),
|
|
||||||
true,
|
|
||||||
StringResource("revanced_hide_floating_microphone_button_summary_on", "Microphone button hidden"),
|
|
||||||
StringResource("revanced_hide_floating_microphone_button_summary_off", "Microphone button shown")
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
fabButtonId = ResourceMappingPatch.resourceMappings.find { it.type == "id" && it.name == "fab" }?.id
|
|
||||||
?: return PatchResultError("Can not find required fab button resource id")
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
|
|
||||||
internal companion object {
|
|
||||||
var fabButtonId: Long = -1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -19,11 +19,11 @@ import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
|||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@DependsOn([IntegrationsPatch::class, SettingsPatch::class])
|
@DependsOn([IntegrationsPatch::class, SettingsPatch::class])
|
||||||
@Name("hide-timestamp")
|
@Name("hide-time")
|
||||||
@Description("Hides timestamp in video player.")
|
@Description("Hides the videos time.")
|
||||||
@HideTimeCompatibility
|
@HideTimeCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class HideTimestampPatch : BytecodePatch(
|
class HideTimePatch : BytecodePatch(
|
||||||
listOf(
|
listOf(
|
||||||
TimeCounterFingerprint
|
TimeCounterFingerprint
|
||||||
)
|
)
|
||||||
@@ -31,17 +31,17 @@ class HideTimestampPatch : BytecodePatch(
|
|||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||||
SwitchPreference(
|
SwitchPreference(
|
||||||
"revanced_hide_timestamp",
|
"revanced_hide_time",
|
||||||
StringResource("revanced_hide_timestamp_title", "Hide video timestamp"),
|
StringResource("revanced_hide_time_title", "Hide time"),
|
||||||
false,
|
false,
|
||||||
StringResource("revanced_hide_timestamp_summary_on", "Timestamp is hidden"),
|
StringResource("revanced_hide_time_summary_on", "Time is hidden"),
|
||||||
StringResource("revanced_hide_timestamp_summary_off", "Timestamp is shown")
|
StringResource("revanced_hide_time_summary_off", "Time is shown")
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
TimeCounterFingerprint.result!!.mutableMethod.addInstructions(
|
TimeCounterFingerprint.result!!.mutableMethod.addInstructions(
|
||||||
0, """
|
0, """
|
||||||
invoke-static { }, Lapp/revanced/integrations/patches/HideTimestampPatch;->hideTimestamp()Z
|
invoke-static { }, Lapp/revanced/integrations/patches/HideTimePatch;->hideTime()Z
|
||||||
move-result v0
|
move-result v0
|
||||||
if-eqz v0, :hide_time
|
if-eqz v0, :hide_time
|
||||||
return-void
|
return-void
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package app.revanced.patches.youtube.layout.panels.popup.annotations
|
package app.revanced.patches.youtube.layout.panels.fullscreen.popup.annotations
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Compatibility
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
import app.revanced.patcher.annotation.Package
|
import app.revanced.patcher.annotation.Package
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package app.revanced.patches.youtube.layout.panels.popup.fingerprints
|
package app.revanced.patches.youtube.layout.panels.fullscreen.popup.fingerprints
|
||||||
|
|
||||||
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
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package app.revanced.patches.youtube.layout.panels.popup.patch
|
package app.revanced.patches.youtube.layout.panels.fullscreen.popup.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
import app.revanced.extensions.toErrorResult
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
@@ -13,18 +13,18 @@ import app.revanced.patcher.patch.annotations.DependsOn
|
|||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||||
import app.revanced.patches.youtube.layout.panels.popup.annotations.PlayerPopupPanelsCompatibility
|
import app.revanced.patches.youtube.layout.panels.fullscreen.popup.annotations.PlayerPopupPanelsCompatibility
|
||||||
import app.revanced.patches.youtube.layout.panels.popup.fingerprints.EngagementPanelControllerFingerprint
|
import app.revanced.patches.youtube.layout.panels.fullscreen.popup.fingerprints.EngagementPanelControllerFingerprint
|
||||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@DependsOn([IntegrationsPatch::class, SettingsPatch::class])
|
@DependsOn([IntegrationsPatch::class, SettingsPatch::class])
|
||||||
@Name("disable-player-popup-panels")
|
@Name("disable-fullscreen-panels-auto-popup")
|
||||||
@Description("Disables panels from appearing automatically when going into fullscreen (playlist or live chat).")
|
@Description("Disables fullscreen panels from appearing automatically when going fullscreen (playlist or live chat).")
|
||||||
@PlayerPopupPanelsCompatibility
|
@PlayerPopupPanelsCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class PlayerPopupPanelsPatch : BytecodePatch(
|
class FullscreenPanelsPatch : BytecodePatch(
|
||||||
listOf(
|
listOf(
|
||||||
EngagementPanelControllerFingerprint
|
EngagementPanelControllerFingerprint
|
||||||
)
|
)
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
package app.revanced.patches.youtube.layout.returnyoutubedislike.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.extensions.or
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
|
||||||
import org.jf.dexlib2.Opcode
|
|
||||||
|
|
||||||
object ShortsTextComponentParentFingerprint : MethodFingerprint(
|
|
||||||
returnType = "V",
|
|
||||||
access = AccessFlags.PROTECTED or AccessFlags.FINAL,
|
|
||||||
parameters = listOf("L", "L"),
|
|
||||||
opcodes = listOf(
|
|
||||||
Opcode.IF_EQZ,
|
|
||||||
Opcode.CONST_4,
|
|
||||||
Opcode.IF_EQ,
|
|
||||||
Opcode.CONST_4,
|
|
||||||
Opcode.IF_EQ,
|
|
||||||
Opcode.RETURN_VOID,
|
|
||||||
Opcode.IGET_OBJECT,
|
|
||||||
Opcode.CHECK_CAST,
|
|
||||||
Opcode.IGET_BOOLEAN,
|
|
||||||
Opcode.IF_EQZ,
|
|
||||||
Opcode.INVOKE_STATIC
|
|
||||||
)
|
|
||||||
)
|
|
||||||
@@ -5,10 +5,8 @@ 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.data.toMethodWalker
|
|
||||||
import app.revanced.patcher.extensions.MethodFingerprintExtensions.name
|
import app.revanced.patcher.extensions.MethodFingerprintExtensions.name
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.instruction
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
@@ -17,15 +15,12 @@ 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.MutableMethod
|
|
||||||
import app.revanced.patches.youtube.layout.returnyoutubedislike.annotations.ReturnYouTubeDislikeCompatibility
|
import app.revanced.patches.youtube.layout.returnyoutubedislike.annotations.ReturnYouTubeDislikeCompatibility
|
||||||
import app.revanced.patches.youtube.layout.returnyoutubedislike.fingerprints.*
|
import app.revanced.patches.youtube.layout.returnyoutubedislike.fingerprints.*
|
||||||
import app.revanced.patches.youtube.layout.returnyoutubedislike.resource.patch.ReturnYouTubeDislikeResourcePatch
|
import app.revanced.patches.youtube.layout.returnyoutubedislike.resource.patch.ReturnYouTubeDislikeResourcePatch
|
||||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||||
import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch
|
import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch
|
||||||
import app.revanced.patches.youtube.misc.video.videoid.patch.VideoIdPatch
|
import app.revanced.patches.youtube.misc.video.videoid.patch.VideoIdPatch
|
||||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction35c
|
|
||||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@DependsOn(
|
@DependsOn(
|
||||||
@@ -43,103 +38,55 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
|||||||
class ReturnYouTubeDislikePatch : BytecodePatch(
|
class ReturnYouTubeDislikePatch : BytecodePatch(
|
||||||
listOf(
|
listOf(
|
||||||
TextComponentSpecParentFingerprint,
|
TextComponentSpecParentFingerprint,
|
||||||
ShortsTextComponentParentFingerprint,
|
|
||||||
LikeFingerprint,
|
LikeFingerprint,
|
||||||
DislikeFingerprint,
|
DislikeFingerprint,
|
||||||
RemoveLikeFingerprint,
|
RemoveLikeFingerprint,
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
// region Inject newVideoLoaded event handler
|
|
||||||
|
|
||||||
VideoIdPatch.injectCall("$INTEGRATIONS_PATCH_CLASS_DESCRIPTOR->newVideoLoaded(Ljava/lang/String;)V")
|
|
||||||
|
|
||||||
// endregion
|
|
||||||
|
|
||||||
// region Hook interaction
|
|
||||||
|
|
||||||
listOf(
|
listOf(
|
||||||
LikeFingerprint.toPatch(Vote.LIKE),
|
LikeFingerprint.toPatch(Vote.LIKE),
|
||||||
DislikeFingerprint.toPatch(Vote.DISLIKE),
|
DislikeFingerprint.toPatch(Vote.DISLIKE),
|
||||||
RemoveLikeFingerprint.toPatch(Vote.REMOVE_LIKE)
|
RemoveLikeFingerprint.toPatch(Vote.REMOVE_LIKE)
|
||||||
).forEach { (fingerprint, vote) ->
|
).forEach { (fingerprint, vote) ->
|
||||||
fingerprint.result?.mutableMethod?.apply {
|
with(fingerprint.result ?: return PatchResultError("Failed to find ${fingerprint.name} method.")) {
|
||||||
addInstructions(
|
mutableMethod.addInstructions(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
const/4 v0, ${vote.value}
|
const/4 v0, ${vote.value}
|
||||||
invoke-static {v0}, $INTEGRATIONS_PATCH_CLASS_DESCRIPTOR->sendVote(I)V
|
invoke-static {v0}, Lapp/revanced/integrations/patches/ReturnYouTubeDislikePatch;->sendVote(I)V
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
} ?: return PatchResultError("Failed to find ${fingerprint.name} method.")
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// endregion
|
VideoIdPatch.injectCall("Lapp/revanced/integrations/patches/ReturnYouTubeDislikePatch;->newVideoLoaded(Ljava/lang/String;)V")
|
||||||
|
|
||||||
// region Hook components
|
with(TextComponentFingerprint
|
||||||
|
.apply { resolve(context, TextComponentSpecParentFingerprint.result!!.classDef) }
|
||||||
|
.result ?: return TextComponentFingerprint.toErrorResult()
|
||||||
|
) {
|
||||||
|
val createComponentMethod = mutableMethod
|
||||||
|
|
||||||
TextComponentFingerprint.also { it.resolve(context, TextComponentSpecParentFingerprint.result!!.classDef) }
|
val conversionContextParam = 5
|
||||||
.result?.let {
|
val textRefParam = createComponentMethod.parameters.size - 2
|
||||||
with(it.mutableMethod) {
|
// insert index must be 0, otherwise UI does not updated correctly in some situations
|
||||||
val createComponentMethod = this
|
// such as switching from full screen or when using previous/next overlay buttons.
|
||||||
|
val insertIndex = 0
|
||||||
val conversionContextParam = 5
|
|
||||||
val textRefParam = createComponentMethod.parameters.size - 2
|
|
||||||
// Insert index must be 0, otherwise UI does not updated correctly in some situations
|
|
||||||
// such as switching from full screen or when using previous/next overlay buttons.
|
|
||||||
val insertIndex = 0
|
|
||||||
|
|
||||||
createComponentMethod.addInstructions(
|
|
||||||
insertIndex,
|
|
||||||
"""
|
|
||||||
move-object/from16 v7, p$conversionContextParam
|
|
||||||
move-object/from16 v8, p$textRefParam
|
|
||||||
invoke-static {v7, v8}, $INTEGRATIONS_PATCH_CLASS_DESCRIPTOR->onComponentCreated(Ljava/lang/Object;Ljava/util/concurrent/atomic/AtomicReference;)V
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
}
|
|
||||||
} ?: return TextComponentFingerprint.toErrorResult()
|
|
||||||
|
|
||||||
ShortsTextComponentParentFingerprint.result?.let {
|
|
||||||
context
|
|
||||||
.toMethodWalker(it.method)
|
|
||||||
.nextMethod(it.scanResult.patternScanResult!!.endIndex, true)
|
|
||||||
.getMethod().let { method ->
|
|
||||||
with(method as MutableMethod) {
|
|
||||||
// After walking, verify the found method is what's expected.
|
|
||||||
if (returnType != ("Ljava/lang/CharSequence;") || parameterTypes.size != 1)
|
|
||||||
return PatchResultError("Method signature did not match: $this $parameterTypes")
|
|
||||||
|
|
||||||
val insertIndex = implementation!!.instructions.size - 1
|
|
||||||
|
|
||||||
val spannedParameterRegister = (instruction(insertIndex) as OneRegisterInstruction).registerA
|
|
||||||
val parameter = (instruction(insertIndex - 2) as BuilderInstruction35c).reference
|
|
||||||
|
|
||||||
if (!parameter.toString().endsWith("Landroid/text/Spanned;"))
|
|
||||||
return PatchResultError("Method signature parameter did not match: $parameter")
|
|
||||||
|
|
||||||
addInstructions(
|
|
||||||
insertIndex,
|
|
||||||
"""
|
|
||||||
invoke-static {v$spannedParameterRegister}, $INTEGRATIONS_PATCH_CLASS_DESCRIPTOR->onShortsComponentCreated(Landroid/text/Spanned;)Landroid/text/Spanned;
|
|
||||||
move-result-object v$spannedParameterRegister
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} ?: return ShortsTextComponentParentFingerprint.toErrorResult()
|
|
||||||
|
|
||||||
// endregion
|
|
||||||
|
|
||||||
|
createComponentMethod.addInstructions(
|
||||||
|
insertIndex,
|
||||||
|
"""
|
||||||
|
move-object/from16 v7, p$conversionContextParam
|
||||||
|
move-object/from16 v8, p$textRefParam
|
||||||
|
invoke-static {v7, v8}, Lapp/revanced/integrations/patches/ReturnYouTubeDislikePatch;->onComponentCreated(Ljava/lang/Object;Ljava/util/concurrent/atomic/AtomicReference;)V
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
}
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
|
||||||
private companion object {
|
private fun MethodFingerprint.toPatch(voteKind: Vote) = VotePatch(this, voteKind)
|
||||||
const val INTEGRATIONS_PATCH_CLASS_DESCRIPTOR =
|
|
||||||
"Lapp/revanced/integrations/patches/ReturnYouTubeDislikePatch;"
|
|
||||||
|
|
||||||
private fun MethodFingerprint.toPatch(voteKind: Vote) = VotePatch(this, voteKind)
|
|
||||||
}
|
|
||||||
|
|
||||||
private data class VotePatch(val fingerprint: MethodFingerprint, val voteKind: Vote)
|
private data class VotePatch(val fingerprint: MethodFingerprint, val voteKind: Vote)
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package app.revanced.patches.youtube.layout.hide.floatingmicrophone.annotations
|
package app.revanced.patches.youtube.misc.openlinksdirectly.annotations
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Compatibility
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
import app.revanced.patcher.annotation.Package
|
import app.revanced.patcher.annotation.Package
|
||||||
@@ -10,4 +10,4 @@ import app.revanced.patcher.annotation.Package
|
|||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
@Retention(AnnotationRetention.RUNTIME)
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
internal annotation class HideFloatingMicrophoneButtonCompatibility
|
internal annotation class OpenLinksDirectlyCompatibility
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.openlinksdirectly.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patches.youtube.misc.openlinksdirectly.annotations.OpenLinksDirectlyCompatibility
|
||||||
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
|
@OpenLinksDirectlyCompatibility
|
||||||
|
object OpenLinksDirectlyPrimaryFingerprint : MethodFingerprint(
|
||||||
|
"L", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L"), listOf(
|
||||||
|
Opcode.INVOKE_STATIC,
|
||||||
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
|
Opcode.RETURN_OBJECT,
|
||||||
|
Opcode.CHECK_CAST,
|
||||||
|
Opcode.SGET,
|
||||||
|
Opcode.SGET_OBJECT
|
||||||
|
)
|
||||||
|
)
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.openlinksdirectly.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patches.youtube.misc.openlinksdirectly.annotations.OpenLinksDirectlyCompatibility
|
||||||
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
|
@OpenLinksDirectlyCompatibility
|
||||||
|
object OpenLinksDirectlySecondaryFingerprint : MethodFingerprint(
|
||||||
|
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L"), listOf(
|
||||||
|
Opcode.INVOKE_STATIC, Opcode.MOVE_RESULT_OBJECT
|
||||||
|
), listOf("://")
|
||||||
|
)
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.openlinksdirectly.patch
|
||||||
|
|
||||||
|
import app.revanced.extensions.toErrorResult
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.instruction
|
||||||
|
import app.revanced.patcher.extensions.replaceInstruction
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||||
|
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||||
|
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||||
|
import app.revanced.patches.youtube.misc.openlinksdirectly.annotations.OpenLinksDirectlyCompatibility
|
||||||
|
import app.revanced.patches.youtube.misc.openlinksdirectly.fingerprints.OpenLinksDirectlyPrimaryFingerprint
|
||||||
|
import app.revanced.patches.youtube.misc.openlinksdirectly.fingerprints.OpenLinksDirectlySecondaryFingerprint
|
||||||
|
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||||
|
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@DependsOn([IntegrationsPatch::class, SettingsPatch::class])
|
||||||
|
@Name("open-links-directly")
|
||||||
|
@Description("Skips over redirection URLs to external links.")
|
||||||
|
@OpenLinksDirectlyCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class OpenLinksDirectlyPatch : BytecodePatch(
|
||||||
|
listOf(OpenLinksDirectlyPrimaryFingerprint, OpenLinksDirectlySecondaryFingerprint)
|
||||||
|
) {
|
||||||
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
SettingsPatch.PreferenceScreen.MISC.addPreferences(
|
||||||
|
SwitchPreference(
|
||||||
|
"revanced_uri_redirect",
|
||||||
|
StringResource("revanced_uri_redirect_title", "Bypass URL redirects"),
|
||||||
|
true,
|
||||||
|
StringResource("revanced_uri_redirect_summary_on", "Bypassing URL redirects"),
|
||||||
|
StringResource("revanced_uri_redirect_summary_off", "Following default redirect policy")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
arrayOf(OpenLinksDirectlyPrimaryFingerprint, OpenLinksDirectlySecondaryFingerprint)
|
||||||
|
.map { it.result ?: return it.toErrorResult() }
|
||||||
|
.forEach { result ->
|
||||||
|
result.mutableMethod.apply {
|
||||||
|
val insertIndex = result.scanResult.patternScanResult!!.startIndex
|
||||||
|
val uriRegister = (instruction(insertIndex) as Instruction35c).registerC
|
||||||
|
replaceInstruction(
|
||||||
|
insertIndex,
|
||||||
|
"invoke-static {v$uriRegister}," +
|
||||||
|
"Lapp/revanced/integrations/patches/OpenLinksDirectlyPatch;" +
|
||||||
|
"->" +
|
||||||
|
"parseRedirectUri(Ljava/lang/String;)Landroid/net/Uri;"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,31 +1,16 @@
|
|||||||
package app.revanced.patches.youtube.misc.video.videoid.fingerprint
|
package app.revanced.patches.youtube.misc.video.videoid.fingerprint
|
||||||
|
|
||||||
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 org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@FuzzyPatternScanMethod(2)
|
|
||||||
object VideoIdFingerprint : MethodFingerprint(
|
object VideoIdFingerprint : MethodFingerprint(
|
||||||
returnType = "V",
|
"V",
|
||||||
access = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
AccessFlags.DECLARED_SYNCHRONIZED or AccessFlags.FINAL or AccessFlags.PUBLIC,
|
||||||
parameters = listOf("L"),
|
listOf("L"),
|
||||||
opcodes = listOf(
|
listOf(Opcode.INVOKE_INTERFACE),
|
||||||
Opcode.IF_EQZ,
|
customFingerprint = {
|
||||||
Opcode.INVOKE_VIRTUAL,
|
it.definingClass.endsWith("PlaybackLifecycleMonitor;")
|
||||||
Opcode.MOVE_RESULT_OBJECT,
|
}
|
||||||
Opcode.INVOKE_INTERFACE,
|
|
||||||
Opcode.MOVE_RESULT_OBJECT,
|
|
||||||
Opcode.IF_EQZ,
|
|
||||||
Opcode.IGET_OBJECT,
|
|
||||||
Opcode.INVOKE_VIRTUAL,
|
|
||||||
Opcode.MOVE_RESULT_OBJECT,
|
|
||||||
Opcode.INVOKE_INTERFACE,
|
|
||||||
Opcode.MOVE_RESULT_OBJECT,
|
|
||||||
Opcode.INVOKE_INTERFACE,
|
|
||||||
Opcode.MOVE_RESULT_OBJECT
|
|
||||||
),
|
|
||||||
null,
|
|
||||||
{ it.definingClass.endsWith("SubtitlesOverlayPresenter;") }
|
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package app.revanced.patches.youtube.misc.video.videoid.patch
|
package app.revanced.patches.youtube.misc.video.videoid.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
|
||||||
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
|
||||||
@@ -23,18 +22,17 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
|||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
@DependsOn([IntegrationsPatch::class])
|
@DependsOn([IntegrationsPatch::class])
|
||||||
class VideoIdPatch : BytecodePatch(
|
class VideoIdPatch : BytecodePatch(
|
||||||
listOf(VideoIdFingerprint)
|
listOf(
|
||||||
|
VideoIdFingerprint
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
VideoIdFingerprint.result?.let {
|
with(VideoIdFingerprint.result!!) {
|
||||||
val videoIdRegisterInstructionIndex = it.scanResult.patternScanResult!!.endIndex
|
insertMethod = mutableMethod
|
||||||
|
insertIndex = scanResult.patternScanResult!!.endIndex + 2
|
||||||
|
|
||||||
with(it.mutableMethod) {
|
videoIdRegister = (insertMethod.instruction(insertIndex - 1) as OneRegisterInstruction).registerA
|
||||||
insertMethod = this
|
}
|
||||||
videoIdRegister = (instruction(videoIdRegisterInstructionIndex) as OneRegisterInstruction).registerA
|
|
||||||
insertIndex = videoIdRegisterInstructionIndex + 1
|
|
||||||
}
|
|
||||||
} ?: return VideoIdFingerprint.toErrorResult()
|
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
@@ -51,15 +49,10 @@ class VideoIdPatch : BytecodePatch(
|
|||||||
*/
|
*/
|
||||||
fun injectCall(
|
fun injectCall(
|
||||||
methodDescriptor: String
|
methodDescriptor: String
|
||||||
) {
|
) = insertMethod.addInstructions(
|
||||||
insertMethod.addInstructions(
|
insertIndex, // move-result-object offset
|
||||||
// TODO: The order has been proven to not be required, so remove the logic for keeping order.
|
"invoke-static {v$videoIdRegister}, $methodDescriptor"
|
||||||
// Keep injection calls in the order they're added:
|
)
|
||||||
// Increment index. So if additional injection calls are added, those calls run after this injection call.
|
|
||||||
insertIndex++,
|
|
||||||
"invoke-static {v$videoIdRegister}, $methodDescriptor"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user