1
mirror of https://github.com/revanced/revanced-integrations synced 2025-11-19 03:23:27 +01:00

Compare commits

...

93 Commits

Author SHA1 Message Date
semantic-release-bot
d996d3832a chore(release): 1.12.0-dev.1 [skip ci]
# [1.12.0-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v1.11.2-dev.3...v1.12.0-dev.1) (2024-07-14)

### Features

* **YouTube:** Add `Bypass image region restrictions` patch ([#667](https://github.com/ReVanced/revanced-integrations/issues/667)) ([396ba77](396ba77c20))
2024-07-14 22:58:56 +00:00
LisoUseInAIKyrios
396ba77c20 feat(YouTube): Add Bypass image region restrictions patch (#667) 2024-07-15 02:55:42 +04:00
semantic-release-bot
67ff3172bb chore(release): 1.11.2-dev.3 [skip ci]
## [1.11.2-dev.3](https://github.com/ReVanced/revanced-integrations/compare/v1.11.2-dev.2...v1.11.2-dev.3) (2024-07-14)
2024-07-14 22:43:08 +00:00
oSumAtrIX
7af763f4b1 build(Needs bump): Sign APK properly without relying on internal Gradle classes 2024-07-15 00:40:02 +02:00
oSumAtrIX
2fabdb245f ci: Add custom release rule to create a build release 2024-07-15 00:40:02 +02:00
semantic-release-bot
3368023ff9 chore(release): 1.11.2-dev.2 [skip ci]
## [1.11.2-dev.2](https://github.com/ReVanced/revanced-integrations/compare/v1.11.2-dev.1...v1.11.2-dev.2) (2024-07-14)

### Bug Fixes

* **YouTube - Alternative thumbnails:** Always use primary thumbnail domain for still captures ([#666](https://github.com/ReVanced/revanced-integrations/issues/666)) ([7cdaf8d](7cdaf8df14))
* **YouTube - Hide layout components:** Hide new type of horizontal shelf ([1fa59a6](1fa59a62a1))
2024-07-14 14:15:08 +00:00
LisoUseInAIKyrios
1fa59a62a1 fix(YouTube - Hide layout components): Hide new type of horizontal shelf 2024-07-14 18:11:55 +04:00
semantic-release-bot
66cf6c4263 chore(release): 1.11.2-dev.2 [skip ci]
## [1.11.2-dev.2](https://github.com/ReVanced/revanced-integrations/compare/v1.11.2-dev.1...v1.11.2-dev.2) (2024-07-13)

### Bug Fixes

* **YouTube - Alternative thumbnails:** Always use primary thumbnail domain for still captures ([#666](https://github.com/ReVanced/revanced-integrations/issues/666)) ([7cdaf8d](7cdaf8df14))
2024-07-13 15:55:01 +00:00
LisoUseInAIKyrios
7cdaf8df14 fix(YouTube - Alternative thumbnails): Always use primary thumbnail domain for still captures (#666) 2024-07-13 19:32:40 +04:00
oSumAtrIX
34ef27de79 ci: Correct usage of repository variable 2024-07-13 00:44:39 +02:00
semantic-release-bot
6fe85a21e9 chore(release): 1.11.2-dev.1 [skip ci]
## [1.11.2-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v1.11.1...v1.11.2-dev.1) (2024-07-12)

### Bug Fixes

* adjust blacklist ([d8d2a85](d8d2a852d3))
* **YouTube - Hide keyword content:** Do not hide flyout menu ([cda1f31](cda1f3160c))
* **YouTube - Hide keyword content:** Do not hide flyout menu ([#664](https://github.com/ReVanced/revanced-integrations/issues/664)) ([120188d](120188d643))
2024-07-12 17:52:23 +00:00
LisoUseInAIKyrios
120188d643 fix(YouTube - Hide keyword content): Do not hide flyout menu (#664) 2024-07-12 21:49:18 +04:00
LisoUseInAIKyrios
d8d2a852d3 fix: adjust blacklist 2024-07-12 21:48:36 +04:00
LisoUseInAIKyrios
9469239264 refactor 2024-07-12 21:45:44 +04:00
LisoUseInAIKyrios
cda1f3160c fix(YouTube - Hide keyword content): Do not hide flyout menu 2024-07-12 21:22:42 +04:00
semantic-release-bot
34a224e5de chore(release): 1.11.1 [skip ci]
## [1.11.1](https://github.com/ReVanced/revanced-integrations/compare/v1.11.0...v1.11.1) (2024-07-11)

### Bug Fixes

* **YouTube - Hide ads:** Hide new types of home feed button ads ([#662](https://github.com/ReVanced/revanced-integrations/issues/662)) ([ff2637c](ff2637cb4c))
* **YouTube - Hide layout components:** Detect if a keyword filter hides all videos ([#657](https://github.com/ReVanced/revanced-integrations/issues/657)) ([3a3ceec](3a3ceec4b5))
* **YouTube - Hide layout components:** Hide new kind of community post ([#659](https://github.com/ReVanced/revanced-integrations/issues/659)) ([c237e3c](c237e3c02c))
* **YouTube - Settings:** Move some settings to different menus, adjust default setting values ([#661](https://github.com/ReVanced/revanced-integrations/issues/661)) ([77533cf](77533cf3d6))
* **YouTube - SponsorBlock:** Skip segments when casting ([#655](https://github.com/ReVanced/revanced-integrations/issues/655)) ([5ce16ee](5ce16eedc6))
2024-07-11 18:53:43 +00:00
LisoUseInAIKyrios
1aba976b28 chore: Merge branch dev to main (#658) 2024-07-11 22:50:39 +04:00
semantic-release-bot
6fef1b28a4 chore(release): 1.11.1-dev.4 [skip ci]
## [1.11.1-dev.4](https://github.com/ReVanced/revanced-integrations/compare/v1.11.1-dev.3...v1.11.1-dev.4) (2024-07-10)

### Bug Fixes

* **YouTube - SponsorBlock:** Skip segments when casting ([#655](https://github.com/ReVanced/revanced-integrations/issues/655)) ([5ce16ee](5ce16eedc6))
2024-07-10 22:14:58 +00:00
Sami Alaoui
5ce16eedc6 fix(YouTube - SponsorBlock): Skip segments when casting (#655)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
Co-authored-by: Hoàng Gia Bảo <70064328+YT-Advanced@users.noreply.github.com>
Co-authored-by: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
fix(YouTube - SponsorBlock): Skip segments when casting #655
2024-07-11 00:11:55 +02:00
semantic-release-bot
7aec04647a chore(release): 1.11.1-dev.3 [skip ci]
## [1.11.1-dev.3](https://github.com/ReVanced/revanced-integrations/compare/v1.11.1-dev.2...v1.11.1-dev.3) (2024-07-05)

### Bug Fixes

* **YouTube - Hide ads:** Hide new types of home feed button ads ([#662](https://github.com/ReVanced/revanced-integrations/issues/662)) ([ff2637c](ff2637cb4c))
* **YouTube - Settings:** Move some settings to different menus, adjust default setting values ([#661](https://github.com/ReVanced/revanced-integrations/issues/661)) ([77533cf](77533cf3d6))
2024-07-05 17:44:15 +00:00
LisoUseInAIKyrios
ff2637cb4c fix(YouTube - Hide ads): Hide new types of home feed button ads (#662) 2024-07-05 21:40:52 +04:00
LisoUseInAIKyrios
77533cf3d6 fix(YouTube - Settings): Move some settings to different menus, adjust default setting values (#661) 2024-07-05 21:38:33 +04:00
semantic-release-bot
d9f7679020 chore(release): 1.11.1-dev.2 [skip ci]
## [1.11.1-dev.2](https://github.com/ReVanced/revanced-integrations/compare/v1.11.1-dev.1...v1.11.1-dev.2) (2024-06-30)

### Bug Fixes

* **YouTube - Hide layout components:** Hide new kind of community post ([#659](https://github.com/ReVanced/revanced-integrations/issues/659)) ([c237e3c](c237e3c02c))
2024-06-30 18:45:48 +00:00
Bceez
c237e3c02c fix(YouTube - Hide layout components): Hide new kind of community post (#659)
fix(YouTube - Hide layout components) Community posts not hiding
2024-06-30 20:42:52 +02:00
semantic-release-bot
3dda3de280 chore(release): 1.11.1-dev.1 [skip ci]
## [1.11.1-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v1.11.0...v1.11.1-dev.1) (2024-06-23)

### Bug Fixes

* **YouTube - Hide layout components:** Detect if a keyword filter hides all videos ([#657](https://github.com/ReVanced/revanced-integrations/issues/657)) ([3a3ceec](3a3ceec4b5))
2024-06-23 12:50:16 +00:00
LisoUseInAIKyrios
3a3ceec4b5 fix(YouTube - Hide layout components): Detect if a keyword filter hides all videos (#657) 2024-06-23 15:46:42 +03:00
semantic-release-bot
8fe73b25d9 chore(release): 1.11.0 [skip ci]
# [1.11.0](https://github.com/ReVanced/revanced-integrations/compare/v1.10.0...v1.11.0) (2024-06-23)

### Bug Fixes

* **YouTube - Client spoof:** Correctly play more livestreams using Android VR ([#652](https://github.com/ReVanced/revanced-integrations/issues/652)) ([58f8172](58f8172b2d))
* **YouTube - Hide description components:** Replace `Hide game section` and `Hide music section` with `Hide attributes section` ([#654](https://github.com/ReVanced/revanced-integrations/issues/654)) ([f82dfce](f82dfce887))
* **YouTube - Return YouTube Dislike:** Do not replace view count with dislikes ([5f79196](5f79196692))
* **YouTube - Spoof client:** Correctly play as background audio only with Android VR ([9adbc66](9adbc66197))
* **YouTube - Spoof client:** Correctly play some live streams when using Android VR ([f74fb17](f74fb17a12))
* **YouTube:** Rename `Minimized playback` to `Remove background playback restrictions` ([#651](https://github.com/ReVanced/revanced-integrations/issues/651)) ([84c50c0](84c50c080c))

### Features

* **Boost For Reddit:** Add `Fix /s/ links` patch ([#631](https://github.com/ReVanced/revanced-integrations/issues/631)) ([0c9ad35](0c9ad35fc9))
* **YouTube - Comments:** Add `Hide 'Create a Short' button` option ([#656](https://github.com/ReVanced/revanced-integrations/issues/656)) ([064d8e9](064d8e99a9))
* **YouTube - Comments:** Add `Hide Thanks button` and `Hide 'Comments by members' header` options ([#653](https://github.com/ReVanced/revanced-integrations/issues/653)) ([240e805](240e805489))
* **YouTube - Miniplayer:** Rename `Tablet mini player` and allow selecting the style of the in-app miniplayer ([#649](https://github.com/ReVanced/revanced-integrations/issues/649)) ([f483af6](f483af6d3a))
2024-06-23 12:15:11 +00:00
oSumAtrIX
fac49c7c10 chore: Merge branch dev to main (#650) 2024-06-23 14:11:58 +02:00
semantic-release-bot
e018746ceb chore(release): 1.11.0-dev.7 [skip ci]
# [1.11.0-dev.7](https://github.com/ReVanced/revanced-integrations/compare/v1.11.0-dev.6...v1.11.0-dev.7) (2024-06-17)

### Bug Fixes

* **YouTube - Hide description components:** Replace `Hide game section` and `Hide music section` with `Hide attributes section` ([#654](https://github.com/ReVanced/revanced-integrations/issues/654)) ([f82dfce](f82dfce887))
2024-06-17 22:57:01 +00:00
ILoveOpenSourceApplications
f82dfce887 fix(YouTube - Hide description components): Replace Hide game section and Hide music section with Hide attributes section (#654)
Co-authored-by: ILoveOpenSourceApplications <ILoveOpenSourceApplications@users.noreply.github.com>
2024-06-18 00:54:06 +02:00
semantic-release-bot
a1e358bc18 chore(release): 1.11.0-dev.6 [skip ci]
# [1.11.0-dev.6](https://github.com/ReVanced/revanced-integrations/compare/v1.11.0-dev.5...v1.11.0-dev.6) (2024-06-17)

### Features

* **YouTube - Comments:** Add `Hide 'Create a Short' button` option ([#656](https://github.com/ReVanced/revanced-integrations/issues/656)) ([064d8e9](064d8e99a9))
2024-06-17 22:52:30 +00:00
ILoveOpenSourceApplications
064d8e99a9 feat(YouTube - Comments): Add Hide 'Create a Short' button option (#656)
Co-authored-by: ILoveOpenSourceApplications <ILoveOpenSourceApplications@users.noreply.github.com>
2024-06-18 00:49:14 +02:00
semantic-release-bot
84d2484ace chore(release): 1.11.0-dev.5 [skip ci]
# [1.11.0-dev.5](https://github.com/ReVanced/revanced-integrations/compare/v1.11.0-dev.4...v1.11.0-dev.5) (2024-06-09)

### Features

* **YouTube - Comments:** Add `Hide Thanks button` and `Hide 'Comments by members' header` options ([#653](https://github.com/ReVanced/revanced-integrations/issues/653)) ([240e805](240e805489))
2024-06-09 09:18:07 +00:00
ILoveOpenSourceApplications
240e805489 feat(YouTube - Comments): Add Hide Thanks button and Hide 'Comments by members' header options (#653) 2024-06-09 12:14:51 +03:00
semantic-release-bot
376eb46f10 chore(release): 1.11.0-dev.4 [skip ci]
# [1.11.0-dev.4](https://github.com/ReVanced/revanced-integrations/compare/v1.11.0-dev.3...v1.11.0-dev.4) (2024-06-09)

### Bug Fixes

* **YouTube - Client spoof:** Correctly play more livestreams using Android VR ([#652](https://github.com/ReVanced/revanced-integrations/issues/652)) ([58f8172](58f8172b2d))
2024-06-09 08:34:37 +00:00
LisoUseInAIKyrios
58f8172b2d fix(YouTube - Client spoof): Correctly play more livestreams using Android VR (#652) 2024-06-09 11:31:30 +03:00
semantic-release-bot
758dfade7f chore(release): 1.11.0-dev.3 [skip ci]
# [1.11.0-dev.3](https://github.com/ReVanced/revanced-integrations/compare/v1.11.0-dev.2...v1.11.0-dev.3) (2024-06-08)

### Features

* **Boost For Reddit:** Add `Fix /s/ links` patch ([#631](https://github.com/ReVanced/revanced-integrations/issues/631)) ([0c9ad35](0c9ad35fc9))
2024-06-08 16:34:15 +00:00
Yan
0c9ad35fc9 feat(Boost For Reddit): Add Fix /s/ links patch (#631)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2024-06-08 18:31:13 +02:00
semantic-release-bot
5da0913d1d chore(release): 1.11.0-dev.2 [skip ci]
# [1.11.0-dev.2](https://github.com/ReVanced/revanced-integrations/compare/v1.11.0-dev.1...v1.11.0-dev.2) (2024-06-08)

### Bug Fixes

* **YouTube:** Rename `Minimized playback` to `Remove background playback restrictions` ([#651](https://github.com/ReVanced/revanced-integrations/issues/651)) ([84c50c0](84c50c080c))
2024-06-08 08:37:59 +00:00
LisoUseInAIKyrios
84c50c080c fix(YouTube): Rename Minimized playback to Remove background playback restrictions (#651) 2024-06-08 11:34:57 +03:00
semantic-release-bot
925f8bb297 chore(release): 1.11.0-dev.1 [skip ci]
# [1.11.0-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v1.10.1-dev.3...v1.11.0-dev.1) (2024-06-07)

### Features

* **YouTube - Miniplayer:** Rename `Tablet mini player` and allow selecting the style of the in-app miniplayer ([#649](https://github.com/ReVanced/revanced-integrations/issues/649)) ([f483af6](f483af6d3a))
2024-06-07 22:48:23 +00:00
LisoUseInAIKyrios
f483af6d3a feat(YouTube - Miniplayer): Rename Tablet mini player and allow selecting the style of the in-app miniplayer (#649) 2024-06-08 01:45:24 +03:00
semantic-release-bot
7a7b2db6f7 chore(release): 1.10.1-dev.3 [skip ci]
## [1.10.1-dev.3](https://github.com/ReVanced/revanced-integrations/compare/v1.10.1-dev.2...v1.10.1-dev.3) (2024-06-07)

### Bug Fixes

* **YouTube - Spoof client:** Correctly play as background audio only with Android VR ([9adbc66](9adbc66197))
2024-06-07 14:06:57 +00:00
LisoUseInAIKyrios
9adbc66197 fix(YouTube - Spoof client): Correctly play as background audio only with Android VR 2024-06-07 17:03:34 +03:00
semantic-release-bot
7736ca4ef8 chore(release): 1.10.1-dev.2 [skip ci]
## [1.10.1-dev.2](https://github.com/ReVanced/revanced-integrations/compare/v1.10.1-dev.1...v1.10.1-dev.2) (2024-06-06)

### Bug Fixes

* **YouTube - Return YouTube Dislike:** Do not replace view count with dislikes ([5f79196](5f79196692))
2024-06-06 09:42:56 +00:00
LisoUseInAIKyrios
5f79196692 fix(YouTube - Return YouTube Dislike): Do not replace view count with dislikes 2024-06-06 12:39:42 +03:00
semantic-release-bot
ecd687100c chore(release): 1.10.1-dev.1 [skip ci]
## [1.10.1-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v1.10.0...v1.10.1-dev.1) (2024-06-06)

### Bug Fixes

* **YouTube - Spoof client:** Correctly play some live streams when using Android VR ([f74fb17](f74fb17a12))
2024-06-06 09:26:10 +00:00
LisoUseInAIKyrios
f74fb17a12 fix(YouTube - Spoof client): Correctly play some live streams when using Android VR 2024-06-06 12:22:38 +03:00
semantic-release-bot
4f11b1d2eb chore(release): 1.10.0 [skip ci]
# [1.10.0](https://github.com/ReVanced/revanced-integrations/compare/v1.9.2...v1.10.0) (2024-06-02)

### Bug Fixes

* **YouTube - Spoof client:** Allow swipe gestures to enter/exit fullscreen when spoofing with `Android VR` client ([#645](https://github.com/ReVanced/revanced-integrations/issues/645)) ([b826865](b826865ef4))
* **YouTube - Spoof client:** Restore playback speed menu when spoofing to an iOS client ([2b2a70e](2b2a70e6ea))

### Features

* **YouTube - Hide layout components:** Disable like / subscribe button glow animation ([#646](https://github.com/ReVanced/revanced-integrations/issues/646)) ([777ffb1](777ffb1360))
* **YouTube - Playback speed:** Add option to show speed dialog button in video player ([#636](https://github.com/ReVanced/revanced-integrations/issues/636)) ([59220d6](59220d6e25))
* **YouTube:** Support version `19.12`, `19.13`, `19.14`, `19.15` and `19.16` ([#643](https://github.com/ReVanced/revanced-integrations/issues/643)) ([4dce73a](4dce73a6fb))
2024-06-02 17:45:16 +00:00
oSumAtrIX
5f0852c0c2 chore: Merge branch dev to main (#647) 2024-06-02 19:42:00 +02:00
semantic-release-bot
240e19966d chore(release): 1.10.0-dev.5 [skip ci]
# [1.10.0-dev.5](https://github.com/ReVanced/revanced-integrations/compare/v1.10.0-dev.4...v1.10.0-dev.5) (2024-06-02)

### Features

* **YouTube - Playback speed:** Add option to show speed dialog button in video player ([#636](https://github.com/ReVanced/revanced-integrations/issues/636)) ([59220d6](59220d6e25))
2024-06-02 15:51:00 +00:00
MarcaD
59220d6e25 feat(YouTube - Playback speed): Add option to show speed dialog button in video player (#636)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2024-06-02 17:48:02 +02:00
semantic-release-bot
571ce75c84 chore(release): 1.10.0-dev.4 [skip ci]
# [1.10.0-dev.4](https://github.com/ReVanced/revanced-integrations/compare/v1.10.0-dev.3...v1.10.0-dev.4) (2024-06-02)

### Bug Fixes

* **YouTube - Spoof client:** Restore playback speed menu when spoofing to an iOS client ([2b2a70e](2b2a70e6ea))
2024-06-02 15:46:59 +00:00
oSumAtrIX
2b2a70e6ea fix(YouTube - Spoof client): Restore playback speed menu when spoofing to an iOS client 2024-06-02 17:43:40 +02:00
semantic-release-bot
caa94fa6a4 chore(release): 1.10.0-dev.3 [skip ci]
# [1.10.0-dev.3](https://github.com/ReVanced/revanced-integrations/compare/v1.10.0-dev.2...v1.10.0-dev.3) (2024-06-01)

### Features

* **YouTube:** Support version `19.12`, `19.13`, `19.14`, `19.15` and `19.16` ([#643](https://github.com/ReVanced/revanced-integrations/issues/643)) ([4dce73a](4dce73a6fb))
2024-06-01 18:12:48 +00:00
LisoUseInAIKyrios
4dce73a6fb feat(YouTube): Support version 19.12, 19.13, 19.14, 19.15 and 19.16 (#643) 2024-06-01 22:09:36 +04:00
semantic-release-bot
a7e9390479 chore(release): 1.10.0-dev.2 [skip ci]
# [1.10.0-dev.2](https://github.com/ReVanced/revanced-integrations/compare/v1.10.0-dev.1...v1.10.0-dev.2) (2024-06-01)

### Bug Fixes

* **YouTube - Spoof client:** Allow swipe gestures to enter/exit fullscreen when spoofing with `Android VR` client ([#645](https://github.com/ReVanced/revanced-integrations/issues/645)) ([b826865](b826865ef4))
2024-06-01 09:32:09 +00:00
KAZI MMT
b826865ef4 fix(YouTube - Spoof client): Allow swipe gestures to enter/exit fullscreen when spoofing with Android VR client (#645) 2024-06-01 13:29:14 +04:00
semantic-release-bot
b1109350fa chore(release): 1.10.0-dev.1 [skip ci]
# [1.10.0-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v1.9.2...v1.10.0-dev.1) (2024-05-31)

### Features

* **YouTube - Hide layout components:** Disable like / subscribe button glow animation ([#646](https://github.com/ReVanced/revanced-integrations/issues/646)) ([777ffb1](777ffb1360))
2024-05-31 21:01:12 +00:00
LisoUseInAIKyrios
777ffb1360 feat(YouTube - Hide layout components): Disable like / subscribe button glow animation (#646) 2024-06-01 00:57:47 +04:00
semantic-release-bot
3fe0f3fa06 chore(release): 1.9.2 [skip ci]
## [1.9.2](https://github.com/ReVanced/revanced-integrations/compare/v1.9.1...v1.9.2) (2024-05-31)

### Bug Fixes

* **YouTube - Restore old video quality menu:** Do not show error toast if using an old version of YT ([#640](https://github.com/ReVanced/revanced-integrations/issues/640)) ([2227b45](2227b45020))
* **YouTube - Spoof client:** Disable AV1 if not supported by spoofing an older iOS device ([#644](https://github.com/ReVanced/revanced-integrations/issues/644)) ([e28edba](e28edbadbf))
* **YouTube - Spoof client:** Improve Android spoofing ([#641](https://github.com/ReVanced/revanced-integrations/issues/641)) ([baf967e](baf967e12a))
2024-05-31 10:07:33 +00:00
oSumAtrIX
60ae48bdbf chore: Merge branch dev to main (#642) 2024-05-31 12:04:12 +02:00
LisoUseInAIKyrios
1f36aae81b chore: Sanitize spoof logs 2024-05-29 00:48:04 +04:00
semantic-release-bot
3a978ecc92 chore(release): 1.9.2-dev.3 [skip ci]
## [1.9.2-dev.3](https://github.com/ReVanced/revanced-integrations/compare/v1.9.2-dev.2...v1.9.2-dev.3) (2024-05-28)

### Bug Fixes

* **YouTube - Spoof client:** Disable AV1 if not supported by spoofing an older iOS device ([#644](https://github.com/ReVanced/revanced-integrations/issues/644)) ([e28edba](e28edbadbf))
2024-05-28 19:42:25 +00:00
LisoUseInAIKyrios
e28edbadbf fix(YouTube - Spoof client): Disable AV1 if not supported by spoofing an older iOS device (#644) 2024-05-28 23:38:57 +04:00
semantic-release-bot
b2eac9099f chore(release): 1.9.2-dev.2 [skip ci]
## [1.9.2-dev.2](https://github.com/ReVanced/revanced-integrations/compare/v1.9.2-dev.1...v1.9.2-dev.2) (2024-05-27)

### Bug Fixes

* **YouTube - Restore old video quality menu:** Do not show error toast if using an old version of YT ([#640](https://github.com/ReVanced/revanced-integrations/issues/640)) ([2227b45](2227b45020))
2024-05-27 14:15:23 +00:00
LisoUseInAIKyrios
2227b45020 fix(YouTube - Restore old video quality menu): Do not show error toast if using an old version of YT (#640) 2024-05-27 18:12:05 +04:00
LisoUseInAIKyrios
22ed627a5d build: fix gradle 2024-05-27 18:11:33 +04:00
oSumAtrIX
2ac29c2579 build: Bump dependencies 2024-05-26 01:21:12 +02:00
oSumAtrIX
0e7bf05a0e docs: Improve issue templates 2024-05-26 00:43:36 +02:00
semantic-release-bot
97e531d795 chore(release): 1.9.2-dev.1 [skip ci]
## [1.9.2-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v1.9.1...v1.9.2-dev.1) (2024-05-25)

### Bug Fixes

* **YouTube - Spoof client:** Improve Android spoofing ([#641](https://github.com/ReVanced/revanced-integrations/issues/641)) ([baf967e](baf967e12a))
2024-05-25 22:13:13 +00:00
LisoUseInAIKyrios
baf967e12a fix(YouTube - Spoof client): Improve Android spoofing (#641) 2024-05-26 02:10:09 +04:00
semantic-release-bot
702df1a93d chore(release): 1.9.1 [skip ci]
## [1.9.1](https://github.com/ReVanced/revanced-integrations/compare/v1.9.0...v1.9.1) (2024-05-24)

### Bug Fixes

* **YouTube - Client spoof:** Spoof iOS client model to fix various side effects ([#638](https://github.com/ReVanced/revanced-integrations/issues/638)) ([fcff9a2](fcff9a2049))
2024-05-24 00:34:27 +00:00
oSumAtrIX
8a70ffe9c0 chore: Merge branch dev to main (#639) 2024-05-24 02:31:34 +02:00
semantic-release-bot
d2e74aca3d chore(release): 1.9.1-dev.1 [skip ci]
## [1.9.1-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v1.9.0...v1.9.1-dev.1) (2024-05-23)

### Bug Fixes

* **YouTube - Client spoof:** Spoof iOS client model to fix various side effects ([#638](https://github.com/ReVanced/revanced-integrations/issues/638)) ([fcff9a2](fcff9a2049))
2024-05-23 20:45:14 +00:00
oSumAtrIX
fcff9a2049 fix(YouTube - Client spoof): Spoof iOS client model to fix various side effects (#638)
Co-authored-by: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
2024-05-23 22:42:15 +02:00
semantic-release-bot
1b82e985b6 chore(release): 1.9.0 [skip ci]
# [1.9.0](https://github.com/ReVanced/revanced-integrations/compare/v1.8.0...v1.9.0) (2024-05-21)

### Bug Fixes

* Use Java instead of Kotlin Regex to improve reliability ([#628](https://github.com/ReVanced/revanced-integrations/issues/628)) ([44c3cc4](44c3cc4636))
* **YouTube - Client spoof:** Spoof client to fix playback ([#637](https://github.com/ReVanced/revanced-integrations/issues/637)) ([4c1f82a](4c1f82aa22))
* **YouTube - Hide keyword content:** Filter Shorts found in horizontal shelves ([75fa579](75fa5797f7))
* **YouTube - Hide Shorts components:** Hide old layout like/dislike buttons without leaving empty space ([9782338](978233843d))
* **YouTube - Hide Shorts components:** Hide Shorts in search result horizontal shelves ([#625](https://github.com/ReVanced/revanced-integrations/issues/625)) ([656ca17](656ca17ffc))
* **YouTube - Hide video action buttons:** Remove obsolete `hide Shop button` ([#618](https://github.com/ReVanced/revanced-integrations/issues/618)) ([a78c3ff](a78c3ff09e))
* **YouTube - Hide video action buttons:** Updated path filter ([b74e544](b74e54481a))
* **YouTube - Player flyout menu:** Remove obsolete `Hide report menu` ([9e9d969](9e9d96910c))
* **YouTube - Restore old video quality menu:** Do not make click sounds when opening Shorts quality menu ([578a27d](578a27dea5))
* **YouTube - Restore old video quality menu:** Show advanced quality menu in Shorts quality flyout ([#632](https://github.com/ReVanced/revanced-integrations/issues/632)) ([77c9825](77c9825b82))
* **YouTube - Settings:** Use same background color for about screen if Theme patch is not included ([4164ed3](4164ed3486))
* **YouTube - SponsorBlock:** Show correct segment times if video is over 24 hours in length ([#630](https://github.com/ReVanced/revanced-integrations/issues/630)) ([81251f9](81251f9a34))

### Features

* **YouTube - Comments:** Add option to hide timestamp and emoji buttons ([#621](https://github.com/ReVanced/revanced-integrations/issues/621)) ([6e9e122](6e9e12235a))
* **YouTube - Hide ads:** Add option to hide the 'Visit store' button on channel pages ([#622](https://github.com/ReVanced/revanced-integrations/issues/622)) ([9de566c](9de566ca02))
* **YouTube - Hide Shorts components:** Hide 'Buy super thanks' button ([#633](https://github.com/ReVanced/revanced-integrations/issues/633)) ([303754c](303754c46f))
* **YouTube - Hide Shorts components:** Hide like / dislike button in video ads ([#619](https://github.com/ReVanced/revanced-integrations/issues/619)) ([b2b6b8c](b2b6b8c3d7))
* **YouTube - Navigation buttons:** Add option to hide navigation button labels ([#635](https://github.com/ReVanced/revanced-integrations/issues/635)) ([6bd0ac2](6bd0ac20dc))
2024-05-21 00:48:39 +00:00
oSumAtrIX
9147842ac7 chore: Merge branch dev to main (#620) 2024-05-21 02:45:35 +02:00
semantic-release-bot
e3994d381b chore(release): 1.9.0-dev.15 [skip ci]
# [1.9.0-dev.15](https://github.com/ReVanced/revanced-integrations/compare/v1.9.0-dev.14...v1.9.0-dev.15) (2024-05-21)

### Bug Fixes

* **YouTube - Client spoof:** Spoof client to fix playback ([#637](https://github.com/ReVanced/revanced-integrations/issues/637)) ([4c1f82a](4c1f82aa22))
2024-05-21 00:44:41 +00:00
oSumAtrIX
4c1f82aa22 fix(YouTube - Client spoof): Spoof client to fix playback (#637)
Co-authored-by: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
2024-05-21 02:41:34 +02:00
semantic-release-bot
ea184d050e chore(release): 1.9.0-dev.14 [skip ci]
# [1.9.0-dev.14](https://github.com/ReVanced/revanced-integrations/compare/v1.9.0-dev.13...v1.9.0-dev.14) (2024-05-18)

### Features

* **YouTube - Navigation buttons:** Add option to hide navigation button labels ([#635](https://github.com/ReVanced/revanced-integrations/issues/635)) ([6bd0ac2](6bd0ac20dc))
2024-05-18 21:18:05 +00:00
MarcaD
6bd0ac20dc feat(YouTube - Navigation buttons): Add option to hide navigation button labels (#635)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2024-05-19 01:15:14 +04:00
semantic-release-bot
78cf116e58 chore(release): 1.9.0-dev.13 [skip ci]
# [1.9.0-dev.13](https://github.com/ReVanced/revanced-integrations/compare/v1.9.0-dev.12...v1.9.0-dev.13) (2024-05-16)

### Features

* **YouTube - Hide Shorts components:** Hide 'Buy super thanks' button ([#633](https://github.com/ReVanced/revanced-integrations/issues/633)) ([303754c](303754c46f))
2024-05-16 17:12:27 +00:00
LisoUseInAIKyrios
303754c46f feat(YouTube - Hide Shorts components): Hide 'Buy super thanks' button (#633) 2024-05-16 21:09:02 +04:00
semantic-release-bot
195a521238 chore(release): 1.9.0-dev.12 [skip ci]
# [1.9.0-dev.12](https://github.com/ReVanced/revanced-integrations/compare/v1.9.0-dev.11...v1.9.0-dev.12) (2024-05-15)

### Bug Fixes

* **YouTube - Hide Shorts components:** Hide old layout like/dislike buttons without leaving empty space ([9782338](978233843d))
* **YouTube - Restore old video quality menu:** Do not make click sounds when opening Shorts quality menu ([578a27d](578a27dea5))
2024-05-15 18:22:49 +00:00
LisoUseInAIKyrios
978233843d fix(YouTube - Hide Shorts components): Hide old layout like/dislike buttons without leaving empty space
Also change hide by 1dp to 0dp, and consolidate two methods together
2024-05-15 22:19:22 +04:00
LisoUseInAIKyrios
578a27dea5 fix(YouTube - Restore old video quality menu): Do not make click sounds when opening Shorts quality menu 2024-05-15 22:19:22 +04:00
semantic-release-bot
6710acd928 chore(release): 1.9.0-dev.11 [skip ci]
# [1.9.0-dev.11](https://github.com/ReVanced/revanced-integrations/compare/v1.9.0-dev.10...v1.9.0-dev.11) (2024-05-15)

### Bug Fixes

* **YouTube - Hide video action buttons:** Updated path filter ([b74e544](b74e54481a))
2024-05-15 16:25:21 +00:00
LisoUseInAIKyrios
b74e54481a fix(YouTube - Hide video action buttons): Updated path filter 2024-05-15 20:21:46 +04:00
semantic-release-bot
a14567df27 chore(release): 1.9.0-dev.10 [skip ci]
# [1.9.0-dev.10](https://github.com/ReVanced/revanced-integrations/compare/v1.9.0-dev.9...v1.9.0-dev.10) (2024-05-11)

### Bug Fixes

* **YouTube - Restore old video quality menu:** Show advanced quality menu in Shorts quality flyout ([#632](https://github.com/ReVanced/revanced-integrations/issues/632)) ([77c9825](77c9825b82))
2024-05-11 20:33:16 +00:00
LisoUseInAIKyrios
77c9825b82 fix(YouTube - Restore old video quality menu): Show advanced quality menu in Shorts quality flyout (#632) 2024-05-12 00:30:10 +04:00
semantic-release-bot
44dea1af4e chore(release): 1.9.0-dev.9 [skip ci]
# [1.9.0-dev.9](https://github.com/ReVanced/revanced-integrations/compare/v1.9.0-dev.8...v1.9.0-dev.9) (2024-05-08)

### Bug Fixes

* **YouTube - SponsorBlock:** Show correct segment times if video is over 24 hours in length ([#630](https://github.com/ReVanced/revanced-integrations/issues/630)) ([81251f9](81251f9a34))
2024-05-08 22:30:31 +00:00
LisoUseInAIKyrios
81251f9a34 fix(YouTube - SponsorBlock): Show correct segment times if video is over 24 hours in length (#630) 2024-05-09 02:27:07 +04:00
60 changed files with 2503 additions and 1172 deletions

View File

@@ -70,7 +70,7 @@ body:
Before creating a new bug report, please keep the following in mind:
- **Do not submit a duplicate bug report**: You can review existing bug reports [here](https://github.com/ReVanced/revanced-integrations/labels/Bug%20report).
- **Do not submit a duplicate bug report**: Search for existing bug reports [here](https://github.com/ReVanced/revanced-integrations/issues?q=label%3A%22Bug+report%22).
- **Do not use the issue page for support**: If you need help or have questions, check out other platforms on [revanced.app](https://revanced.app).
- type: textarea
attributes:
@@ -101,7 +101,7 @@ body:
label: Acknowledgements
description: Your bug report will be closed if you don't follow the checklist below.
options:
- label: This issue is not a duplicate of an existing bug report.
- label: I have checked all open and closed bug reports and this is not a duplicate.
required: true
- label: I have chosen an appropriate title.
required: true

View File

@@ -70,7 +70,7 @@ body:
Before creating a new feature request, please keep the following in mind:
- **Do not submit a duplicate feature request**: You can review existing feature requests [here](https://github.com/ReVanced/revanced-integrations/labels/Feature%20request).
- **Do not submit a duplicate feature request**: Search for existing feature requests [here](https://github.com/ReVanced/revanced-integrations/issues?q=label%3A%22Feature+request%22).
- **Do not use the issue page for support**: If you need help or have questions, check out other platforms on [revanced.app](https://revanced.app).
- type: textarea
attributes:
@@ -97,7 +97,7 @@ body:
label: Acknowledgements
description: Your feature request will be closed if you don't follow the checklist below.
options:
- label: This issue is not a duplicate of an existing feature request.
- label: I have checked all open and closed feature requests and this is not a duplicate.
required: true
- label: I have chosen an appropriate title.
required: true

View File

@@ -45,7 +45,7 @@ jobs:
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
fingerprint: ${{ env.GPG_FINGERPRINT }}
fingerprint: ${{ vars.GPG_FINGERPRINT }}
- name: Release
env:

View File

@@ -7,7 +7,13 @@
}
],
"plugins": [
"@semantic-release/commit-analyzer",
[
"@semantic-release/commit-analyzer", {
"releaseRules": [
{ "type": "build", "scope": "Needs bump", "release": "patch" }
]
}
],
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"gradle-semantic-release-plugin",

File diff suppressed because it is too large Load Diff

View File

@@ -2,6 +2,7 @@ plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin)
publishing
signing
}
android {
@@ -53,28 +54,27 @@ dependencies {
compileOnly(project(":stub"))
}
tasks {
// Because the signing plugin doesn't support signing APKs, do it manually.
register("sign") {
group = "signing"
dependsOn(build)
tasks {
val assembleReleaseSignApk by registering {
dependsOn("assembleRelease")
val apk = layout.buildDirectory.file("outputs/apk/release/${rootProject.name}-$version.apk")
inputs.file(apk).withPropertyName("input")
outputs.file(apk.map { it.asFile.resolveSibling("${it.asFile.name}.asc") })
doLast {
val outputDirectory = layout.buildDirectory.dir("outputs/apk/release").get().asFile
val integrationsApk = outputDirectory.resolve("${rootProject.name}-$version.apk")
org.gradle.security.internal.gnupg.GnupgSignatoryFactory().createSignatory(project).sign(
integrationsApk.inputStream(),
outputDirectory.resolve("${integrationsApk.name}.asc").outputStream(),
)
signing {
useGpgCmd()
sign(*inputs.files.files.toTypedArray())
}
}
}
// Needed by gradle-semantic-release-plugin.
// Tracking: https://github.com/KengoTODA/gradle-semantic-release-plugin/issues/435
// Tracking: https://github.com/KengoTODA/gradle-semantic-release-plugin/issues/435.
publish {
dependsOn(build)
dependsOn("sign")
dependsOn(assembleReleaseSignApk)
}
}

View File

@@ -0,0 +1,24 @@
package app.revanced.integrations.boostforreddit;
import com.rubenmayayo.reddit.ui.activities.WebViewActivity;
import app.revanced.integrations.shared.fixes.slink.BaseFixSLinksPatch;
/** @noinspection unused*/
public class FixSLinksPatch extends BaseFixSLinksPatch {
static {
INSTANCE = new FixSLinksPatch();
}
private FixSLinksPatch() {
webViewActivityClass = WebViewActivity.class;
}
public static boolean patchResolveSLink(String link) {
return INSTANCE.resolveSLink(link);
}
public static void patchSetAccessToken(String accessToken) {
INSTANCE.setAccessToken(accessToken);
}
}

View File

@@ -15,6 +15,7 @@ import android.preference.PreferenceGroup;
import android.preference.PreferenceScreen;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.FrameLayout;
@@ -53,12 +54,13 @@ public class Utils {
*
* @return The manifest 'Version' entry of the patches.jar used during patching.
*/
@SuppressWarnings("SameReturnValue")
public static String getPatchesReleaseVersion() {
return ""; // Value is replaced during patching.
}
/**
* @return The version name of the app, such as "YouTube".
* @return The version name of the app, such as 19.11.43
*/
public static String getAppVersionName() {
if (versionName == null) {
@@ -88,18 +90,32 @@ public class Utils {
return versionName;
}
/**
* Hide a view by setting its layout height and width to 1dp.
*
* @param condition The setting to check for hiding the view.
* @param view The view to hide.
*/
public static void hideViewBy1dpUnderCondition(BooleanSetting condition, View view) {
if (!condition.get()) return;
public static void hideViewBy0dpUnderCondition(BooleanSetting condition, View view) {
if (hideViewBy0dpUnderCondition(condition.get(), view)) {
Logger.printDebug(() -> "View hidden by setting: " + condition);
}
}
Logger.printDebug(() -> "Hiding view with setting: " + condition);
/**
* Hide a view by setting its layout height and width to 1dp.
*
* @param condition The setting to check for hiding the view.
* @param view The view to hide.
*/
public static boolean hideViewBy0dpUnderCondition(boolean condition, View view) {
if (condition) {
hideViewByLayoutParams(view);
return true;
}
hideViewByLayoutParams(view);
return false;
}
/**
@@ -109,11 +125,42 @@ public class Utils {
* @param view The view to hide.
*/
public static void hideViewUnderCondition(BooleanSetting condition, View view) {
if (!condition.get()) return;
if (hideViewUnderCondition(condition.get(), view)) {
Logger.printDebug(() -> "View hidden by setting: " + condition);
}
}
Logger.printDebug(() -> "Hiding view with setting: " + condition);
/**
* Hide a view by setting its visibility to GONE.
*
* @param condition The setting to check for hiding the view.
* @param view The view to hide.
*/
public static boolean hideViewUnderCondition(boolean condition, View view) {
if (condition) {
view.setVisibility(View.GONE);
return true;
}
view.setVisibility(View.GONE);
return false;
}
public static void hideViewByRemovingFromParentUnderCondition(BooleanSetting condition, View view) {
if (hideViewByRemovingFromParentUnderCondition(condition.get(), view)) {
Logger.printDebug(() -> "View hidden by setting: " + condition);
}
}
public static boolean hideViewByRemovingFromParentUnderCondition(boolean setting, View view) {
if (setting) {
ViewParent parent = view.getParent();
if (parent instanceof ViewGroup) {
((ViewGroup) parent).removeView(view);
return true;
}
}
return false;
}
/**
@@ -226,6 +273,8 @@ public class Utils {
@NonNull MatchFilter<View> filter) {
for (int i = 0, childCount = viewGroup.getChildCount(); i < childCount; i++) {
View childAt = viewGroup.getChildAt(i);
Logger.printDebug(() -> "View id: " + childAt.getId() + " tag: " + childAt.getTag());
if (filter.matches(childAt)) {
//noinspection unchecked
return (T) childAt;
@@ -239,6 +288,25 @@ public class Utils {
return null;
}
@Nullable
public static ViewParent getParentView(@NonNull View view, int nthParent) {
ViewParent parent = view.getParent();
int currentDepth = 0;
while (++currentDepth < nthParent && parent != null) {
parent = parent.getParent();
}
if (currentDepth == nthParent) {
return parent;
}
final int currentDepthLog = currentDepth;
Logger.printDebug(() -> "Could not find parent view of depth: " + nthParent
+ " and instead found at: " + currentDepthLog + " view: " + view);
return null;
}
public static void restartApp(@NonNull Context context) {
String packageName = context.getPackageName();
Intent intent = context.getPackageManager().getLaunchIntentForPackage(packageName);
@@ -412,27 +480,30 @@ public class Utils {
}
/**
* Hide a view by setting its layout params to 1x1
* Hide a view by setting its layout params to 0x0
* @param view The view to hide.
*/
public static void hideViewByLayoutParams(View view) {
if (view instanceof LinearLayout) {
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(1, 1);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(0, 0);
view.setLayoutParams(layoutParams);
} else if (view instanceof FrameLayout) {
FrameLayout.LayoutParams layoutParams2 = new FrameLayout.LayoutParams(1, 1);
FrameLayout.LayoutParams layoutParams2 = new FrameLayout.LayoutParams(0, 0);
view.setLayoutParams(layoutParams2);
} else if (view instanceof RelativeLayout) {
RelativeLayout.LayoutParams layoutParams3 = new RelativeLayout.LayoutParams(1, 1);
RelativeLayout.LayoutParams layoutParams3 = new RelativeLayout.LayoutParams(0, 0);
view.setLayoutParams(layoutParams3);
} else if (view instanceof Toolbar) {
Toolbar.LayoutParams layoutParams4 = new Toolbar.LayoutParams(1, 1);
Toolbar.LayoutParams layoutParams4 = new Toolbar.LayoutParams(0, 0);
view.setLayoutParams(layoutParams4);
} else if (view instanceof ViewGroup) {
ViewGroup.LayoutParams layoutParams5 = new ViewGroup.LayoutParams(1, 1);
ViewGroup.LayoutParams layoutParams5 = new ViewGroup.LayoutParams(0, 0);
view.setLayoutParams(layoutParams5);
} else {
Logger.printDebug(() -> "Hidden view with id " + view.getId());
ViewGroup.LayoutParams params = view.getLayoutParams();
params.width = 0;
params.height = 0;
view.setLayoutParams(params);
}
}

View File

@@ -0,0 +1,208 @@
package app.revanced.integrations.shared.fixes.slink;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import androidx.annotation.NonNull;
import app.revanced.integrations.shared.Logger;
import app.revanced.integrations.shared.Utils;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.SocketTimeoutException;
import java.net.URL;
import java.util.Objects;
import static app.revanced.integrations.shared.Utils.getContext;
/**
* Base class to implement /s/ link resolution in 3rd party Reddit apps.
* <br>
* <br>
* Usage:
* <br>
* <br>
* An implementation of this class must have two static methods that are called by the app:
* <ul>
* <li>public static boolean patchResolveSLink(String link)</li>
* <li>public static void patchSetAccessToken(String accessToken)</li>
* </ul>
* The static methods must call the instance methods of the base class.
* <br>
* The singleton pattern can be used to access the instance of the class:
* <pre>
* {@code
* {
* INSTANCE = new FixSLinksPatch();
* }
* }
* </pre>
* Set the app's web view activity class as a fallback to open /s/ links if the resolution fails:
* <pre>
* {@code
* private FixSLinksPatch() {
* webViewActivityClass = WebViewActivity.class;
* }
* }
* </pre>
* Hook the app's navigation handler to call this method before doing any of its own resolution:
* <pre>
* {@code
* public static boolean patchResolveSLink(Context context, String link) {
* return INSTANCE.resolveSLink(context, link);
* }
* }
* </pre>
* If this method returns true, the app should early return and not do any of its own resolution.
* <br>
* <br>
* Hook the app's access token so that this class can use it to resolve /s/ links:
* <pre>
* {@code
* public static void patchSetAccessToken(String accessToken) {
* INSTANCE.setAccessToken(access_token);
* }
* }
* </pre>
*/
public abstract class BaseFixSLinksPatch {
/**
* The class of the activity used to open links in a web view if resolving them fails.
*/
protected Class<? extends Activity> webViewActivityClass;
/**
* The access token used to resolve the /s/ link.
*/
protected String accessToken;
/**
* The URL that was trying to be resolved before the access token was set.
* If this is not null, the URL will be resolved right after the access token is set.
*/
protected String pendingUrl;
/**
* The singleton instance of the class.
*/
protected static BaseFixSLinksPatch INSTANCE;
public boolean resolveSLink(String link) {
switch (resolveLink(link)) {
case ACCESS_TOKEN_START: {
pendingUrl = link;
return true;
}
case DO_NOTHING:
return true;
default:
return false;
}
}
private ResolveResult resolveLink(String link) {
Context context = getContext();
if (link.matches(".*reddit\\.com/r/[^/]+/s/[^/]+")) {
// A link ends with #bypass if it failed to resolve below.
// resolveLink is called with the same link again but this time with #bypass
// so that the link is opened in the app browser instead of trying to resolve it again.
if (link.endsWith("#bypass")) {
openInAppBrowser(context, link);
return ResolveResult.DO_NOTHING;
}
Logger.printDebug(() -> "Resolving " + link);
if (accessToken == null) {
// This is not optimal.
// However, an accessToken is necessary to make an authenticated request to Reddit.
// in case Reddit has banned the IP - e.g. VPN.
Intent startIntent = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName());
context.startActivity(startIntent);
return ResolveResult.ACCESS_TOKEN_START;
}
Utils.runOnBackgroundThread(() -> {
String bypassLink = link + "#bypass";
String finalLocation = bypassLink;
try {
HttpURLConnection connection = getHttpURLConnection(link, accessToken);
connection.connect();
String location = connection.getHeaderField("location");
connection.disconnect();
Objects.requireNonNull(location, "Location is null");
finalLocation = location;
Logger.printDebug(() -> "Resolved " + link + " to " + location);
} catch (SocketTimeoutException e) {
Logger.printException(() -> "Timeout when trying to resolve " + link, e);
finalLocation = bypassLink;
} catch (Exception e) {
Logger.printException(() -> "Failed to resolve " + link, e);
finalLocation = bypassLink;
} finally {
Intent startIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(finalLocation));
startIntent.setPackage(context.getPackageName());
startIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(startIntent);
}
});
return ResolveResult.DO_NOTHING;
}
return ResolveResult.CONTINUE;
}
public void setAccessToken(String accessToken) {
Logger.printDebug(() -> "Setting access token");
this.accessToken = accessToken;
// In case a link was trying to be resolved before access token was set.
// The link is resolved now, after the access token is set.
if (pendingUrl != null) {
String link = pendingUrl;
pendingUrl = null;
Logger.printDebug(() -> "Opening pending URL");
resolveLink(link);
}
}
private void openInAppBrowser(Context context, String link) {
Intent intent = new Intent(context, webViewActivityClass);
intent.putExtra("url", link);
context.startActivity(intent);
}
@NonNull
private HttpURLConnection getHttpURLConnection(String link, String accessToken) throws IOException {
URL url = new URL(link);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setInstanceFollowRedirects(false);
connection.setRequestMethod("HEAD");
connection.setConnectTimeout(2000);
connection.setReadTimeout(2000);
if (accessToken != null) {
Logger.printDebug(() -> "Setting access token to make /s/ request");
connection.setRequestProperty("Authorization", "Bearer " + accessToken);
} else {
Logger.printDebug(() -> "Not setting access token to make /s/ request, because it is null");
}
return connection;
}
}

View File

@@ -0,0 +1,10 @@
package app.revanced.integrations.shared.fixes.slink;
public enum ResolveResult {
// Let app handle rest of stuff
CONTINUE,
// Start app, to make it cache its access_token
ACCESS_TOKEN_START,
// Don't do anything - we started resolving
DO_NOTHING
}

View File

@@ -2,13 +2,15 @@ package app.revanced.integrations.shared.settings;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import app.revanced.integrations.shared.Logger;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.Locale;
import java.util.Objects;
import app.revanced.integrations.shared.Logger;
/**
* If an Enum value is removed or changed, any saved or imported data using the
* non-existent value will be reverted to the default value
@@ -98,4 +100,18 @@ public class EnumSetting<T extends Enum<?>> extends Setting<T> {
public T get() {
return value;
}
/**
* Availability based on if this setting is currently set to any of the provided types.
*/
@SafeVarargs
public final Setting.Availability availability(@NonNull T... types) {
return () -> {
T currentEnumType = get();
for (T enumType : types) {
if (currentEnumType == enumType) return true;
}
return false;
};
}
}

View File

@@ -1,42 +1,24 @@
package app.revanced.integrations.syncforreddit;
import android.os.StrictMode;
import app.revanced.integrations.shared.Logger;
import com.laurencedawson.reddit_sync.ui.activities.WebViewActivity;
import java.net.HttpURLConnection;
import java.net.URL;
import app.revanced.integrations.shared.fixes.slink.BaseFixSLinksPatch;
public final class FixSLinksPatch {
public static String resolveSLink(String link) {
if (link.matches(".*reddit\\.com/r/[^/]+/s/[^/]+")) {
Logger.printInfo(() -> "Resolving " + link);
try {
URL url = new URL(link);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setInstanceFollowRedirects(false);
connection.setRequestMethod("HEAD");
/** @noinspection unused*/
public class FixSLinksPatch extends BaseFixSLinksPatch {
static {
INSTANCE = new FixSLinksPatch();
}
// Disable strict mode in order to allow network access on the main thread.
// This is not ideal, but it's the easiest solution for now.
final var currentPolicy = StrictMode.getThreadPolicy();
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
private FixSLinksPatch() {
webViewActivityClass = WebViewActivity.class;
}
connection.connect();
String location = connection.getHeaderField("location");
connection.disconnect();
public static boolean patchResolveSLink(String link) {
return INSTANCE.resolveSLink(link);
}
// Restore the original strict mode policy.
StrictMode.setThreadPolicy(currentPolicy);
Logger.printInfo(() -> "Resolved " + link + " -> " + location);
return location;
} catch (Exception e) {
Logger.printException(() -> "Failed to resolve " + link, e);
}
}
return link;
public static void patchSetAccessToken(String accessToken) {
INSTANCE.setAccessToken(accessToken);
}
}

View File

@@ -6,7 +6,7 @@ import app.revanced.integrations.tiktok.settings.Settings;
@SuppressWarnings("unused")
public class SpoofSimPatch {
private static final Boolean ENABLED = Settings.SIM_SPOOF.get();
private static final boolean ENABLED = Settings.SIM_SPOOF.get();
public static String getCountryIso(String value) {
if (ENABLED) {

View File

@@ -39,6 +39,7 @@ public class ThemeHelper {
/**
* Injection point.
*/
@SuppressWarnings("SameReturnValue")
private static String darkThemeResourceName() {
// Value is changed by Theme patch, if included.
return "@color/yt_black3";
@@ -58,6 +59,7 @@ public class ThemeHelper {
/**
* Injection point.
*/
@SuppressWarnings("SameReturnValue")
private static String lightThemeResourceName() {
// Value is changed by Theme patch, if included.
return "@color/yt_white1";

View File

@@ -380,7 +380,7 @@ public abstract class TrieSearch<T> {
throw new IllegalArgumentException("endIndex: " + endIndex
+ " is greater than texToSearchLength: " + textToSearchLength);
}
if (patterns.size() == 0) {
if (patterns.isEmpty()) {
return false; // No patterns were added.
}
for (int i = startIndex; i < endIndex; i++) {
@@ -393,7 +393,7 @@ public abstract class TrieSearch<T> {
* @return Estimated memory size (in kilobytes) of this instance.
*/
public int getEstimatedMemorySize() {
if (patterns.size() == 0) {
if (patterns.isEmpty()) {
return 0;
}
// Assume the device has less than 32GB of ram (and can use pointer compression),

View File

@@ -190,16 +190,17 @@ public final class AlternativeThumbnailsPatch {
* Build the alternative thumbnail url using YouTube provided still video captures.
*
* @param decodedUrl Decoded original thumbnail request url.
* @return The alternative thumbnail url, or the original url. Both without tracking parameters.
* @return The alternative thumbnail url, or if not available NULL.
*/
@NonNull
private static String buildYoutubeVideoStillURL(@NonNull DecodedThumbnailUrl decodedUrl,
@Nullable
private static String buildYouTubeVideoStillURL(@NonNull DecodedThumbnailUrl decodedUrl,
@NonNull ThumbnailQuality qualityToUse) {
String sanitizedReplacement = decodedUrl.createStillsUrl(qualityToUse, false);
if (VerifiedQualities.verifyAltThumbnailExist(decodedUrl.videoId, qualityToUse, sanitizedReplacement)) {
return sanitizedReplacement;
}
return decodedUrl.sanitizedUrl;
return null;
}
/**
@@ -284,14 +285,21 @@ public final class AlternativeThumbnailsPatch {
final boolean includeTracking;
if (option.useDeArrow && canUseDeArrowAPI()) {
includeTracking = false; // Do not include view tracking parameters with API call.
final String fallbackUrl = option.useStillImages
? buildYoutubeVideoStillURL(decodedUrl, qualityToUse)
: decodedUrl.sanitizedUrl;
String fallbackUrl = null;
if (option.useStillImages) {
fallbackUrl = buildYouTubeVideoStillURL(decodedUrl, qualityToUse);
}
if (fallbackUrl == null) {
fallbackUrl = decodedUrl.sanitizedUrl;
}
sanitizedReplacementUrl = buildDeArrowThumbnailURL(decodedUrl.videoId, fallbackUrl);
} else if (option.useStillImages) {
includeTracking = true; // Include view tracking parameters if present.
sanitizedReplacementUrl = buildYoutubeVideoStillURL(decodedUrl, qualityToUse);
sanitizedReplacementUrl = buildYouTubeVideoStillURL(decodedUrl, qualityToUse);
if (sanitizedReplacementUrl == null) {
return originalUrl; // Still capture is not available. Return the untouched original url.
}
} else {
return originalUrl; // Recently experienced DeArrow failure and video stills are not enabled.
}
@@ -345,7 +353,7 @@ public final class AlternativeThumbnailsPatch {
return; // Not a thumbnail.
}
Logger.printDebug(() -> "handleCronetSuccess, image not available: " + url);
Logger.printDebug(() -> "handleCronetSuccess, image not available: " + decodedUrl.sanitizedUrl);
ThumbnailQuality quality = ThumbnailQuality.altImageNameToQuality(decodedUrl.imageQuality);
if (quality == null) {
@@ -627,14 +635,17 @@ public final class AlternativeThumbnailsPatch {
* YouTube video thumbnail url, decoded into it's relevant parts.
*/
private static class DecodedThumbnailUrl {
/**
* YouTube thumbnail URL prefix. Can be '/vi/' or '/vi_webp/'
*/
private static final String YOUTUBE_THUMBNAIL_PREFIX = "https://i.ytimg.com/vi";
private static final String YOUTUBE_THUMBNAIL_DOMAIN = "https://i.ytimg.com/";
@Nullable
static DecodedThumbnailUrl decodeImageUrl(String url) {
final int videoIdStartIndex = url.indexOf('/', YOUTUBE_THUMBNAIL_PREFIX.length()) + 1;
final int urlPathStartIndex = url.indexOf('/', "https://".length()) + 1;
if (urlPathStartIndex <= 0) return null;
final int urlPathEndIndex = url.indexOf('/', urlPathStartIndex);
if (urlPathEndIndex < 0) return null;
final int videoIdStartIndex = url.indexOf('/', urlPathEndIndex) + 1;
if (videoIdStartIndex <= 0) return null;
final int videoIdEndIndex = url.indexOf('/', videoIdStartIndex);
@@ -647,15 +658,15 @@ public final class AlternativeThumbnailsPatch {
int imageExtensionEndIndex = url.indexOf('?', imageSizeEndIndex);
if (imageExtensionEndIndex < 0) imageExtensionEndIndex = url.length();
return new DecodedThumbnailUrl(url, videoIdStartIndex, videoIdEndIndex,
return new DecodedThumbnailUrl(url, urlPathStartIndex, urlPathEndIndex, videoIdStartIndex, videoIdEndIndex,
imageSizeStartIndex, imageSizeEndIndex, imageExtensionEndIndex);
}
final String originalFullUrl;
/** Full usable url, but stripped of any tracking information. */
final String sanitizedUrl;
/** Url up to the video ID. */
final String urlPrefix;
/** Url path, such as 'vi' or 'vi_webp' */
final String urlPath;
final String videoId;
/** Quality, such as hq720 or sddefault. */
final String imageQuality;
@@ -664,11 +675,11 @@ public final class AlternativeThumbnailsPatch {
/** User view tracking parameters, only present on some images. */
final String viewTrackingParameters;
DecodedThumbnailUrl(String fullUrl, int videoIdStartIndex, int videoIdEndIndex,
DecodedThumbnailUrl(String fullUrl, int urlPathStartIndex, int urlPathEndIndex, int videoIdStartIndex, int videoIdEndIndex,
int imageSizeStartIndex, int imageSizeEndIndex, int imageExtensionEndIndex) {
originalFullUrl = fullUrl;
sanitizedUrl = fullUrl.substring(0, imageExtensionEndIndex);
urlPrefix = fullUrl.substring(0, videoIdStartIndex);
urlPath = fullUrl.substring(urlPathStartIndex, urlPathEndIndex);
videoId = fullUrl.substring(videoIdStartIndex, videoIdEndIndex);
imageQuality = fullUrl.substring(imageSizeStartIndex, imageSizeEndIndex);
imageExtension = fullUrl.substring(imageSizeEndIndex + 1, imageExtensionEndIndex);
@@ -681,9 +692,12 @@ public final class AlternativeThumbnailsPatch {
// Images could be upgraded to webp if they are not already, but this fails quite often,
// especially for new videos uploaded in the last hour.
// And even if alt webp images do exist, sometimes they can load much slower than the original jpg alt images.
// (as much as 4x slower has been observed, despite the alt webp image being a smaller file).
// (as much as 4x slower network response has been observed, despite the alt webp image being a smaller file).
StringBuilder builder = new StringBuilder(originalFullUrl.length() + 2);
builder.append(urlPrefix);
// Many different "i.ytimage.com" domains exist such as "i9.ytimg.com",
// but still captures are frequently not available on the other domains (especially newly uploaded videos).
// So always use the primary domain for a higher success rate.
builder.append(YOUTUBE_THUMBNAIL_DOMAIN).append(urlPath).append('/');
builder.append(videoId).append('/');
builder.append(qualityToUse.getAltImageNameToUse());
builder.append('.').append(imageExtension);

View File

@@ -3,7 +3,7 @@ package app.revanced.integrations.youtube.patches;
import app.revanced.integrations.youtube.shared.PlayerType;
@SuppressWarnings("unused")
public class MinimizedPlaybackPatch {
public class BackgroundPlaybackPatch {
/**
* Injection point.
@@ -35,7 +35,7 @@ public class MinimizedPlaybackPatch {
/**
* Injection point.
*/
public static boolean overrideMinimizedPlaybackAvailable() {
public static boolean overrideBackgroundPlaybackAvailable() {
// This could be done entirely in the patch,
// but having a unique method to search for makes manually inspecting the patched apk much easier.
return true;

View File

@@ -0,0 +1,46 @@
package app.revanced.integrations.youtube.patches;
import static app.revanced.integrations.youtube.settings.Settings.BYPASS_IMAGE_REGION_RESTRICTIONS;
import java.util.regex.Pattern;
import app.revanced.integrations.shared.Logger;
import app.revanced.integrations.youtube.settings.Settings;
@SuppressWarnings("unused")
public final class BypassImageRegionRestrictionsPatch {
private static final boolean BYPASS_IMAGE_REGION_RESTRICTIONS_ENABLED = BYPASS_IMAGE_REGION_RESTRICTIONS.get();
private static final String REPLACEMENT_IMAGE_DOMAIN = "https://yt4.ggpht.com";
/**
* YouTube static images domain. Includes user and channel avatar images and community post images.
*/
private static final Pattern YOUTUBE_STATIC_IMAGE_DOMAIN_PATTERN
= Pattern.compile("^https://(yt3|lh[3-6]|play-lh)\\.(ggpht|googleusercontent)\\.com");
/**
* Injection point. Called off the main thread and by multiple threads at the same time.
*
* @param originalUrl Image url for all image urls loaded.
*/
public static String overrideImageURL(String originalUrl) {
try {
if (BYPASS_IMAGE_REGION_RESTRICTIONS_ENABLED) {
String replacement = YOUTUBE_STATIC_IMAGE_DOMAIN_PATTERN
.matcher(originalUrl).replaceFirst(REPLACEMENT_IMAGE_DOMAIN);
if (Settings.DEBUG.get() && !replacement.equals(originalUrl)) {
Logger.printDebug(() -> "Replaced: '" + originalUrl + "' with: '" + replacement + "'");
}
return replacement;
}
} catch (Exception ex) {
Logger.printException(() -> "overrideImageURL failure", ex);
}
return originalUrl;
}
}

View File

@@ -1,22 +1,33 @@
package app.revanced.integrations.youtube.patches;
import static app.revanced.integrations.shared.StringRef.str;
import android.widget.ImageView;
import app.revanced.integrations.youtube.settings.Settings;
import app.revanced.integrations.shared.Utils;
import app.revanced.integrations.youtube.settings.Settings;
@SuppressWarnings("unused")
public class CustomPlayerOverlayOpacityPatch {
public static void changeOpacity(ImageView imageView) {
private static final int PLAYER_OVERLAY_OPACITY_LEVEL;
static {
int opacity = Settings.PLAYER_OVERLAY_OPACITY.get();
if (opacity < 0 || opacity > 100) {
Utils.showToastLong("Player overlay opacity must be between 0-100");
Utils.showToastLong(str("revanced_player_overlay_opacity_invalid_toast"));
Settings.PLAYER_OVERLAY_OPACITY.resetToDefault();
opacity = Settings.PLAYER_OVERLAY_OPACITY.defaultValue;
}
imageView.setImageAlpha((opacity * 255) / 100);
PLAYER_OVERLAY_OPACITY_LEVEL = (opacity * 255) / 100;
}
/**
* Injection point.
*/
public static void changeOpacity(ImageView imageView) {
imageView.setImageAlpha(PLAYER_OVERLAY_OPACITY_LEVEL);
}
}

View File

@@ -1,13 +1,8 @@
package app.revanced.integrations.youtube.patches;
import android.annotation.SuppressLint;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import app.revanced.integrations.shared.Logger;
import app.revanced.integrations.youtube.settings.Settings;
/** @noinspection unused*/

View File

@@ -1,10 +0,0 @@
package app.revanced.integrations.youtube.patches;
import app.revanced.integrations.youtube.settings.Settings;
@SuppressWarnings("unused")
public final class EnableTabletLayoutPatch {
public static boolean enableTabletLayout() {
return Settings.TABLET_LAYOUT.get();
}
}

View File

@@ -4,7 +4,13 @@ import app.revanced.integrations.youtube.settings.Settings;
@SuppressWarnings("unused")
public class HideAutoplayButtonPatch {
public static boolean isButtonShown() {
return !Settings.HIDE_AUTOPLAY_BUTTON.get();
private static final boolean HIDE_AUTOPLAY_BUTTON_ENABLED = Settings.HIDE_AUTOPLAY_BUTTON.get();
/**
* Injection point.
*/
public static boolean hideAutoPlayButton() {
return HIDE_AUTOPLAY_BUTTON_ENABLED;
}
}

View File

@@ -0,0 +1,166 @@
package app.revanced.integrations.youtube.patches;
import static app.revanced.integrations.shared.StringRef.str;
import static app.revanced.integrations.youtube.patches.MiniplayerPatch.MiniplayerType.*;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.Nullable;
import app.revanced.integrations.shared.Logger;
import app.revanced.integrations.shared.Utils;
import app.revanced.integrations.youtube.settings.Settings;
@SuppressWarnings("unused")
public final class MiniplayerPatch {
/**
* Mini player type. Null fields indicates to use the original un-patched value.
*/
public enum MiniplayerType {
/** Unmodified type, and same as un-patched. */
ORIGINAL(null, null),
PHONE(false, null),
TABLET(true, null),
MODERN_1(null, 1),
MODERN_2(null, 2),
MODERN_3(null, 3);
/**
* Legacy tablet hook value.
*/
@Nullable
final Boolean legacyTabletOverride;
/**
* Modern player type used by YT.
*/
@Nullable
final Integer modernPlayerType;
MiniplayerType(@Nullable Boolean legacyTabletOverride, @Nullable Integer modernPlayerType) {
this.legacyTabletOverride = legacyTabletOverride;
this.modernPlayerType = modernPlayerType;
}
public boolean isModern() {
return modernPlayerType != null;
}
}
/**
* Modern subtitle overlay for {@link MiniplayerType#MODERN_2}.
* Resource is not present in older targets, and this field will be zero.
*/
private static final int MODERN_OVERLAY_SUBTITLE_TEXT
= Utils.getResourceIdentifier("modern_miniplayer_subtitle_text", "id");
private static final MiniplayerType CURRENT_TYPE = Settings.MINIPLAYER_TYPE.get();
private static final boolean HIDE_EXPAND_CLOSE_ENABLED =
(CURRENT_TYPE == MODERN_1 || CURRENT_TYPE == MODERN_3) && Settings.MINIPLAYER_HIDE_EXPAND_CLOSE.get();
private static final boolean HIDE_SUBTEXT_ENABLED =
(CURRENT_TYPE == MODERN_1 || CURRENT_TYPE == MODERN_3) && Settings.MINIPLAYER_HIDE_SUBTEXT.get();
private static final boolean HIDE_REWIND_FORWARD_ENABLED =
CURRENT_TYPE == MODERN_1 && Settings.MINIPLAYER_HIDE_REWIND_FORWARD.get();
private static final int OPACITY_LEVEL;
static {
int opacity = Settings.MINIPLAYER_OPACITY.get();
if (opacity < 0 || opacity > 100) {
Utils.showToastLong(str("revanced_miniplayer_opacity_invalid_toast"));
Settings.MINIPLAYER_OPACITY.resetToDefault();
opacity = Settings.MINIPLAYER_OPACITY.defaultValue;
}
OPACITY_LEVEL = (opacity * 255) / 100;
}
/**
* Injection point.
*/
public static boolean getLegacyTabletMiniplayerOverride(boolean original) {
Boolean isTablet = CURRENT_TYPE.legacyTabletOverride;
return isTablet == null
? original
: isTablet;
}
/**
* Injection point.
*/
public static boolean getModernMiniplayerOverride(boolean original) {
return CURRENT_TYPE == ORIGINAL
? original
: CURRENT_TYPE.isModern();
}
/**
* Injection point.
*/
public static int getModernMiniplayerOverrideType(int original) {
Integer modernValue = CURRENT_TYPE.modernPlayerType;
return modernValue == null
? original
: modernValue;
}
/**
* Injection point.
*/
public static void adjustMiniplayerOpacity(ImageView view) {
if (CURRENT_TYPE == MODERN_1) {
view.setImageAlpha(OPACITY_LEVEL);
}
}
/**
* Injection point.
*/
public static void hideMiniplayerExpandClose(ImageView view) {
Utils.hideViewByRemovingFromParentUnderCondition(HIDE_EXPAND_CLOSE_ENABLED, view);
}
/**
* Injection point.
*/
public static void hideMiniplayerRewindForward(ImageView view) {
Utils.hideViewByRemovingFromParentUnderCondition(HIDE_REWIND_FORWARD_ENABLED, view);
}
/**
* Injection point.
*/
public static void hideMiniplayerSubTexts(View view) {
// Different subviews are passed in, but only TextView and layouts are of interest here.
final boolean hideView = HIDE_SUBTEXT_ENABLED && (view instanceof TextView || view instanceof LinearLayout);
Utils.hideViewByRemovingFromParentUnderCondition(hideView, view);
}
/**
* Injection point.
*/
public static void playerOverlayGroupCreated(View group) {
// Modern 2 has an half broken subtitle that is always present.
// Always hide it to make the miniplayer mostly usable.
if (CURRENT_TYPE == MODERN_2 && MODERN_OVERLAY_SUBTITLE_TEXT != 0) {
if (group instanceof ViewGroup) {
View subtitleText = Utils.getChildView((ViewGroup) group, true,
view -> view.getId() == MODERN_OVERLAY_SUBTITLE_TEXT);
if (subtitleText != null) {
subtitleText.setVisibility(View.GONE);
Logger.printDebug(() -> "Modern overlay subtitle view set to hidden");
}
}
}
}
}

View File

@@ -1,5 +1,6 @@
package app.revanced.integrations.youtube.patches;
import static app.revanced.integrations.shared.Utils.hideViewUnderCondition;
import static app.revanced.integrations.youtube.shared.NavigationBar.NavigationButton;
import android.view.View;
@@ -7,7 +8,7 @@ import android.view.View;
import java.util.EnumMap;
import java.util.Map;
import app.revanced.integrations.shared.Logger;
import android.widget.TextView;
import app.revanced.integrations.youtube.settings.Settings;
@SuppressWarnings("unused")
@@ -22,7 +23,7 @@ public final class NavigationButtonsPatch {
}
};
private static final Boolean SWITCH_CREATE_WITH_NOTIFICATIONS_BUTTON
private static final boolean SWITCH_CREATE_WITH_NOTIFICATIONS_BUTTON
= Settings.SWITCH_CREATE_WITH_NOTIFICATIONS_BUTTON.get();
/**
@@ -40,4 +41,11 @@ public final class NavigationButtonsPatch {
tabView.setVisibility(View.GONE);
}
}
/**
* Injection point.
*/
public static void hideNavigationButtonLabels(TextView navigationLabelsView) {
hideViewUnderCondition(Settings.HIDE_NAVIGATION_BUTTON_LABELS, navigationLabelsView);
}
}

View File

@@ -2,8 +2,6 @@ package app.revanced.integrations.youtube.patches;
import android.view.ViewGroup;
import androidx.annotation.Nullable;
import app.revanced.integrations.youtube.shared.PlayerOverlays;
@SuppressWarnings("unused")

View File

@@ -221,6 +221,10 @@ public class ReturnYouTubeDislikePatch {
String conversionContextString = conversionContext.toString();
if (isRollingNumber && !conversionContextString.contains("video_action_bar.eml|")) {
return original;
}
final CharSequence replacement;
if (conversionContextString.contains("|segmented_like_dislike_button.eml|")) {
// Regular video.
@@ -289,6 +293,7 @@ public class ReturnYouTubeDislikePatch {
@NonNull String original) {
try {
CharSequence replacement = onLithoTextLoaded(conversionContext, original, true);
String replacementString = replacement.toString();
if (!replacementString.equals(original)) {
rollingNumberSpan = replacement;

View File

@@ -0,0 +1,16 @@
package app.revanced.integrations.youtube.patches;
import app.revanced.integrations.youtube.settings.Settings;
@SuppressWarnings("unused")
public final class TabletLayoutPatch {
private static final boolean TABLET_LAYOUT_ENABLED = Settings.TABLET_LAYOUT.get();
/**
* Injection point.
*/
public static boolean getTabletLayoutEnabled() {
return TABLET_LAYOUT_ENABLED;
}
}

View File

@@ -1,13 +0,0 @@
package app.revanced.integrations.youtube.patches;
import app.revanced.integrations.youtube.settings.Settings;
@SuppressWarnings("unused")
public class TabletMiniPlayerOverridePatch {
public static boolean getTabletMiniPlayerOverride(boolean original) {
if (Settings.USE_TABLET_MINIPLAYER.get())
return true;
return original;
}
}

View File

@@ -23,7 +23,9 @@ public final class VideoInformation {
private static final String SHORTS_PLAYER_PARAMETERS = "8AEB";
private static WeakReference<Object> playerControllerRef;
private static WeakReference<Object> mdxPlayerDirectorRef;
private static Method seekMethod;
private static Method mdxSeekMethod;
@NonNull
private static String videoId = "";
@@ -59,6 +61,22 @@ public final class VideoInformation {
}
}
/**
* Injection point.
*
* @param mdxPlayerDirector MDX player director object (casting mode).
*/
public static void initializeMdx(@NonNull Object mdxPlayerDirector) {
try {
mdxPlayerDirectorRef = new WeakReference<>(Objects.requireNonNull(mdxPlayerDirector));
mdxSeekMethod = mdxPlayerDirector.getClass().getMethod(SEEK_METHOD_NAME, Long.TYPE);
mdxSeekMethod.setAccessible(true);
} catch (Exception ex) {
Logger.printException(() -> "Failed to initialize MDX", ex);
}
}
/**
* Injection point.
*
@@ -81,7 +99,7 @@ public final class VideoInformation {
/**
* Injection point.
*/
public static String newPlayerResponseSignature(@NonNull String signature, boolean isShortAndOpeningOrPlaying) {
public static String newPlayerResponseSignature(@NonNull String signature, String videoId, boolean isShortAndOpeningOrPlaying) {
final boolean isShort = playerParametersAreShort(signature);
playerResponseVideoIdIsShort = isShort;
if (!isShort || isShortAndOpeningOrPlaying) {
@@ -178,8 +196,32 @@ public final class VideoInformation {
}
Logger.printDebug(() -> "Seeking to " + adjustedSeekTime);
//noinspection DataFlowIssue
return (Boolean) seekMethod.invoke(playerControllerRef.get(), adjustedSeekTime);
try {
//noinspection DataFlowIssue
if ((Boolean) seekMethod.invoke(playerControllerRef.get(), adjustedSeekTime)) {
return true;
} // Else the video is loading or changing videos, or video is casting to a different device.
} catch (Exception ex) {
Logger.printInfo(() -> "seekTo method call failed", ex);
}
// Try calling the seekTo method of the MDX player director (called when casting).
// The difference has to be a different second mark in order to avoid infinite skip loops
// as the Lounge API only supports seconds.
if ((adjustedSeekTime / 1000) == (videoTime / 1000)) {
Logger.printDebug(() -> "Skipping seekTo for MDX because seek time is too small ("
+ (adjustedSeekTime - videoTime) + "ms)");
return false;
}
try {
//noinspection DataFlowIssue
return (Boolean) mdxSeekMethod.invoke(mdxPlayerDirectorRef.get(), adjustedSeekTime);
} catch (Exception ex) {
Logger.printInfo(() -> "seekTo (MDX) method call failed", ex);
return false;
}
} catch (Exception ex) {
Logger.printException(() -> "Failed to seek", ex);
return false;
@@ -278,6 +320,7 @@ public final class VideoInformation {
*
* @see VideoState
*/
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
public static boolean isAtEndOfVideo() {
return videoTime >= videoLength && videoLength > 0;
}

View File

@@ -56,10 +56,11 @@ public final class AdsFilter extends Filter {
final var buttonedAd = new StringFilterGroup(
Settings.HIDE_BUTTONED_ADS,
"_buttoned_layout",
"full_width_square_image_layout",
"_ad_with",
"text_image_button_group_layout",
"_buttoned_layout",
// text_image_button_group_layout, landscape_image_button_group_layout, full_width_square_image_button_group_layout
"image_button_group_layout",
"full_width_square_image_layout",
"video_display_button_group_layout",
"landscape_image_wide_button_layout",
"video_display_carousel_button_group_layout"
@@ -175,7 +176,7 @@ public final class AdsFilter extends Filter {
* @param view The view, which shows ads.
*/
public static void hideAdAttributionView(View view) {
Utils.hideViewBy1dpUnderCondition(Settings.HIDE_GENERAL_ADS, view);
Utils.hideViewBy0dpUnderCondition(Settings.HIDE_GENERAL_ADS, view);
}
/**

View File

@@ -22,7 +22,7 @@ final class ButtonsFilter extends Filter {
bufferFilterPathGroup = new StringFilterGroup(
null,
"|CellType|CollectionType|CellType|ContainerType|button.eml|"
"|ContainerType|button.eml|"
);
addPathCallbacks(
new StringFilterGroup(

View File

@@ -14,21 +14,37 @@ final class CommentsFilter extends Filter {
private final ByteArrayFilterGroup emojiPickerBufferGroup;
public CommentsFilter() {
var commentsByMembers = new StringFilterGroup(
Settings.HIDE_COMMENTS_BY_MEMBERS_HEADER,
"sponsorships_comments_header.eml",
"sponsorships_comments_footer.eml"
);
var comments = new StringFilterGroup(
Settings.HIDE_COMMENTS_SECTION,
"video_metadata_carousel",
"_comments"
);
var createAShort = new StringFilterGroup(
Settings.HIDE_COMMENTS_CREATE_A_SHORT_BUTTON,
"composer_short_creation_button.eml"
);
var previewComment = new StringFilterGroup(
Settings.HIDE_PREVIEW_COMMENT,
Settings.HIDE_COMMENTS_PREVIEW_COMMENT,
"|carousel_item",
"comments_entry_point_teaser",
"comments_entry_point_simplebox"
);
var thanksButton = new StringFilterGroup(
Settings.HIDE_COMMENTS_THANKS_BUTTON,
"super_thanks_button.eml"
);
commentComposer = new StringFilterGroup(
Settings.HIDE_COMMENT_TIMESTAMP_AND_EMOJI_BUTTONS,
Settings.HIDE_COMMENTS_TIMESTAMP_AND_EMOJI_BUTTONS,
"comment_composer.eml"
);
@@ -38,8 +54,11 @@ final class CommentsFilter extends Filter {
);
addPathCallbacks(
commentsByMembers,
comments,
createAShort,
previewComment,
thanksButton,
commentComposer
);
}

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