Compare commits

..

46 Commits

Author SHA1 Message Date
semantic-release-bot
361e010f3c chore(release): 2.160.0-dev.1 [skip ci]
# [2.160.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.159.0...v2.160.0-dev.1) (2023-02-10)

### Features

* **instagram:** `hide-timeline-ads` patch ([499961b](499961ba05))
2023-02-10 04:32:59 +00:00
oSumAtrIX
c5064a4d62 build: bump patcher dependency version
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-10 05:28:35 +01:00
oSumAtrIX
499961ba05 feat(instagram): hide-timeline-ads patch
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-10 05:23:48 +01:00
oSumAtrIX
a11d6fffd7 refactor(youtube/microg-support): internalize Constants object
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-06 23:08:14 +01:00
semantic-release-bot
d33a55d784 chore(release): 2.159.0 [skip ci]
# [2.159.0](https://github.com/revanced/revanced-patches/compare/v2.158.0...v2.159.0) (2023-02-03)

### Bug Fixes

* **youtube/custom-branding:** correct scaling, margin and images ([#1580](https://github.com/revanced/revanced-patches/issues/1580)) ([aefc1f0](aefc1f02a4))

### Features

* `spoof-wifi-connection` patch ([#1527](https://github.com/revanced/revanced-patches/issues/1527)) ([2223b07](2223b07dbe))
* **music:** bump patches compatibility to v5.41.50 ([#1551](https://github.com/revanced/revanced-patches/issues/1551)) ([17b046d](17b046df60))
* **netguard:** `remove-broadcasts-restriction` patch ([#1581](https://github.com/revanced/revanced-patches/issues/1581)) ([6f7e887](6f7e887a69))
* **spotify-lite:** enable on-demand patch ([8d57c55](8d57c555a0))
* **youtube:** `hide-player-buttons` patch ([9804aee](9804aee8d1))
2023-02-03 03:58:20 +00:00
oSumAtrIX
ed9671575b chore: merge branch dev to main (#1582) 2023-02-03 04:56:14 +01:00
semantic-release-bot
af8772fdd6 chore(release): 2.159.0-dev.4 [skip ci]
# [2.159.0-dev.4](https://github.com/revanced/revanced-patches/compare/v2.159.0-dev.3...v2.159.0-dev.4) (2023-02-03)

### Features

* **netguard:** `remove-broadcasts-restriction` patch ([#1581](https://github.com/revanced/revanced-patches/issues/1581)) ([6f7e887](6f7e887a69))
2023-02-03 03:50:26 +00:00
Linus
6f7e887a69 feat(netguard): remove-broadcasts-restriction patch (#1581)
Co-authored-by: Linus789 <Linus789@users.noreply.github.com>
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-03 04:48:28 +01:00
oSumAtrIX
005dd099f7 chore(youtube/hide-video-action-buttons): use proper name and description
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-03 04:45:06 +01:00
semantic-release-bot
86738c66a1 chore(release): 2.159.0-dev.3 [skip ci]
# [2.159.0-dev.3](https://github.com/revanced/revanced-patches/compare/v2.159.0-dev.2...v2.159.0-dev.3) (2023-02-03)

### Features

* **youtube:** `hide-player-buttons` patch ([9804aee](9804aee8d1))
2023-02-03 03:42:10 +00:00
oSumAtrIX
9804aee8d1 feat(youtube): hide-player-buttons patch
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-03 04:39:40 +01:00
manatails
f5080e8a51 refactor: remove unnecessary locale-config-fix patch (#1578)
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-01 21:49:10 +01:00
semantic-release-bot
e67d27c4b0 chore(release): 2.159.0-dev.2 [skip ci]
# [2.159.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.159.0-dev.1...v2.159.0-dev.2) (2023-02-01)

### Features

* `spoof-wifi-connection` patch ([#1527](https://github.com/revanced/revanced-patches/issues/1527)) ([2223b07](2223b07dbe))
2023-02-01 19:54:19 +00:00
Linus
2223b07dbe feat: spoof-wifi-connection patch (#1527)
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
Co-authored-by: Linus789 <Linus789@users.noreply.github.com>
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-01 20:52:41 +01:00
semantic-release-bot
4e3c06684a chore(release): 2.159.0-dev.1 [skip ci]
# [2.159.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.158.0...v2.159.0-dev.1) (2023-02-01)

### Bug Fixes

* **youtube/custom-branding:** correct scaling, margin and images ([#1580](https://github.com/revanced/revanced-patches/issues/1580)) ([aefc1f0](aefc1f02a4))

### Features

* **music:** bump patches compatibility to v5.41.50 ([#1551](https://github.com/revanced/revanced-patches/issues/1551)) ([17b046d](17b046df60))
* **spotify-lite:** enable on-demand patch ([8d57c55](8d57c555a0))
2023-02-01 19:29:44 +00:00
LisoUseInAIKyrios
aefc1f02a4 fix(youtube/custom-branding): correct scaling, margin and images (#1580) 2023-02-01 20:26:32 +01:00
EvadeMaster
762e290658 chore(youtube): word patch descriptions clearly (#1571)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-01 20:24:23 +01:00
EvadeMaster
17b046df60 feat(music): bump patches compatibility to v5.41.50 (#1551)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-01 20:24:12 +01:00
illerokcob
8d57c555a0 feat(spotify-lite): enable on-demand patch 2023-01-30 01:56:12 +01:00
semantic-release-bot
8e4235af16 chore(release): 2.158.0 [skip ci]
# [2.158.0](https://github.com/revanced/revanced-patches/compare/v2.157.0...v2.158.0) (2023-01-29)

### Bug Fixes

* **youtube/microg-support:** replace new permission ([d3bd5f6](d3bd5f65ef))
* **youtube:** resolve duplicate preference keys ([#1550](https://github.com/revanced/revanced-patches/issues/1550)) ([5324d47](5324d471c9))

### Features

* **irplus:** `remove-ads` patch ([#1554](https://github.com/revanced/revanced-patches/issues/1554)) ([86e28ac](86e28acd2f))
2023-01-29 10:01:44 +00:00
oSumAtrIX
b3f9858402 chore: merge branch dev to main (#1559) 2023-01-29 10:59:48 +01:00
github-actions[bot]
bd9c89cdcc chore: merge branch dev to main (#1553)
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
Co-authored-by: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Co-authored-by: illerokcob <113302047+illerokcob@users.noreply.github.com>
2023-01-28 20:07:06 +01:00
semantic-release-bot
963089d866 chore(release): 2.158.0-dev.1 [skip ci]
# [2.158.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.157.1-dev.2...v2.158.0-dev.1) (2023-01-28)

### Features

* **irplus:** `remove-ads` patch ([#1554](https://github.com/revanced/revanced-patches/issues/1554)) ([86e28ac](86e28acd2f))
2023-01-28 19:06:12 +00:00
illerokcob
86e28acd2f feat(irplus): remove-ads patch (#1554)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-01-28 20:04:29 +01:00
semantic-release-bot
cc86f4ead3 chore(release): 2.157.1-dev.2 [skip ci]
## [2.157.1-dev.2](https://github.com/revanced/revanced-patches/compare/v2.157.1-dev.1...v2.157.1-dev.2) (2023-01-28)

### Bug Fixes

* **youtube:** resolve duplicate preference keys ([#1550](https://github.com/revanced/revanced-patches/issues/1550)) ([5324d47](5324d471c9))
2023-01-28 16:23:20 +00:00
LisoUseInAIKyrios
5324d471c9 fix(youtube): resolve duplicate preference keys (#1550) 2023-01-28 17:21:05 +01:00
semantic-release-bot
8ee531f816 chore(release): 2.157.1-dev.1 [skip ci]
## [2.157.1-dev.1](https://github.com/revanced/revanced-patches/compare/v2.157.0...v2.157.1-dev.1) (2023-01-28)

### Bug Fixes

* **youtube/microg-support:** replace new permission ([d3bd5f6](d3bd5f65ef))
2023-01-28 15:57:22 +00:00
oSumAtrIX
d3bd5f65ef fix(youtube/microg-support): replace new permission
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-01-28 16:55:21 +01:00
semantic-release-bot
d5fff653d5 chore(release): 2.157.0 [skip ci]
# [2.157.0](https://github.com/revanced/revanced-patches/compare/v2.156.0...v2.157.0) (2023-01-28)

### Bug Fixes

* parse any kind of patch version ([bc06b4d](bc06b4dfda))
* **twitter/hide-views-stats:** constrain to last working version ([#1522](https://github.com/revanced/revanced-patches/issues/1522)) ([068f18c](068f18cd5b))
* **youtube/return-youtube-dislike:** do not fetch voting stats when watching shorts ([#1532](https://github.com/revanced/revanced-patches/issues/1532)) ([dd3a9a4](dd3a9a4f38))
* **youtube/settings:** resolve fingerprints robustly ([3bf8d1d](3bf8d1d3cb))
* **youtube/sponsorblock:** replace missing strings ([69394a6](69394a60b2))
* **youtube:** reliably resolve fingerprints ([57e13cf](57e13cf8a8))

### Features

* **finanzonline:** `remove-bootloader-detection` patch ([c30bf18](c30bf18745))
* **finanzonline:** `remove-root-detection` patch ([1a94209](1a94209bfb))
* **music:** update patches compatibility to v5.40.51 ([#1541](https://github.com/revanced/revanced-patches/issues/1541)) ([225726f](225726feeb))
* **youtube/general-ads:** remove hiding video shelf ([e4fa523](e4fa523b15))
* **youtube/microg-support:** check if Vanced MicroG is running in the background ([#1531](https://github.com/revanced/revanced-patches/issues/1531)) ([c6e0e79](c6e0e79cd5))
* **youtube:** `open-links-externally` patch ([#1524](https://github.com/revanced/revanced-patches/issues/1524)) ([53ab837](53ab837489))
* **youtube:** show toasts along exceptions ([#1511](https://github.com/revanced/revanced-patches/issues/1511)) ([46effd3](46effd337f))
2023-01-28 08:04:57 +00:00
oSumAtrIX
3cf86bd1e9 chore: merge branch dev to main (#1523) 2023-01-28 09:02:34 +01:00
semantic-release-bot
f24a7c3ca9 chore(release): 2.157.0-dev.6 [skip ci]
# [2.157.0-dev.6](https://github.com/revanced/revanced-patches/compare/v2.157.0-dev.5...v2.157.0-dev.6) (2023-01-28)

### Bug Fixes

* **youtube/sponsorblock:** replace missing strings ([69394a6](69394a60b2))
2023-01-28 08:01:36 +00:00
oSumAtrIX
69394a60b2 fix(youtube/sponsorblock): replace missing strings
This partially reverts commit 52287003

Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-01-28 08:56:07 +01:00
semantic-release-bot
9ff595d5df chore(release): 2.157.0-dev.5 [skip ci]
# [2.157.0-dev.5](https://github.com/revanced/revanced-patches/compare/v2.157.0-dev.4...v2.157.0-dev.5) (2023-01-28)

### Features

* **youtube:** show toasts along exceptions ([#1511](https://github.com/revanced/revanced-patches/issues/1511)) ([46effd3](46effd337f))
2023-01-28 07:40:38 +00:00
LisoUseInAIKyrios
46effd337f feat(youtube): show toasts along exceptions (#1511)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-01-28 08:38:39 +01:00
semantic-release-bot
06a981a317 chore(release): 2.157.0-dev.4 [skip ci]
# [2.157.0-dev.4](https://github.com/revanced/revanced-patches/compare/v2.157.0-dev.3...v2.157.0-dev.4) (2023-01-28)

### Bug Fixes

* **youtube/return-youtube-dislike:** do not fetch voting stats when watching shorts ([#1532](https://github.com/revanced/revanced-patches/issues/1532)) ([dd3a9a4](dd3a9a4f38))
2023-01-28 07:30:33 +00:00
LisoUseInAIKyrios
dd3a9a4f38 fix(youtube/return-youtube-dislike): do not fetch voting stats when watching shorts (#1532)
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-01-28 08:28:48 +01:00
oSumAtrIX
5228700317 refactor(youtube/sponsorblock): remove dead code
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-01-28 08:11:52 +01:00
semantic-release-bot
e68a65c950 chore(release): 2.157.0-dev.3 [skip ci]
# [2.157.0-dev.3](https://github.com/revanced/revanced-patches/compare/v2.157.0-dev.2...v2.157.0-dev.3) (2023-01-28)

### Bug Fixes

* **youtube/settings:** resolve fingerprints robustly ([3bf8d1d](3bf8d1d3cb))
* **youtube:** reliably resolve fingerprints ([57e13cf](57e13cf8a8))

### Features

* **youtube/general-ads:** remove hiding video shelf ([e4fa523](e4fa523b15))
2023-01-28 07:06:55 +00:00
oSumAtrIX
817ad0b9f2 chore(youtube): bump patches compatibility to v18.03.36
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-01-28 08:00:30 +01:00
oSumAtrIX
57e13cf8a8 fix(youtube): reliably resolve fingerprints
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-01-28 07:58:58 +01:00
oSumAtrIX
e4fa523b15 feat(youtube/general-ads): remove hiding video shelf
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-01-28 06:00:36 +01:00
oSumAtrIX
440278be33 refactor(youtube/custom-video-buffer): apply Kotlin idioms
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-01-28 05:30:44 +01:00
oSumAtrIX
3bf8d1d3cb fix(youtube/settings): resolve fingerprints robustly
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-01-28 03:55:20 +01:00
semantic-release-bot
246a6ce927 chore(release): 2.157.0-dev.2 [skip ci]
# [2.157.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.157.0-dev.1...v2.157.0-dev.2) (2023-01-24)

### Features

* **music:** update patches compatibility to v5.40.51 ([#1541](https://github.com/revanced/revanced-patches/issues/1541)) ([225726f](225726feeb))
2023-01-24 12:32:28 +00:00
FineFindus
225726feeb feat(music): update patches compatibility to v5.40.51 (#1541) 2023-01-24 13:30:23 +01:00
oSumAtrIX
f0b384bbfe refactor: move classes to correct places and fix their access
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-01-23 02:30:43 +01:00
143 changed files with 1454 additions and 532 deletions

View File

@@ -1,3 +1,158 @@
# [2.160.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.159.0...v2.160.0-dev.1) (2023-02-10)
### Features
* **instagram:** `hide-timeline-ads` patch ([61668e6](https://github.com/revanced/revanced-patches/commit/61668e67083b74a08f8015308f4afe548e16a9ad))
# [2.159.0](https://github.com/revanced/revanced-patches/compare/v2.158.0...v2.159.0) (2023-02-03)
### Bug Fixes
* **youtube/custom-branding:** correct scaling, margin and images ([#1580](https://github.com/revanced/revanced-patches/issues/1580)) ([491c413](https://github.com/revanced/revanced-patches/commit/491c4138f0185664a9c5d3db9ebdf026ff4594e8))
### Features
* `spoof-wifi-connection` patch ([#1527](https://github.com/revanced/revanced-patches/issues/1527)) ([adce206](https://github.com/revanced/revanced-patches/commit/adce206d66e1f7017328fe68a5818d424f70e588))
* **music:** bump patches compatibility to v5.41.50 ([#1551](https://github.com/revanced/revanced-patches/issues/1551)) ([0b1024a](https://github.com/revanced/revanced-patches/commit/0b1024ab754a3e2ce798a54cccda6f41f97069a5))
* **netguard:** `remove-broadcasts-restriction` patch ([#1581](https://github.com/revanced/revanced-patches/issues/1581)) ([73132e3](https://github.com/revanced/revanced-patches/commit/73132e37cf83f4c1f05cf6a184dfd8e454f7456e))
* **spotify-lite:** enable on-demand patch ([9f0de4f](https://github.com/revanced/revanced-patches/commit/9f0de4f5678e9f57baaf6ec788821641d75defdc))
* **youtube:** `hide-player-buttons` patch ([3469d37](https://github.com/revanced/revanced-patches/commit/3469d37bcedfd2dfbe46231b17cd098b591810c1))
# [2.159.0-dev.4](https://github.com/revanced/revanced-patches/compare/v2.159.0-dev.3...v2.159.0-dev.4) (2023-02-03)
### Features
* **netguard:** `remove-broadcasts-restriction` patch ([#1581](https://github.com/revanced/revanced-patches/issues/1581)) ([73132e3](https://github.com/revanced/revanced-patches/commit/73132e37cf83f4c1f05cf6a184dfd8e454f7456e))
# [2.159.0-dev.3](https://github.com/revanced/revanced-patches/compare/v2.159.0-dev.2...v2.159.0-dev.3) (2023-02-03)
### Features
* **youtube:** `hide-player-buttons` patch ([3469d37](https://github.com/revanced/revanced-patches/commit/3469d37bcedfd2dfbe46231b17cd098b591810c1))
# [2.159.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.159.0-dev.1...v2.159.0-dev.2) (2023-02-01)
### Features
* `spoof-wifi-connection` patch ([#1527](https://github.com/revanced/revanced-patches/issues/1527)) ([adce206](https://github.com/revanced/revanced-patches/commit/adce206d66e1f7017328fe68a5818d424f70e588))
# [2.159.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.158.0...v2.159.0-dev.1) (2023-02-01)
### Bug Fixes
* **youtube/custom-branding:** correct scaling, margin and images ([#1580](https://github.com/revanced/revanced-patches/issues/1580)) ([491c413](https://github.com/revanced/revanced-patches/commit/491c4138f0185664a9c5d3db9ebdf026ff4594e8))
### Features
* **music:** bump patches compatibility to v5.41.50 ([#1551](https://github.com/revanced/revanced-patches/issues/1551)) ([0b1024a](https://github.com/revanced/revanced-patches/commit/0b1024ab754a3e2ce798a54cccda6f41f97069a5))
* **spotify-lite:** enable on-demand patch ([9f0de4f](https://github.com/revanced/revanced-patches/commit/9f0de4f5678e9f57baaf6ec788821641d75defdc))
# [2.158.0](https://github.com/revanced/revanced-patches/compare/v2.157.0...v2.158.0) (2023-01-29)
### Bug Fixes
* **youtube/microg-support:** replace new permission ([3d1cce5](https://github.com/revanced/revanced-patches/commit/3d1cce5b4ca54c622b863f24febeb03a6060033c))
* **youtube:** resolve duplicate preference keys ([#1550](https://github.com/revanced/revanced-patches/issues/1550)) ([aafdb89](https://github.com/revanced/revanced-patches/commit/aafdb891b2f0f243cb2d997a38ab3e6a7b46aba8))
### Features
* **irplus:** `remove-ads` patch ([#1554](https://github.com/revanced/revanced-patches/issues/1554)) ([9943a52](https://github.com/revanced/revanced-patches/commit/9943a520d29ee89598b4aa6aba69ff83cb4768ce))
# [2.158.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.157.1-dev.2...v2.158.0-dev.1) (2023-01-28)
### Features
* **irplus:** `remove-ads` patch ([#1554](https://github.com/revanced/revanced-patches/issues/1554)) ([9943a52](https://github.com/revanced/revanced-patches/commit/9943a520d29ee89598b4aa6aba69ff83cb4768ce))
## [2.157.1-dev.2](https://github.com/revanced/revanced-patches/compare/v2.157.1-dev.1...v2.157.1-dev.2) (2023-01-28)
### Bug Fixes
* **youtube:** resolve duplicate preference keys ([#1550](https://github.com/revanced/revanced-patches/issues/1550)) ([aafdb89](https://github.com/revanced/revanced-patches/commit/aafdb891b2f0f243cb2d997a38ab3e6a7b46aba8))
## [2.157.1-dev.1](https://github.com/revanced/revanced-patches/compare/v2.157.0...v2.157.1-dev.1) (2023-01-28)
### Bug Fixes
* **youtube/microg-support:** replace new permission ([3d1cce5](https://github.com/revanced/revanced-patches/commit/3d1cce5b4ca54c622b863f24febeb03a6060033c))
# [2.157.0](https://github.com/revanced/revanced-patches/compare/v2.156.0...v2.157.0) (2023-01-28)
### Bug Fixes
* parse any kind of patch version ([66cd88f](https://github.com/revanced/revanced-patches/commit/66cd88f4d8a9161a4c51b70f2384dcee92fe2aea))
* **twitter/hide-views-stats:** constrain to last working version ([#1522](https://github.com/revanced/revanced-patches/issues/1522)) ([bf45817](https://github.com/revanced/revanced-patches/commit/bf45817677fd058f9b255dbef5c1ca9aaec95531))
* **youtube/return-youtube-dislike:** do not fetch voting stats when watching shorts ([#1532](https://github.com/revanced/revanced-patches/issues/1532)) ([f46fcad](https://github.com/revanced/revanced-patches/commit/f46fcadd855a13d9f8916f21980abcf5564e97d7))
* **youtube/settings:** resolve fingerprints robustly ([8e98605](https://github.com/revanced/revanced-patches/commit/8e98605a7491d69e99c6b1aeb2de3db9396faa20))
* **youtube/sponsorblock:** replace missing strings ([7b8f0db](https://github.com/revanced/revanced-patches/commit/7b8f0db2c17da6488db1ec2c21a21a14ff8466aa))
* **youtube:** reliably resolve fingerprints ([1598306](https://github.com/revanced/revanced-patches/commit/1598306eb58ae8f8dc38b472628b237e55ec0f1b))
### Features
* **finanzonline:** `remove-bootloader-detection` patch ([3952138](https://github.com/revanced/revanced-patches/commit/39521386c2296f46479e31c39ab245c2778ebd65))
* **finanzonline:** `remove-root-detection` patch ([1d46d63](https://github.com/revanced/revanced-patches/commit/1d46d63fdcf3cbce53a7719f4490225368c4d5ae))
* **music:** update patches compatibility to v5.40.51 ([#1541](https://github.com/revanced/revanced-patches/issues/1541)) ([13143cb](https://github.com/revanced/revanced-patches/commit/13143cb5260f8793d246633a6a506bdc9f3a3ce7))
* **youtube/general-ads:** remove hiding video shelf ([c4c9e5b](https://github.com/revanced/revanced-patches/commit/c4c9e5bb3765d08d6653864d33546c25ba367292))
* **youtube/microg-support:** check if Vanced MicroG is running in the background ([#1531](https://github.com/revanced/revanced-patches/issues/1531)) ([81934ef](https://github.com/revanced/revanced-patches/commit/81934efb39b8ed9b0a523ffd7c4d841227ac141f))
* **youtube:** `open-links-externally` patch ([#1524](https://github.com/revanced/revanced-patches/issues/1524)) ([caf3d70](https://github.com/revanced/revanced-patches/commit/caf3d70c30bc440923c0e76e7331010905f6e729))
* **youtube:** show toasts along exceptions ([#1511](https://github.com/revanced/revanced-patches/issues/1511)) ([5817e4d](https://github.com/revanced/revanced-patches/commit/5817e4d27fab692c0e95ab4aa2fa8f13005cb780))
# [2.157.0-dev.6](https://github.com/revanced/revanced-patches/compare/v2.157.0-dev.5...v2.157.0-dev.6) (2023-01-28)
### Bug Fixes
* **youtube/sponsorblock:** replace missing strings ([7b8f0db](https://github.com/revanced/revanced-patches/commit/7b8f0db2c17da6488db1ec2c21a21a14ff8466aa))
# [2.157.0-dev.5](https://github.com/revanced/revanced-patches/compare/v2.157.0-dev.4...v2.157.0-dev.5) (2023-01-28)
### Features
* **youtube:** show toasts along exceptions ([#1511](https://github.com/revanced/revanced-patches/issues/1511)) ([5817e4d](https://github.com/revanced/revanced-patches/commit/5817e4d27fab692c0e95ab4aa2fa8f13005cb780))
# [2.157.0-dev.4](https://github.com/revanced/revanced-patches/compare/v2.157.0-dev.3...v2.157.0-dev.4) (2023-01-28)
### Bug Fixes
* **youtube/return-youtube-dislike:** do not fetch voting stats when watching shorts ([#1532](https://github.com/revanced/revanced-patches/issues/1532)) ([f46fcad](https://github.com/revanced/revanced-patches/commit/f46fcadd855a13d9f8916f21980abcf5564e97d7))
# [2.157.0-dev.3](https://github.com/revanced/revanced-patches/compare/v2.157.0-dev.2...v2.157.0-dev.3) (2023-01-28)
### Bug Fixes
* **youtube/settings:** resolve fingerprints robustly ([8e98605](https://github.com/revanced/revanced-patches/commit/8e98605a7491d69e99c6b1aeb2de3db9396faa20))
* **youtube:** reliably resolve fingerprints ([1598306](https://github.com/revanced/revanced-patches/commit/1598306eb58ae8f8dc38b472628b237e55ec0f1b))
### Features
* **youtube/general-ads:** remove hiding video shelf ([c4c9e5b](https://github.com/revanced/revanced-patches/commit/c4c9e5bb3765d08d6653864d33546c25ba367292))
# [2.157.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.157.0-dev.1...v2.157.0-dev.2) (2023-01-24)
### Features
* **music:** update patches compatibility to v5.40.51 ([#1541](https://github.com/revanced/revanced-patches/issues/1541)) ([13143cb](https://github.com/revanced/revanced-patches/commit/13143cb5260f8793d246633a6a506bdc9f3a3ce7))
# [2.157.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.156.0...v2.157.0-dev.1) (2023-01-23) # [2.157.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.156.0...v2.157.0-dev.1) (2023-01-23)

124
README.md
View File

@@ -9,58 +9,58 @@ The official Patch bundle provided by ReVanced and the community.
| 💊 Patch | 📜 Description | 🏹 Target Version | | 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:| |:--------:|:--------------:|:-----------------:|
| `always-autorepeat` | Always repeats the playing video again. | 17.49.37 | | `always-autorepeat` | Always repeats the playing video again. | 18.03.36 |
| `client-spoof` | Spoofs the YouTube or Vanced client to prevent playback issues. | all | | `client-spoof` | Spoofs the YouTube or Vanced client to prevent playback issues. | all |
| `comments` | Hides components related to comments. | 17.49.37 | | `comments` | Hides components related to comments. | 18.03.36 |
| `copy-video-url` | Adds buttons in player to copy video links. | 17.49.37 | | `copy-video-url` | Adds buttons in player to copy video links. | 18.03.36 |
| `custom-branding` | Changes the YouTube launcher icon and name to your choice (defaults to ReVanced). | all | | `custom-branding` | Changes the YouTube launcher icon and name to your choice (defaults to ReVanced). | all |
| `custom-video-buffer` | Lets you change the buffers of videos. | 17.49.37 | | `custom-video-buffer` | Lets you change the buffers of videos. | 18.03.36 |
| `custom-video-speed` | Adds more video speed options. | 17.49.37 | | `custom-video-speed` | Adds more video speed options. | 18.03.36 |
| `debugging` | Adds debugging options. | all | | `debugging` | Adds debugging options. | all |
| `disable-auto-captions` | Disable forced captions from being automatically enabled. | 17.49.37 | | `disable-auto-captions` | Disable forced captions from being automatically enabled. | 18.03.36 |
| `disable-auto-player-popup-panels` | Disable automatic popup panels (playlist or live chat) on video player. | 17.49.37 | | `disable-auto-player-popup-panels` | Disable automatic popup panels (playlist or live chat) on video player. | 18.03.36 |
| `disable-fullscreen-panels` | Disables video description and comments panel in fullscreen view. | 17.49.37 | | `disable-fullscreen-panels` | Disables video description and comments panel in fullscreen view. | 18.03.36 |
| `disable-startup-shorts-player` | Disables playing YouTube Shorts when launching YouTube. | 17.49.37 | | `disable-startup-shorts-player` | Disables playing YouTube Shorts when launching YouTube. | 18.03.36 |
| `disable-zoom-haptics` | Disables haptics when zooming. | all | | `disable-zoom-haptics` | Disables haptics when zooming. | all |
| `downloads` | Enables downloading music and videos from YouTube. | 17.49.37 | | `downloads` | Enables downloading music and videos from YouTube. | 18.03.36 |
| `enable-wide-searchbar` | Replaces the search icon with a wide search bar. This will hide the YouTube logo when active. | 17.49.37 | | `enable-wide-searchbar` | Replaces the search icon with a wide search bar. This will hide the YouTube logo when active. | 18.03.36 |
| `general-ads` | Removes general ads. | 17.49.37 | | `general-ads` | Removes general ads. | 18.03.36 |
| `hdr-auto-brightness` | Makes the brightness of HDR videos follow the system default. | 17.49.37 | | `hdr-auto-brightness` | Makes the brightness of HDR videos follow the system default. | 18.03.36 |
| `hide-album-cards` | Hides the album cards below the artist description. | 17.49.37 | | `hide-album-cards` | Hides the album cards below the artist description. | 18.03.36 |
| `hide-artist-card` | Hides the artist card below the searchbar. | 17.49.37 | | `hide-artist-card` | Hides the artist card below the searchbar. | 18.03.36 |
| `hide-autoplay-button` | Hides the autoplay button in the video player. | 17.49.37 | | `hide-autoplay-button` | Hides the autoplay button in the video player. | 18.03.36 |
| `hide-breaking-news-shelf` | Hides the breaking news shelf on the homepage tab. | 17.49.37 | | `hide-breaking-news-shelf` | Hides the breaking news shelf on the homepage tab. | 18.03.36 |
| `hide-captions-button` | Hides the captions button on video player. | 17.49.37 | | `hide-captions-button` | Hides the captions button on video player. | 18.03.36 |
| `hide-cast-button` | Hides the cast button in the video player. | all | | `hide-cast-button` | Hides the cast button in the video player. | all |
| `hide-create-button` | Hides the create button in the navigation bar. | 17.49.37 | | `hide-create-button` | Hides the create button in the navigation bar. | 18.03.36 |
| `hide-crowdfunding-box` | Hides the crowdfunding box between the player and video description. | 17.49.37 | | `hide-crowdfunding-box` | Hides the crowdfunding box between the player and video description. | 18.03.36 |
| `hide-email-address` | Hides the email address in the account switcher. | 17.49.37 | | `hide-email-address` | Hides the email address in the account switcher. | 18.03.36 |
| `hide-endscreen-cards` | Hides the suggested video cards at the end of a video in fullscreen. | 17.49.37 | | `hide-endscreen-cards` | Hides the suggested video cards at the end of a video in fullscreen. | 18.03.36 |
| `hide-info-cards` | Hides info-cards in videos. | 17.49.37 | | `hide-info-cards` | Hides info-cards in videos. | 18.03.36 |
| `hide-my-mix` | Hides mix playlists. | 17.49.37 | | `hide-my-mix` | Hides mix playlists. | 18.03.36 |
| `hide-shorts-button` | Hides the shorts button on the navigation bar. | 17.49.37 | | `hide-player-buttons` | Adds the option to hide video player previous and next buttons. | all |
| `hide-time-and-seekbar` | Hides progress bar and time counter on videos. | 17.49.37 | | `hide-shorts-button` | Hides the shorts button on the navigation bar. | 18.03.36 |
| `hide-video-buttons` | Adds options to hide action buttons under a video. | 17.49.37 | | `hide-time-and-seekbar` | Hides progress bar and time counter on videos. | 18.03.36 |
| `hide-watch-in-vr` | Hides the Watch in VR option in the player settings flyout panel. | 17.49.37 | | `hide-video-action-buttons` | Adds the options to hide action buttons under a video. | 18.03.36 |
| `hide-watermark` | Hides creator's watermarks on videos. | 17.49.37 | | `hide-watch-in-vr` | Hides the Watch in VR option in the player settings flyout panel. | 18.03.36 |
| `microg-support` | Allows YouTube ReVanced to run without root and under a different package name with Vanced MicroG. | 17.49.37 | | `hide-watermark` | Hides creator's watermarks on videos. | 18.03.36 |
| `minimized-playback` | Enables minimized and background playback. | 17.49.37 | | `microg-support` | Allows YouTube ReVanced to run without root and under a different package name with Vanced MicroG. | 18.03.36 |
| `old-quality-layout` | Enables the original video quality flyout in the video player settings | 17.49.37 | | `minimized-playback` | Enables minimized and background playback. | 18.03.36 |
| `open-links-directly` | Bypasses https://youtube.com/redirect URLs. | 17.49.37 | | `old-quality-layout` | Enables the original video quality flyout in the video player settings | 18.03.36 |
| `open-links-externally` | Open links outside of the app directly in your browser. | 17.49.37 | | `open-links-directly` | Skips over redirection URLs to external links. | 18.03.36 |
| `open-links-externally` | Open links outside of the app directly in your browser. | 18.03.36 |
| `premium-heading` | Shows premium branding on the home screen. | all | | `premium-heading` | Shows premium branding on the home screen. | all |
| `remember-playback-rate` | Adds the ability to remember the playback rate you chose in the video playback rate flyout. | 17.49.37 | | `remember-playback-rate` | Adds the ability to remember the playback rate you chose in the video playback rate flyout. | 18.03.36 |
| `remember-video-quality` | Adds the ability to remember the video quality you chose in the video quality flyout. | 17.49.37 | | `remember-video-quality` | Adds the ability to remember the video quality you chose in the video quality flyout. | 18.03.36 |
| `remove-player-button-background` | Removes the background from the video player buttons. | 17.49.37 | | `remove-player-button-background` | Removes the background from the video player buttons. | 18.03.36 |
| `return-youtube-dislike` | Shows the dislike count of videos using the Return YouTube Dislike API. | 17.49.37 | | `return-youtube-dislike` | Shows the dislike count of videos using the Return YouTube Dislike API. | 18.03.36 |
| `seekbar-tapping` | Enables tap-to-seek on the seekbar of the video player. | 17.49.37 | | `seekbar-tapping` | Enables tap-to-seek on the seekbar of the video player. | 18.03.36 |
| `settings` | Adds settings for ReVanced to YouTube. | all | | `sponsorblock` | Integrates SponsorBlock which allows skipping video segments such as sponsored content. | 18.03.36 |
| `sponsorblock` | Integrate SponsorBlock. | 17.49.37 | | `spoof-app-version` | Tricks YouTube into thinking, you are running an older version of the app. One of the side effects also includes restoring the old UI. | 18.03.36 |
| `spoof-app-version` | Tricks YouTube into thinking, you are running an older version of the app. One of the side effects also includes restoring the old UI. | 17.49.37 | | `swipe-controls` | Adds volume and brightness swipe controls. | 18.03.36 |
| `swipe-controls` | Adds volume and brightness swipe controls. | 17.49.37 | | `tablet-mini-player` | Enables the tablet mini player layout. | 18.03.36 |
| `tablet-mini-player` | Enables the tablet mini player layout. | 17.49.37 |
| `theme` | Applies a custom theme. | all | | `theme` | Applies a custom theme. | all |
| `video-ads` | Removes ads in the video player. | 17.49.37 | | `video-ads` | Removes ads in the video player. | 18.03.36 |
</details> </details>
### [📦 `com.google.android.apps.youtube.music`](https://play.google.com/store/apps/details?id=com.google.android.apps.youtube.music) ### [📦 `com.google.android.apps.youtube.music`](https://play.google.com/store/apps/details?id=com.google.android.apps.youtube.music)
@@ -161,7 +161,7 @@ The official Patch bundle provided by ReVanced and the community.
| 💊 Patch | 📜 Description | 🏹 Target Version | | 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:| |:--------:|:--------------:|:-----------------:|
| `remove-bootloader-detection` | Removes the check for an unlocked bootloader. | 2.2.0 | | `remove-bootloader-detection` | Removes the check for an unlocked bootloader. | 2.2.0 |
| `remove-root-detection` | Removes the check for root permissions | 2.2.0 | | `remove-root-detection` | Removes the check for root permissions. | 2.2.0 |
</details> </details>
### [📦 `at.gv.oe.app`](https://play.google.com/store/apps/details?id=at.gv.oe.app) ### [📦 `at.gv.oe.app`](https://play.google.com/store/apps/details?id=at.gv.oe.app)
@@ -189,6 +189,22 @@ The official Patch bundle provided by ReVanced and the community.
| `disable-ads` | Disables ads in HexEditor. | all | | `disable-ads` | Disables ads in HexEditor. | all |
</details> </details>
### [📦 `com.spotify.lite`](https://play.google.com/store/apps/details?id=com.spotify.lite)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `enable-on-demand` | Enables listening to songs on-demand, allowing to play any song from playlists, albums or artists without limitations. This does not remove ads. | all |
</details>
### [📦 `com.instagram.android`](https://play.google.com/store/apps/details?id=com.instagram.android)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `hide-timeline-ads` | Removes ads from the timeline. | all |
</details>
### [📦 `org.citra.citra_emu`](https://play.google.com/store/apps/details?id=org.citra.citra_emu) ### [📦 `org.citra.citra_emu`](https://play.google.com/store/apps/details?id=org.citra.citra_emu)
<details> <details>
@@ -221,6 +237,22 @@ The official Patch bundle provided by ReVanced and the community.
| `promo-code-unlock` | Disables the validation of promo code. Any code will work to unlock all features. | all | | `promo-code-unlock` | Disables the validation of promo code. Any code will work to unlock all features. | all |
</details> </details>
### [📦 `net.binarymode.android.irplus`](https://play.google.com/store/apps/details?id=net.binarymode.android.irplus)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `remove-ads` | Removes all ads from the app. | all |
</details>
### [📦 `eu.faircode.netguard`](https://play.google.com/store/apps/details?id=eu.faircode.netguard)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `remove-broadcasts-restriction` | Enables starting/stopping NetGuard via broadcasts. | all |
</details>
### [📦 `com.teslacoilsw.launcher`](https://play.google.com/store/apps/details?id=com.teslacoilsw.launcher) ### [📦 `com.teslacoilsw.launcher`](https://play.google.com/store/apps/details?id=com.teslacoilsw.launcher)
<details> <details>

View File

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

View File

@@ -1,2 +1,2 @@
kotlin.code.style = official kotlin.code.style = official
version = 2.157.0-dev.1 version = 2.160.0-dev.1

File diff suppressed because one or more lines are too long

View File

@@ -20,14 +20,14 @@ internal class JsonGenerator : PatchesFileGenerator {
it.version ?: "0.0.0", it.version ?: "0.0.0",
!it.include, !it.include,
it.options?.map { option -> it.options?.map { option ->
Option( JsonPatch.Option(
option.key, option.key,
option.title, option.title,
option.description, option.description,
option.required, option.required,
option.let { lo -> option.let { listOption ->
if (lo is PatchOption.ListOption<*>) { if (listOption is PatchOption.ListOption<*>) {
lo.options.toMutableList().toTypedArray() listOption.options.toMutableList().toTypedArray()
} else null } else null
} }
) )
@@ -36,7 +36,7 @@ internal class JsonGenerator : PatchesFileGenerator {
dep.java.patchName dep.java.patchName
}?.toTypedArray() ?: emptyArray(), }?.toTypedArray() ?: emptyArray(),
it.compatiblePackages?.map { pkg -> it.compatiblePackages?.map { pkg ->
CompatiblePackage(pkg.name, pkg.versions) JsonPatch.CompatiblePackage(pkg.name, pkg.versions)
}?.toTypedArray() ?: emptyArray() }?.toTypedArray() ?: emptyArray()
) )
} }
@@ -45,7 +45,7 @@ internal class JsonGenerator : PatchesFileGenerator {
json.writeText(GsonBuilder().serializeNulls().create().toJson(patches)) json.writeText(GsonBuilder().serializeNulls().create().toJson(patches))
} }
data class JsonPatch( private class JsonPatch(
val name: String, val name: String,
val description: String, val description: String,
val version: String, val version: String,
@@ -53,18 +53,18 @@ internal class JsonGenerator : PatchesFileGenerator {
val options: Array<Option>, val options: Array<Option>,
val dependencies: Array<String>, val dependencies: Array<String>,
val compatiblePackages: Array<CompatiblePackage>, val compatiblePackages: Array<CompatiblePackage>,
) ) {
class CompatiblePackage(
val name: String,
val versions: Array<String>,
)
data class CompatiblePackage( class Option(
val name: String, val key: String,
val versions: Array<String>, val title: String,
) val description: String,
val required: Boolean,
data class Option( val choices: Array<*>?,
val key: String, )
val title: String, }
val description: String,
val required: Boolean,
val choices: Array<*>?,
)
} }

View File

@@ -0,0 +1,206 @@
package app.revanced.patches.all.connectivity.wifi.spoof.patch
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.util.patch.*
import org.jf.dexlib2.iface.ClassDef
import org.jf.dexlib2.iface.Method
import org.jf.dexlib2.iface.instruction.Instruction
import java.util.*
@Patch(false)
@Name("spoof-wifi-connection")
@Description("Spoofs an existing Wi-Fi connection.")
@Version("0.0.1")
internal class SpoofWifiPatch : AbstractTransformInstructionsPatch<Instruction35cInfo>() {
private companion object {
const val INTEGRATIONS_CLASS_DESCRIPTOR_PREFIX = "Lapp/revanced/all/connectivity/wifi/spoof/SpoofWifiPatch"
const val INTEGRATIONS_CLASS_DESCRIPTOR = "${INTEGRATIONS_CLASS_DESCRIPTOR_PREFIX};"
}
// Information about method calls we want to replace
enum class MethodCall(
override val definedClassName: String,
override val methodName: String,
override val methodParams: Array<String>,
override val returnType: String,
): IMethodCall {
GetSystemService1(
"Landroid/content/Context;",
"getSystemService",
arrayOf("Ljava/lang/String;"),
"Ljava/lang/Object;",
),
GetSystemService2(
"Landroid/content/Context;",
"getSystemService",
arrayOf("Ljava/lang/Class;"),
"Ljava/lang/Object;",
),
GetActiveNetworkInfo(
"Landroid/net/ConnectivityManager;",
"getActiveNetworkInfo",
arrayOf(),
"Landroid/net/NetworkInfo;",
),
IsConnected(
"Landroid/net/NetworkInfo;",
"isConnected",
arrayOf(),
"Z",
),
IsConnectedOrConnecting(
"Landroid/net/NetworkInfo;",
"isConnectedOrConnecting",
arrayOf(),
"Z",
),
IsAvailable(
"Landroid/net/NetworkInfo;",
"isAvailable",
arrayOf(),
"Z",
),
GetState(
"Landroid/net/NetworkInfo;",
"getState",
arrayOf(),
"Landroid/net/NetworkInfo\$State;",
),
GetDetailedState(
"Landroid/net/NetworkInfo;",
"getDetailedState",
arrayOf(),
"Landroid/net/NetworkInfo\$DetailedState;",
),
IsActiveNetworkMetered(
"Landroid/net/ConnectivityManager;",
"isActiveNetworkMetered",
arrayOf(),
"Z",
),
GetActiveNetwork(
"Landroid/net/ConnectivityManager;",
"getActiveNetwork",
arrayOf(),
"Landroid/net/Network;",
),
GetNetworkInfo(
"Landroid/net/ConnectivityManager;",
"getNetworkInfo",
arrayOf("Landroid/net/Network;"),
"Landroid/net/NetworkInfo;",
),
HasTransport(
"Landroid/net/NetworkCapabilities;",
"hasTransport",
arrayOf("I"),
"Z",
),
HasCapability(
"Landroid/net/NetworkCapabilities;",
"hasCapability",
arrayOf("I"),
"Z",
),
RegisterBestMatchingNetworkCallback(
"Landroid/net/ConnectivityManager;",
"registerBestMatchingNetworkCallback",
arrayOf("Landroid/net/NetworkRequest;", "Landroid/net/ConnectivityManager\$NetworkCallback;", "Landroid/os/Handler;"),
"V",
),
RegisterDefaultNetworkCallback1(
"Landroid/net/ConnectivityManager;",
"registerDefaultNetworkCallback",
arrayOf("Landroid/net/ConnectivityManager\$NetworkCallback;"),
"V",
),
RegisterDefaultNetworkCallback2(
"Landroid/net/ConnectivityManager;",
"registerDefaultNetworkCallback",
arrayOf("Landroid/net/ConnectivityManager\$NetworkCallback;", "Landroid/os/Handler;"),
"V",
),
RegisterNetworkCallback1(
"Landroid/net/ConnectivityManager;",
"registerNetworkCallback",
arrayOf("Landroid/net/NetworkRequest;", "Landroid/net/ConnectivityManager\$NetworkCallback;"),
"V",
),
RegisterNetworkCallback2(
"Landroid/net/ConnectivityManager;",
"registerNetworkCallback",
arrayOf("Landroid/net/NetworkRequest;", "Landroid/app/PendingIntent;"),
"V",
),
RegisterNetworkCallback3(
"Landroid/net/ConnectivityManager;",
"registerNetworkCallback",
arrayOf("Landroid/net/NetworkRequest;", "Landroid/net/ConnectivityManager\$NetworkCallback;", "Landroid/os/Handler;"),
"V",
),
RequestNetwork1(
"Landroid/net/ConnectivityManager;",
"requestNetwork",
arrayOf("Landroid/net/NetworkRequest;", "Landroid/net/ConnectivityManager\$NetworkCallback;"),
"V",
),
RequestNetwork2(
"Landroid/net/ConnectivityManager;",
"requestNetwork",
arrayOf("Landroid/net/NetworkRequest;", "Landroid/net/ConnectivityManager\$NetworkCallback;", "I"),
"V",
),
RequestNetwork3(
"Landroid/net/ConnectivityManager;",
"requestNetwork",
arrayOf("Landroid/net/NetworkRequest;", "Landroid/net/ConnectivityManager\$NetworkCallback;", "Landroid/os/Handler;"),
"V",
),
RequestNetwork4(
"Landroid/net/ConnectivityManager;",
"requestNetwork",
arrayOf("Landroid/net/NetworkRequest;", "Landroid/app/PendingIntent;"),
"V",
),
RequestNetwork5(
"Landroid/net/ConnectivityManager;",
"requestNetwork",
arrayOf("Landroid/net/NetworkRequest;", "Landroid/net/ConnectivityManager\$NetworkCallback;", "Landroid/os/Handler;", "I"),
"V",
),
UnregisterNetworkCallback1(
"Landroid/net/ConnectivityManager;",
"unregisterNetworkCallback",
arrayOf("Landroid/net/ConnectivityManager\$NetworkCallback;"),
"V",
),
UnregisterNetworkCallback2(
"Landroid/net/ConnectivityManager;",
"unregisterNetworkCallback",
arrayOf("Landroid/app/PendingIntent;"),
"V",
);
}
override fun filterMap(
classDef: ClassDef,
method: Method,
instruction: Instruction,
instructionIndex: Int
) = filterMapInstruction35c<MethodCall>(
INTEGRATIONS_CLASS_DESCRIPTOR_PREFIX,
classDef,
instruction,
instructionIndex
)
override fun transform(mutableMethod: MutableMethod, entry: Instruction35cInfo) {
val (methodType, instruction, instructionIndex) = entry
methodType.replaceInvokeVirtualWithIntegrations(INTEGRATIONS_CLASS_DESCRIPTOR, mutableMethod, instruction, instructionIndex)
}
}

View File

@@ -1,106 +1,57 @@
package app.revanced.patches.all.screenshot.removerestriction.patch package app.revanced.patches.all.screenshot.removerestriction.patch
import app.revanced.extensions.findMutableMethodOf
import app.revanced.patcher.annotation.Description import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.replaceInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import org.jf.dexlib2.Opcode import app.revanced.util.patch.*
import org.jf.dexlib2.iface.instruction.formats.Instruction35c import org.jf.dexlib2.iface.ClassDef
import org.jf.dexlib2.iface.reference.MethodReference import org.jf.dexlib2.iface.Method
import org.jf.dexlib2.iface.instruction.Instruction
import java.util.*
@Patch(false) @Patch(false)
@Name("remove-screenshot-restriction") @Name("remove-screenshot-restriction")
@Description("Removes the restriction of making screenshots.") @Description("Removes the restriction of taking screenshots in apps that normally wouldn't allow it.")
@Version("0.0.1") @Version("0.0.1")
class RemoveScreenshotRestrictionPatch : BytecodePatch() { internal class RemoveScreenshotRestrictionPatch : AbstractTransformInstructionsPatch<Instruction35cInfo>() {
private companion object { private companion object {
const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/all/screenshot/removerestriction/RemoveScreenshotRestrictionPatch;" const val INTEGRATIONS_CLASS_DESCRIPTOR_PREFIX =
"Lapp/revanced/all/screenshot/removerestriction/RemoveScreenshotRestrictionPatch"
const val INTEGRATIONS_CLASS_DESCRIPTOR = "$INTEGRATIONS_CLASS_DESCRIPTOR_PREFIX;"
} }
// Information about method calls we want to replace // Information about method calls we want to replace
private enum class MethodCall( enum class MethodCall(
val definedClassName: String, override val definedClassName: String,
val methodName: String, override val methodName: String,
val replacementMethodDefinition: String override val methodParams: Array<String>,
) { override val returnType: String
): IMethodCall {
SetFlags( SetFlags(
"Landroid/view/Window;", "Landroid/view/Window;",
"setFlags", "setFlags",
"setFlags(Landroid/view/Window;II)V", arrayOf("I", "I"),
"V",
); );
fun replaceInstruction(method: MutableMethod, instruction: Instruction35c, instructionIndex: Int) {
when (this) {
SetFlags -> {
method.replaceInstruction(
instructionIndex,
"invoke-static { v${instruction.registerC}, v${instruction.registerD}, v${instruction.registerE} }, ${INTEGRATIONS_CLASS_DESCRIPTOR}->${replacementMethodDefinition}"
)
}
}
}
companion object {
fun fromMethodReference(methodReference: MethodReference) = values().firstOrNull { search ->
search.definedClassName == methodReference.definingClass && search.methodName == methodReference.name
}
}
} }
override fun execute(context: BytecodeContext): PatchResult { override fun filterMap(
// Find all instructions where one of the methods is called classDef: ClassDef,
buildMap { method: Method,
context.classes.forEach { classDef -> instruction: Instruction,
if (classDef.type == INTEGRATIONS_CLASS_DESCRIPTOR) { instructionIndex: Int
// avoid infinite recursion ) = filterMapInstruction35c<MethodCall>(
return@forEach INTEGRATIONS_CLASS_DESCRIPTOR_PREFIX,
} classDef,
instruction,
instructionIndex
)
classDef.methods.let { methods -> override fun transform(mutableMethod: MutableMethod, entry: Instruction35cInfo) {
buildMap methodList@{ val (methodType, instruction, instructionIndex) = entry
methods.forEach methods@{ method -> methodType.replaceInvokeVirtualWithIntegrations(INTEGRATIONS_CLASS_DESCRIPTOR, mutableMethod, instruction, instructionIndex)
with(method.implementation?.instructions ?: return@methods) {
ArrayDeque<Triple<MethodCall, Instruction35c, Int>>().also { patchIndices ->
this.forEachIndexed { index, instruction ->
if (instruction.opcode != Opcode.INVOKE_VIRTUAL) return@forEachIndexed
val invokeInstruction = instruction as Instruction35c
val methodRef = invokeInstruction.reference as MethodReference
val methodCall = MethodCall.fromMethodReference(methodRef) ?: return@forEachIndexed
patchIndices.add(Triple(methodCall, invokeInstruction, index))
}
}.also { if (it.isEmpty()) return@methods }.let { patches ->
put(method, patches)
}
}
}
}
}.also { if (it.isEmpty()) return@forEach }.let { methodPatches ->
put(classDef, methodPatches)
}
}
}.forEach { (classDef, methods) ->
// And finally replace the instructions...
with(context.proxy(classDef).mutableClass) {
methods.forEach { (method, patches) ->
val mutableMethod = findMutableMethodOf(method)
while (!patches.isEmpty()) {
val (methodType, instruction, instructionIndex) = patches.removeLast()
methodType.replaceInstruction(mutableMethod, instruction, instructionIndex)
}
}
}
}
return PatchResultSuccess()
} }
} }

View File

@@ -15,7 +15,7 @@ import app.revanced.patches.finanzonline.detection.shared.annotations.DetectionC
@Patch @Patch
@Name("remove-root-detection") @Name("remove-root-detection")
@Description("Removes the check for root permissions") @Description("Removes the check for root permissions.")
@DetectionCompatibility @DetectionCompatibility
@Version("0.0.1") @Version("0.0.1")
class RootDetectionPatch : BytecodePatch( class RootDetectionPatch : BytecodePatch(

View File

@@ -0,0 +1,7 @@
package app.revanced.patches.instagram.patches.ads.timeline.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object MediaFingerprint : MethodFingerprint(
strings = listOf("is_paid_partnership", "story_ad_headline", "is_panorama")
)

View File

@@ -0,0 +1,26 @@
package app.revanced.patches.instagram.patches.ads.timeline.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
object ShowAdFingerprint : MethodFingerprint(
"Z",
AccessFlags.PUBLIC or AccessFlags.STATIC or AccessFlags.FINAL,
listOf("L", "L", "Z", "Z"),
opcodes = listOf(
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT,
Opcode.IF_NEZ,
Opcode.RETURN,
Opcode.CONST_4,
Opcode.GOTO,
Opcode.CONST_4,
Opcode.GOTO,
Opcode.CONST_4,
Opcode.GOTO,
Opcode.CONST_4,
Opcode.RETURN,
),
)

View File

@@ -0,0 +1,18 @@
package app.revanced.patches.instagram.patches.ads.timeline.fingerprints.ads
import org.jf.dexlib2.Opcode
object GenericMediaAdFingerprint : MediaAdFingerprint(
opcodes = listOf(
Opcode.INVOKE_INTERFACE,
Opcode.MOVE_RESULT_OBJECT,
Opcode.INVOKE_INTERFACE,
Opcode.MOVE_RESULT_OBJECT,
Opcode.CONST_4,
Opcode.IF_EQZ,
Opcode.CONST_4,
Opcode.RETURN,
)
) {
override fun toString() = result!!.method.toString()
}

View File

@@ -0,0 +1,23 @@
package app.revanced.patches.instagram.patches.ads.timeline.fingerprints.ads
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
import org.jf.dexlib2.iface.Method
abstract class MediaAdFingerprint(
returnType: String? = "Z",
access: Int? = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters: Iterable<String>? = listOf(),
opcodes: Iterable<Opcode>?,
customFingerprint: ((methodDef: Method) -> Boolean)? = null
) : MethodFingerprint(
returnType,
access,
parameters,
opcodes,
customFingerprint = customFingerprint
) {
abstract override fun toString(): String
}

View File

@@ -0,0 +1,29 @@
package app.revanced.patches.instagram.patches.ads.timeline.fingerprints.ads
import org.jf.dexlib2.Opcode
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
import org.jf.dexlib2.iface.reference.MethodReference
object PaidPartnershipAdFingerprint : MediaAdFingerprint(
"V",
null,
listOf("L", "L"),
listOf(
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT,
Opcode.IPUT_BOOLEAN,
Opcode.IPUT_BOOLEAN
),
customFingerprint = { methodDef ->
methodDef.definingClass.endsWith("ClipsEditMetadataController;")
}
) {
override fun toString() = result!!.let {
val adCheckIndex = it.scanResult.patternScanResult!!.startIndex
val adCheckInstruction = it.method.implementation!!.instructions.elementAt(adCheckIndex)
val adCheckMethod = (adCheckInstruction as ReferenceInstruction).reference as MethodReference
adCheckMethod.toString()
}
}

View File

@@ -0,0 +1,21 @@
package app.revanced.patches.instagram.patches.ads.timeline.fingerprints.ads
import org.jf.dexlib2.Opcode
object ShoppingAdFingerprint : MediaAdFingerprint(
opcodes = listOf(
Opcode.IF_EQZ,
Opcode.IGET_OBJECT,
Opcode.IGET_OBJECT,
Opcode.IF_EQZ,
Opcode.IGET_OBJECT,
Opcode.IF_EQZ,
Opcode.IGET_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT,
Opcode.XOR_INT_LIT8,
Opcode.IF_EQZ,
)
) {
override fun toString() = result!!.method.toString()
}

View File

@@ -0,0 +1,108 @@
package app.revanced.patches.instagram.patches.ads.timeline.patch
import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.*
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.extensions.instruction
import app.revanced.patcher.extensions.removeInstruction
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.util.smali.ExternalLabel
import app.revanced.patches.instagram.patches.ads.timeline.fingerprints.MediaFingerprint
import app.revanced.patches.instagram.patches.ads.timeline.fingerprints.ShowAdFingerprint
import app.revanced.patches.instagram.patches.ads.timeline.fingerprints.ads.GenericMediaAdFingerprint
import app.revanced.patches.instagram.patches.ads.timeline.fingerprints.ads.MediaAdFingerprint
import app.revanced.patches.instagram.patches.ads.timeline.fingerprints.ads.PaidPartnershipAdFingerprint
import app.revanced.patches.instagram.patches.ads.timeline.fingerprints.ads.ShoppingAdFingerprint
import org.jf.dexlib2.iface.instruction.FiveRegisterInstruction
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Patch
@Name("hide-timeline-ads")
@Description("Removes ads from the timeline.")
@Compatibility([Package("com.instagram.android")])
@Version("0.0.1")
class HideTimelineAdsPatch : BytecodePatch(
listOf(
ShowAdFingerprint,
MediaFingerprint,
PaidPartnershipAdFingerprint // Unlike the other ads this one is resolved from all classes.
)
) {
override fun execute(context: BytecodeContext): PatchResult {
// region Resolve required methods to check for ads.
ShowAdFingerprint.result ?: return ShowAdFingerprint.toErrorResult()
PaidPartnershipAdFingerprint.result ?: return PaidPartnershipAdFingerprint.toErrorResult()
MediaFingerprint.result?.let {
GenericMediaAdFingerprint.resolve(context, it.classDef)
ShoppingAdFingerprint.resolve(context, it.classDef)
return@let
} ?: return MediaFingerprint.toErrorResult()
// endregion
ShowAdFingerprint.result!!.apply {
// region Create instructions.
val scanStart = scanResult.patternScanResult!!.startIndex
val jumpIndex = scanStart - 1
val mediaInstanceRegister = (mutableMethod.instruction(scanStart) as FiveRegisterInstruction).registerC
val freeRegister = (mutableMethod.instruction(jumpIndex) as OneRegisterInstruction).registerA
val returnFalseLabel = "an_ad"
val checkForAdInstructions =
listOf(GenericMediaAdFingerprint, PaidPartnershipAdFingerprint, ShoppingAdFingerprint)
.map(MediaAdFingerprint::toString)
.joinToString("\n") {
"""
invoke-virtual {v$mediaInstanceRegister}, $it
move-result v$freeRegister
if-nez v$freeRegister, :$returnFalseLabel
""".trimIndent()
}.let { "$it\nconst/4 v0, 0x1\nreturn v0" }
// endregion
// region Patch.
val insertIndex = scanStart + 3
mutableMethod.addInstructions(
insertIndex,
checkForAdInstructions,
listOf(
ExternalLabel(
returnFalseLabel,
mutableMethod.instruction(mutableMethod.implementation!!.instructions.size - 2 /* return false = ad */)
)
)
)
// endregion
// region Jump to checks for ads from previous patch.
mutableMethod.apply {
addInstructions(
jumpIndex + 1,
"if-nez v$freeRegister, :start_check",
listOf(ExternalLabel("start_check", instruction(insertIndex)))
)
}.removeInstruction(jumpIndex)
// endregion
}
return PatchResultSuccess()
}
}

View File

@@ -1,9 +1,9 @@
package app.revanced.patches.youtube.misc.settings.annotations package app.revanced.patches.irplus.ad.annotations
import app.revanced.patcher.annotation.Compatibility import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package import app.revanced.patcher.annotation.Package
@Compatibility([Package("com.google.android.youtube")]) @Compatibility([Package("net.binarymode.android.irplus")])
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME) @Retention(AnnotationRetention.RUNTIME)
internal annotation class SettingsCompatibility internal annotation class IrplusAdsCompatibility

View File

@@ -0,0 +1,12 @@
package app.revanced.patches.irplus.ad.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.AccessFlags
object IrplusAdsFingerprint : MethodFingerprint(
"V",
AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
listOf("L", "Z"),
strings = listOf("TAGGED")
)

View File

@@ -0,0 +1,33 @@
package app.revanced.patches.irplus.ad.patch
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.addInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.irplus.ad.annotations.IrplusAdsCompatibility
import app.revanced.patches.irplus.ad.fingerprints.IrplusAdsFingerprint
@Patch
@Name("remove-ads")
@Description("Removes all ads from the app.")
@IrplusAdsCompatibility
@Version("0.0.1")
class IrplusAdsPatch : BytecodePatch(
listOf(IrplusAdsFingerprint)
) {
override fun execute(context: BytecodeContext): PatchResult {
val method = IrplusAdsFingerprint.result!!.mutableMethod
// By overwriting the second parameter of the method,
// the view which holds the advertisement is removed.
method.addInstruction(0, "const/4 p2, 0x0")
return PatchResultSuccess()
}
}

View File

@@ -23,7 +23,9 @@ import app.revanced.patcher.annotation.Package
"5.34.51", "5.34.51",
"5.36.51", "5.36.51",
"5.38.53", "5.38.53",
"5.39.52" "5.39.52",
"5.40.51",
"5.41.50"
) )
)] )]
) )

View File

@@ -23,7 +23,9 @@ import app.revanced.patcher.annotation.Package
"5.34.51", "5.34.51",
"5.36.51", "5.36.51",
"5.38.53", "5.38.53",
"5.39.52" "5.39.52",
"5.40.51",
"5.41.50"
) )
)] )]
) )

View File

@@ -23,7 +23,9 @@ import app.revanced.patcher.annotation.Package
"5.34.51", "5.34.51",
"5.36.51", "5.36.51",
"5.38.53", "5.38.53",
"5.39.52" "5.39.52",
"5.40.51",
"5.41.50"
) )
)] )]
) )

View File

@@ -22,7 +22,9 @@ import app.revanced.patcher.annotation.Package
"5.34.51", "5.34.51",
"5.36.51", "5.36.51",
"5.38.53", "5.38.53",
"5.39.52" "5.39.52",
"5.40.51",
"5.41.50"
) )
)] )]
) )

View File

@@ -23,7 +23,9 @@ import app.revanced.patcher.annotation.Package
"5.34.51", "5.34.51",
"5.36.51", "5.36.51",
"5.38.53", "5.38.53",
"5.39.52" "5.39.52",
"5.40.51",
"5.41.50"
) )
)] )]
) )

View File

@@ -25,7 +25,9 @@ import app.revanced.patcher.annotation.Package
"5.34.51", "5.34.51",
"5.36.51", "5.36.51",
"5.38.53", "5.38.53",
"5.39.52" "5.39.52",
"5.40.51",
"5.41.50"
) )
)] )]
) )

View File

@@ -23,7 +23,9 @@ import app.revanced.patcher.annotation.Package
"5.34.51", "5.34.51",
"5.36.51", "5.36.51",
"5.38.53", "5.38.53",
"5.39.52" "5.39.52",
"5.40.51",
"5.41.50"
) )
)] )]
) )

View File

@@ -22,8 +22,10 @@ import app.revanced.patcher.annotation.Package
"5.31.50", "5.31.50",
"5.34.51", "5.34.51",
"5.36.51", "5.36.51",
"5.38.53", "5.38.53",
"5.39.52" "5.39.52",
"5.40.51",
"5.41.50"
) )
)] )]
) )

View File

@@ -23,7 +23,9 @@ import app.revanced.patcher.annotation.Package
"5.34.51", "5.34.51",
"5.36.51", "5.36.51",
"5.38.53", "5.38.53",
"5.39.52" "5.39.52",
"5.40.51",
"5.41.50"
) )
)] )]
) )

View File

@@ -0,0 +1,9 @@
package app.revanced.patches.netguard.broadcasts.removerestriction.resource.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility([Package("eu.faircode.netguard")])
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
annotation class RemoveBroadcastsRestrictionCompatibility

View File

@@ -0,0 +1,40 @@
package app.revanced.patches.netguard.broadcasts.removerestriction.resource.patch
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.netguard.broadcasts.removerestriction.resource.annotations.RemoveBroadcastsRestrictionCompatibility
import org.w3c.dom.Element
@Patch(false)
@Name("remove-broadcasts-restriction")
@Description("Enables starting/stopping NetGuard via broadcasts.")
@RemoveBroadcastsRestrictionCompatibility
@Version("0.0.1")
class RemoveBroadcastsRestrictionPatch : ResourcePatch {
override fun execute(context: ResourceContext): PatchResult {
context.xmlEditor["AndroidManifest.xml"].use { dom ->
val applicationNode = dom
.file
.getElementsByTagName("application")
.item(0) as Element
applicationNode.getElementsByTagName("receiver").also { list ->
for (i in 0 until list.length) {
val element = list.item(i) as? Element ?: continue
if (element.getAttribute("android:name") == "eu.faircode.netguard.WidgetAdmin") {
element.removeAttribute("android:permission")
break
}
}
}
}
return PatchResultSuccess()
}
}

View File

@@ -5,14 +5,11 @@ import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.* import app.revanced.patcher.patch.*
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.spotify.layout.theme.annotations.ThemeCompatibility import app.revanced.patches.spotify.layout.theme.annotations.ThemeCompatibility
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
import org.w3c.dom.Element import org.w3c.dom.Element
@Patch @Patch
@DependsOn([FixLocaleConfigErrorPatch::class])
@Name("spotify-theme") @Name("spotify-theme")
@Description("Applies a custom theme.") @Description("Applies a custom theme.")
@ThemeCompatibility @ThemeCompatibility

View File

@@ -0,0 +1,11 @@
package app.revanced.patches.spotify.lite.ondemand.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility(
[Package("com.spotify.lite")]
)
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class OnDemandCompatibility

View File

@@ -0,0 +1,25 @@
package app.revanced.patches.spotify.lite.ondemand.fingerprints
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.Opcode
@FuzzyPatternScanMethod(2)
object OnDemandFingerprint : MethodFingerprint(
"L",
parameters = listOf(),
opcodes = listOf(
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT,
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT_OBJECT,
Opcode.IF_EQZ,
Opcode.SGET_OBJECT,
Opcode.GOTO,
Opcode.SGET_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT,
Opcode.IPUT,
Opcode.RETURN_OBJECT
)
)

View File

@@ -0,0 +1,34 @@
package app.revanced.patches.spotify.lite.ondemand.patch
import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.addInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.spotify.lite.ondemand.annotations.OnDemandCompatibility
import app.revanced.patches.spotify.lite.ondemand.fingerprints.OnDemandFingerprint
@Patch
@Name("enable-on-demand")
@Description("Enables listening to songs on-demand, allowing to play any song from playlists, albums or artists without limitations. This does not remove ads.")
@OnDemandCompatibility
@Version("0.0.1")
class OnDemandPatch : BytecodePatch(
listOf(
OnDemandFingerprint
)
) {
override fun execute(context: BytecodeContext): PatchResult {
OnDemandFingerprint.result?.apply {
val insertIndex = scanResult.patternScanResult!!.endIndex - 1
// Spoof a premium account
mutableMethod.addInstruction(insertIndex, "const/4 v0, 0x2")
} ?: return OnDemandFingerprint.toErrorResult()
return PatchResultSuccess()
}
}

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -10,13 +10,11 @@ import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
import app.revanced.patches.shared.settings.preference.impl.* import app.revanced.patches.shared.settings.preference.impl.*
import app.revanced.patches.youtube.ad.general.annotation.GeneralAdsCompatibility import app.revanced.patches.youtube.ad.general.annotation.GeneralAdsCompatibility
import app.revanced.patches.youtube.misc.litho.filter.patch.LithoFilterPatch import app.revanced.patches.youtube.misc.litho.filter.patch.LithoFilterPatch
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch.PreferenceScreen import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch.PreferenceScreen
@DependsOn( @DependsOn(
dependencies = [ dependencies = [
FixLocaleConfigErrorPatch::class,
LithoFilterPatch::class, LithoFilterPatch::class,
SettingsPatch::class, SettingsPatch::class,
ResourceMappingPatch::class ResourceMappingPatch::class
@@ -197,13 +195,6 @@ class GeneralAdsResourcePatch : ResourcePatch {
StringResource("revanced_adremover_paid_content_enabled_summary_on", "Paid content is hidden"), StringResource("revanced_adremover_paid_content_enabled_summary_on", "Paid content is hidden"),
StringResource("revanced_adremover_paid_content_enabled_summary_off", "Paid content is shown") StringResource("revanced_adremover_paid_content_enabled_summary_off", "Paid content is shown")
), ),
SwitchPreference(
"revanced_adremover_hide_suggestions",
StringResource("revanced_adremover_hide_suggestions_enabled_title", "Hide suggestions"),
true,
StringResource("revanced_adremover_hide_suggestions_enabled_summary_on", "Suggestions are hidden"),
StringResource("revanced_adremover_hide_suggestions_enabled_summary_off", "Suggestions are shown")
),
SwitchPreference( SwitchPreference(
"revanced_adremover_hide_latest_posts", "revanced_adremover_hide_latest_posts",
StringResource("revanced_adremover_hide_latest_posts_enabled_title", "Hide latest posts"), StringResource("revanced_adremover_hide_latest_posts_enabled_title", "Hide latest posts"),

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[ [
Package("com.google.android.youtube", arrayOf("17.49.37")) Package("com.google.android.youtube", arrayOf("17.49.37", "18.03.36"))
] ]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -12,7 +12,6 @@ import app.revanced.patches.shared.settings.preference.impl.PreferenceScreen
import app.revanced.patches.shared.settings.preference.impl.StringResource import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
import app.revanced.patches.youtube.interaction.copyvideourl.annotation.CopyVideoUrlCompatibility import app.revanced.patches.youtube.interaction.copyvideourl.annotation.CopyVideoUrlCompatibility
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
import app.revanced.patches.youtube.misc.playercontrols.resource.patch.BottomControlsResourcePatch import app.revanced.patches.youtube.misc.playercontrols.resource.patch.BottomControlsResourcePatch
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
import app.revanced.util.resources.ResourceUtils import app.revanced.util.resources.ResourceUtils
@@ -20,7 +19,7 @@ import app.revanced.util.resources.ResourceUtils.copyResources
@Name("copy-video-url-resource") @Name("copy-video-url-resource")
@Description("Makes necessary changes to resources for copy video link buttons.") @Description("Makes necessary changes to resources for copy video link buttons.")
@DependsOn([BottomControlsResourcePatch::class, FixLocaleConfigErrorPatch::class, SettingsPatch::class]) @DependsOn([BottomControlsResourcePatch::class, SettingsPatch::class])
@CopyVideoUrlCompatibility @CopyVideoUrlCompatibility
@Version("0.0.1") @Version("0.0.1")
class CopyVideoUrlResourcePatch : ResourcePatch { class CopyVideoUrlResourcePatch : ResourcePatch {
@@ -31,14 +30,14 @@ class CopyVideoUrlResourcePatch : ResourcePatch {
StringResource("revanced_copy_video_url_title", "Copy video URL settings"), StringResource("revanced_copy_video_url_title", "Copy video URL settings"),
listOf( listOf(
SwitchPreference( SwitchPreference(
"revanced_copy_video_url", "revanced_copy_video_url_enabled",
StringResource("revanced_copy_video_url_enabled_title", "Show copy video URL button"), StringResource("revanced_copy_video_url_enabled_title", "Show copy video URL button"),
true, true,
StringResource("revanced_copy_video_url_enabled_summary_on", "Button is shown, click to copy video URL without timestamp"), StringResource("revanced_copy_video_url_enabled_summary_on", "Button is shown, click to copy video URL without timestamp"),
StringResource("revanced_copy_video_url_enabled_summary_off", "Button is not shown") StringResource("revanced_copy_video_url_enabled_summary_off", "Button is not shown")
), ),
SwitchPreference( SwitchPreference(
"revanced_copy_video_url_timestamp", "revanced_copy_video_url_timestamp_enabled",
StringResource("revanced_copy_video_url_timestamp_enabled_title", "Show copy timestamp URL button"), StringResource("revanced_copy_video_url_timestamp_enabled_title", "Show copy timestamp URL button"),
true, true,
StringResource("revanced_copy_video_url_timestamp_enabled_summary_on", "Button is shown, click to copy video URL with timestamp"), StringResource("revanced_copy_video_url_timestamp_enabled_summary_on", "Button is shown, click to copy video URL with timestamp"),

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -10,7 +10,6 @@ import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patches.shared.settings.preference.impl.* import app.revanced.patches.shared.settings.preference.impl.*
import app.revanced.patches.youtube.interaction.downloads.annotation.DownloadsCompatibility import app.revanced.patches.youtube.interaction.downloads.annotation.DownloadsCompatibility
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
import app.revanced.patches.youtube.misc.playercontrols.resource.patch.BottomControlsResourcePatch import app.revanced.patches.youtube.misc.playercontrols.resource.patch.BottomControlsResourcePatch
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
import app.revanced.util.resources.ResourceUtils import app.revanced.util.resources.ResourceUtils
@@ -18,7 +17,7 @@ import app.revanced.util.resources.ResourceUtils.copyResources
import app.revanced.util.resources.ResourceUtils.mergeStrings import app.revanced.util.resources.ResourceUtils.mergeStrings
@Name("downloads-resource-patch") @Name("downloads-resource-patch")
@DependsOn([BottomControlsResourcePatch::class, FixLocaleConfigErrorPatch::class, SettingsPatch::class]) @DependsOn([BottomControlsResourcePatch::class, SettingsPatch::class])
@Description("Makes necessary changes to resources for the download button.") @Description("Makes necessary changes to resources for the download button.")
@DownloadsCompatibility @DownloadsCompatibility
@Version("0.0.1") @Version("0.0.1")
@@ -30,7 +29,7 @@ class DownloadsResourcePatch : ResourcePatch {
StringResource("revanced_downloads_title", "Download settings"), StringResource("revanced_downloads_title", "Download settings"),
listOf( listOf(
SwitchPreference( SwitchPreference(
"revanced_downloads", "revanced_downloads_enabled",
StringResource("revanced_downloads_enabled_title", "Show download button"), StringResource("revanced_downloads_enabled_title", "Show download button"),
true, true,
StringResource("revanced_downloads_enabled_summary_on", "Download button is shown"), StringResource("revanced_downloads_enabled_summary_on", "Download button is shown"),

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -8,16 +8,13 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.youtube.layout.branding.header.annotations.PremiumHeadingCompatibility import app.revanced.patches.youtube.layout.branding.header.annotations.PremiumHeadingCompatibility
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
import java.nio.file.Files import java.nio.file.Files
import java.nio.file.StandardCopyOption import java.nio.file.StandardCopyOption
import kotlin.io.path.exists import kotlin.io.path.exists
@Patch @Patch
@DependsOn([FixLocaleConfigErrorPatch::class])
@Name("premium-heading") @Name("premium-heading")
@Description("Shows premium branding on the home screen.") @Description("Shows premium branding on the home screen.")
@PremiumHeadingCompatibility @PremiumHeadingCompatibility

View File

@@ -5,17 +5,14 @@ import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.* import app.revanced.patcher.patch.*
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.youtube.layout.branding.icon.annotations.CustomBrandingCompatibility import app.revanced.patches.youtube.layout.branding.icon.annotations.CustomBrandingCompatibility
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
import app.revanced.util.resources.ResourceUtils import app.revanced.util.resources.ResourceUtils
import app.revanced.util.resources.ResourceUtils.copyResources import app.revanced.util.resources.ResourceUtils.copyResources
import java.io.File import java.io.File
import java.nio.file.Files import java.nio.file.Files
@Patch @Patch
@DependsOn([FixLocaleConfigErrorPatch::class])
@Name("custom-branding") @Name("custom-branding")
@Description("Changes the YouTube launcher icon and name to your choice (defaults to ReVanced).") @Description("Changes the YouTube launcher icon and name to your choice (defaults to ReVanced).")
@CustomBrandingCompatibility @CustomBrandingCompatibility

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -9,18 +9,18 @@ import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.youtube.misc.litho.filter.patch.LithoFilterPatch
import app.revanced.patches.youtube.layout.buttons.annotations.HideButtonsCompatibility
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
import app.revanced.patches.shared.settings.preference.impl.PreferenceScreen import app.revanced.patches.shared.settings.preference.impl.PreferenceScreen
import app.revanced.patches.shared.settings.preference.impl.StringResource import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
import app.revanced.patches.youtube.layout.buttons.annotations.HideButtonsCompatibility
import app.revanced.patches.youtube.misc.litho.filter.patch.LithoFilterPatch
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
@Patch @Patch
@DependsOn([ResourceMappingPatch::class, LithoFilterPatch::class]) @DependsOn([ResourceMappingPatch::class, LithoFilterPatch::class])
@Name("hide-video-buttons") @Name("hide-video-action-buttons")
@Description("Adds options to hide action buttons under a video.") @Description("Adds the options to hide action buttons under a video.")
@HideButtonsCompatibility @HideButtonsCompatibility
@Version("0.0.1") @Version("0.0.1")
class HideButtonsPatch : ResourcePatch { class HideButtonsPatch : ResourcePatch {

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -5,10 +5,7 @@ import org.jf.dexlib2.Opcode
object PivotBarCreateButtonViewFingerprint : MethodFingerprint( object PivotBarCreateButtonViewFingerprint : MethodFingerprint(
opcodes = listOf( opcodes = listOf(
Opcode.MOVE_OBJECT,
Opcode.INVOKE_DIRECT_RANGE, // unique instruction anchor Opcode.INVOKE_DIRECT_RANGE, // unique instruction anchor
Opcode.CONST_4,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT,
Opcode.INVOKE_STATIC
) )
) )

View File

@@ -22,6 +22,7 @@ import app.revanced.patches.youtube.layout.pivotbar.utils.InjectionUtils.REGISTE
import app.revanced.patches.youtube.layout.pivotbar.utils.InjectionUtils.injectHook import app.revanced.patches.youtube.layout.pivotbar.utils.InjectionUtils.injectHook
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
import org.jf.dexlib2.Opcode
@Patch @Patch
@DependsOn([IntegrationsPatch::class, ResourceMappingPatch::class, SettingsPatch::class, ResolvePivotBarFingerprintsPatch::class]) @DependsOn([IntegrationsPatch::class, ResourceMappingPatch::class, SettingsPatch::class, ResolvePivotBarFingerprintsPatch::class])
@@ -54,17 +55,24 @@ class CreateButtonRemoverPatch : BytecodePatch() {
return PivotBarCreateButtonViewFingerprint.toErrorResult() return PivotBarCreateButtonViewFingerprint.toErrorResult()
} }
val createButtonResult = PivotBarCreateButtonViewFingerprint.result!! PivotBarCreateButtonViewFingerprint.result!!.apply {
val insertIndex = createButtonResult.scanResult.patternScanResult!!.endIndex val insertIndex = mutableMethod.implementation!!.instructions.let {
val scanStart = scanResult.patternScanResult!!.endIndex
/* scanStart + it.subList(scanStart, it.size - 1).indexOfFirst { instruction ->
* Inject hooks instruction.opcode == Opcode.INVOKE_STATIC
*/ }
}
val hook = "invoke-static { v$REGISTER_TEMPLATE_REPLACEMENT }, " + /*
"$INTEGRATIONS_CLASS_DESCRIPTOR->hideCreateButton(Landroid/view/View;)V" * Inject hooks
*/
val hook = "invoke-static { v$REGISTER_TEMPLATE_REPLACEMENT }, " +
"$INTEGRATIONS_CLASS_DESCRIPTOR->hideCreateButton(Landroid/view/View;)V"
mutableMethod.injectHook(hook, insertIndex)
}
createButtonResult.mutableMethod.injectHook(hook, insertIndex)
return PatchResultSuccess() return PatchResultSuccess()
} }

View File

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

View File

@@ -0,0 +1,9 @@
package app.revanced.patches.youtube.layout.player.buttons.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.Opcode
object PlayerControlsVisibilityModelFingerprint : MethodFingerprint(
opcodes = listOf(Opcode.INVOKE_DIRECT_RANGE),
strings = listOf("hasNext", "hasPrevious", "Missing required properties:")
)

View File

@@ -0,0 +1,74 @@
package app.revanced.patches.youtube.layout.player.buttons.patch
import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.extensions.instruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
import app.revanced.patches.youtube.layout.player.buttons.annotations.HidePlayerButtonsCompatibility
import app.revanced.patches.youtube.layout.player.buttons.fingerprints.PlayerControlsVisibilityModelFingerprint
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
import org.jf.dexlib2.iface.instruction.formats.Instruction3rc
@Patch
@DependsOn([IntegrationsPatch::class, SettingsPatch::class])
@Name("hide-player-buttons")
@Description("Adds the option to hide video player previous and next buttons.")
@HidePlayerButtonsCompatibility
@Version("0.0.1")
class HidePlayerButtonsPatch : BytecodePatch(
listOf(PlayerControlsVisibilityModelFingerprint)
) {
private object ParameterOffsets {
const val HAS_NEXT = 5
}
override fun execute(context: BytecodeContext): PatchResult {
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
SwitchPreference(
"revanced_hide_player_buttons",
StringResource(
"revanced_hide_player_buttons_title",
"Hide previous & next video buttons"
),
false,
StringResource(
"revanced_hide_player_buttons_summary_on",
"The buttons are hidden"
),
StringResource(
"revanced_hide_player_buttons_summary_off",
"The buttons are shown"
)
)
)
PlayerControlsVisibilityModelFingerprint.result?.apply {
val callIndex = scanResult.patternScanResult!!.endIndex
val callInstruction = mutableMethod.instruction(callIndex) as Instruction3rc
// overriding this parameter register hides the previous and next buttons
val hasNextParameterRegister = callInstruction.startRegister + ParameterOffsets.HAS_NEXT
mutableMethod.addInstructions(
callIndex,
"""
invoke-static { }, Lapp/revanced/integrations/patches/HidePlayerButtonsPatch;->hideButtons()Z
move-result v$hasNextParameterRegister
xor-int/lit8 v$hasNextParameterRegister, v$hasNextParameterRegister, 1
"""
)
} ?: return PlayerControlsVisibilityModelFingerprint.toErrorResult()
return PatchResultSuccess()
}
}

View File

@@ -4,7 +4,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[ [
Package("com.google.android.youtube", arrayOf("17.49.37")) Package("com.google.android.youtube", arrayOf("17.49.37", "18.03.36"))
] ]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -7,15 +7,12 @@ import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.youtube.layout.playerbuttonbackground.annotations.PlayerButtonBackgroundCompatibility import app.revanced.patches.youtube.layout.playerbuttonbackground.annotations.PlayerButtonBackgroundCompatibility
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
import org.w3c.dom.Element import org.w3c.dom.Element
@Patch @Patch
@DependsOn([FixLocaleConfigErrorPatch::class])
@Name("remove-player-button-background") @Name("remove-player-button-background")
@Description("Removes the background from the video player buttons.") @Description("Removes the background from the video player buttons.")
@PlayerButtonBackgroundCompatibility @PlayerButtonBackgroundCompatibility

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -4,33 +4,14 @@ import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.AccessFlags import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
@FuzzyPatternScanMethod(3) @FuzzyPatternScanMethod(3)
object EngagementPanelControllerFingerprint : MethodFingerprint( object EngagementPanelControllerFingerprint : MethodFingerprint(
"L", AccessFlags.PRIVATE or AccessFlags.FINAL, listOf("L", "L", "Z", "Z", "Z"), listOf( returnType = "L",
Opcode.MOVE_OBJECT_FROM16, access = AccessFlags.PRIVATE or AccessFlags.FINAL,
Opcode.MOVE_OBJECT_FROM16, strings = listOf(
Opcode.MOVE_FROM16, "EngagementPanelController: cannot show EngagementPanel before EngagementPanelController.init() has been called.",
Opcode.IGET_BOOLEAN, "[EngagementPanel] Cannot show EngagementPanel before EngagementPanelController.init() has been called."
Opcode.CONST_4,
Opcode.IF_NEZ,
Opcode.CONST_STRING,
Opcode.INVOKE_STATIC,
Opcode.SGET_OBJECT,
Opcode.SGET_OBJECT,
Opcode.CONST_STRING,
Opcode.INVOKE_STATIC,
Opcode.RETURN_OBJECT,
Opcode.IGET_OBJECT,
Opcode.IGET_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.CONST_4,
Opcode.CONST_4,
Opcode.CONST_4,
Opcode.CONST_4,
Opcode.CONST_4,
Opcode.CONST_4,
) )
) )

View File

@@ -1,5 +1,6 @@
package app.revanced.patches.youtube.layout.playerpopuppanels.patch package app.revanced.patches.youtube.layout.playerpopuppanels.patch
import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.Description import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version import app.revanced.patcher.annotation.Version
@@ -10,12 +11,12 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
import app.revanced.patches.youtube.layout.playerpopuppanels.annotations.PlayerPopupPanelsCompatibility import app.revanced.patches.youtube.layout.playerpopuppanels.annotations.PlayerPopupPanelsCompatibility
import app.revanced.patches.youtube.layout.playerpopuppanels.fingerprints.EngagementPanelControllerFingerprint import app.revanced.patches.youtube.layout.playerpopuppanels.fingerprints.EngagementPanelControllerFingerprint
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
@Patch @Patch
@DependsOn([IntegrationsPatch::class, SettingsPatch::class]) @DependsOn([IntegrationsPatch::class, SettingsPatch::class])
@@ -39,7 +40,8 @@ class PlayerPopupPanelsPatch : BytecodePatch(
) )
) )
val engagementPanelControllerMethod = EngagementPanelControllerFingerprint.result!!.mutableMethod val engagementPanelControllerMethod = EngagementPanelControllerFingerprint
.result?.mutableMethod ?: return EngagementPanelControllerFingerprint.toErrorResult()
engagementPanelControllerMethod.addInstructions( engagementPanelControllerMethod.addInstructions(
0, """ 0, """

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -19,17 +19,28 @@ import app.revanced.patches.youtube.layout.returnyoutubedislike.annotations.Retu
import app.revanced.patches.youtube.layout.returnyoutubedislike.fingerprints.* import app.revanced.patches.youtube.layout.returnyoutubedislike.fingerprints.*
import app.revanced.patches.youtube.layout.returnyoutubedislike.resource.patch.ReturnYouTubeDislikeResourcePatch import app.revanced.patches.youtube.layout.returnyoutubedislike.resource.patch.ReturnYouTubeDislikeResourcePatch
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch
import app.revanced.patches.youtube.misc.video.videoid.patch.VideoIdPatch import app.revanced.patches.youtube.misc.video.videoid.patch.VideoIdPatch
@Patch @Patch
@DependsOn([IntegrationsPatch::class, VideoIdPatch::class, ReturnYouTubeDislikeResourcePatch::class]) @DependsOn(
[
IntegrationsPatch::class,
VideoIdPatch::class,
ReturnYouTubeDislikeResourcePatch::class,
PlayerTypeHookPatch::class,
]
)
@Name("return-youtube-dislike") @Name("return-youtube-dislike")
@Description("Shows the dislike count of videos using the Return YouTube Dislike API.") @Description("Shows the dislike count of videos using the Return YouTube Dislike API.")
@ReturnYouTubeDislikeCompatibility @ReturnYouTubeDislikeCompatibility
@Version("0.0.1") @Version("0.0.1")
class ReturnYouTubeDislikePatch : BytecodePatch( class ReturnYouTubeDislikePatch : BytecodePatch(
listOf( listOf(
TextComponentSpecParentFingerprint, LikeFingerprint, DislikeFingerprint, RemoveLikeFingerprint TextComponentSpecParentFingerprint,
LikeFingerprint,
DislikeFingerprint,
RemoveLikeFingerprint,
) )
) { ) {
override fun execute(context: BytecodeContext): PatchResult { override fun execute(context: BytecodeContext): PatchResult {

View File

@@ -11,11 +11,10 @@ import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patches.shared.settings.preference.impl.Preference import app.revanced.patches.shared.settings.preference.impl.Preference
import app.revanced.patches.shared.settings.preference.impl.StringResource import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.youtube.layout.returnyoutubedislike.annotations.ReturnYouTubeDislikeCompatibility import app.revanced.patches.youtube.layout.returnyoutubedislike.annotations.ReturnYouTubeDislikeCompatibility
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
import app.revanced.util.resources.ResourceUtils.mergeStrings import app.revanced.util.resources.ResourceUtils.mergeStrings
@DependsOn([FixLocaleConfigErrorPatch::class, SettingsPatch::class]) @DependsOn([SettingsPatch::class])
@Name("return-youtube-dislike-resource-patch") @Name("return-youtube-dislike-resource-patch")
@Description("Adds the preferences for Return YouTube Dislike.") @Description("Adds the preferences for Return YouTube Dislike.")
@ReturnYouTubeDislikeCompatibility @ReturnYouTubeDislikeCompatibility

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -1,41 +0,0 @@
package app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.sponsorblock.resource.patch.SponsorBlockResourcePatch
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
@FuzzyPatternScanMethod(3)
object ShortsPlayerConstructorFingerprint : MethodFingerprint(
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
opcodes = listOf(
Opcode.MOVE_OBJECT_FROM16,
Opcode.MOVE_OBJECT_FROM16,
Opcode.MOVE_OBJECT_FROM16,
Opcode.INVOKE_DIRECT_RANGE,
Opcode.NEW_INSTANCE,
Opcode.INVOKE_DIRECT,
Opcode.IPUT_OBJECT,
Opcode.NEW_INSTANCE,
Opcode.INVOKE_DIRECT,
Opcode.IPUT_OBJECT,
Opcode.NEW_INSTANCE,
Opcode.INVOKE_DIRECT,
Opcode.IPUT_OBJECT,
Opcode.NEW_INSTANCE,
Opcode.INVOKE_DIRECT,
Opcode.IPUT_OBJECT,
Opcode.IPUT_OBJECT,
Opcode.CONST_4
),
customFingerprint = { methodDef ->
methodDef.implementation?.instructions?.any { instruction ->
instruction.opcode.ordinal == Opcode.CONST.ordinal &&
(instruction as? WideLiteralInstruction)?.wideLiteral == SponsorBlockResourcePatch.reelButtonGroupResourceId
} == true
}
)

View File

@@ -19,12 +19,12 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.shared.fingerprints.SeekbarFingerprint import app.revanced.patches.shared.fingerprints.SeekbarFingerprint
import app.revanced.patches.shared.fingerprints.SeekbarOnDrawFingerprint import app.revanced.patches.shared.fingerprints.SeekbarOnDrawFingerprint
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
import app.revanced.patches.youtube.layout.autocaptions.fingerprints.StartVideoInformerFingerprint
import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility
import app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints.* import app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints.*
import app.revanced.patches.youtube.layout.sponsorblock.resource.patch.SponsorBlockResourcePatch 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.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.playercontrols.bytecode.patch.PlayerControlsBytecodePatch import app.revanced.patches.youtube.misc.playercontrols.bytecode.patch.PlayerControlsBytecodePatch
import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch
import app.revanced.patches.youtube.misc.video.information.patch.VideoInformationPatch import app.revanced.patches.youtube.misc.video.information.patch.VideoInformationPatch
import app.revanced.patches.youtube.misc.video.videoid.patch.VideoIdPatch import app.revanced.patches.youtube.misc.video.videoid.patch.VideoIdPatch
import org.jf.dexlib2.Opcode import org.jf.dexlib2.Opcode
@@ -39,13 +39,14 @@ import org.jf.dexlib2.iface.reference.StringReference
dependencies = [ dependencies = [
VideoInformationPatch::class, // updates video information and adds method to seek in video VideoInformationPatch::class, // updates video information and adds method to seek in video
PlayerControlsBytecodePatch::class, PlayerControlsBytecodePatch::class,
PlayerTypeHookPatch::class,
IntegrationsPatch::class, IntegrationsPatch::class,
SponsorBlockResourcePatch::class, SponsorBlockResourcePatch::class,
VideoIdPatch::class VideoIdPatch::class
] ]
) )
@Name("sponsorblock") @Name("sponsorblock")
@Description("Integrate SponsorBlock.") @Description("Integrates SponsorBlock which allows skipping video segments such as sponsored content.")
@SponsorBlockCompatibility @SponsorBlockCompatibility
@Version("0.0.1") @Version("0.0.1")
class SponsorBlockBytecodePatch : BytecodePatch( class SponsorBlockBytecodePatch : BytecodePatch(
@@ -54,8 +55,6 @@ class SponsorBlockBytecodePatch : BytecodePatch(
NextGenWatchLayoutFingerprint, NextGenWatchLayoutFingerprint,
AppendTimeFingerprint, AppendTimeFingerprint,
PlayerOverlaysLayoutInitFingerprint, PlayerOverlaysLayoutInitFingerprint,
ShortsPlayerConstructorFingerprint,
StartVideoInformerFingerprint
) )
) { ) {
@@ -260,32 +259,15 @@ class SponsorBlockBytecodePatch : BytecodePatch(
if (it.opcode.ordinal != Opcode.CONST_STRING.ordinal) continue if (it.opcode.ordinal != Opcode.CONST_STRING.ordinal) continue
when (((it as ReferenceInstruction).reference as StringReference).string) { when (((it as ReferenceInstruction).reference as StringReference).string) {
"replaceMeWithsetSponsorBarRect" -> "replaceMeWithsetSponsorBarRect" -> method.replaceStringInstruction(
method.replaceStringInstruction(index, it, rectangleFieldName) index,
it,
"replaceMeWithsetMillisecondMethod" -> rectangleFieldName
method.replaceStringInstruction(index, it, "seekHelper") )
} }
} }
} ?: return PatchResultError("Could not find the method which contains the replaceMeWith* strings") } ?: return PatchResultError("Could not find the method which contains the replaceMeWith* strings")
val startVideoInformerMethod = StartVideoInformerFingerprint.result!!.mutableMethod
startVideoInformerMethod.addInstructions(
0, """
const/4 v0, 0x0
sput-boolean v0, $INTEGRATIONS_PLAYER_CONTROLLER_CLASS_DESCRIPTOR->shorts_playing:Z
"""
)
val shortsPlayerConstructorMethod = ShortsPlayerConstructorFingerprint.result!!.mutableMethod
shortsPlayerConstructorMethod.addInstructions(
0, """
const/4 v0, 0x1
sput-boolean v0, $INTEGRATIONS_PLAYER_CONTROLLER_CLASS_DESCRIPTOR->shorts_playing:Z
"""
)
// TODO: isSBChannelWhitelisting implementation // TODO: isSBChannelWhitelisting implementation
return PatchResultSuccess() return PatchResultSuccess()

View File

@@ -11,7 +11,6 @@ import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
import app.revanced.patches.shared.settings.preference.impl.Preference import app.revanced.patches.shared.settings.preference.impl.Preference
import app.revanced.patches.shared.settings.preference.impl.StringResource import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
import app.revanced.util.resources.ResourceUtils import app.revanced.util.resources.ResourceUtils
import app.revanced.util.resources.ResourceUtils.copyResources import app.revanced.util.resources.ResourceUtils.copyResources
@@ -20,12 +19,9 @@ import app.revanced.util.resources.ResourceUtils.mergeStrings
@Name("sponsorblock-resource-patch") @Name("sponsorblock-resource-patch")
@SponsorBlockCompatibility @SponsorBlockCompatibility
@DependsOn([FixLocaleConfigErrorPatch::class, SettingsPatch::class, ResourceMappingPatch::class]) @DependsOn([SettingsPatch::class, ResourceMappingPatch::class])
@Version("0.0.1") @Version("0.0.1")
class SponsorBlockResourcePatch : ResourcePatch { class SponsorBlockResourcePatch : ResourcePatch {
companion object {
internal var reelButtonGroupResourceId: Long = 0
}
override fun execute(context: ResourceContext): PatchResult { override fun execute(context: ResourceContext): PatchResult {
val youtubePackage = "com.google.android.youtube" val youtubePackage = "com.google.android.youtube"
@@ -107,10 +103,6 @@ class SponsorBlockResourcePatch : ResourcePatch {
} }
}.close() // close afterwards }.close() // close afterwards
reelButtonGroupResourceId = ResourceMappingPatch.resourceMappings.single {
it.type == "id" && it.name == "reel_persistent_edu_button_group"
}.id
return PatchResultSuccess() return PatchResultSuccess()
} }
} }

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -8,13 +8,12 @@ import app.revanced.patcher.patch.*
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.youtube.layout.theme.annotations.ThemeCompatibility import app.revanced.patches.youtube.layout.theme.annotations.ThemeCompatibility
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
import app.revanced.util.resources.ResourceUtils import app.revanced.util.resources.ResourceUtils
import app.revanced.util.resources.ResourceUtils.copyResources import app.revanced.util.resources.ResourceUtils.copyResources
import org.w3c.dom.Element import org.w3c.dom.Element
@Patch @Patch
@DependsOn([LithoThemePatch::class, FixLocaleConfigErrorPatch::class]) @DependsOn([LithoThemePatch::class])
@Name("theme") @Name("theme")
@Description("Applies a custom theme.") @Description("Applies a custom theme.")
@ThemeCompatibility @ThemeCompatibility

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -29,7 +29,7 @@ class DebuggingPatch : ResourcePatch {
listOf( listOf(
SwitchPreference( SwitchPreference(
"revanced_debug_enabled", "revanced_debug_enabled",
StringResource("revanced_debug_enabled_title", "Enable debug logs"), StringResource("revanced_debug_enabled_title", "Debug logging"),
false, false,
StringResource("revanced_debug_summary_on", "Debug logs are enabled"), StringResource("revanced_debug_summary_on", "Debug logs are enabled"),
StringResource("revanced_debug_summary_off", "Debug logs are disabled") StringResource("revanced_debug_summary_off", "Debug logs are disabled")
@@ -38,11 +38,21 @@ class DebuggingPatch : ResourcePatch {
"revanced_debug_stacktrace_enabled", "revanced_debug_stacktrace_enabled",
StringResource( StringResource(
"revanced_debug_stacktrace_enabled_title", "revanced_debug_stacktrace_enabled_title",
"Print stack traces" "Log stack traces"
), ),
false, false,
StringResource("revanced_debug_stacktrace_summary_on", "Enabled printing stack traces"), StringResource("revanced_debug_stacktrace_summary_on", "Debug logs include stack trace"),
StringResource("revanced_debug_stacktrace_summary_off", "Disabled printing stack traces") StringResource("revanced_debug_stacktrace_summary_off", "Debug logs do not include stack trace")
),
SwitchPreference(
"revanced_debug_toast_on_error_enabled",
StringResource(
"revanced_debug_toast_on_error_enabled_title",
"Show toast on ReVanced error"
),
true,
StringResource("revanced_debug_toast_on_error_summary_on", "Toast shown if error occurs"),
StringResource("revanced_debug_toast_on_error_summary_off", "Toast not shown if error occurs")
), ),
), ),
StringResource("revanced_debug_summary", "Enable or disable debugging options") StringResource("revanced_debug_summary", "Enable or disable debugging options")

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -1,9 +0,0 @@
package app.revanced.patches.youtube.misc.manifest.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility([Package("com.google.android.youtube")])
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class FixLocaleConfigErrorCompatibility

View File

@@ -1,36 +0,0 @@
package app.revanced.patches.youtube.misc.manifest.patch
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patches.youtube.misc.manifest.annotations.FixLocaleConfigErrorCompatibility
import org.w3c.dom.Element
@Name("locale-config-fix")
@Description("Fixes an error when building the resources by patching the manifest file.")
@FixLocaleConfigErrorCompatibility
@Version("0.0.1")
class FixLocaleConfigErrorPatch : ResourcePatch {
override fun execute(context: ResourceContext): PatchResult {
// create an xml editor instance
context.xmlEditor["AndroidManifest.xml"].use {
// edit the application nodes attribute...
val applicationNode = it
.file
.getElementsByTagName("application")
.item(0) as Element
// by replacing the attributes name
val attribute = "android:localeConfig"
applicationNode.setAttribute("localeConfig", applicationNode.getAttribute(attribute))
applicationNode.removeAttribute(attribute)
}
return PatchResultSuccess()
}
}

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -8,7 +8,8 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch import app.revanced.patches.shared.settings.preference.impl.Preference
import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
import app.revanced.patches.youtube.misc.microg.shared.Constants.PACKAGE_NAME import app.revanced.patches.youtube.misc.microg.shared.Constants.PACKAGE_NAME
import app.revanced.patches.youtube.misc.microg.shared.Constants.REVANCED_APP_NAME import app.revanced.patches.youtube.misc.microg.shared.Constants.REVANCED_APP_NAME
@@ -16,15 +17,13 @@ import app.revanced.patches.youtube.misc.microg.shared.Constants.REVANCED_PACKAG
import app.revanced.patches.youtube.misc.microg.shared.Constants.SPOOFED_PACKAGE_NAME import app.revanced.patches.youtube.misc.microg.shared.Constants.SPOOFED_PACKAGE_NAME
import app.revanced.patches.youtube.misc.microg.shared.Constants.SPOOFED_PACKAGE_SIGNATURE import app.revanced.patches.youtube.misc.microg.shared.Constants.SPOOFED_PACKAGE_SIGNATURE
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
import app.revanced.patches.shared.settings.preference.impl.Preference
import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsResourcePatch import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsResourcePatch
import app.revanced.util.microg.Constants.MICROG_VENDOR import app.revanced.util.microg.Constants.MICROG_VENDOR
import app.revanced.util.microg.MicroGManifestHelper import app.revanced.util.microg.MicroGManifestHelper
import app.revanced.util.microg.MicroGResourceHelper import app.revanced.util.microg.MicroGResourceHelper
@Name("microg-resource-patch") @Name("microg-resource-patch")
@DependsOn([FixLocaleConfigErrorPatch::class, SettingsResourcePatch::class]) @DependsOn([SettingsResourcePatch::class])
@Description("Resource patch to allow YouTube ReVanced to run without root and under a different package name.") @Description("Resource patch to allow YouTube ReVanced to run without root and under a different package name.")
@MicroGPatchCompatibility @MicroGPatchCompatibility
@Version("0.0.1") @Version("0.0.1")

View File

@@ -1,9 +1,9 @@
package app.revanced.patches.youtube.misc.microg.shared package app.revanced.patches.youtube.misc.microg.shared
object Constants { internal object Constants {
internal const val REVANCED_APP_NAME = "YouTube ReVanced" const val REVANCED_APP_NAME = "YouTube ReVanced"
internal const val REVANCED_PACKAGE_NAME = "app.revanced.android.youtube" const val REVANCED_PACKAGE_NAME = "app.revanced.android.youtube"
internal const val PACKAGE_NAME = "com.google.android.youtube" const val PACKAGE_NAME = "com.google.android.youtube"
internal const val SPOOFED_PACKAGE_NAME = PACKAGE_NAME const val SPOOFED_PACKAGE_NAME = PACKAGE_NAME
internal const val SPOOFED_PACKAGE_SIGNATURE = "24bb24c05e47e0aefa68a58a766179d9b613a600" const val SPOOFED_PACKAGE_SIGNATURE = "24bb24c05e47e0aefa68a58a766179d9b613a600"
} }

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.google.android.youtube", arrayOf("17.49.37") "com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

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