Compare commits

..

87 Commits

Author SHA1 Message Date
semantic-release-bot
eef7e87bbf chore(release): 2.24.0 [skip ci]
# [2.24.0](https://github.com/revanced/revanced-patches/compare/v2.23.0...v2.24.0) (2022-07-26)

### Features

* `music-microg-support` patch ([#208](https://github.com/revanced/revanced-patches/issues/208)) ([535f621](535f621f20))
2022-07-26 15:38:02 +00:00
Canny1913
535f621f20 feat: music-microg-support patch (#208)
* Add files via upload

* feat: complete `music-microg-support` patch

* fix: delete unused patch

* oh no

* dedupelicate some stuff and remove nativelib

* Update src/main/kotlin/app/revanced/patches/music/misc/microg/patch/bytecode/MusicMicroGBytecodePatch.kt

style: formatting

Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>

* refactor: remove listOf

* fix: typo

* refactor: switch to using direct pattern

Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>

* refactor: constants

* fix: bump patch version

* refactor: use full brand name

Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-07-26 17:36:17 +02:00
semantic-release-bot
695a0d14ad chore(release): 2.23.0 [skip ci]
# [2.23.0](https://github.com/revanced/revanced-patches/compare/v2.22.2...v2.23.0) (2022-07-26)

### Features

* bump compatibility of YouTube Music patches to v5.16.51 ([#238](https://github.com/revanced/revanced-patches/issues/238)) ([f70e545](f70e54545b))
2022-07-26 15:14:20 +00:00
Lacia~chan
f70e54545b feat: bump compatibility of YouTube Music patches to v5.16.51 (#238) 2022-07-26 17:12:27 +02:00
bogadana
353f036a72 docs: fix readme skipping first patch (#237) 2022-07-26 16:38:14 +02:00
semantic-release-bot
4d305775a0 chore(release): 2.22.2 [skip ci]
## [2.22.2](https://github.com/revanced/revanced-patches/compare/v2.22.1...v2.22.2) (2022-07-26)

### Bug Fixes

* bump youtube version to 17.29.34 ([#236](https://github.com/revanced/revanced-patches/issues/236)) ([d726443](d726443ca0))
2022-07-26 14:08:22 +00:00
Canny1913
d726443ca0 fix: bump youtube version to 17.29.34 (#236) 2022-07-26 16:06:31 +02:00
bogadana
c5046edf8d docs: better structuring (#230) 2022-07-25 20:31:07 +02:00
semantic-release-bot
e15d6afed1 chore(release): 2.22.1 [skip ci]
## [2.22.1](https://github.com/revanced/revanced-patches/compare/v2.22.0...v2.22.1) (2022-07-24)

### Bug Fixes

* remove broken video-quality patch ([f505599](f5055997c7))
2022-07-24 21:47:50 +00:00
Joey Peter
f5055997c7 fix: remove broken video-quality patch 2022-07-24 23:45:53 +02:00
semantic-release-bot
e6f41988dc chore(release): 2.22.0 [skip ci]
# [2.22.0](https://github.com/revanced/revanced-patches/compare/v2.21.3...v2.22.0) (2022-07-24)

### Features

* `default-video-quality` patch ([#141](https://github.com/revanced/revanced-patches/issues/141)) ([c8567d3](c8567d35ef))
2022-07-24 20:30:04 +00:00
Canny1913
c8567d35ef feat: default-video-quality patch (#141) 2022-07-24 22:28:13 +02:00
semantic-release-bot
cea92cacfd chore(release): 2.21.3 [skip ci]
## [2.21.3](https://github.com/revanced/revanced-patches/compare/v2.21.2...v2.21.3) (2022-07-24)

### Bug Fixes

* rename autorepeat-by-default patch to always-autorepeat ([8f83fc1](8f83fc1edf))
2022-07-24 09:48:44 +00:00
Joey Peter
8f83fc1edf fix: rename autorepeat-by-default patch to always-autorepeat 2022-07-24 11:46:18 +02:00
semantic-release-bot
b9e33d0d08 chore(release): 2.21.2 [skip ci]
## [2.21.2](https://github.com/revanced/revanced-patches/compare/v2.21.1...v2.21.2) (2022-07-23)

### Bug Fixes

* bump youtube version to 17.28.34 ([#225](https://github.com/revanced/revanced-patches/issues/225)) ([7df8f6b](7df8f6b42a))
2022-07-23 19:29:51 +00:00
Alberto Ponces
7df8f6b42a fix: bump youtube version to 17.28.34 (#225) 2022-07-23 21:27:50 +02:00
semantic-release-bot
ac117f04df chore(release): 2.21.1 [skip ci]
## [2.21.1](https://github.com/revanced/revanced-patches/compare/v2.21.0...v2.21.1) (2022-07-23)

### Bug Fixes

* add v17.28.34 compatiblity for the `hide-shorts-button` patch ([#224](https://github.com/revanced/revanced-patches/issues/224)) ([d3bb96d](d3bb96d8b3))
2022-07-23 16:50:54 +00:00
Alberto Ponces
d3bb96d8b3 fix: add v17.28.34 compatiblity for the hide-shorts-button patch (#224) 2022-07-23 18:49:03 +02:00
semantic-release-bot
a31e4b4df3 chore(release): 2.21.0 [skip ci]
# [2.21.0](https://github.com/revanced/revanced-patches/compare/v2.20.5...v2.21.0) (2022-07-23)

### Features

* twitter `timeline-ads` patch ([#222](https://github.com/revanced/revanced-patches/issues/222)) ([90144fc](90144fc55a))
2022-07-23 01:36:15 +00:00
oSumAtrIX
90144fc55a feat: twitter timeline-ads patch (#222) 2022-07-23 03:33:36 +02:00
semantic-release-bot
12d1c36a3f chore(release): 2.20.5 [skip ci]
## [2.20.5](https://github.com/revanced/revanced-patches/compare/v2.20.4...v2.20.5) (2022-07-22)

### Bug Fixes

* exclude `swipe-controls` by default due to instability ([a7fce11](a7fce11015))
2022-07-22 20:13:13 +00:00
oSumAtrIX
a7fce11015 fix: exclude swipe-controls by default due to instability 2022-07-22 22:10:26 +02:00
semantic-release-bot
60029da7a3 chore(release): 2.20.4 [skip ci]
## [2.20.4](https://github.com/revanced/revanced-patches/compare/v2.20.3...v2.20.4) (2022-07-21)

### Bug Fixes

* crash when using force-vp9-codec patch ([964b598](964b598ad9))
* use dependency in correct patch ([16d5010](16d50100e7))
2022-07-21 15:16:19 +00:00
TheJeterLP
46a586b2af build: trigger release 2022-07-21 17:13:59 +02:00
semantic-release-bot
8a86034728 chore(release): 2.20.4 [skip ci]
## [2.20.4](https://github.com/revanced/revanced-patches/compare/v2.20.3...v2.20.4) (2022-07-21)

### Bug Fixes

* crash when using force-vp9-codec patch ([964b598](964b598ad9))
* use dependency in correct patch ([16d5010](16d50100e7))
2022-07-21 15:09:38 +00:00
TheJeterLP
ba1abf9319 build: trigger release 2022-07-21 17:07:25 +02:00
semantic-release-bot
82810cca6b chore(release): 2.20.4 [skip ci]
## [2.20.4](https://github.com/revanced/revanced-patches/compare/v2.20.3...v2.20.4) (2022-07-21)

### Bug Fixes

* crash when using force-vp9-codec patch ([964b598](964b598ad9))
* use dependency in correct patch ([16d5010](16d50100e7))
2022-07-21 15:06:16 +00:00
TheJeterLP
964b598ad9 fix: crash when using force-vp9-codec patch 2022-07-21 17:04:30 +02:00
semantic-release-bot
16fbfe555f chore(release): 2.20.4 [skip ci]
## [2.20.4](https://github.com/revanced/revanced-patches/compare/v2.20.3...v2.20.4) (2022-07-21)

### Bug Fixes

* use dependency in correct patch ([16d5010](16d50100e7))
2022-07-21 00:14:24 +00:00
oSumAtrIX
16d50100e7 fix: use dependency in correct patch 2022-07-21 01:35:04 +02:00
semantic-release-bot
2397d6140b chore(release): 2.20.3 [skip ci]
## [2.20.3](https://github.com/revanced/revanced-patches/compare/v2.20.2...v2.20.3) (2022-07-20)

### Bug Fixes

* disable-fullscreen-panels patch not working ([#213](https://github.com/revanced/revanced-patches/issues/213)) ([513276e](513276e950))
2022-07-20 22:20:59 +00:00
TheJeterLP
513276e950 fix: disable-fullscreen-panels patch not working (#213) 2022-07-21 00:19:04 +02:00
TheJeterLP
2aab1a0c66 refactor: cleanup code 2022-07-20 22:58:48 +02:00
semantic-release-bot
cfb5d0908b chore(release): 2.20.2 [skip ci]
## [2.20.2](https://github.com/revanced/revanced-patches/compare/v2.20.1...v2.20.2) (2022-07-20)

### Bug Fixes

* autoplay not working. ([eddf520](eddf520626))
2022-07-20 20:51:45 +00:00
TheJeterLP
5e3eefe5dd build: trigger release 2022-07-20 22:49:33 +02:00
TheJeterLP
6ccee3ef68 Merge branch 'main' of https://github.com/revanced/revanced-patches 2022-07-20 22:47:39 +02:00
TheJeterLP
eddf520626 fix: autoplay not working. 2022-07-20 22:47:27 +02:00
semantic-release-bot
3613fb5409 chore(release): 2.20.1 [skip ci]
## [2.20.1](https://github.com/revanced/revanced-patches/compare/v2.20.0...v2.20.1) (2022-07-20)

### Bug Fixes

* autoplay still enabled when using patch ([97366cd](97366cdd4c))
2022-07-20 20:33:51 +00:00
TheJeterLP
97366cdd4c fix: autoplay still enabled when using patch 2022-07-20 22:31:58 +02:00
oSumAtrIX
ee55cf970e refactor: remove unused strings 2022-07-20 11:49:46 +02:00
semantic-release-bot
ad1ed56a71 chore(release): 2.20.0 [skip ci]
# [2.20.0](https://github.com/revanced/revanced-patches/compare/v2.19.0...v2.20.0) (2022-07-18)

### Features

* `minimize-playback-music` patch ([#200](https://github.com/revanced/revanced-patches/issues/200)) ([13ccea2](13ccea2e7c))
2022-07-18 23:43:01 +00:00
Alberto Ponces
13ccea2e7c feat: minimize-playback-music patch (#200)
* feat: `minimize-playback` - unblocks minimized playback on kids music

* refactor: add missing `;`

* fix: rename to `minimized-playback-music`

Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-07-19 01:40:56 +02:00
semantic-release-bot
02d4ba64d6 chore(release): 2.19.0 [skip ci]
# [2.19.0](https://github.com/revanced/revanced-patches/compare/v2.18.3...v2.19.0) (2022-07-18)

### Features

* `compact-header` patch ([891ac04](891ac04155))
2022-07-18 23:37:20 +00:00
Alberto Ponces
891ac04155 feat: compact-header patch 2022-07-19 01:35:34 +02:00
semantic-release-bot
c70c3de205 chore(release): 2.18.3 [skip ci]
## [2.18.3](https://github.com/revanced/revanced-patches/compare/v2.18.2...v2.18.3) (2022-07-18)

### Bug Fixes

* compatibility of `force-vp9-codec-parent-fingerprint` fingerprint with version `17.27.39` ([92dc97e](92dc97e2bf))
2022-07-18 23:18:30 +00:00
oSumAtrIX
92dc97e2bf fix: compatibility of force-vp9-codec-parent-fingerprint fingerprint with version 17.27.39 2022-07-19 01:16:45 +02:00
oSumAtrIX
cdf4313880 style: uppercase first letter in descriptions 2022-07-19 01:16:45 +02:00
semantic-release-bot
0e0763221c chore(release): 2.18.2 [skip ci]
## [2.18.2](https://github.com/revanced/revanced-patches/compare/v2.18.1...v2.18.2) (2022-07-18)

### Bug Fixes

* make all patches toggleable with settings ([#202](https://github.com/revanced/revanced-patches/issues/202)) ([6b515dd](6b515dd59e))
2022-07-18 21:01:38 +00:00
TheJeterLP
6b515dd59e fix: make all patches toggleable with settings (#202) 2022-07-18 22:59:21 +02:00
semantic-release-bot
4ee40a954f chore(release): 2.18.1 [skip ci]
## [2.18.1](https://github.com/revanced/revanced-patches/compare/v2.18.0...v2.18.1) (2022-07-18)

### Bug Fixes

* `minimized-playback` patch for YouTube Kids videos ([#201](https://github.com/revanced/revanced-patches/issues/201)) ([fb96c6e](fb96c6e4bc))
2022-07-18 14:31:50 +00:00
Alberto Ponces
fb96c6e4bc fix: minimized-playback patch for YouTube Kids videos (#201) 2022-07-18 16:29:51 +02:00
semantic-release-bot
c5156fa7e3 chore(release): 2.18.0 [skip ci]
# [2.18.0](https://github.com/revanced/revanced-patches/compare/v2.17.0...v2.18.0) (2022-07-18)

### Features

* `hide-get-premium` patch ([#195](https://github.com/revanced/revanced-patches/issues/195)) ([8b0622f](8b0622f0bf))
2022-07-18 14:25:54 +00:00
Alberto Ponces
8b0622f0bf feat: hide-get-premium patch (#195)
* feat: `hide-get-premium` patch

* fix: improve `hide-get-premium` fingerprints
2022-07-18 16:24:10 +02:00
semantic-release-bot
1e3eddd3f2 chore(release): 2.17.0 [skip ci]
# [2.17.0](https://github.com/revanced/revanced-patches/compare/v2.16.1...v2.17.0) (2022-07-17)

### Bug Fixes

* check if node has attributes before accessing them ([1d12a17](1d12a17999))

### Features

* `sponsorblock` patch ([#101](https://github.com/revanced/revanced-patches/issues/101)) ([db410e1](db410e1be6)), closes [#89](https://github.com/revanced/revanced-patches/issues/89) [#90](https://github.com/revanced/revanced-patches/issues/90)
2022-07-17 23:52:36 +00:00
oSumAtrIX
1d12a17999 fix: check if node has attributes before accessing them 2022-07-18 01:50:46 +02:00
oSumAtrIX
db410e1be6 feat: sponsorblock patch (#101)
* chore(release): 2.5.1-dev.1 [skip ci]

## [2.5.1-dev.1](https://github.com/revanced/revanced-patches/compare/v2.5.0...v2.5.1-dev.1) (2022-06-30)

### Bug Fixes

* freezing panels when watching video in fullscreen ([#89](https://github.com/revanced/revanced-patches/issues/89)) ([d3e1419](d3e1419d0e))
* invalid version in compatibility annotation ([#90](https://github.com/revanced/revanced-patches/issues/90)) ([c21e177](c21e177ed1))

* feat: migrate to breaking changes of patcher

* chore(release): 2.6.0-dev.1 [skip ci]

# [2.6.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.5.1-dev.1...v2.6.0-dev.1) (2022-07-02)

### Features

* migrate to breaking changes of patcher ([c95c241](c95c241887))

* refactor: add package for fingerprints

* feat: partial `sponsorblock` patch

* feat: add `Name` annotation to `sponsorblock-resource-patch`

* fix: `sponsorblock-resource-patch`

* refactor: remove unused resources

* refactor: remove `locale-config-fix` dependency

* fix: broken fingerprints

* feat: general fixes on `sponsorblock` patch

* feat: more fixes on `sponsorblock` patch

* feat: update `sponsorblock` patch to 17.26.35

* style: use better wording and fix spelling mistakes

* fix: finish `sponsorblock` patch

Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net>
2022-07-18 01:17:03 +02:00
semantic-release-bot
9969d03116 chore(release): 2.16.1 [skip ci]
## [2.16.1](https://github.com/revanced/revanced-patches/compare/v2.16.0...v2.16.1) (2022-07-17)

### Bug Fixes

* bump youtube version to 17.27.39 ([9d1fecc](9d1fecc2f5))
2022-07-17 15:04:31 +00:00
TheJeterLP
9d1fecc2f5 fix: bump youtube version to 17.27.39 2022-07-17 17:02:43 +02:00
semantic-release-bot
63df96d251 chore(release): 2.16.0 [skip ci]
# [2.16.0](https://github.com/revanced/revanced-patches/compare/v2.15.1...v2.16.0) (2022-07-17)

### Features

* `force-vp9-codec` patch ([#157](https://github.com/revanced/revanced-patches/issues/157)) ([d1266a2](d1266a252d))
2022-07-17 14:34:06 +00:00
TheJeterLP
d1266a252d feat: force-vp9-codec patch (#157) 2022-07-17 16:32:29 +02:00
semantic-release-bot
6ec6d16dbc chore(release): 2.15.1 [skip ci]
## [2.15.1](https://github.com/revanced/revanced-patches/compare/v2.15.0...v2.15.1) (2022-07-17)

### Bug Fixes

* `old-quality-layout` patch ([f940e46](f940e4647e))
* references to integrations in `return-youtube-dislike` patch ([9860658](986065858d))
2022-07-17 14:05:02 +00:00
oSumAtrIX
f940e4647e fix: old-quality-layout patch 2022-07-17 16:03:20 +02:00
oSumAtrIX
cc39b77b49 refactor: use .single for resourceMappings 2022-07-17 16:03:20 +02:00
oSumAtrIX
986065858d fix: references to integrations in return-youtube-dislike patch 2022-07-17 16:03:19 +02:00
TheJeterLP
56475e8f38 refactor: rename HDRAutoBrightnessPatch 2022-07-17 15:07:21 +02:00
Palm
2e0ff07d1a style: better patch descriptions (#193) 2022-07-17 12:36:46 +02:00
oSumAtrIX
a654e25000 refactor: simplify use of dependencies field in Dependencies annotations 2022-07-16 17:32:03 +02:00
oSumAtrIX
a8736a8f70 style: naming for ReturnYouTubeDislike patch 2022-07-16 17:31:40 +02:00
semantic-release-bot
b0d6cee4db chore(release): 2.15.0 [skip ci]
# [2.15.0](https://github.com/revanced/revanced-patches/compare/v2.14.1...v2.15.0) (2022-07-16)

### Features

* `return-youtube-dislikes` patch ([#175](https://github.com/revanced/revanced-patches/issues/175)) ([6bbcdf8](6bbcdf8ebd))
2022-07-16 14:52:58 +00:00
j4k0xb
6bbcdf8ebd feat: return-youtube-dislikes patch (#175)
* feat: ryd

* refactor: use ryd patches class

* feat: add video id dependency patch

* fix: compatibility with 17.26.35

* refactor: named param variable, simpler mutableClass access
2022-07-16 16:50:37 +02:00
semantic-release-bot
6fa8289ca6 chore(release): 2.14.1 [skip ci]
## [2.14.1](https://github.com/revanced/revanced-patches/compare/v2.14.0...v2.14.1) (2022-07-15)

### Bug Fixes

* `codecs-unlock` patch and update Music patches to `5.14.53` ([97dbb43](97dbb43caa))
2022-07-15 12:57:47 +00:00
Alberto Ponces
97dbb43caa fix: codecs-unlock patch and update Music patches to 5.14.53 2022-07-15 14:56:10 +02:00
semantic-release-bot
8cda5663ef chore(release): 2.14.0 [skip ci]
# [2.14.0](https://github.com/revanced/revanced-patches/compare/v2.13.6...v2.14.0) (2022-07-15)

### Features

* `music-video-ads` patch ([#172](https://github.com/revanced/revanced-patches/issues/172)) ([5587c91](5587c91899))
2022-07-15 11:20:04 +00:00
Alberto Ponces
5587c91899 feat: music-video-ads patch (#172) 2022-07-15 13:18:25 +02:00
semantic-release-bot
4e6d82a334 chore(release): 2.13.6 [skip ci]
## [2.13.6](https://github.com/revanced/revanced-patches/compare/v2.13.5...v2.13.6) (2022-07-14)
2022-07-14 16:48:23 +00:00
TheJeterLP
be7302689e build: trigger build 2022-07-14 18:46:33 +02:00
TheJeterLP
14d94d6a44 refactor: prepare for settings patch (#168) 2022-07-14 18:42:22 +02:00
genericness
8d598f5b82 style: casing in description (#174) 2022-07-14 18:40:21 +02:00
semantic-release-bot
918782908b chore(release): 2.13.5 [skip ci]
## [2.13.5](https://github.com/revanced/revanced-patches/compare/v2.13.4...v2.13.5) (2022-07-14)

### Bug Fixes

* `swipe-controls` with active engagement panel ([#177](https://github.com/revanced/revanced-patches/issues/177)) ([524fe19](524fe19840))
2022-07-14 15:23:07 +00:00
Chris
524fe19840 fix: swipe-controls with active engagement panel (#177) 2022-07-14 17:21:26 +02:00
semantic-release-bot
18aafb400b chore(release): 2.13.4 [skip ci]
## [2.13.4](https://github.com/revanced/revanced-patches/compare/v2.13.3...v2.13.4) (2022-07-13)

### Bug Fixes

* constrain `old-quality-layout` to older version ([83ac6b3](83ac6b3e34))
2022-07-13 11:38:21 +00:00
oSumAtrIX
83ac6b3e34 fix: constrain old-quality-layout to older version 2022-07-13 13:36:09 +02:00
oSumAtrIX
890ebf04df docs: change size of headings [skip ci] 2022-07-12 01:13:09 +02:00
oSumAtrIX
6838daf1c3 refactor: rename class and move to sub-package 2022-07-12 00:04:22 +02:00
bogadana
08f4e8532c docs: properly handle semantic versions (#156) [skip ci] 2022-07-11 21:08:47 +02:00
semantic-release-bot
30d25a87da chore(release): 2.13.3 [skip ci]
## [2.13.3](https://github.com/revanced/revanced-patches/compare/v2.13.2...v2.13.3) (2022-07-11)

### Bug Fixes

* `exclusive-audio-playback` patch ([#153](https://github.com/revanced/revanced-patches/issues/153)) ([af0523d](af0523df39))
2022-07-11 18:07:27 +00:00
Alberto Ponces
af0523df39 fix: exclusive-audio-playback patch (#153) 2022-07-11 20:05:03 +02:00
151 changed files with 3510 additions and 670 deletions

View File

@@ -3,21 +3,22 @@ name: Bug report
about: Create a bug report on patches
title: 'problem: `some-patch`'
labels: bug
assignees: ''
---
# 🐞 Issue
## 🐞 Issue
<!-- Describe your issue in detail here -->
# ⚙ Reproduce
## ⚙ Reproduce
<!-- Include your environment and steps to reproduce the issue as detailed as possible -->
# 🛠 Solution
## 🛠 Solution
<!-- If applicable, add a possible solution -->
# ⚠ Additional context
## ⚠ Additional context
<!-- Add any other context about the problem here -->

View File

@@ -3,21 +3,22 @@ name: Feature request
about: Suggest a change to some patch. Do not submit suggestions for patches here.
title: 'feat: some feature'
labels: feature-request
assignees: ''
---
# 🐞 Issue
## 🐞 Issue
<!-- Explain here, what the current problem is and why it lead you to request a feature change -->
<!-- Explain here, what the current problem is and why it leads you to request a feature change -->
# ❗ Solution
## ❗ Solution
<!-- Explain how your current issue can be solved -->
# ❓ Motivation
## ❓ Motivation
<!-- Explain why your feature should be considered -->
# ⚠ Additional context
## ⚠ Additional context
<!-- Add any other context or screenshots about the feature request here -->

View File

@@ -1,3 +1,301 @@
# [2.24.0](https://github.com/revanced/revanced-patches/compare/v2.23.0...v2.24.0) (2022-07-26)
### Features
* `music-microg-support` patch ([#208](https://github.com/revanced/revanced-patches/issues/208)) ([50863e9](https://github.com/revanced/revanced-patches/commit/50863e97cc8eba7e1ad6d11b4821baa45fdd29c4))
# [2.23.0](https://github.com/revanced/revanced-patches/compare/v2.22.2...v2.23.0) (2022-07-26)
### Features
* bump compatibility of YouTube Music patches to v5.16.51 ([#238](https://github.com/revanced/revanced-patches/issues/238)) ([4fa2a12](https://github.com/revanced/revanced-patches/commit/4fa2a127d715f953a1e4efacaecbc218209a01f3))
## [2.22.2](https://github.com/revanced/revanced-patches/compare/v2.22.1...v2.22.2) (2022-07-26)
### Bug Fixes
* bump youtube version to 17.29.34 ([#236](https://github.com/revanced/revanced-patches/issues/236)) ([be6494a](https://github.com/revanced/revanced-patches/commit/be6494a80989044cba961dc22fc58ffb2e8591f0))
## [2.22.1](https://github.com/revanced/revanced-patches/compare/v2.22.0...v2.22.1) (2022-07-24)
### Bug Fixes
* remove broken video-quality patch ([e8d516a](https://github.com/revanced/revanced-patches/commit/e8d516af896971a09bb9aca8b00e7b7bb57c3dd9))
# [2.22.0](https://github.com/revanced/revanced-patches/compare/v2.21.3...v2.22.0) (2022-07-24)
### Features
* `default-video-quality` patch ([#141](https://github.com/revanced/revanced-patches/issues/141)) ([609ad7d](https://github.com/revanced/revanced-patches/commit/609ad7dee7e29b2ecc4e95a93e9dab1646b4b050))
# [2.12.0](https://github.com/Canny1913/revanced-patches/compare/v2.11.0...v2.12.0) (2022-07-24)
### Bug Fixes
* `autorepeat-by-default` patch ([#148](https://github.com/Canny1913/revanced-patches/issues/148)) ([fe628ba](https://github.com/Canny1913/revanced-patches/commit/fe628ba909d89ea0bf3d95fe94ca78ef819677da))
* `codecs-unlock` patch and update Music patches to `5.14.53` ([2437d30](https://github.com/Canny1913/revanced-patches/commit/2437d3070f6a630d353619f642cefebd47abee20))
* `exclusive-audio-playback` patch ([#153](https://github.com/Canny1913/revanced-patches/issues/153)) ([9beff95](https://github.com/Canny1913/revanced-patches/commit/9beff9567f1586e5c58690c1f1d2f7f204025ab7))
* `hrd-auto-brightness` ([#152](https://github.com/Canny1913/revanced-patches/issues/152)) ([5f2e9ba](https://github.com/Canny1913/revanced-patches/commit/5f2e9ba30b7432be04bdc9f9f7ec7ac75fdc4b34))
* `minimized-playback` patch for YouTube Kids videos ([#201](https://github.com/Canny1913/revanced-patches/issues/201)) ([31e3b42](https://github.com/Canny1913/revanced-patches/commit/31e3b42c6bbce0d00f049b8a69bafc94900bb3b4))
* `old-quality-layout` patch ([2497425](https://github.com/Canny1913/revanced-patches/commit/2497425c9f11b8b14c861c2f0f34ff47bdbfac53))
* `swipe-controls` with active engagement panel ([#177](https://github.com/Canny1913/revanced-patches/issues/177)) ([000ec6d](https://github.com/Canny1913/revanced-patches/commit/000ec6d8f6ecbb910a06ec852564ee9e5f03dcf8))
* add v17.28.34 compatiblity for the `hide-shorts-button` patch ([#224](https://github.com/Canny1913/revanced-patches/issues/224)) ([76166bb](https://github.com/Canny1913/revanced-patches/commit/76166bb35f940ef661e2802f5bf93ed91f2e2913))
* autoplay not working. ([586eed5](https://github.com/Canny1913/revanced-patches/commit/586eed515fc7ff8e3b1b150b0d34610b39480bb5))
* autoplay still enabled when using patch ([4f96129](https://github.com/Canny1913/revanced-patches/commit/4f961298f6cb6417ee3f3d6f8ac7ce96594ed03b))
* bump youtube version for swipe-controls patch ([ff207a5](https://github.com/Canny1913/revanced-patches/commit/ff207a57af7d3c15a8127f4465e97da23878b0d6))
* bump youtube version to 17.27.39 ([b93401a](https://github.com/Canny1913/revanced-patches/commit/b93401a391c0ed4887dd1376ac253f74f98a8d7e))
* bump youtube version to 17.28.34 ([#225](https://github.com/Canny1913/revanced-patches/issues/225)) ([738cb6a](https://github.com/Canny1913/revanced-patches/commit/738cb6af177e92bbff8c02d6808fe416c0ad2582))
* check if node has attributes before accessing them ([2d2ed87](https://github.com/Canny1913/revanced-patches/commit/2d2ed870dacfe092eb6acbcaae5e51775c611322))
* compatibility of `force-vp9-codec-parent-fingerprint` fingerprint with version `17.27.39` ([523fd86](https://github.com/Canny1913/revanced-patches/commit/523fd8627bc965a724267f725c28fba5e7a25a04))
* constrain `old-quality-layout` to older version ([add7232](https://github.com/Canny1913/revanced-patches/commit/add72326199e90f677b450b553b9d88c0bb4c490))
* crash when using force-vp9-codec patch ([7a35e5c](https://github.com/Canny1913/revanced-patches/commit/7a35e5c985b412d5a84083d1416d3207a40b3e97))
* disable-fullscreen-panels patch not working ([#213](https://github.com/Canny1913/revanced-patches/issues/213)) ([5372105](https://github.com/Canny1913/revanced-patches/commit/5372105e72607f289b779e4c2a3c13f3458842ce))
* display codename for patch names ([10c53f7](https://github.com/Canny1913/revanced-patches/commit/10c53f720df3e70b9d59e8bc3219d56b996f03db))
* exclude `swipe-controls` by default due to instability ([bdeb8e0](https://github.com/Canny1913/revanced-patches/commit/bdeb8e04609a0ca94d9e2921bf7d486b9e229cec))
* incorrect package name in gradle task ([152b2c9](https://github.com/Canny1913/revanced-patches/commit/152b2c90cf102170648fcc168da10f46743bdc63))
* invalid regex ([26bf1d8](https://github.com/Canny1913/revanced-patches/commit/26bf1d818f953abc061126d8b91f17cd9008ba1d))
* listing of wrong fingerprint class ([#147](https://github.com/Canny1913/revanced-patches/issues/147)) ([95c2bbd](https://github.com/Canny1913/revanced-patches/commit/95c2bbdd1deb1d76f1177b48286fa6a3bc9f7663))
* make all patches toggleable with settings ([#202](https://github.com/Canny1913/revanced-patches/issues/202)) ([7e1d82f](https://github.com/Canny1913/revanced-patches/commit/7e1d82f1161237632c3a57f109db6b8903006b33))
* make the patch work w/o settings ([7f0be5c](https://github.com/Canny1913/revanced-patches/commit/7f0be5c08b738d7baeef7ad3e167aab623c2d08e))
* references to integrations in `return-youtube-dislike` patch ([5824c2c](https://github.com/Canny1913/revanced-patches/commit/5824c2cdfb1a2d7b8d68044388e5e0746ef2ca09))
* remove "dependency" ([b93cb9b](https://github.com/Canny1913/revanced-patches/commit/b93cb9b8dd4b78c53bbf0298db0f532a42d46f7d))
* rename autorepeat-by-default patch to always-autorepeat ([3606015](https://github.com/Canny1913/revanced-patches/commit/3606015d715f150cc51fbb29adf3be252b96faab))
* stop using manually entered index ([ed0520d](https://github.com/Canny1913/revanced-patches/commit/ed0520d85c74729d7daabbfbd6cb77ad8cd62f15))
* update patches to `17.26.35` ([#142](https://github.com/Canny1913/revanced-patches/issues/142)) ([b04112c](https://github.com/Canny1913/revanced-patches/commit/b04112c8562a7b95e7555e894b665913094b33eb))
* use dependency in correct patch ([a2a1ee8](https://github.com/Canny1913/revanced-patches/commit/a2a1ee8eb5e059b30fe58c918a80976ef4d7b637))
* wording [skip ci] ([ba64d9e](https://github.com/Canny1913/revanced-patches/commit/ba64d9efc3ee606e9bda30ad7f8017af34b1dc3f))
### Features
* `compact-header` patch ([83753ba](https://github.com/Canny1913/revanced-patches/commit/83753bacf8f56ad16f8abafc02034f1595c12532))
* `default-video-quality` patch ([9d30d37](https://github.com/Canny1913/revanced-patches/commit/9d30d372dd13663564286820f3e7685c0a0cee8a))
* `force-vp9-codec` patch ([#157](https://github.com/Canny1913/revanced-patches/issues/157)) ([07806a1](https://github.com/Canny1913/revanced-patches/commit/07806a16e5368118949e0e476e901987433ad403))
* `hide-get-premium` patch ([#195](https://github.com/Canny1913/revanced-patches/issues/195)) ([639aab4](https://github.com/Canny1913/revanced-patches/commit/639aab411ee514b50840c15c8e9a1a889854403f))
* `minimize-playback-music` patch ([#200](https://github.com/Canny1913/revanced-patches/issues/200)) ([d4fd18b](https://github.com/Canny1913/revanced-patches/commit/d4fd18bc74c92e17cdfb21b627b2f6a8919ff2dc))
* `music-video-ads` patch ([#172](https://github.com/Canny1913/revanced-patches/issues/172)) ([cbb71b5](https://github.com/Canny1913/revanced-patches/commit/cbb71b5faf1386ed31dd9e0387f6cf0509d92d31))
* `return-youtube-dislikes` patch ([#175](https://github.com/Canny1913/revanced-patches/issues/175)) ([18a66d8](https://github.com/Canny1913/revanced-patches/commit/18a66d8454cf6e7cfdd4183631a6870c80d16b90))
* `sponsorblock` patch ([#101](https://github.com/Canny1913/revanced-patches/issues/101)) ([36af4cc](https://github.com/Canny1913/revanced-patches/commit/36af4cc14ff8057c10b99019cb23acc6e5aec3f2)), closes [#89](https://github.com/Canny1913/revanced-patches/issues/89) [#90](https://github.com/Canny1913/revanced-patches/issues/90)
* `swipe-controls` rewrite ([#131](https://github.com/Canny1913/revanced-patches/issues/131)) ([b7dba09](https://github.com/Canny1913/revanced-patches/commit/b7dba09927ba15a9eacb06dcb4bf1f268560c96e))
* 1 line of code ([e2d28bd](https://github.com/Canny1913/revanced-patches/commit/e2d28bd576f74f1792dc959b8ed3064ec6a4cb68))
* add version 17.26.35 ([25cd66c](https://github.com/Canny1913/revanced-patches/commit/25cd66cc6d2cd56a4170c5c69a708011fe7eab1d))
* complete `default-video-quality` patch ([f7e153b](https://github.com/Canny1913/revanced-patches/commit/f7e153bd08b6dfe07591678195bfa6b06606f6a2))
* issue templates ([b82b0aa](https://github.com/Canny1913/revanced-patches/commit/b82b0aad88b7ab9d86f1bcc8e007f6a76a9aa1a5))
* twitter `timeline-ads` patch ([#222](https://github.com/Canny1913/revanced-patches/issues/222)) ([f16e67f](https://github.com/Canny1913/revanced-patches/commit/f16e67fc75c9c3505ff875a216ce7e868022075e))
## [2.21.3](https://github.com/revanced/revanced-patches/compare/v2.21.2...v2.21.3) (2022-07-24)
### Bug Fixes
* rename autorepeat-by-default patch to always-autorepeat ([3606015](https://github.com/revanced/revanced-patches/commit/3606015d715f150cc51fbb29adf3be252b96faab))
## [2.21.2](https://github.com/revanced/revanced-patches/compare/v2.21.1...v2.21.2) (2022-07-23)
### Bug Fixes
* bump youtube version to 17.28.34 ([#225](https://github.com/revanced/revanced-patches/issues/225)) ([738cb6a](https://github.com/revanced/revanced-patches/commit/738cb6af177e92bbff8c02d6808fe416c0ad2582))
## [2.21.1](https://github.com/revanced/revanced-patches/compare/v2.21.0...v2.21.1) (2022-07-23)
### Bug Fixes
* add v17.28.34 compatiblity for the `hide-shorts-button` patch ([#224](https://github.com/revanced/revanced-patches/issues/224)) ([76166bb](https://github.com/revanced/revanced-patches/commit/76166bb35f940ef661e2802f5bf93ed91f2e2913))
# [2.21.0](https://github.com/revanced/revanced-patches/compare/v2.20.5...v2.21.0) (2022-07-23)
### Features
* twitter `timeline-ads` patch ([#222](https://github.com/revanced/revanced-patches/issues/222)) ([f16e67f](https://github.com/revanced/revanced-patches/commit/f16e67fc75c9c3505ff875a216ce7e868022075e))
## [2.20.5](https://github.com/revanced/revanced-patches/compare/v2.20.4...v2.20.5) (2022-07-22)
### Bug Fixes
* exclude `swipe-controls` by default due to instability ([bdeb8e0](https://github.com/revanced/revanced-patches/commit/bdeb8e04609a0ca94d9e2921bf7d486b9e229cec))
## [2.20.4](https://github.com/revanced/revanced-patches/compare/v2.20.3...v2.20.4) (2022-07-21)
### Bug Fixes
* crash when using force-vp9-codec patch ([7a35e5c](https://github.com/revanced/revanced-patches/commit/7a35e5c985b412d5a84083d1416d3207a40b3e97))
* use dependency in correct patch ([a2a1ee8](https://github.com/revanced/revanced-patches/commit/a2a1ee8eb5e059b30fe58c918a80976ef4d7b637))
## [2.20.4](https://github.com/revanced/revanced-patches/compare/v2.20.3...v2.20.4) (2022-07-21)
### Bug Fixes
* crash when using force-vp9-codec patch ([7a35e5c](https://github.com/revanced/revanced-patches/commit/7a35e5c985b412d5a84083d1416d3207a40b3e97))
* use dependency in correct patch ([a2a1ee8](https://github.com/revanced/revanced-patches/commit/a2a1ee8eb5e059b30fe58c918a80976ef4d7b637))
## [2.20.4](https://github.com/revanced/revanced-patches/compare/v2.20.3...v2.20.4) (2022-07-21)
### Bug Fixes
* crash when using force-vp9-codec patch ([7a35e5c](https://github.com/revanced/revanced-patches/commit/7a35e5c985b412d5a84083d1416d3207a40b3e97))
* use dependency in correct patch ([a2a1ee8](https://github.com/revanced/revanced-patches/commit/a2a1ee8eb5e059b30fe58c918a80976ef4d7b637))
## [2.20.4](https://github.com/revanced/revanced-patches/compare/v2.20.3...v2.20.4) (2022-07-21)
### Bug Fixes
* use dependency in correct patch ([a2a1ee8](https://github.com/revanced/revanced-patches/commit/a2a1ee8eb5e059b30fe58c918a80976ef4d7b637))
## [2.20.3](https://github.com/revanced/revanced-patches/compare/v2.20.2...v2.20.3) (2022-07-20)
### Bug Fixes
* disable-fullscreen-panels patch not working ([#213](https://github.com/revanced/revanced-patches/issues/213)) ([5372105](https://github.com/revanced/revanced-patches/commit/5372105e72607f289b779e4c2a3c13f3458842ce))
## [2.20.2](https://github.com/revanced/revanced-patches/compare/v2.20.1...v2.20.2) (2022-07-20)
### Bug Fixes
* autoplay not working. ([586eed5](https://github.com/revanced/revanced-patches/commit/586eed515fc7ff8e3b1b150b0d34610b39480bb5))
## [2.20.1](https://github.com/revanced/revanced-patches/compare/v2.20.0...v2.20.1) (2022-07-20)
### Bug Fixes
* autoplay still enabled when using patch ([4f96129](https://github.com/revanced/revanced-patches/commit/4f961298f6cb6417ee3f3d6f8ac7ce96594ed03b))
# [2.20.0](https://github.com/revanced/revanced-patches/compare/v2.19.0...v2.20.0) (2022-07-18)
### Features
* `minimize-playback-music` patch ([#200](https://github.com/revanced/revanced-patches/issues/200)) ([d4fd18b](https://github.com/revanced/revanced-patches/commit/d4fd18bc74c92e17cdfb21b627b2f6a8919ff2dc))
# [2.19.0](https://github.com/revanced/revanced-patches/compare/v2.18.3...v2.19.0) (2022-07-18)
### Features
* `compact-header` patch ([83753ba](https://github.com/revanced/revanced-patches/commit/83753bacf8f56ad16f8abafc02034f1595c12532))
## [2.18.3](https://github.com/revanced/revanced-patches/compare/v2.18.2...v2.18.3) (2022-07-18)
### Bug Fixes
* compatibility of `force-vp9-codec-parent-fingerprint` fingerprint with version `17.27.39` ([523fd86](https://github.com/revanced/revanced-patches/commit/523fd8627bc965a724267f725c28fba5e7a25a04))
## [2.18.2](https://github.com/revanced/revanced-patches/compare/v2.18.1...v2.18.2) (2022-07-18)
### Bug Fixes
* make all patches toggleable with settings ([#202](https://github.com/revanced/revanced-patches/issues/202)) ([7e1d82f](https://github.com/revanced/revanced-patches/commit/7e1d82f1161237632c3a57f109db6b8903006b33))
## [2.18.1](https://github.com/revanced/revanced-patches/compare/v2.18.0...v2.18.1) (2022-07-18)
### Bug Fixes
* `minimized-playback` patch for YouTube Kids videos ([#201](https://github.com/revanced/revanced-patches/issues/201)) ([31e3b42](https://github.com/revanced/revanced-patches/commit/31e3b42c6bbce0d00f049b8a69bafc94900bb3b4))
# [2.18.0](https://github.com/revanced/revanced-patches/compare/v2.17.0...v2.18.0) (2022-07-18)
### Features
* `hide-get-premium` patch ([#195](https://github.com/revanced/revanced-patches/issues/195)) ([639aab4](https://github.com/revanced/revanced-patches/commit/639aab411ee514b50840c15c8e9a1a889854403f))
# [2.17.0](https://github.com/revanced/revanced-patches/compare/v2.16.1...v2.17.0) (2022-07-17)
### Bug Fixes
* check if node has attributes before accessing them ([2d2ed87](https://github.com/revanced/revanced-patches/commit/2d2ed870dacfe092eb6acbcaae5e51775c611322))
### Features
* `sponsorblock` patch ([#101](https://github.com/revanced/revanced-patches/issues/101)) ([36af4cc](https://github.com/revanced/revanced-patches/commit/36af4cc14ff8057c10b99019cb23acc6e5aec3f2)), closes [#89](https://github.com/revanced/revanced-patches/issues/89) [#90](https://github.com/revanced/revanced-patches/issues/90)
## [2.16.1](https://github.com/revanced/revanced-patches/compare/v2.16.0...v2.16.1) (2022-07-17)
### Bug Fixes
* bump youtube version to 17.27.39 ([b93401a](https://github.com/revanced/revanced-patches/commit/b93401a391c0ed4887dd1376ac253f74f98a8d7e))
# [2.16.0](https://github.com/revanced/revanced-patches/compare/v2.15.1...v2.16.0) (2022-07-17)
### Features
* `force-vp9-codec` patch ([#157](https://github.com/revanced/revanced-patches/issues/157)) ([07806a1](https://github.com/revanced/revanced-patches/commit/07806a16e5368118949e0e476e901987433ad403))
## [2.15.1](https://github.com/revanced/revanced-patches/compare/v2.15.0...v2.15.1) (2022-07-17)
### Bug Fixes
* `old-quality-layout` patch ([2497425](https://github.com/revanced/revanced-patches/commit/2497425c9f11b8b14c861c2f0f34ff47bdbfac53))
* references to integrations in `return-youtube-dislike` patch ([5824c2c](https://github.com/revanced/revanced-patches/commit/5824c2cdfb1a2d7b8d68044388e5e0746ef2ca09))
# [2.15.0](https://github.com/revanced/revanced-patches/compare/v2.14.1...v2.15.0) (2022-07-16)
### Features
* `return-youtube-dislikes` patch ([#175](https://github.com/revanced/revanced-patches/issues/175)) ([18a66d8](https://github.com/revanced/revanced-patches/commit/18a66d8454cf6e7cfdd4183631a6870c80d16b90))
## [2.14.1](https://github.com/revanced/revanced-patches/compare/v2.14.0...v2.14.1) (2022-07-15)
### Bug Fixes
* `codecs-unlock` patch and update Music patches to `5.14.53` ([2437d30](https://github.com/revanced/revanced-patches/commit/2437d3070f6a630d353619f642cefebd47abee20))
# [2.14.0](https://github.com/revanced/revanced-patches/compare/v2.13.6...v2.14.0) (2022-07-15)
### Features
* `music-video-ads` patch ([#172](https://github.com/revanced/revanced-patches/issues/172)) ([cbb71b5](https://github.com/revanced/revanced-patches/commit/cbb71b5faf1386ed31dd9e0387f6cf0509d92d31))
## [2.13.6](https://github.com/revanced/revanced-patches/compare/v2.13.5...v2.13.6) (2022-07-14)
## [2.13.5](https://github.com/revanced/revanced-patches/compare/v2.13.4...v2.13.5) (2022-07-14)
### Bug Fixes
* `swipe-controls` with active engagement panel ([#177](https://github.com/revanced/revanced-patches/issues/177)) ([000ec6d](https://github.com/revanced/revanced-patches/commit/000ec6d8f6ecbb910a06ec852564ee9e5f03dcf8))
## [2.13.4](https://github.com/revanced/revanced-patches/compare/v2.13.3...v2.13.4) (2022-07-13)
### Bug Fixes
* constrain `old-quality-layout` to older version ([add7232](https://github.com/revanced/revanced-patches/commit/add72326199e90f677b450b553b9d88c0bb4c490))
## [2.13.3](https://github.com/revanced/revanced-patches/compare/v2.13.2...v2.13.3) (2022-07-11)
### Bug Fixes
* `exclusive-audio-playback` patch ([#153](https://github.com/revanced/revanced-patches/issues/153)) ([9beff95](https://github.com/revanced/revanced-patches/commit/9beff9567f1586e5c58690c1f1d2f7f204025ab7))
## [2.13.2](https://github.com/revanced/revanced-patches/compare/v2.13.1...v2.13.2) (2022-07-11)

View File

@@ -1,9 +1,7 @@
# ReVanced Patches
# 🧩 ReVanced Patches
🧩 Official patches by ReVanced
Official patches by ReVanced
# List of available patches
## 📜 List of available patches
| 💊 Patch | 📜 Description | 🎯 Target Package | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|:-----------------:|
{{ table }}

View File

@@ -1,36 +1,64 @@
# ReVanced Patches
# 🧩 ReVanced Patches
🧩 Official patches by ReVanced
Official patches by ReVanced
# List of available patches
## 📜 List of available patches
### 📦 `com.twitter.android`
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `timeline-ads` | Removes ads from the Twitter timeline. | all |
</details>
### 📦 `com.google.android.apps.youtube.music`
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `minimized-playback-music` | Enables minimized playback on Kids music. | 5.16.51 |
| `tasteBuilder-remover` | Removes the "Tell us which artists you like" card from the home screen. | 5.16.51 |
| `hide-get-premium` | Removes all "Get Premium" evidences from the avatar menu. | 5.16.51 |
| `compact-header` | Hides the music category bar at the top of the homepage. | 5.16.51 |
| `upgrade-button-remover` | Removes the upgrade tab from the pivot bar. | 5.16.51 |
| `background-play` | Enables playing music in the background. | 5.16.51 |
| `music-microg-support` | Patch to allow YouTube Music ReVanced to run without root and under a different package name. | 5.16.51 |
| `music-video-ads` | Removes ads in the music player. | 5.16.51 |
| `codecs-unlock` | Adds more audio codec options. The new audio codecs usually result in better audio quality. | 5.16.51 |
| `exclusive-audio-playback` | Enables the option to play music without video. | 5.16.51 |
</details>
### 📦 `com.google.android.youtube`
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `swipe-controls` | Adds volume and brightness swipe controls. | 17.29.34 |
| `seekbar-tapping` | Enables tap-to-seek on the seekbar of the video player. | 17.29.34 |
| `minimized-playback` | Enables minimized and background playback. | 17.29.34 |
| `amoled` | Enables pure black theme. | 17.29.34 |
| `disable-create-button` | Hides the create button in the navigation bar. | 17.29.34 |
| `hide-cast-button` | Hides the cast button in the video player. | all |
| `return-youtube-dislike` | Shows the dislike count of videos using the Return YouTube Dislike API. | 17.29.34 |
| `hide-autoplay-button` | Hides the autoplay button in the video player. | 17.29.34 |
| `premium-heading` | Shows premium branding on the home screen. | all |
| `custom-branding` | Changes the YouTube launcher icon to be ReVanced's. | all |
| `disable-fullscreen-panels` | Disables video description and comments panel in fullscreen view. | 17.29.34 |
| `old-quality-layout` | Enables the original quality flyout menu. | 17.29.34 |
| `hide-shorts-button` | Hides the shorts button on the navigation bar. | 17.29.34 |
| `hide-watermark` | Hides creator's watermarks on videos. | 17.29.34 |
| `sponsorblock` | Integrate SponsorBlock. | 17.29.34 |
| `enable-wide-searchbar` | Replaces the search icon with a wide search bar. This will hide the YouTube logo when active. | 17.29.34 |
| `force-vp9-codec` | Forces the VP9 codec for videos. | 17.29.34 |
| `always-autorepeat` | Always repeats the playing video again. | 17.29.34 |
| `microg-support` | Allows YouTube ReVanced to run without root and under a different package name with Vanced MicroG | 17.29.34 |
| `enable-debugging` | Enables app debugging by patching the manifest file. | all |
| `custom-playback-speed` | Adds more video playback speed options. | 17.29.34 |
| `hdr-auto-brightness` | Makes the brightness of HDR videos follow the system default. | 17.29.34 |
| `video-ads` | Removes ads in the video player. | 17.29.34 |
| `general-ads` | Removes general ads. | 17.29.34 |
| `hide-infocard-suggestions` | Hides infocards in videos. | 17.29.34 |
</details>
| 💊 Patch | 📜 Description | 🎯 Target Package | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|:-----------------:|
| `exclusive-audio-playback` | Adds the option to play music without video. | `com.google.android.apps.youtube.music` | 5.03.50 |
| `codecs-unlock` | Enables more audio codecs. Usually results in better audio quality but may depend on song and device. | `com.google.android.apps.youtube.music` | 5.03.50 |
| `background-play` | Enables playing music in the background. | `com.google.android.apps.youtube.music` | 5.03.50 |
| `tasteBuilder-remover` | Removes the "Tell us which artists you like" card from the Home screen. The same functionality can be triggered from the settings anyway. | `com.google.android.apps.youtube.music` | 5.03.50 |
| `upgrade-button-remover` | Removes the upgrade tab from the pivot bar in YouTube music. | `com.google.android.apps.youtube.music` | 5.03.50 |
| `hide-infocard-suggestions` | Hides infocards in videos. | `com.google.android.youtube` | 17.26.35 |
| `video-ads` | Removes ads in the YouTube video player. | `com.google.android.youtube` | 17.26.35 |
| `general-ads` | Removes general ads in bytecode. | `com.google.android.youtube` | 17.26.35 |
| `seekbar-tapping` | Enables tapping on the seekbar of the YouTube player. | `com.google.android.youtube` | 17.26.35 |
| `swipe-controls` | Adds volume and brightness swipe controls. | `com.google.android.youtube` | 17.26.35 |
| `microg-support` | Allows YouTube ReVanced to run without root and under a different package name. | `com.google.android.youtube` | 17.26.35 |
| `hdr-auto-brightness` | Makes the brightness of HDR videos follow the system default. | `com.google.android.youtube` | 17.26.35 |
| `autorepeat-by-default` | Enables auto repeating of videos by default. | `com.google.android.youtube` | 17.26.35 |
| `custom-playback-speed` | Allows to change the default playback speed options. | `com.google.android.youtube` | 17.26.35 |
| `enable-debugging` | Enables app debugging by patching the manifest file. | `com.google.android.youtube` | all |
| `old-quality-layout` | Enables the original quality flyout menu. | `com.google.android.youtube` | 17.26.35 |
| `hide-cast-button` | Hides the cast button. | `com.google.android.youtube` | all |
| `amoled` | Enables pure black theme. | `com.google.android.youtube` | 17.26.35 |
| `hide-autoplay-button` | Disables the autoplay button. | `com.google.android.youtube` | 17.26.35 |
| `minimized-playback` | Enables minimized and background playback. | `com.google.android.youtube` | 17.26.35 |
| `premium-heading` | Shows premium branding on the YouTube home screen. | `com.google.android.youtube` | all |
| `custom-branding` | Changes the branding of YouTube. | `com.google.android.youtube` | all |
| `enable-wide-searchbar` | Replaces the search icon with a wide search bar. This will hide the YouTube logo when active. | `com.google.android.youtube` | 17.26.35 |
| `disable-fullscreen-panels` | Disables comments panel in fullscreen view. | `com.google.android.youtube` | 17.26.35 |
| `hide-shorts-button` | Hides the shorts button. | `com.google.android.youtube` | 17.26.35 |
| `disable-create-button` | Disables the create button. | `com.google.android.youtube` | 17.26.35 |
| `hide-watermark` | Hides the creator's watermark on videos. | `com.google.android.youtube` | 17.26.35 |

View File

@@ -1,2 +1,2 @@
kotlin.code.style = official
version = 2.13.2
version = 2.24.0

View File

@@ -17,6 +17,7 @@ import org.w3c.dom.Node
import java.io.OutputStream
import java.nio.file.Files
// TODO: this method does not make sense here
internal fun MutableMethodImplementation.injectHideCall(
index: Int,
register: Int

View File

@@ -0,0 +1,11 @@
package app.revanced.meta.readme
import app.revanced.patcher.data.Data
import app.revanced.patcher.extensions.PatchExtensions.compatiblePackages
import app.revanced.patcher.patch.Patch
internal fun Class<out Patch<Data>>.getLatestVersion(): SemanticVersion? =
this.compatiblePackages?.first()?.versions?.map { SemanticVersion.fromString(it) }
?.maxWithOrNull(
SemanticVersionComparator
)

View File

@@ -1,38 +1,55 @@
package app.revanced.meta.readme
import app.revanced.patcher.data.Data
import app.revanced.patcher.extensions.PatchExtensions.compatiblePackages
import app.revanced.patcher.extensions.PatchExtensions.description
import app.revanced.patcher.extensions.PatchExtensions.patchName
import app.revanced.patcher.patch.Patch
import app.revanced.patcher.util.patch.implementation.JarPatchBundle
import java.io.File
class Generator {
companion object {
@JvmStatic
fun main(args: Array<String>) {
val buildDir = File("build/libs/")
val buildJar =
buildDir.listFiles()?.first { it.name.startsWith("revanced-patches-") && it.name.endsWith(".jar") }!!
object Generator {
private const val TABLE_HEADER =
"| \uD83D\uDC8A Patch | \uD83D\uDCDC Description | \uD83C\uDFF9 Target Version |\n" +
"|:--------:|:--------------:|:-----------------:|"
val bundle = JarPatchBundle(buildJar.absolutePath).loadPatches()
@JvmStatic
fun main(args: Array<String>) {
val buildDir = File("build/libs/")
val buildJar =
buildDir.listFiles()?.first { it.name.startsWith("revanced-patches-") && it.name.endsWith(".jar") }!!
val patches = StringBuilder()
val bundle = JarPatchBundle(buildJar.absolutePath).loadPatches()
for (patch in bundle) {
val patchName = patch.patchName
val compatiblePackage = patch.compatiblePackages?.first()
val latestVersion = compatiblePackage?.versions?.maxByOrNull { it.replace(".", "").toInt() } ?: "all"
val output = StringBuilder()
patches.appendLine("| `$patchName` | ${patch.description} | `${compatiblePackage?.name}` | $latestVersion |")
val packages = mutableMapOf<String, MutableList<Class<out Patch<Data>>>>()
bundle.map {
val packageName = it.compatiblePackages?.first()?.name!!
if (!packages.contains(packageName)) {
packages[packageName] = mutableListOf()
}
val readMeTemplateFile = File("README-template.md")
val readmeTemplate = Template(readMeTemplateFile.readText())
readmeTemplate.replaceVariable("table", patches.toString())
val readme = File("README.md")
readme.writeText(readmeTemplate.toString())
packages[packageName]?.add(it)
}
for (pkg in packages) {
output.appendLine("### \uD83D\uDCE6 `${pkg.key}`")
output.appendLine("<details>\n")
output.appendLine(TABLE_HEADER)
pkg.value.forEach { output.appendLine("| `${it.patchName}` | ${it.description} | ${it.getLatestVersion() ?: "all"} |") }
output.appendLine("</details>\n")
}
val readMeTemplateFile = File("README-template.md")
val readmeTemplate = Template(readMeTemplateFile.readText())
readmeTemplate.replaceVariable("table", output.toString())
val readme = File("README.md")
readme.writeText(readmeTemplate.toString())
}
}

View File

@@ -0,0 +1,24 @@
package app.revanced.meta.readme
data class SemanticVersion(val major: Int, val minor: Int, val patch: Int) {
companion object {
fun fromString(version: String): SemanticVersion {
var parts = version.split(".")
if (parts.count() != 3) throw IllegalArgumentException("Invalid semantic version")
val versionNumbers = parts.map { it.toInt() }
return SemanticVersion(versionNumbers[0], versionNumbers[1], versionNumbers[2])
}
}
override fun toString(): String = "$major.$minor.$patch"
}
object SemanticVersionComparator : Comparator<SemanticVersion> {
override fun compare(a: SemanticVersion, b: SemanticVersion): Int = when {
a.major != b.major -> a.major - b.major
a.minor != b.minor -> a.minor - b.minor
else -> a.patch - b.patch
}
}

View File

@@ -0,0 +1,13 @@
package app.revanced.patches.music.ad.video.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
)]
)
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class MusicVideoAdsCompatibility

View File

@@ -0,0 +1,39 @@
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.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patches.music.ad.video.annotations.MusicVideoAdsCompatibility
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
@Name("show-video-ads-constructor-fingerprint")
@MatchingMethod(
"Laghd;",
"<init>",
)
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
@MusicVideoAdsCompatibility
@Version("0.0.1")
object ShowMusicVideoAdsConstructorFingerprint : MethodFingerprint(
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L"), listOf(
Opcode.INVOKE_DIRECT,
Opcode.NEW_INSTANCE,
Opcode.INVOKE_DIRECT,
Opcode.IPUT_OBJECT,
Opcode.NEW_INSTANCE,
Opcode.INVOKE_DIRECT,
Opcode.IPUT_OBJECT,
Opcode.NEW_INSTANCE,
Opcode.INVOKE_DIRECT,
Opcode.IPUT_OBJECT,
Opcode.IPUT_OBJECT,
Opcode.IPUT_OBJECT,
Opcode.CONST_4,
Opcode.IPUT_BOOLEAN,
Opcode.RETURN_VOID
)
)

View File

@@ -0,0 +1,26 @@
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.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
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.Opcode
@Name("show-video-ads-method-fingerprint")
@MatchingMethod(
"Laghd;", "d"
)
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
@MusicVideoAdsCompatibility
@Version("0.0.1")
object ShowMusicVideoAdsFingerprint : MethodFingerprint(
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("Z"), listOf(
Opcode.IPUT_BOOLEAN,
Opcode.INVOKE_VIRTUAL,
Opcode.RETURN_VOID
)
)

View File

@@ -0,0 +1,40 @@
package app.revanced.patches.music.ad.video.patch
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.impl.BytecodeData
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.fingerprint.method.utils.MethodFingerprintUtils.resolve
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patches.music.ad.video.annotations.MusicVideoAdsCompatibility
import app.revanced.patches.music.ad.video.fingerprints.ShowMusicVideoAdsConstructorFingerprint
import app.revanced.patches.music.ad.video.fingerprints.ShowMusicVideoAdsFingerprint
@Patch
@Name("music-video-ads")
@Description("Removes ads in the music player.")
@MusicVideoAdsCompatibility
@Version("0.0.1")
class MusicVideoAdsPatch : BytecodePatch(
listOf(
ShowMusicVideoAdsConstructorFingerprint
)
) {
override fun execute(data: BytecodeData): PatchResult {
ShowMusicVideoAdsFingerprint.resolve(data, ShowMusicVideoAdsConstructorFingerprint.result!!.classDef)
val result = ShowMusicVideoAdsFingerprint.result!!
result.mutableMethod.addInstructions(
result.patternScanResult!!.startIndex, """
const/4 p1, 0x0
"""
)
return PatchResultSuccess()
}
}

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.apps.youtube.music", arrayOf("5.03.50")
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
)]
)
@Target(AnnotationTarget.CLASS)

View File

@@ -20,8 +20,9 @@ import org.jf.dexlib2.Opcode
@Version("0.0.1")
object CodecsLockFingerprint : MethodFingerprint(
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L", "L", "L", "L"), listOf(
Opcode.INVOKE_STATIC,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT,
Opcode.CHECK_CAST,
Opcode.INVOKE_DIRECT,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT,
@@ -29,18 +30,11 @@ object CodecsLockFingerprint : MethodFingerprint(
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT,
Opcode.IF_NEZ,
Opcode.SGET,
Opcode.SGET_OBJECT,
Opcode.IGET_OBJECT,
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT_OBJECT,
Opcode.INVOKE_INTERFACE,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT,
Opcode.IF_NEZ,
Opcode.SGET_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT,
Opcode.CHECK_CAST,
Opcode.INVOKE_INTERFACE,
Opcode.INVOKE_DIRECT,
Opcode.RETURN_OBJECT
)

View File

@@ -16,7 +16,7 @@ import app.revanced.patches.music.audio.codecs.fingerprints.CodecsLockFingerprin
@Patch
@Name("codecs-unlock")
@Description("Enables more audio codecs. Usually results in better audio quality but may depend on song and device.")
@Description("Adds more audio codec options. The new audio codecs usually result in better audio quality.")
@CodecsUnlockCompatibility
@Version("0.0.1")
class CodecsUnlockPatch : BytecodePatch(

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.apps.youtube.music", arrayOf("5.03.50")
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
)]
)
@Target(AnnotationTarget.CLASS)

View File

@@ -17,7 +17,7 @@ import app.revanced.patches.music.audio.exclusiveaudio.fingerprints.ExclusiveAud
@Patch
@Name("exclusive-audio-playback")
@Description("Adds the option to play music without video.")
@Description("Enables the option to play music without video.")
@ExclusiveAudioCompatibility
@Version("0.0.1")
class ExclusiveAudioPatch : BytecodePatch(
@@ -26,9 +26,7 @@ class ExclusiveAudioPatch : BytecodePatch(
)
) {
override fun execute(data: BytecodeData): PatchResult {
ExclusiveAudioFingerprint.resolve(data, AudioOnlyEnablerFingerprint.result!!.classDef)
val method = ExclusiveAudioFingerprint.result!!.mutableMethod
val method = AudioOnlyEnablerFingerprint.result!!.mutableMethod
method.replaceInstruction(method.implementation!!.instructions.count() - 1, "const/4 v0, 0x1")
method.addInstruction("return v0")

View File

@@ -0,0 +1,13 @@
package app.revanced.patches.music.layout.compactheader.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
)]
)
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class CompactHeaderCompatibility

View File

@@ -0,0 +1,33 @@
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.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patches.music.layout.compactheader.annotations.CompactHeaderCompatibility
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
@Name("compact-header-constructor-fingerprint")
@MatchingMethod(
"Llcz;", "<init>"
)
@CompactHeaderCompatibility
@Version("0.0.1")
object CompactHeaderConstructorFingerprint : MethodFingerprint(
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L", "L", "L"), listOf(
Opcode.INVOKE_DIRECT,
Opcode.IPUT_OBJECT,
Opcode.IPUT_OBJECT,
Opcode.IPUT_OBJECT,
Opcode.NEW_INSTANCE,
Opcode.INVOKE_DIRECT,
Opcode.IPUT_OBJECT,
Opcode.CONST,
Opcode.CONST_4,
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT_OBJECT,
Opcode.CHECK_CAST
)
)

View File

@@ -0,0 +1,41 @@
package app.revanced.patches.music.layout.compactheader.patch
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.impl.BytecodeData
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patches.music.layout.compactheader.annotations.CompactHeaderCompatibility
import app.revanced.patches.music.layout.compactheader.fingerprints.CompactHeaderConstructorFingerprint
import org.jf.dexlib2.builder.instruction.BuilderInstruction11x
@Patch(false)
@Name("compact-header")
@Description("Hides the music category bar at the top of the homepage.")
@CompactHeaderCompatibility
@Version("0.0.1")
class CompactHeaderPatch : BytecodePatch(
listOf(
CompactHeaderConstructorFingerprint
)
) {
override fun execute(data: BytecodeData): PatchResult {
val result = CompactHeaderConstructorFingerprint.result!!
val method = result.mutableMethod
val insertIndex = result.patternScanResult!!.endIndex
val register = (method.implementation!!.instructions[insertIndex - 1] as BuilderInstruction11x).registerA
method.addInstructions(
insertIndex, """
const/16 v0, 0x8
invoke-virtual {v${register}, v0}, Landroid/view/View;->setVisibility(I)V
"""
)
return PatchResultSuccess()
}
}

View File

@@ -0,0 +1,13 @@
package app.revanced.patches.music.layout.minimizedplayback.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
)]
)
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class MinimizedPlaybackCompatibility

View File

@@ -0,0 +1,36 @@
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.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patches.music.layout.minimizedplayback.annotations.MinimizedPlaybackCompatibility
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
@Name("minimized-playback-manager-fingerprint")
@MatchingMethod(
"Llxw;", "c"
)
@MinimizedPlaybackCompatibility
@Version("0.0.1")
object MinimizedPlaybackManagerFingerprint : MethodFingerprint(
"V",
AccessFlags.PUBLIC or AccessFlags.FINAL,
listOf("I", "L", "Z"),
listOf(
Opcode.IGET,
Opcode.IF_NE,
Opcode.IGET_OBJECT,
Opcode.IF_NE,
Opcode.IGET_BOOLEAN,
Opcode.IF_EQ,
Opcode.GOTO,
Opcode.RETURN_VOID,
Opcode.SGET_OBJECT,
Opcode.CONST_4,
Opcode.IF_NE,
Opcode.IPUT_BOOLEAN,
)
)

View File

@@ -0,0 +1,38 @@
package app.revanced.patches.music.layout.minimizedplayback.patch
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.impl.BytecodeData
import app.revanced.patcher.data.impl.toMethodWalker
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.music.layout.minimizedplayback.annotations.MinimizedPlaybackCompatibility
import app.revanced.patches.music.layout.minimizedplayback.fingerprints.MinimizedPlaybackManagerFingerprint
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
import org.jf.dexlib2.iface.reference.MethodReference
@Patch
@Name("minimized-playback-music")
@Description("Enables minimized playback on Kids music.")
@MinimizedPlaybackCompatibility
@Version("0.0.1")
class MinimizedPlaybackPatch : BytecodePatch(
listOf(
MinimizedPlaybackManagerFingerprint
)
) {
override fun execute(data: BytecodeData): PatchResult {
MinimizedPlaybackManagerFingerprint.result!!.mutableMethod.addInstructions(
0, """
return-void
"""
)
return PatchResultSuccess()
}
}

View File

@@ -0,0 +1,14 @@
package app.revanced.patches.music.layout.premium.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
)]
)
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class HideGetPremiumCompatibility

View File

@@ -0,0 +1,26 @@
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.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patches.music.layout.premium.annotations.HideGetPremiumCompatibility
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
@Name("hide-get-premium-fingerprint")
@MatchingMethod(
"Lktn;", "k"
)
@HideGetPremiumCompatibility
@Version("0.0.1")
object HideGetPremiumFingerprint : MethodFingerprint(
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(), listOf(
Opcode.IF_NEZ,
Opcode.CONST_16,
Opcode.GOTO,
Opcode.NOP,
Opcode.INVOKE_VIRTUAL
)
)

View File

@@ -0,0 +1,29 @@
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.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patches.music.layout.premium.annotations.HideGetPremiumCompatibility
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
@Name("hide-get-premium-parent-fingerprint")
@MatchingMethod(
"Lktn;", "k"
)
@HideGetPremiumCompatibility
@Version("0.0.1")
object HideGetPremiumParentFingerprint : MethodFingerprint(
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(), listOf(
Opcode.IGET_BOOLEAN,
Opcode.CONST_4,
Opcode.IF_EQZ,
Opcode.IGET_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT,
Opcode.INVOKE_STATIC
),
listOf("FEmusic_history"),
)

View File

@@ -0,0 +1,49 @@
package app.revanced.patches.music.layout.premium.patch
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.impl.BytecodeData
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.extensions.replaceInstruction
import app.revanced.patcher.fingerprint.method.utils.MethodFingerprintUtils.resolve
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patches.music.layout.premium.annotations.HideGetPremiumCompatibility
import app.revanced.patches.music.layout.premium.fingerprints.HideGetPremiumFingerprint
import app.revanced.patches.music.layout.premium.fingerprints.HideGetPremiumParentFingerprint
@Patch
@Name("hide-get-premium")
@Description("Removes all \"Get Premium\" evidences from the avatar menu.")
@HideGetPremiumCompatibility
@Version("0.0.1")
class HideGetPremiumPatch : BytecodePatch(
listOf(
HideGetPremiumParentFingerprint
)
) {
override fun execute(data: BytecodeData): PatchResult {
val parentResult = HideGetPremiumParentFingerprint.result!!
HideGetPremiumFingerprint.resolve(data, parentResult.classDef)
val parentMethod = parentResult.mutableMethod
parentMethod.replaceInstruction(
parentResult.patternScanResult!!.startIndex, """
const/4 v1, 0x0
"""
)
val result = HideGetPremiumFingerprint.result!!
val method = result.mutableMethod
method.addInstructions(
result.patternScanResult!!.startIndex, """
const/16 v0, 0x8
"""
)
return PatchResultSuccess()
}
}

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.apps.youtube.music", arrayOf("5.03.50")
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
)]
)
@Target(AnnotationTarget.CLASS)

View File

@@ -15,7 +15,7 @@ import org.jf.dexlib2.iface.instruction.formats.Instruction22c
@Patch
@Name("tasteBuilder-remover")
@Description("Removes the \"Tell us which artists you like\" card from the Home screen. The same functionality can be triggered from the settings anyway.")
@Description("Removes the \"Tell us which artists you like\" card from the home screen.")
@RemoveTasteBuilderCompatibility
@Version("0.0.1")
class RemoveTasteBuilderPatch : BytecodePatch(

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.apps.youtube.music", arrayOf("5.03.50")
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
)]
)
@Target(AnnotationTarget.CLASS)

View File

@@ -20,7 +20,7 @@ import org.jf.dexlib2.iface.instruction.formats.Instruction35c
@Patch
@Name("upgrade-button-remover")
@Description("Removes the upgrade tab from the pivot bar in YouTube music.")
@Description("Removes the upgrade tab from the pivot bar.")
@RemoveUpgradeButtonCompatibility
@Version("0.0.1")
class RemoveUpgradeButtonPatch : BytecodePatch(

View File

@@ -0,0 +1,13 @@
package app.revanced.patches.music.misc.microg.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
)]
)
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class MusicMicroGPatchCompatibility

View File

@@ -0,0 +1,21 @@
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.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patches.music.misc.microg.annotations.MusicMicroGPatchCompatibility
import org.jf.dexlib2.AccessFlags
@Name("google-play-utility-fingerprint")
@MatchingMethod(
"Lnuv;", "b"
)
@DirectPatternScanMethod
@MusicMicroGPatchCompatibility
@Version("0.0.1")
object GooglePlayUtilityFingerprint : MethodFingerprint(
"I", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L", "I"), null, listOf("This should never happen.", "MetadataValueReader", "GooglePlayServicesUtil", "com.android.vending", "android.hardware.type.embedded")
)

View File

@@ -0,0 +1,19 @@
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.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patches.music.misc.microg.annotations.MusicMicroGPatchCompatibility
@Name("google-play-prime-fingerprint")
@MatchingMethod(
"Lrwi;", "a"
)
@DirectPatternScanMethod
@MusicMicroGPatchCompatibility
@Version("0.0.1")
object PrimeFingerprint : MethodFingerprint(
null, null, null, null, listOf("com.google.android.GoogleCamera", "com.android.vending")
)

View File

@@ -0,0 +1,21 @@
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.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patches.music.misc.microg.annotations.MusicMicroGPatchCompatibility
import org.jf.dexlib2.AccessFlags
@Name("google-play-service-checker-fingerprint")
@MatchingMethod(
"Lnuv;", "d"
)
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
@MusicMicroGPatchCompatibility
@Version("0.0.1")
object ServiceCheckFingerprint : MethodFingerprint(
"V", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L", "I"), null, listOf("Google Play Services not available")
)

View File

@@ -0,0 +1,160 @@
package app.revanced.patches.music.misc.microg.patch.bytecode
import app.revanced.extensions.equalsAny
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.impl.BytecodeData
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.extensions.replaceInstruction
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.util.proxy.mutableTypes.MutableClass
import app.revanced.patches.music.misc.microg.annotations.MusicMicroGPatchCompatibility
import app.revanced.patches.music.misc.microg.patch.resource.MusicMicroGResourcePatch
import app.revanced.patches.youtube.misc.microg.patch.resource.enum.StringReplaceMode
import app.revanced.patches.music.misc.microg.shared.Constants.BASE_MICROG_PACKAGE_NAME
import app.revanced.patches.music.misc.microg.shared.Constants.REVANCED_MUSIC_PACKAGE_NAME
import app.revanced.patches.music.misc.microg.fingerprints.*
import org.jf.dexlib2.Opcode
import org.jf.dexlib2.builder.MutableMethodImplementation
import org.jf.dexlib2.builder.instruction.BuilderInstruction21c
import org.jf.dexlib2.iface.instruction.formats.Instruction21c
import org.jf.dexlib2.iface.reference.StringReference
import org.jf.dexlib2.immutable.reference.ImmutableStringReference
@Patch
@Dependencies([MusicMicroGResourcePatch::class])
@Name("music-microg-support")
@Description("Patch to allow YouTube Music ReVanced to run without root and under a different package name.")
@MusicMicroGPatchCompatibility
@Version("0.0.1")
class MusicMicroGBytecodePatch : BytecodePatch(
listOf(
ServiceCheckFingerprint,
GooglePlayUtilityFingerprint,
PrimeFingerprint,
)
) {
override fun execute(data: BytecodeData): PatchResult {
disablePlayServiceChecks()
data.classes.forEach { classDef ->
var proxiedClass: MutableClass? = null
classDef.methods.forEach methodLoop@{ method ->
val implementation = method.implementation ?: return@methodLoop
var proxiedImplementation: MutableMethodImplementation? = null
implementation.instructions.forEachIndexed { i, instruction ->
if (instruction.opcode != Opcode.CONST_STRING) return@forEachIndexed
val stringValue = ((instruction as Instruction21c).reference as StringReference).string
val replaceMode = if (stringValue.equalsAny(
"com.google.android.gms",
"com.google.android.gms.chimera",
"com.google.android.c2dm.intent.REGISTER",
"com.google.android.c2dm.permission.SEND",
"com.google.iid.TOKEN_REQUEST",
"com.google",
"com.google.android.gms.chimera.GmsIntentOperationService",
"com.google.android.gms.phenotype.internal.IPhenotypeCallbacks",
"com.google.android.gms.phenotype.internal.IPhenotypeService",
"com.google.android.gms.phenotype.service.START",
"com.google.android.gms.phenotype.PACKAGE_NAME",
"com.google.android.gms.phenotype.UPDATE",
"com.google.android.gms.phenotype",
"com.google.android.gms.auth.accounts",
"com.google.android.c2dm.intent.REGISTRATION",
"com.google.android.gsf.action.GET_GLS",
"com.google.android.gsf.login",
"content://com.google.settings/partner",
"content://com.google.android.gms.phenotype/",
"content://com.google.android.gsf.gservices",
"content://com.google.android.gsf.gservices/prefix",
"com.google.android.c2dm.intent.RECEIVE"
)
) {
StringReplaceMode.REPLACE_WITH_MICROG
} else if (stringValue.equalsAny(
"com.google.android.apps.youtube.music.SuggestionsProvider", "com.google.android.apps.youtube.music.fileprovider"
)
) {
StringReplaceMode.REPLACE_WITH_REVANCED
} else {
StringReplaceMode.DO_NOT_REPLACE
}
if (replaceMode != StringReplaceMode.DO_NOT_REPLACE) {
if (proxiedClass == null) {
proxiedClass = data.proxy(classDef).resolve()
}
if (proxiedImplementation == null) {
proxiedImplementation = proxiedClass!!.methods.first {
it.name == method.name && it.parameterTypes.containsAll(method.parameterTypes)
}.implementation!!
}
val newString = if (replaceMode == StringReplaceMode.REPLACE_WITH_REVANCED) stringValue.replace(
"com.google.android.apps.youtube.music", REVANCED_MUSIC_PACKAGE_NAME
)
else stringValue.replace("com.google", BASE_MICROG_PACKAGE_NAME)
proxiedImplementation!!.replaceInstruction(
i, BuilderInstruction21c(
Opcode.CONST_STRING, instruction.registerA, ImmutableStringReference(newString)
)
)
}
}
}
}
return PatchResultSuccess()
}
private fun disablePlayServiceChecks() {
listOf(
ServiceCheckFingerprint,
GooglePlayUtilityFingerprint,
).forEach { fingerprint ->
val result = fingerprint.result!!
val stringInstructions = when (result.method.returnType.first()) {
'V' -> "return-void"
'I' -> """
const/4 v0, 0x0
return v0
"""
else -> throw Exception("This case should never happen.")
}
result.mutableMethod.addInstructions(
0, stringInstructions
)
}
val primeMethod = PrimeFingerprint.result!!.mutableMethod
val implementation = primeMethod.implementation!!
var register = 2
val index = implementation.instructions.indexOfFirst {
if (it.opcode != Opcode.CONST_STRING) return@indexOfFirst false
val instructionString = ((it as Instruction21c).reference as StringReference).string
if (instructionString != "com.google.android.apps.youtube.music") return@indexOfFirst false
register = it.registerA
return@indexOfFirst true
}
primeMethod.replaceInstruction(
index, "const-string v$register, \"$REVANCED_MUSIC_PACKAGE_NAME\""
)
}
}

View File

@@ -0,0 +1,44 @@
package app.revanced.patches.music.misc.microg.patch.resource
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.impl.ResourceData
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.impl.ResourcePatch
import app.revanced.patches.music.misc.microg.annotations.MusicMicroGPatchCompatibility
import app.revanced.patches.music.misc.microg.shared.Constants.BASE_MICROG_PACKAGE_NAME
import app.revanced.patches.music.misc.microg.shared.Constants.REVANCED_MUSIC_APP_NAME
import app.revanced.patches.music.misc.microg.shared.Constants.REVANCED_MUSIC_PACKAGE_NAME
@Name("music-microg-resource-patch")
@Description("Resource patch to allow YouTube Music ReVanced to run without root and under a different package name.")
@MusicMicroGPatchCompatibility
@Version("0.0.1")
class MusicMicroGResourcePatch : ResourcePatch() {
override fun execute(data: ResourceData): PatchResult {
val manifest = data["AndroidManifest.xml"].readText()
data["AndroidManifest.xml"].writeText(
manifest.replace(
"package=\"com.google.android.apps.youtube.music", "package=\"$REVANCED_MUSIC_PACKAGE_NAME"
).replace(
"android:label=\"@string/app_name", "android:label=\"$REVANCED_MUSIC_APP_NAME"
).replace(
"android:label=\"@string/app_launcher_name", "android:label=\"$REVANCED_MUSIC_APP_NAME"
).replace(
"android:authorities=\"com.google.android.apps.youtube.music", "android:authorities=\"$REVANCED_MUSIC_PACKAGE_NAME"
).replace(
"com.google.android.apps.youtube.music.permission.C2D_MESSAGE", "$REVANCED_MUSIC_PACKAGE_NAME.permission.C2D_MESSAGE"
).replace(
"com.google.android.c2dm", "$BASE_MICROG_PACKAGE_NAME.android.c2dm"
).replace(
"</queries>", "<package android:name=\"$BASE_MICROG_PACKAGE_NAME.android.gms\"/></queries>"
)
)
return PatchResultSuccess()
}
}

View File

@@ -0,0 +1,7 @@
package app.revanced.patches.music.misc.microg.shared
object Constants {
internal const val BASE_MICROG_PACKAGE_NAME = "com.mgoogle"
internal const val REVANCED_MUSIC_APP_NAME = "YouTube Music ReVanced"
internal const val REVANCED_MUSIC_PACKAGE_NAME = "app.revanced.android.apps.youtube.music"
}

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.apps.youtube.music", arrayOf("5.03.50")
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
)]
)
@Target(AnnotationTarget.CLASS)

View File

@@ -0,0 +1,13 @@
package app.revanced.patches.twitter.ad.timeline.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.twitter.android", arrayOf()
)]
)
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class TimelineAdsCompatibility

View File

@@ -0,0 +1,26 @@
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.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.twitter.ad.timeline.annotations.TimelineAdsCompatibility
import org.jf.dexlib2.Opcode
@Name("timeline-tweet-json-parser-fingerprint")
@MatchingMethod("LJsonTimelineTweet\$\$JsonObjectMapper;", "parseField")
@TimelineAdsCompatibility
@Version("0.0.1")
object TimelineTweetJsonParserFingerprint : MethodFingerprint(
null, null, null, listOf(
Opcode.IPUT_OBJECT,
Opcode.GOTO,
Opcode.SGET_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT,
Opcode.CHECK_CAST,
Opcode.IPUT_OBJECT,
Opcode.RETURN_VOID,
), listOf("tweetPromotedMetadata", "promotedMetadata", "hasModeratedReplies", "conversationAnnotation"),
{ methodDef -> methodDef.name == "parseField" }
)

View File

@@ -0,0 +1,77 @@
package app.revanced.patches.twitter.ad.timeline.patch
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.impl.BytecodeData
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.MethodFingerprintResult
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.twitter.ad.timeline.annotations.TimelineAdsCompatibility
import app.revanced.patches.twitter.ad.timeline.fingerprints.TimelineTweetJsonParserFingerprint
import org.jf.dexlib2.Opcode
import org.jf.dexlib2.builder.BuilderInstruction
import org.jf.dexlib2.builder.instruction.BuilderInstruction22c
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
import org.jf.dexlib2.iface.reference.FieldReference
import org.jf.dexlib2.iface.reference.StringReference
@Patch
@Name("timeline-ads")
@Description("Removes ads from the Twitter timeline.")
@TimelineAdsCompatibility
@Version("0.0.1")
class TimelineAdsPatch : BytecodePatch(
listOf(TimelineTweetJsonParserFingerprint)
) {
override fun execute(data: BytecodeData): PatchResult {
if (removePromotedAds())
return PatchResultError("The instruction for the tweet id field could not be found")
return PatchResultSuccess()
}
private fun removePromotedAds(): Boolean {
val (parserFingerprintResult, parserMethod, instructions) = TimelineTweetJsonParserFingerprint.unwrap()
// Anchor index
val tweetIdFieldInstructionIndex = instructions.indexOfFirst { instruction ->
if (instruction.opcode.ordinal != Opcode.CONST_STRING.ordinal) return@indexOfFirst false
if (((instruction as? ReferenceInstruction)?.reference as StringReference).string != "tweetSocialProof") return@indexOfFirst false
// Use the above conditions as an anchor to find the index for the instruction with the field we need
return@indexOfFirst true
} - 2 // This is where the instruction with the field is located
// Reference to the tweetId field for of the timeline tweet
val tweetIdFieldReference =
(parserMethod.instruction(tweetIdFieldInstructionIndex) as? BuilderInstruction22c)?.reference as? FieldReference
?: return true
// Set the tweetId field to null
// This will cause twitter to not show the promoted ads, because we set it to null, when the tweet is promoted
parserFingerprintResult.mutableMethod.addInstructions(
parserFingerprintResult.patternScanResult!!.startIndex + 1,
"""
const/4 v2, 0x0
iput-object v2, p0, Lcom/twitter/model/json/timeline/urt/JsonTimelineTweet;->${tweetIdFieldReference.name}:Ljava/lang/String;
"""
)
return false
}
private fun MethodFingerprint.unwrap(): Triple<MethodFingerprintResult, MutableMethod, MutableList<BuilderInstruction>> {
val parserFingerprintResult = this.result!!
val parserMethod = parserFingerprintResult.mutableMethod
val instructions = parserMethod.implementation!!.instructions
return Triple(parserFingerprintResult, parserMethod, instructions)
}
}

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35")
"com.google.android.youtube", arrayOf("17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34")
)]
)
@Target(AnnotationTarget.CLASS)

View File

@@ -38,11 +38,9 @@ import org.jf.dexlib2.iface.reference.StringReference
import org.jf.dexlib2.immutable.reference.ImmutableMethodReference
@Patch
@Dependencies(
dependencies = [ResourceIdMappingProviderResourcePatch::class, IntegrationsPatch::class]
)
@Dependencies([ResourceIdMappingProviderResourcePatch::class, IntegrationsPatch::class])
@Name("general-ads")
@Description("Removes general ads in bytecode.")
@Description("Removes general ads.")
@GeneralAdsCompatibility
@Version("0.0.1")
class GeneralBytecodeAdsPatch : BytecodePatch() {
@@ -60,7 +58,7 @@ class GeneralBytecodeAdsPatch : BytecodePatch() {
"promoted_video_item_land",
"promoted_video_item_full_bleed",
).map { name ->
ResourceIdMappingProviderResourcePatch.resourceMappings.first { it.name == name }.id
ResourceIdMappingProviderResourcePatch.resourceMappings.single { it.name == name }.id
}
private val stringReferences = arrayOf(
@@ -129,6 +127,7 @@ class GeneralBytecodeAdsPatch : BytecodePatch() {
if (mutableMethod == null) mutableMethod =
mutableClass!!.findMutableMethodOf(method)
//ToDo: Add Settings toggle for whatever this is
mutableMethod!!.implementation!!.removeInstruction(removeIndex)
}
@@ -188,6 +187,7 @@ class GeneralBytecodeAdsPatch : BytecodePatch() {
// return the method
val insertIndex = 1 // after super constructor
//ToDo: Add setting here
mutableMethod!!.implementation!!.addInstruction(
insertIndex, BuilderInstruction10x(Opcode.RETURN_VOID)
)

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.25.34", "17.26.35")
"com.google.android.youtube", arrayOf("17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34")
)]
)
@Target(AnnotationTarget.CLASS)

View File

@@ -4,24 +4,22 @@ import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.impl.BytecodeData
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.extensions.removeInstruction
import app.revanced.patcher.extensions.replaceInstruction
import app.revanced.patcher.fingerprint.method.utils.MethodFingerprintUtils.resolve
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patches.youtube.ad.infocardsuggestions.annotations.HideInfocardSuggestionsCompatibility
import app.revanced.patches.youtube.ad.infocardsuggestions.fingerprints.HideInfocardSuggestionsFingerprint
import app.revanced.patches.youtube.ad.infocardsuggestions.fingerprints.HideInfocardSuggestionsParentFingerprint
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import org.jf.dexlib2.builder.instruction.BuilderInstruction35c
import org.jf.dexlib2.iface.instruction.FiveRegisterInstruction
@Patch
@Dependencies(dependencies = [IntegrationsPatch::class])
@Dependencies([IntegrationsPatch::class])
@Name("hide-infocard-suggestions")
@Description("Hides infocards in videos.")
@HideInfocardSuggestionsCompatibility
@@ -45,17 +43,10 @@ class HideInfocardSuggestionsPatch : BytecodePatch(
?: return PatchResultError("Implementation not found.")
val index = implementation.instructions.indexOfFirst { ((it as? BuilderInstruction35c)?.reference.toString() == "Landroid/view/View;->setVisibility(I)V") }
val register = "v" + (implementation.instructions.get(index) as FiveRegisterInstruction).registerD
method.removeInstruction(index)
method.addInstructions(
index, """
invoke-static {}, Lapp/revanced/integrations/patches/HideInfoCardSuggestionsPatch;->hideInfoCardSuggestions()I
move-result $register
invoke-virtual {p1, $register}, Landroid/view/View;->setVisibility(I)V
"""
)
method.replaceInstruction(index, """
invoke-static {p1}, Lapp/revanced/integrations/patches/HideInfoCardSuggestionsPatch;->hideInfoCardSuggestions(Landroid/view/View;)V
""")
return PatchResultSuccess()
}

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35")
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34")
)]
)
@Target(AnnotationTarget.CLASS)

View File

@@ -17,9 +17,9 @@ import app.revanced.patches.youtube.ad.video.fingerprints.ShowVideoAdsFingerprin
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
@Patch
@Dependencies(dependencies = [IntegrationsPatch::class])
@Dependencies([IntegrationsPatch::class])
@Name("video-ads")
@Description("Removes ads in the YouTube video player.")
@Description("Removes ads in the video player.")
@VideoAdsCompatibility
@Version("0.0.1")
class VideoAdsPatch : BytecodePatch(

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35")
"com.google.android.youtube", arrayOf("17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34")
)]
)
@Target(AnnotationTarget.CLASS)

View File

@@ -22,9 +22,9 @@ import org.jf.dexlib2.iface.instruction.formats.Instruction11n
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
@Patch
@Dependencies(dependencies = [IntegrationsPatch::class])
@Dependencies([IntegrationsPatch::class])
@Name("seekbar-tapping")
@Description("Enables tapping on the seekbar of the YouTube player.")
@Description("Enables tap-to-seek on the seekbar of the video player.")
@SeekbarTappingCompatibility
@Version("0.0.1")
class EnableSeekbarTappingPatch : BytecodePatch(

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.24.34", "17.25.34", "17.26.35")
"com.google.android.youtube", arrayOf("17.24.34", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34")
)]
)
@Target(AnnotationTarget.CLASS)

View File

@@ -1,4 +1,4 @@
package app.revanced.patches.youtube.interaction.swipecontrols.patch
package app.revanced.patches.youtube.interaction.swipecontrols.patch.bytecode
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
@@ -12,22 +12,25 @@ import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patches.youtube.interaction.swipecontrols.annotation.SwipeControlsCompatibility
import app.revanced.patches.youtube.interaction.swipecontrols.fingerprints.WatchWhileOnStartFingerprint
import app.revanced.patches.youtube.interaction.swipecontrols.patch.resource.SwipeControlsResourcePatch
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.playeroverlay.patch.PlayerOverlaysHookPatch
import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch
@Patch
@Patch(include = false)
@Name("swipe-controls")
@Description("Adds volume and brightness swipe controls.")
@SwipeControlsCompatibility
@Version("0.0.2")
@Dependencies(
dependencies = [
[
IntegrationsPatch::class,
PlayerTypeHookPatch::class,
SwipeControlsResourcesPatch::class
PlayerOverlaysHookPatch::class,
SwipeControlsResourcePatch::class
]
)
class SwipeControlsPatch : BytecodePatch(
class SwipeControlsBytecodePatch : BytecodePatch(
listOf(
WatchWhileOnStartFingerprint
)

View File

@@ -1,4 +1,4 @@
package app.revanced.patches.youtube.interaction.swipecontrols.patch
package app.revanced.patches.youtube.interaction.swipecontrols.patch.resource
import app.revanced.extensions.injectResources
import app.revanced.patcher.annotation.Name
@@ -12,7 +12,7 @@ import app.revanced.patches.youtube.interaction.swipecontrols.annotation.SwipeCo
@Name("swipe-controls-resource-patch")
@SwipeControlsCompatibility
@Version("0.0.1")
class SwipeControlsResourcesPatch : ResourcePatch() {
class SwipeControlsResourcePatch : ResourcePatch() {
override fun execute(data: ResourceData): PatchResult {
val resourcesDir = "swipecontrols"

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35")
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34")
)]
)
@Target(AnnotationTarget.CLASS)

View File

@@ -15,11 +15,7 @@ import org.w3c.dom.Element
import java.io.File
@Patch
@Dependencies(
dependencies = [
FixLocaleConfigErrorPatch::class
]
)
@Dependencies([FixLocaleConfigErrorPatch::class])
@Name("amoled")
@Description("Enables pure black theme.")
@AmoledCompatibility

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.25.34", "17.26.35")
"com.google.android.youtube", arrayOf("17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34")
)]
)
@Target(AnnotationTarget.CLASS)

View File

@@ -4,23 +4,26 @@ import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.impl.BytecodeData
import app.revanced.patcher.extensions.removeInstructions
import app.revanced.patcher.extensions.replaceInstructions
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.extensions.removeInstruction
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.youtube.layout.autoplaybutton.annotations.AutoplayButtonCompatibility
import app.revanced.patches.youtube.layout.autoplaybutton.fingerprints.AutonavInformerFingerprint
import app.revanced.patches.youtube.layout.autoplaybutton.fingerprints.LayoutConstructorFingerprint
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.mapping.patch.ResourceIdMappingProviderResourcePatch
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
@Patch
@Dependencies(dependencies = [ResourceIdMappingProviderResourcePatch::class])
@Dependencies([ResourceIdMappingProviderResourcePatch::class, IntegrationsPatch::class])
@Name("hide-autoplay-button")
@Description("Disables the autoplay button.")
@Description("Hides the autoplay button in the video player.")
@AutoplayButtonCompatibility
@Version("0.0.1")
class HideAutoplayButton : BytecodePatch(
@@ -32,30 +35,54 @@ class HideAutoplayButton : BytecodePatch(
val layoutGenMethod = LayoutConstructorFingerprint.result!!.mutableMethod
val autonavToggle =
ResourceIdMappingProviderResourcePatch.resourceMappings.first { it.type == "id" && it.name == "autonav_toggle" }
ResourceIdMappingProviderResourcePatch.resourceMappings.single { it.type == "id" && it.name == "autonav_toggle" }
val autonavPreviewStub =
ResourceIdMappingProviderResourcePatch.resourceMappings.first { it.type == "id" && it.name == "autonav_preview_stub" }
ResourceIdMappingProviderResourcePatch.resourceMappings.single { it.type == "id" && it.name == "autonav_preview_stub" }
val instructions = layoutGenMethod.implementation!!.instructions
val autonavToggleConstIndex =
layoutGenMethod.implementation!!.instructions.indexOfFirst { (it as? WideLiteralInstruction)?.wideLiteral == autonavToggle.id }
instructions.indexOfFirst { (it as? WideLiteralInstruction)?.wideLiteral == autonavToggle.id } + 4
val autonavPreviewStubConstIndex =
layoutGenMethod.implementation!!.instructions.indexOfFirst { (it as? WideLiteralInstruction)?.wideLiteral == autonavPreviewStub.id }
instructions.indexOfFirst { (it as? WideLiteralInstruction)?.wideLiteral == autonavPreviewStub.id } + 4
//remove adding autoplay button to the layout
layoutGenMethod.removeInstructions(autonavToggleConstIndex, 5)
layoutGenMethod.removeInstructions(autonavPreviewStubConstIndex, 5)
injectIfBranch(layoutGenMethod, autonavToggleConstIndex)
injectIfBranch(layoutGenMethod, autonavPreviewStubConstIndex)
val autonavInformerMethod = AutonavInformerFingerprint.result!!.mutableMethod
//force disable autoplay since it's hard to do without the button
autonavInformerMethod.replaceInstructions(
0,
"""
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()
}
private fun injectIfBranch(method: MutableMethod, index: Int) {
val instructions = method.implementation!!.instructions
val insn = (instructions.get(index) as? Instruction35c)!!
val methodToCall = insn.reference.toString()
//remove the invoke-virtual because we want to put it in an if-statement
method.removeInstruction(index)
method.addInstructions(
index, """
invoke-static {}, Lapp/revanced/integrations/patches/HideAutoplayButtonPatch;->isButtonShown()Z
move-result v11
if-eqz v11, :hidebutton
invoke-virtual {v${insn.registerC}, v${insn.registerD}, v${insn.registerE}}, $methodToCall
:hidebutton
nop
"""
)
}
}

View File

@@ -17,11 +17,9 @@ import java.nio.file.StandardCopyOption
import kotlin.io.path.exists
@Patch
@Dependencies(
dependencies = [FixLocaleConfigErrorPatch::class]
)
@Dependencies([FixLocaleConfigErrorPatch::class])
@Name("premium-heading")
@Description("Shows premium branding on the YouTube home screen.")
@Description("Shows premium branding on the home screen.")
@PremiumHeadingCompatibility
@Version("0.0.1")
class PremiumHeadingPatch : ResourcePatch() {
@@ -34,7 +32,7 @@ class PremiumHeadingPatch : ResourcePatch() {
arrayOf("xxxhdpi", "xxhdpi", "xhdpi", "hdpi", "mdpi").forEach { size ->
val headingDirectory = resDirectory.resolve("drawable-$size")
modes.forEach {mode ->
modes.forEach { mode ->
val fromPath = headingDirectory.resolve("${original}_$mode.png").toPath()
val toPath = headingDirectory.resolve("${replacement}_$mode.png").toPath()

View File

@@ -15,11 +15,9 @@ import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatc
import java.nio.file.Files
@Patch
@Dependencies(
dependencies = [FixLocaleConfigErrorPatch::class]
)
@Dependencies([FixLocaleConfigErrorPatch::class])
@Name("custom-branding")
@Description("Changes the branding of YouTube.")
@Description("Changes the YouTube launcher icon to be ReVanced's.")
@CustomBrandingCompatibility
@Version("0.0.1")
class CustomBrandingPatch : ResourcePatch() {

View File

@@ -14,9 +14,9 @@ import app.revanced.patches.youtube.layout.castbutton.annotations.CastButtonComp
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
@Patch
@Dependencies(dependencies = [IntegrationsPatch::class])
@Dependencies([IntegrationsPatch::class])
@Name("hide-cast-button")
@Description("Hides the cast button.")
@Description("Hides the cast button in the video player.")
@CastButtonCompatibility
@Version("0.0.1")
class HideCastButtonPatch : BytecodePatch() {

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35")
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34")
)]
)
@Target(AnnotationTarget.CLASS)

View File

@@ -22,9 +22,9 @@ import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
import org.jf.dexlib2.iface.reference.MethodReference
@Patch
@Dependencies(dependencies = [IntegrationsPatch::class, ResourceIdMappingProviderResourcePatch::class])
@Dependencies([IntegrationsPatch::class, ResourceIdMappingProviderResourcePatch::class])
@Name("disable-create-button")
@Description("Disables the create button.")
@Description("Hides the create button in the navigation bar.")
@CreateButtonCompatibility
@Version("0.0.1")
class CreateButtonRemoverPatch : BytecodePatch(
@@ -39,7 +39,7 @@ class CreateButtonRemoverPatch : BytecodePatch(
val implementation = result.mutableMethod.implementation!!
val imageOnlyLayout =
ResourceIdMappingProviderResourcePatch.resourceMappings.first { it.type == "layout" && it.name == "image_only_tab" }
ResourceIdMappingProviderResourcePatch.resourceMappings.single { it.type == "layout" && it.name == "image_only_tab" }
val imageOnlyLayoutConstIndex =
implementation.instructions.indexOfFirst { (it as? WideLiteralInstruction)?.wideLiteral == imageOnlyLayout.id }

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35")
"com.google.android.youtube", arrayOf("17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34")
)]
)
@Target(AnnotationTarget.CLASS)

View File

@@ -2,7 +2,7 @@ package app.revanced.patches.youtube.layout.fullscreenpanels.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.shorts.button.annotations.ShortsButtonCompatibility
@@ -12,21 +12,14 @@ import org.jf.dexlib2.Opcode
@MatchingMethod(
"LFullscreenEngagementPanelOverlay;", "e"
)
@FuzzyPatternScanMethod(2)
@DirectPatternScanMethod
@ShortsButtonCompatibility
@Version("0.0.1")
object FullscreenViewAdderFingerprint : MethodFingerprint(
null,
null,
listOf("L", "L"),
listOf(
Opcode.GOTO,
Opcode.IGET_BOOLEAN,
Opcode.IF_EQ,
Opcode.GOTO,
Opcode.CONST_4,
Opcode.INVOKE_VIRTUAL,
),
null,
{ it.definingClass.endsWith("FullscreenEngagementPanelOverlay;") }
listOf(
Opcode.IGET_BOOLEAN
)
)

View File

@@ -0,0 +1,32 @@
package app.revanced.patches.youtube.layout.fullscreenpanels.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.shorts.button.annotations.ShortsButtonCompatibility
import org.jf.dexlib2.Opcode
@Name("fullscreen-view-adder-parent-fingerprint")
@MatchingMethod(
"LFullscreenEngagementPanelOverlay;", "e"
)
@DirectPatternScanMethod
@ShortsButtonCompatibility
@Version("0.0.1")
object FullscreenViewAdderParentFingerprint : MethodFingerprint(
null,
null,
listOf("L", "L"),
listOf(
Opcode.GOTO,
Opcode.IGET_BOOLEAN,
Opcode.IF_EQ,
Opcode.GOTO,
Opcode.CONST_4,
Opcode.INVOKE_VIRTUAL,
),
null,
{ it.definingClass.endsWith("FullscreenEngagementPanelOverlay;") }
)

View File

@@ -4,47 +4,48 @@ import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.impl.BytecodeData
import app.revanced.patcher.extensions.addInstruction
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.extensions.removeInstruction
import app.revanced.patcher.fingerprint.method.utils.MethodFingerprintUtils.resolve
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patches.youtube.layout.fullscreenpanels.annotations.FullscreenPanelsCompatibility
import app.revanced.patches.youtube.layout.fullscreenpanels.fingerprints.FullscreenViewAdderFingerprint
import org.jf.dexlib2.Opcode
import org.jf.dexlib2.iface.instruction.FiveRegisterInstruction
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
import org.jf.dexlib2.iface.reference.MethodReference
import app.revanced.patches.youtube.layout.fullscreenpanels.fingerprints.FullscreenViewAdderParentFingerprint
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
@Patch
@Name("disable-fullscreen-panels")
@Description("Disables comments panel in fullscreen view.")
@Dependencies([IntegrationsPatch::class])
@Description("Disables video description and comments panel in fullscreen view.")
@FullscreenPanelsCompatibility
@Version("0.0.1")
class FullscreenPanelsRemovalPatch : BytecodePatch(
class FullscreenPanelsRemoverPatch : BytecodePatch(
listOf(
FullscreenViewAdderFingerprint
FullscreenViewAdderParentFingerprint
)
) {
override fun execute(data: BytecodeData): PatchResult {
val method = FullscreenViewAdderFingerprint.result?.mutableMethod!!
val implementation = method.implementation!!
val parentResult = FullscreenViewAdderParentFingerprint.result!!
FullscreenViewAdderFingerprint.resolve(data, parentResult.method, parentResult.classDef)
val result = FullscreenViewAdderParentFingerprint.result
?: return PatchResultError("Fingerprint not resolved!")
val (visibilityCallIndex, visibilityCall) =
implementation.instructions.withIndex()
.first { ((it.value as? ReferenceInstruction)?.reference as? MethodReference)?.name == ("setVisibility") }
val method = result.mutableMethod
val gotoIndex =
implementation.instructions.subList(0, visibilityCallIndex).indexOfLast { it.opcode == Opcode.GOTO }
val ifIndex = result.patternScanResult!!.startIndex + 2
//force the if
method.removeInstruction(gotoIndex)
val visibilityIntRegister = (visibilityCall as FiveRegisterInstruction).registerD
//set the visibility to GONE
method.addInstruction(visibilityCallIndex - 1, "const/16 v$visibilityIntRegister, 0x8")
method.removeInstruction(ifIndex)
method.addInstructions(
ifIndex, """
invoke-static {}, Lapp/revanced/integrations/patches/FullscreenPanelsRemoverPatch;->getFullscreenPanelsVisibility()I
move-result p1
"""
)
return PatchResultSuccess()
}

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35")
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34")
)]
)
@Target(AnnotationTarget.CLASS)

View File

@@ -0,0 +1,34 @@
package app.revanced.patches.youtube.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.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.minimizedplayback.annotations.MinimizedPlaybackCompatibility
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
@Name("minimized-playback-kids-fingerprint")
@MatchingMethod(
"LMinimizedPlaybackPolicyController;", "k"
)
@MinimizedPlaybackCompatibility
@Version("0.0.1")
object MinimizedPlaybackKidsFingerprint : MethodFingerprint(
"V",
AccessFlags.PUBLIC or AccessFlags.FINAL,
listOf("I", "L", "L"),
listOf(
Opcode.IF_EQZ,
Opcode.SGET_OBJECT,
Opcode.IF_NE,
Opcode.CONST_4,
Opcode.IPUT_BOOLEAN,
Opcode.IF_EQZ,
Opcode.IGET,
Opcode.INVOKE_STATIC
),
null,
{ it.definingClass.endsWith("MinimizedPlaybackPolicyController;") }
)

View File

@@ -7,7 +7,6 @@ import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.minimizedplayback.annotations.MinimizedPlaybackCompatibility
import app.revanced.patches.youtube.misc.mapping.patch.ResourceIdMappingProviderResourcePatch
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction

View File

@@ -8,13 +8,15 @@ import app.revanced.patcher.data.impl.toMethodWalker
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.youtube.layout.minimizedplayback.annotations.MinimizedPlaybackCompatibility
import app.revanced.patches.youtube.layout.minimizedplayback.fingerprints.MinimizedPlaybackKidsFingerprint
import app.revanced.patches.youtube.layout.minimizedplayback.fingerprints.MinimizedPlaybackManagerFingerprint
import app.revanced.patches.youtube.layout.minimizedplayback.fingerprints.MinimizedPlaybackSettingsFingerprint
import app.revanced.patches.youtube.misc.mapping.patch.ResourceIdMappingProviderResourcePatch
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
import org.jf.dexlib2.iface.reference.MethodReference
@@ -22,11 +24,12 @@ import org.jf.dexlib2.iface.reference.MethodReference
@Patch
@Name("minimized-playback")
@Description("Enables minimized and background playback.")
@Dependencies([IntegrationsPatch::class])
@MinimizedPlaybackCompatibility
@Version("0.0.1")
class MinimizedPlaybackPatch : BytecodePatch(
listOf(
MinimizedPlaybackManagerFingerprint, MinimizedPlaybackSettingsFingerprint
MinimizedPlaybackKidsFingerprint, MinimizedPlaybackManagerFingerprint, MinimizedPlaybackSettingsFingerprint
)
) {
override fun execute(data: BytecodeData): PatchResult {
@@ -34,7 +37,8 @@ class MinimizedPlaybackPatch : BytecodePatch(
// we return the method at the beginning instead
MinimizedPlaybackManagerFingerprint.result!!.mutableMethod.addInstructions(
0, """
const/4 v0, 0x1
invoke-static {}, Lapp/revanced/integrations/patches/MinimizedPlaybackPatch;->isMinimizedPlaybackEnabled()Z
move-result v0
return v0
"""
)
@@ -49,11 +53,23 @@ class MinimizedPlaybackPatch : BytecodePatch(
settingsBooleanMethod.addInstructions(
0, """
const/4 v0, 0x1
invoke-static {}, Lapp/revanced/integrations/patches/MinimizedPlaybackPatch;->isMinimizedPlaybackEnabled()Z
move-result v0
return v0
"""
)
MinimizedPlaybackKidsFingerprint.result!!.mutableMethod.addInstructions(
0, """
invoke-static {}, Lapp/revanced/integrations/patches/MinimizedPlaybackPatch;->isMinimizedPlaybackEnabled()Z
move-result v0
if-eqz v0, :enable
return-void
:enable
nop
"""
)
return PatchResultSuccess()
}
}

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35")
"com.google.android.youtube", arrayOf("17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34")
)]
)
@Target(AnnotationTarget.CLASS)

View File

@@ -1,50 +0,0 @@
package app.revanced.patches.youtube.layout.oldqualitylayout.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patches.youtube.layout.oldqualitylayout.annotations.OldQualityLayoutCompatibility
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
@Name("old-quality-parent-method-fingerprint")
@MatchingMethod(
"Libh", "<init>"
)
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
@OldQualityLayoutCompatibility
@Version("0.0.1")
object OldQualityParentFingerprint : MethodFingerprint(
"V",
AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
listOf("L", "L", "L", "L", "L", "L", "L"),
listOf(
Opcode.INVOKE_DIRECT,
Opcode.IPUT_OBJECT,
Opcode.IPUT_OBJECT,
Opcode.IPUT_OBJECT,
Opcode.IPUT_OBJECT,
Opcode.IPUT_OBJECT,
Opcode.IPUT_OBJECT,
Opcode.IPUT_OBJECT,
Opcode.SGET_OBJECT,
Opcode.IPUT_OBJECT,
Opcode.SGET_OBJECT,
Opcode.IPUT_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT,
Opcode.IGET_OBJECT,
Opcode.IF_NEZ,
Opcode.SGET_OBJECT,
Opcode.IGET_OBJECT,
Opcode.IF_NEZ,
Opcode.SGET_OBJECT,
Opcode.IGET_BOOLEAN,
Opcode.CONST_4,
Opcode.CONST_4,
Opcode.CONST_4,
)
)

View File

@@ -3,27 +3,37 @@ package app.revanced.patches.youtube.layout.oldqualitylayout.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.oldqualitylayout.annotations.OldQualityLayoutCompatibility
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
@Name("old-quality-fingerprint")
@MatchingMethod(definingClass = "Libh")
@FuzzyPatternScanMethod(2)
@Name("quality-menu-view-inflate-fingerprint")
@MatchingMethod("Lkhp;", "K")
@OldQualityLayoutCompatibility
@Version("0.0.1")
object OldQualityFingerprint : MethodFingerprint(
"L", AccessFlags.FINAL or AccessFlags.PRIVATE, listOf("Z"), listOf(
object QualityMenuViewInflateFingerprint : MethodFingerprint(
"L", AccessFlags.FINAL or AccessFlags.PUBLIC, listOf("L", "L", "L"), listOf(
Opcode.INVOKE_SUPER,
Opcode.CONST,
Opcode.CONST_4,
Opcode.INVOKE_VIRTUAL,
Opcode.IGET_OBJECT,
Opcode.IGET_OBJECT,
Opcode.MOVE_RESULT_OBJECT,
Opcode.CONST,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT,
Opcode.CONST_16,
Opcode.INVOKE_VIRTUAL,
Opcode.CONST,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT,
Opcode.CHECK_CAST,
Opcode.CONST,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT,
Opcode.IGET_OBJECT,
Opcode.GOTO,
Opcode.IGET_OBJECT,
Opcode.CONST_STRING,
)
)

View File

@@ -4,49 +4,41 @@ import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.impl.BytecodeData
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.fingerprint.method.utils.MethodFingerprintUtils.resolve
import app.revanced.patcher.extensions.addInstruction
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patches.youtube.layout.oldqualitylayout.annotations.OldQualityLayoutCompatibility
import app.revanced.patches.youtube.layout.oldqualitylayout.fingerprints.OldQualityFingerprint
import app.revanced.patches.youtube.layout.oldqualitylayout.fingerprints.OldQualityParentFingerprint
import app.revanced.patches.youtube.layout.oldqualitylayout.fingerprints.QualityMenuViewInflateFingerprint
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import org.jf.dexlib2.Opcode
import org.jf.dexlib2.builder.instruction.BuilderInstruction21t
import org.jf.dexlib2.iface.instruction.FiveRegisterInstruction
@Patch
@Dependencies(dependencies = [IntegrationsPatch::class])
@Dependencies([IntegrationsPatch::class])
@Name("old-quality-layout")
@Description("Enables the original quality flyout menu.")
@OldQualityLayoutCompatibility
@Version("0.0.1")
class OldQualityLayoutPatch : BytecodePatch(
listOf(
OldQualityParentFingerprint
)
listOf(QualityMenuViewInflateFingerprint)
) {
override fun execute(data: BytecodeData): PatchResult {
OldQualityFingerprint.resolve(data, OldQualityParentFingerprint.result!!.classDef)
val result = OldQualityFingerprint.result
?: return PatchResultError("Required parent method could not be found.")
val inflateFingerprintResult = QualityMenuViewInflateFingerprint.result!!
val method = inflateFingerprintResult.mutableMethod
val instructions = method.implementation!!.instructions
val implementation = result.mutableMethod.implementation!!
// at this index the listener is added to the list view
val listenerInvokeRegister = instructions.size - 1 - 1
// if useOldStyleQualitySettings == true, jump over all instructions
val jmpInstruction = BuilderInstruction21t(
Opcode.IF_NEZ, 0, implementation.instructions[result.patternScanResult!!.endIndex].location.labels.first()
)
implementation.addInstruction(5, jmpInstruction)
result.mutableMethod.addInstructions(
0, """
invoke-static { }, Lapp/revanced/integrations/patches/OldStyleQualityPatch;->useOldStyleQualitySettings()Z
move-result v0
"""
// get the register which stores the quality menu list view
val onItemClickViewRegister = (instructions[listenerInvokeRegister] as FiveRegisterInstruction).registerC
// insert the integrations method
method.addInstruction(
listenerInvokeRegister, // insert the integrations instructions right before the listener
"invoke-static { v$onItemClickViewRegister }, Lapp/revanced/integrations/patches/OldQualityLayoutPatch;->showOldQualityMenu(Landroid/widget/ListView;)V"
)
return PatchResultSuccess()

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35")
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34")
)]
)
@Target(AnnotationTarget.CLASS)

View File

@@ -13,7 +13,7 @@ import app.revanced.patches.youtube.layout.reels.fingerprints.HideReelsFingerpri
//@Patch TODO: this is currently in the general-bytecode-ads patch due to the integrations having a preference for including reels or not. Move it here.
@Name("hide-reels")
@Description("Hides reels on the page.")
@Description("Hides reels on the home page.")
@HideReelsCompatibility
@Version("0.0.1")
class HideReelsPatch : BytecodePatch(

View File

@@ -0,0 +1,13 @@
package app.revanced.patches.youtube.layout.returnyoutubedislike.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.14.35", "17.26.35", "17.27.39", "17.28.34", "17.29.34")
)]
)
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class ReturnYouTubeDislikeCompatibility

View File

@@ -0,0 +1,25 @@
package app.revanced.patches.youtube.layout.returnyoutubedislike.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.returnyoutubedislike.annotations.ReturnYouTubeDislikeCompatibility
import org.jf.dexlib2.AccessFlags
@Name("dislike-fingerprint")
@MatchingMethod(
"Luqs;", "<init>"
)
@FuzzyPatternScanMethod(2)
@ReturnYouTubeDislikeCompatibility
@Version("0.0.2")
object DislikeFingerprint : MethodFingerprint(
"V",
AccessFlags.PROTECTED or AccessFlags.CONSTRUCTOR,
null,
null,
listOf("like/dislike")
)

View File

@@ -0,0 +1,25 @@
package app.revanced.patches.youtube.layout.returnyoutubedislike.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.returnyoutubedislike.annotations.ReturnYouTubeDislikeCompatibility
import org.jf.dexlib2.AccessFlags
@Name("like-fingerprint")
@MatchingMethod(
"Luqt;", "<init>"
)
@FuzzyPatternScanMethod(2)
@ReturnYouTubeDislikeCompatibility
@Version("0.0.2")
object LikeFingerprint : MethodFingerprint(
"V",
AccessFlags.PROTECTED or AccessFlags.CONSTRUCTOR,
null,
null,
listOf("like/like")
)

View File

@@ -0,0 +1,25 @@
package app.revanced.patches.youtube.layout.returnyoutubedislike.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.returnyoutubedislike.annotations.ReturnYouTubeDislikeCompatibility
import org.jf.dexlib2.AccessFlags
@Name("remove-like-fingerprint")
@MatchingMethod(
"Luqw;", "<init>"
)
@FuzzyPatternScanMethod(2)
@ReturnYouTubeDislikeCompatibility
@Version("0.0.2")
object RemoveLikeFingerprint : MethodFingerprint(
"V",
AccessFlags.PROTECTED or AccessFlags.CONSTRUCTOR,
null,
null,
listOf("like/removelike")
)

View File

@@ -0,0 +1,23 @@
package app.revanced.patches.youtube.layout.returnyoutubedislike.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.returnyoutubedislike.annotations.ReturnYouTubeDislikeCompatibility
@Name("text-component-spec-parent-fingerprint")
@MatchingMethod(
"Lnvy;", "e"
)
@DirectPatternScanMethod
@ReturnYouTubeDislikeCompatibility
@Version("0.0.1")
object TextComponentSpecParentFingerprint : MethodFingerprint(
null,
null,
null,
null,
listOf("TextComponentSpec: No converter for extension: ")
)

View File

@@ -0,0 +1,79 @@
package app.revanced.patches.youtube.layout.returnyoutubedislike.patch
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.impl.BytecodeData
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patches.youtube.layout.returnyoutubedislike.annotations.ReturnYouTubeDislikeCompatibility
import app.revanced.patches.youtube.layout.returnyoutubedislike.fingerprints.TextComponentSpecParentFingerprint
import app.revanced.patches.youtube.layout.returnyoutubedislike.fingerprints.DislikeFingerprint
import app.revanced.patches.youtube.layout.returnyoutubedislike.fingerprints.LikeFingerprint
import app.revanced.patches.youtube.layout.returnyoutubedislike.fingerprints.RemoveLikeFingerprint
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.videoid.patch.VideoIdPatch
@Patch
@Dependencies([IntegrationsPatch::class, VideoIdPatch::class])
@Name("return-youtube-dislike")
@Description("Shows the dislike count of videos using the Return YouTube Dislike API.")
@ReturnYouTubeDislikeCompatibility
@Version("0.0.1")
class ReturnYouTubeDislikePatch : BytecodePatch(
listOf(
TextComponentSpecParentFingerprint, LikeFingerprint, DislikeFingerprint, RemoveLikeFingerprint
)
) {
override fun execute(data: BytecodeData): PatchResult {
LikeFingerprint.result!!.mutableMethod.addInstructions(
0,
"""
const/4 v0, 1
invoke-static {v0}, Lapp/revanced/integrations/patches/ReturnYouTubeDislikePatch;->sendVote(I)V
"""
)
DislikeFingerprint.result!!.mutableMethod.addInstructions(
0,
"""
const/4 v0, -1
invoke-static {v0}, Lapp/revanced/integrations/patches/ReturnYouTubeDislikePatch;->sendVote(I)V
"""
)
RemoveLikeFingerprint.result!!.mutableMethod.addInstructions(
0,
"""
const/4 v0, 0
invoke-static {v0}, Lapp/revanced/integrations/patches/ReturnYouTubeDislikePatch;->sendVote(I)V
"""
)
VideoIdPatch.injectCall("Lapp/revanced/integrations/patches/ReturnYouTubeDislikePatch;->newVideoLoaded(Ljava/lang/String;)V")
val parentResult = TextComponentSpecParentFingerprint.result!!
val createComponentMethod = parentResult.mutableClass.methods.find { method ->
method.parameters.size >= 19 && method.parameterTypes.takeLast(4)
.all { param -> param == "Ljava/util/concurrent/atomic/AtomicReference;" }
}
?: return PatchResultError("TextComponentSpec.createComponent not found")
val conversionContextParam = 5
val textRefParam = createComponentMethod.parameters.size - 2
createComponentMethod.addInstructions(
0,
"""
move-object/from16 v0, p$conversionContextParam
move-object/from16 v1, p$textRefParam
invoke-static {v0, v1}, Lapp/revanced/integrations/patches/ReturnYouTubeDislikePatch;->onComponentCreated(Ljava/lang/Object;Ljava/util/concurrent/atomic/AtomicReference;)V
"""
)
return PatchResultSuccess()
}
}

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35")
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34")
)]
)
@Target(AnnotationTarget.CLASS)

View File

@@ -3,7 +3,6 @@ package app.revanced.patches.youtube.layout.shorts.button.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.shorts.button.annotations.ShortsButtonCompatibility
@@ -14,7 +13,6 @@ import org.jf.dexlib2.Opcode
@MatchingMethod(
"Lknw;", "z"
)
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
@ShortsButtonCompatibility
@Version("0.0.1")
object PivotBarButtonsViewFingerprint : MethodFingerprint(
@@ -22,28 +20,19 @@ object PivotBarButtonsViewFingerprint : MethodFingerprint(
AccessFlags.PUBLIC or AccessFlags.FINAL,
listOf("Z"),
listOf(
Opcode.NEW_INSTANCE, // new StateListDrawable()
Opcode.INVOKE_DIRECT,
Opcode.NEW_ARRAY,
Opcode.CONST,
Opcode.CONST_16,
Opcode.APUT,
Opcode.INVOKE_VIRTUAL,
Opcode.INVOKE_VIRTUAL_RANGE,
Opcode.MOVE_RESULT_OBJECT,
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.GOTO,
Opcode.IGET_OBJECT,
Opcode.IF_NEZ,
Opcode.SGET_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT,
Opcode.IGET,
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_OBJECT,
Opcode.MOVE_OBJECT,
Opcode.MOVE,
Opcode.MOVE_OBJECT,
Opcode.INVOKE_VIRTUAL_RANGE, // pivotBar.getView(drawable, tabName, z, i, map, akebVar, optional)
Opcode.MOVE_RESULT_OBJECT,
Opcode.IF_NEZ,
Opcode.SGET_OBJECT,
Opcode.INVOKE_INTERFACE,
Opcode.MOVE_RESULT,
Opcode.IGET
)
)
)

View File

@@ -17,9 +17,9 @@ import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Patch
@Dependencies(dependencies = [IntegrationsPatch::class])
@Dependencies([IntegrationsPatch::class])
@Name("hide-shorts-button")
@Description("Hides the shorts button.")
@Description("Hides the shorts button on the navigation bar.")
@ShortsButtonCompatibility
@Version("0.0.1")
class ShortsButtonRemoverPatch : BytecodePatch(
@@ -35,7 +35,7 @@ class ShortsButtonRemoverPatch : BytecodePatch(
val buttonsViewResult = PivotBarButtonsViewFingerprint.result!!
val buttonsViewImplementation = buttonsViewResult.mutableMethod.implementation!!
val moveViewInstruction = buttonsViewImplementation.instructions[buttonsViewResult.patternScanResult!!.endIndex]
val moveViewInstruction = buttonsViewImplementation.instructions[buttonsViewResult.patternScanResult!!.startIndex + 1]
val viewRegister = (moveViewInstruction as OneRegisterInstruction).registerA
@@ -48,7 +48,7 @@ class ShortsButtonRemoverPatch : BytecodePatch(
// Hide the button view via proxy by passing it to the hideShortsButton method
// It only hides it if the last tab name is "TAB_SHORTS"
buttonsViewResult.mutableMethod.addInstruction(
buttonsViewResult.patternScanResult!!.endIndex + 2,
buttonsViewResult.patternScanResult!!.startIndex + 3,
"invoke-static { v$viewRegister }, Lapp/revanced/integrations/patches/HideShortsButtonPatch;->hideShortsButton(Landroid/view/View;)V"
)

View File

@@ -0,0 +1,13 @@
package app.revanced.patches.youtube.layout.sponsorblock.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.22.36", "17.26.35", "17.27.39", "17.28.34", "17.29.34")
)]
)
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class SponsorBlockCompatibility

View File

@@ -0,0 +1,41 @@
package app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
@Name("append-time-fingerprint")
@MatchingMethod(
"Liet;", "e"
)
@DirectPatternScanMethod
@SponsorBlockCompatibility
@Version("0.0.1")
object AppendTimeFingerprint : MethodFingerprint(
"V",
AccessFlags.PUBLIC or AccessFlags.FINAL,
listOf("L", "L", "L"),
listOf(
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT,
Opcode.IGET_OBJECT,
Opcode.IGET_OBJECT,
Opcode.CHECK_CAST,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT,
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT,
Opcode.IF_NEZ,
Opcode.IGET_OBJECT,
Opcode.IGET_OBJECT,
Opcode.CHECK_CAST,
Opcode.INVOKE_VIRTUAL,
Opcode.RETURN_VOID
)
)

View File

@@ -0,0 +1,21 @@
package app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility
@Name("create-video-player-seekbar-fingerprint")
@MatchingMethod(
"Lfcm;", "onDraw"
)
@DirectPatternScanMethod
@SponsorBlockCompatibility
@Version("0.0.1")
object CreateVideoPlayerSeekbarFingerprint : MethodFingerprint(
"V", null, null,
null,
listOf("timed_markers_width")
)

View File

@@ -0,0 +1,24 @@
package app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility
import org.jf.dexlib2.util.MethodUtil
@Name("next-gen-watch-layout-fingerprint")
@MatchingMethod(
"LNextGenWatchLayout;", "<init>"
)
@DirectPatternScanMethod
@SponsorBlockCompatibility
@Version("0.0.1")
object NextGenWatchLayoutFingerprint : MethodFingerprint(
"V", // constructors return void, in favour of speed of matching, this fingerprint has been added
null,
null,
null,
customFingerprint = { methodDef -> MethodUtil.isConstructor(methodDef) && methodDef.parameterTypes.size == 3 && methodDef.definingClass.endsWith("NextGenWatchLayout;") }
)

View File

@@ -0,0 +1,22 @@
package app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility
import org.jf.dexlib2.Opcode
@Name("player-controller-set-time-reference-fingerprint")
@MatchingMethod(
"Lxqm;", "<init>"
)
@DirectPatternScanMethod
@SponsorBlockCompatibility
@Version("0.0.1")
object PlayerControllerSetTimeReferenceFingerprint : MethodFingerprint(
null, null, null,
listOf(Opcode.INVOKE_DIRECT_RANGE, Opcode.IGET_OBJECT),
listOf("Media progress reported outside media playback: ")
)

View File

@@ -0,0 +1,23 @@
package app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility
@Name("player-init-fingerprint")
@MatchingMethod(
"Laajv;", "aG"
)
@DirectPatternScanMethod
@SponsorBlockCompatibility
@Version("0.0.1")
object PlayerInitFingerprint : MethodFingerprint(
null, null, null,
null,
strings = listOf(
"playVideo called on player response with no videoStreamingData."
),
)

View File

@@ -0,0 +1,22 @@
package app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility
@Name("player-overlays-layout-init-fingerprint")
@MatchingMethod(
"Lihh;", "u"
)
@DirectPatternScanMethod
@SponsorBlockCompatibility
@Version("0.0.1")
object PlayerOverlaysLayoutInitFingerprint : MethodFingerprint(
null, null, null,
null,
null,
{ methodDef -> methodDef.returnType.endsWith("YouTubePlayerOverlaysLayout;") }
)

View File

@@ -0,0 +1,37 @@
package app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
import org.jf.dexlib2.iface.reference.MethodReference
@Name("rectangle-field-invalidator-fingerprint")
@MatchingMethod(
"Lfcm;", "kY"
)
@DirectPatternScanMethod
@SponsorBlockCompatibility
@Version("0.0.1")
object RectangleFieldInvalidatorFingerprint : MethodFingerprint(
"V",
null,
null,
null,
null,
custom@{ methodDef ->
val instructions = methodDef.implementation?.instructions!!
val instructionCount = instructions.count()
// the method has definitely more than 5 instructions
if (instructionCount < 5) return@custom false
val referenceInstruction = instructions.elementAt(instructionCount - 2) // the second to last instruction
val reference = ((referenceInstruction as? ReferenceInstruction)?.reference as? MethodReference)
reference?.parameterTypes?.size == 1 && reference.name == "invalidate" // the reference is the invalidate(..) method
}
)

View File

@@ -0,0 +1,23 @@
package app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility
@Name("seek-fingerprint")
@MatchingMethod(
"Laajv;", "af"
)
@DirectPatternScanMethod
@SponsorBlockCompatibility
@Version("0.0.1")
object SeekFingerprint : MethodFingerprint(
null,
null,
null,
null,
listOf("Attempting to seek during an ad")
)

View File

@@ -0,0 +1,19 @@
package app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility
@Name("show-player-controls-fingerprint")
@MatchingMethod(
"LYouTubeControlsOverlay;", "ac"
)
@DirectPatternScanMethod
@SponsorBlockCompatibility
@Version("0.0.1")
object ShowPlayerControlsFingerprint : MethodFingerprint(
"V", null, listOf("Z","Z"), null, null
)

View File

@@ -0,0 +1,34 @@
package app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility
import org.jf.dexlib2.Opcode
@Name("video-length-fingerprint")
@MatchingMethod(
"Lyfh;", "z"
)
@DirectPatternScanMethod
@SponsorBlockCompatibility
@Version("0.0.1")
object VideoLengthFingerprint : MethodFingerprint(
null, null, null,
listOf(
Opcode.MOVE_RESULT_WIDE,
Opcode.CMP_LONG,
Opcode.IF_LEZ,
Opcode.IGET_OBJECT,
Opcode.CHECK_CAST,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_WIDE,
Opcode.GOTO,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_WIDE,
Opcode.CONST_4,
Opcode.INVOKE_VIRTUAL
)
)

View File

@@ -0,0 +1,20 @@
package app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility
@Name("video-time-fingerprint")
@MatchingMethod(
"Lwyh;", "<init>"
)
@DirectPatternScanMethod
@SponsorBlockCompatibility
@Version("0.0.1")
object VideoTimeFingerprint : MethodFingerprint(
null, null, null, null,
listOf("MedialibPlayerTimeInfo{currentPositionMillis=")
)

View File

@@ -0,0 +1,335 @@
package app.revanced.patches.youtube.layout.sponsorblock.bytecode.patch
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.impl.BytecodeData
import app.revanced.patcher.data.impl.toMethodWalker
import app.revanced.patcher.extensions.addInstruction
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.extensions.or
import app.revanced.patcher.extensions.replaceInstruction
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.utils.MethodFingerprintUtils.resolve
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable
import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility
import app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints.*
import app.revanced.patches.youtube.layout.sponsorblock.resource.patch.SponsorBlockResourcePatch
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.mapping.patch.ResourceIdMappingProviderResourcePatch
import app.revanced.patches.youtube.misc.videoid.patch.VideoIdPatch
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
import org.jf.dexlib2.builder.MutableMethodImplementation
import org.jf.dexlib2.iface.instruction.*
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
import org.jf.dexlib2.iface.reference.FieldReference
import org.jf.dexlib2.iface.reference.MethodReference
import org.jf.dexlib2.iface.reference.StringReference
import org.jf.dexlib2.immutable.ImmutableMethod
import org.jf.dexlib2.immutable.ImmutableMethodParameter
import org.jf.dexlib2.util.MethodUtil
@Patch
@Dependencies(
dependencies = [IntegrationsPatch::class, ResourceIdMappingProviderResourcePatch::class, SponsorBlockResourcePatch::class, VideoIdPatch::class]
)
@Name("sponsorblock")
@Description("Integrate SponsorBlock.")
@SponsorBlockCompatibility
@Version("0.0.1")
class SponsorBlockBytecodePatch : BytecodePatch(
listOf(
PlayerControllerSetTimeReferenceFingerprint,
CreateVideoPlayerSeekbarFingerprint,
VideoTimeFingerprint,
NextGenWatchLayoutFingerprint,
AppendTimeFingerprint,
PlayerInitFingerprint,
PlayerOverlaysLayoutInitFingerprint
)
) {
override fun execute(data: BytecodeData): PatchResult {/*
Set current video time
*/
val referenceResult = PlayerControllerSetTimeReferenceFingerprint.result!!
val playerControllerSetTimeMethod =
data.toMethodWalker(referenceResult.method).nextMethod(referenceResult.patternScanResult!!.startIndex, true)
.getMethod() as MutableMethod
playerControllerSetTimeMethod.addInstruction(
2,
"invoke-static {p1, p2}, Lapp/revanced/integrations/sponsorblock/PlayerController;->setCurrentVideoTime(J)V"
)
/*
Set current video time high precision
*/
val constructorFingerprint =
object : MethodFingerprint("V", null, listOf("J", "J", "J", "J", "I", "L"), null) {}
constructorFingerprint.resolve(data, VideoTimeFingerprint.result!!.classDef)
val constructor = constructorFingerprint.result!!.mutableMethod
constructor.addInstruction(
0,
"invoke-static {p1, p2}, Lapp/revanced/integrations/sponsorblock/PlayerController;->setCurrentVideoTimeHighPrecision(J)V"
)
/*
Set current video id
*/
VideoIdPatch.injectCall("Lapp/revanced/integrations/sponsorblock/PlayerController;->setCurrentVideoId(Ljava/lang/String;)V")
/*
Seekbar drawing
*/
val seekbarSignatureResult = CreateVideoPlayerSeekbarFingerprint.result!!
val seekbarMethod = seekbarSignatureResult.mutableMethod
val seekbarMethodInstructions = seekbarMethod.implementation!!.instructions
/*
Get the instance of the seekbar rectangle
*/
seekbarMethod.addInstruction(
1,
"invoke-static {v0}, Lapp/revanced/integrations/sponsorblock/PlayerController;->setSponsorBarRect(Ljava/lang/Object;)V"
)
for ((index, instruction) in seekbarMethodInstructions.withIndex()) {
if (instruction.opcode != Opcode.INVOKE_STATIC) continue
val invokeInstruction = instruction as Instruction35c
if ((invokeInstruction.reference as MethodReference).name != "round") continue
val insertIndex = index + 2
// set the thickness of the segment
seekbarMethod.addInstruction(
insertIndex,
"invoke-static {v${invokeInstruction.registerC}}, Lapp/revanced/integrations/sponsorblock/PlayerController;->setSponsorBarThickness(I)V"
)
break
}
/*
Set rectangle absolute left and right positions
*/
val drawRectangleInstructions = seekbarMethodInstructions.filter {
it is ReferenceInstruction && (it.reference as? MethodReference)?.name == "drawRect" && it is FiveRegisterInstruction
}.map { // TODO: improve code
seekbarMethodInstructions.indexOf(it) to (it as FiveRegisterInstruction).registerD
}
val (indexRight, rectangleRightRegister) = drawRectangleInstructions[0]
val (indexLeft, rectangleLeftRegister) = drawRectangleInstructions[3]
// order of operation is important here due to the code above which has to be improved
// the reason for that is that we get the index, add instructions and then the offset would be wrong
seekbarMethod.addInstruction(
indexLeft + 1,
"invoke-static {v$rectangleLeftRegister}, Lapp/revanced/integrations/sponsorblock/PlayerController;->setSponsorBarAbsoluteLeft(Landroid/graphics/Rect;)V"
)
seekbarMethod.addInstruction(
indexRight + 1,
"invoke-static {v$rectangleRightRegister}, Lapp/revanced/integrations/sponsorblock/PlayerController;->setSponsorBarAbsoluteRight(Landroid/graphics/Rect;)V"
)
/*
Draw segment
*/
val drawSegmentInstructionInsertIndex = (seekbarMethodInstructions.size - 1 - 2)
val (canvasInstance, centerY) = (seekbarMethodInstructions[drawSegmentInstructionInsertIndex] as FiveRegisterInstruction).let {
it.registerC to it.registerE
}
seekbarMethod.addInstruction(
drawSegmentInstructionInsertIndex - 1,
"invoke-static {v$canvasInstance, v$centerY}, Lapp/revanced/integrations/sponsorblock/PlayerController;->drawSponsorTimeBars(Landroid/graphics/Canvas;F)V"
)
/*
Set video length
*/
VideoLengthFingerprint.resolve(data, seekbarSignatureResult.classDef)
val videoLengthMethodResult = VideoLengthFingerprint.result!!
val videoLengthMethod = videoLengthMethodResult.mutableMethod
val videoLengthMethodInstructions = videoLengthMethod.implementation!!.instructions
val videoLengthRegister =
(videoLengthMethodInstructions[videoLengthMethodResult.patternScanResult!!.endIndex - 2] as OneRegisterInstruction).registerA
val dummyRegisterForLong =
videoLengthRegister + 1 // this is required for long values since they are 64 bit wide
videoLengthMethod.addInstruction(
videoLengthMethodResult.patternScanResult!!.endIndex,
"invoke-static {v$videoLengthRegister, v$dummyRegisterForLong}, Lapp/revanced/integrations/sponsorblock/PlayerController;->setVideoLength(J)V"
)
/*
Voting & Shield button
*/
ShowPlayerControlsFingerprint.resolve(data, data.classes.find { it.type.endsWith("YouTubeControlsOverlay;") }!!)
val controlsMethodResult = ShowPlayerControlsFingerprint.result!!
val controlsLayoutStubResourceId =
ResourceIdMappingProviderResourcePatch.resourceMappings.single { it.type == "id" && it.name == "controls_layout_stub" }.id
val zoomOverlayResourceId =
ResourceIdMappingProviderResourcePatch.resourceMappings.single { it.type == "id" && it.name == "video_zoom_overlay_stub" }.id
methods@ for (method in controlsMethodResult.mutableClass.methods) {
val instructions = method.implementation?.instructions!!
instructions@ for ((index, instruction) in instructions.withIndex()) {
// search for method which inflates the controls layout view
if (instruction.opcode != Opcode.CONST) continue@instructions
when ((instruction as NarrowLiteralInstruction).wideLiteral) {
controlsLayoutStubResourceId -> {
// replace the view with the YouTubeControlsOverlay
val moveResultInstructionIndex = index + 5
val inflatedViewRegister =
(instructions[moveResultInstructionIndex] as OneRegisterInstruction).registerA
// initialize with the player overlay object
method.addInstructions(
moveResultInstructionIndex + 1, // insert right after moving the view to the register and use that register
"""
invoke-static {v$inflatedViewRegister}, Lapp/revanced/integrations/sponsorblock/ShieldButton;->initialize(Ljava/lang/Object;)V
invoke-static {v$inflatedViewRegister}, Lapp/revanced/integrations/sponsorblock/VotingButton;->initialize(Ljava/lang/Object;)V
"""
)
}
zoomOverlayResourceId -> {
val invertVisibilityMethod =
data.toMethodWalker(method).nextMethod(index - 6, true).getMethod() as MutableMethod
// change visibility of the buttons
invertVisibilityMethod.addInstructions(
0, """
invoke-static {p1}, Lapp/revanced/integrations/sponsorblock/ShieldButton;->changeVisibilityNegatedImmediate(Z)V
invoke-static {p1}, Lapp/revanced/integrations/sponsorblock/VotingButton;->changeVisibilityNegatedImmediate(Z)V
""".trimIndent()
)
}
}
}
}
// change visibility of the buttons
controlsMethodResult.mutableMethod.addInstructions(
0, """
invoke-static {p1}, Lapp/revanced/integrations/sponsorblock/ShieldButton;->changeVisibility(Z)V
invoke-static {p1}, Lapp/revanced/integrations/sponsorblock/VotingButton;->changeVisibility(Z)V
""".trimIndent()
)
// set SegmentHelperLayout.context to the player layout instance
val instanceRegister = 0
NextGenWatchLayoutFingerprint.result!!.mutableMethod.addInstruction(
3, // after super call
"invoke-static/range {p$instanceRegister}, Lapp/revanced/integrations/sponsorblock/PlayerController;->addSkipSponsorView15(Landroid/view/View;)V"
)
// append the new time to the player layout
val appendTimeFingerprintResult = AppendTimeFingerprint.result!!
val appendTimePatternScanStartIndex = appendTimeFingerprintResult.patternScanResult!!.startIndex
val targetRegister =
(appendTimeFingerprintResult.method.implementation!!.instructions.elementAt(appendTimePatternScanStartIndex + 1) as OneRegisterInstruction).registerA
appendTimeFingerprintResult.mutableMethod.addInstructions(
appendTimePatternScanStartIndex + 2, """
invoke-static {v$targetRegister}, Lapp/revanced/integrations/sponsorblock/SponsorBlockUtils;->appendTimeWithoutSegments(Ljava/lang/String;)Ljava/lang/String;
move-result-object v$targetRegister
"""
)
// initialize the player controller
val initFingerprintResult = PlayerInitFingerprint.result!!
val initInstanceRegister = 0
initFingerprintResult.mutableClass.methods.first { MethodUtil.isConstructor(it) }.addInstruction(
4, // after super class invoke
"invoke-static {v$initInstanceRegister}, Lapp/revanced/integrations/sponsorblock/PlayerController;->onCreate(Ljava/lang/Object;)V"
)
// initialize the sponsorblock view
PlayerOverlaysLayoutInitFingerprint.result!!.mutableMethod.addInstruction(
6, // after inflating the view
"invoke-static {p0}, Lapp/revanced/integrations/sponsorblock/player/ui/SponsorBlockView;->initialize(Ljava/lang/Object;)V"
)
// lastly create hooks for the player controller
// get original seek method
SeekFingerprint.resolve(data, initFingerprintResult.classDef)
val seekFingerprintResultMethod = SeekFingerprint.result!!.method
// get enum type for the seek helper method
val seekSourceEnumType = seekFingerprintResultMethod.parameterTypes[1].toString()
// create helper method
val seekHelperMethod = ImmutableMethod(
seekFingerprintResultMethod.definingClass,
"seekHelper",
listOf(ImmutableMethodParameter("J", null, "time")),
"Z",
AccessFlags.PUBLIC or AccessFlags.FINAL,
null, null,
MutableMethodImplementation(4)
).toMutable()
// insert helper method instructions
seekHelperMethod.addInstructions(
0,
"""
sget-object v0, $seekSourceEnumType->a:$seekSourceEnumType
invoke-virtual {p0, p1, p2, v0}, ${seekFingerprintResultMethod.definingClass}->${seekFingerprintResultMethod.name}(J$seekSourceEnumType)Z
move-result p1
return p1
"""
)
// add the helper method to the original class
initFingerprintResult.mutableClass.methods.add(seekHelperMethod)
// get rectangle field name
RectangleFieldInvalidatorFingerprint.resolve(data, seekbarSignatureResult.classDef)
val rectangleFieldInvalidatorInstructions =
RectangleFieldInvalidatorFingerprint.result!!.method.implementation!!.instructions
val rectangleFieldName =
((rectangleFieldInvalidatorInstructions.elementAt(rectangleFieldInvalidatorInstructions.count() - 3) as ReferenceInstruction).reference as FieldReference).name
// get the player controller class from the integrations
val playerControllerMethods =
data.proxy(data.classes.first { it.type.endsWith("PlayerController;") }).resolve().methods
// get the method which contain the "replaceMe" strings
val replaceMeMethods =
playerControllerMethods.filter { it.name == "onCreate" || it.name == "setSponsorBarRect" }
fun MutableMethod.replaceStringInstruction(index: Int, instruction: Instruction, with: String) {
val register = (instruction as OneRegisterInstruction).registerA
this.replaceInstruction(
index, "const-string v$register, \"$with\""
)
}
// replace the "replaceMeWith*" strings
for (method in replaceMeMethods) {
for ((index, it) in method.implementation!!.instructions.withIndex()) {
if (it.opcode.ordinal != Opcode.CONST_STRING.ordinal) continue
when (((it as ReferenceInstruction).reference as StringReference).string) {
"replaceMeWithsetSponsorBarRect" ->
method.replaceStringInstruction(index, it, rectangleFieldName)
"replaceMeWithsetMillisecondMethod" ->
method.replaceStringInstruction(index, it, "seekHelper")
}
}
}
// TODO: isSBChannelWhitelisting implementation
return PatchResultSuccess()
}
}

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