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

Compare commits

...

50 Commits

Author SHA1 Message Date
semantic-release-bot
69ccb5fc05 chore(release): 0.100.2-dev.1 [skip ci]
## [0.100.2-dev.1](https://github.com/revanced/revanced-integrations/compare/v0.100.1...v0.100.2-dev.1) (2023-03-14)

### Bug Fixes

* **youtube/return-youtube-dislike:** fix right to left text layout ([#333](https://github.com/revanced/revanced-integrations/issues/333)) ([2dd1431](2dd14313a6))
2023-03-14 18:54:35 +00:00
LisoUseInAIKyrios
2dd14313a6 fix(youtube/return-youtube-dislike): fix right to left text layout (#333) 2023-03-14 22:52:45 +04:00
LisoUseInAIKyrios
5e518855d1 fixing LTR layout 2023-03-14 22:40:05 +04:00
semantic-release-bot
52ac4acff3 chore(release): 0.100.1 [skip ci]
## [0.100.1](https://github.com/revanced/revanced-integrations/compare/v0.100.0...v0.100.1) (2023-03-14)

### Bug Fixes

* minor syntax issue ([1e1504d](1e1504d118))
2023-03-14 15:28:44 +00:00
oSumAtrIX
a08bc53828 chore: merge branch dev to main (#332) 2023-03-14 16:26:48 +01:00
semantic-release-bot
5d7dc94d8d chore(release): 0.100.1-dev.1 [skip ci]
## [0.100.1-dev.1](https://github.com/revanced/revanced-integrations/compare/v0.100.0...v0.100.1-dev.1) (2023-03-14)

### Bug Fixes

* minor syntax issue ([1e1504d](1e1504d118))
2023-03-14 15:25:08 +00:00
oSumAtrIX
1e1504d118 fix: minor syntax issue 2023-03-14 16:23:20 +01:00
semantic-release-bot
393d6e62f2 chore(release): 0.100.0 [skip ci]
# [0.100.0](https://github.com/revanced/revanced-integrations/compare/v0.99.0...v0.100.0) (2023-03-14)

### Bug Fixes

* **youtube/general-ads:** hide any kind of buttoned ad ([0b3508b](0b3508bd8d))
* **youtube/general-ads:** hide chapters in video description ([#326](https://github.com/revanced/revanced-integrations/issues/326)) ([f31e3a0](f31e3a02a0))
* **youtube/hide-floating-microphone-button:** reboot when changing settings ([919f285](919f2855ed))
* **youtube/remember-video-quality:** treat any connection as wifi except mobile and bluetooth ([1f90f7b](1f90f7b9cc))
* **youtube/return-youtube-dislike:** improve segmented like/dislike layout ([416c695](416c695837))

### Features

* **youtube/general-ads:** do not hide components in library tab ([3c00e58](3c00e58c13))
* **youtube/general-ads:** hide image shelf from search results ([db6ce55](db6ce55477))
* **youtube/general-ads:** hide new type of ad ([844bc3b](844bc3b24f))
* **youtube/general-ads:** hide new type of ad ([#331](https://github.com/revanced/revanced-integrations/issues/331)) ([7e64e05](7e64e05709))
* **youtube/hide-autoplay-button:** do not disable autoplay button when hidden ([519c2bd](519c2bd511))
* **youtube:** `hide-floating-microphone-button` patch ([cb77e96](cb77e96da9))
* **youtube:** remove `custom-video-buffer` patch ([#1718](https://github.com/revanced/revanced-integrations/issues/1718)) ([d5919a8](d5919a8a2c))
2023-03-14 15:01:22 +00:00
oSumAtrIX
1361595076 chore: merge branch dev to main (#324) 2023-03-14 15:59:09 +01:00
semantic-release-bot
2f5c839613 chore(release): 0.100.0-dev.6 [skip ci]
# [0.100.0-dev.6](https://github.com/revanced/revanced-integrations/compare/v0.100.0-dev.5...v0.100.0-dev.6) (2023-03-14)

### Bug Fixes

* **youtube/hide-floating-microphone-button:** reboot when changing settings ([919f285](919f2855ed))
* **youtube/remember-video-quality:** treat any connection as wifi except mobile and bluetooth ([1f90f7b](1f90f7b9cc))
* **youtube/return-youtube-dislike:** improve segmented like/dislike layout ([416c695](416c695837))

### Features

* **youtube/general-ads:** hide new type of ad ([844bc3b](844bc3b24f))
* **youtube/general-ads:** hide new type of ad ([#331](https://github.com/revanced/revanced-integrations/issues/331)) ([7e64e05](7e64e05709))
* **youtube:** remove `custom-video-buffer` patch ([#1718](https://github.com/revanced/revanced-integrations/issues/1718)) ([d5919a8](d5919a8a2c))
2023-03-14 14:30:11 +00:00
johnconner122
7e64e05709 feat(youtube/general-ads): hide new type of ad (#331)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-03-14 15:26:31 +01:00
oSumAtrIX
d5919a8a2c feat(youtube): remove custom-video-buffer patch (#1718) 2023-03-14 15:26:30 +01:00
oSumAtrIX
844bc3b24f feat(youtube/general-ads): hide new type of ad 2023-03-14 15:26:30 +01:00
oSumAtrIX
67fa87051f chore: fix logging message 2023-03-14 15:26:30 +01:00
oSumAtrIX
1f90f7b9cc fix(youtube/remember-video-quality): treat any connection as wifi except mobile and bluetooth 2023-03-14 15:26:29 +01:00
semantic-release-bot
0c725218fd chore(release): 0.100.0-dev.6 [skip ci]
# [0.100.0-dev.6](https://github.com/revanced/revanced-integrations/compare/v0.100.0-dev.5...v0.100.0-dev.6) (2023-02-26)

### Bug Fixes

* **youtube/hide-floating-microphone-button:** reboot when changing settings ([919f285](919f2855ed))
2023-03-14 15:26:00 +01:00
LisousEinaiKyrios
416c695837 fix(youtube/return-youtube-dislike): improve segmented like/dislike layout 2023-03-14 15:26:00 +01:00
oSumAtrIX
919f2855ed fix(youtube/hide-floating-microphone-button): reboot when changing settings
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-27 00:23:59 +01:00
semantic-release-bot
040ba24640 chore(release): 0.100.0-dev.5 [skip ci]
# [0.100.0-dev.5](https://github.com/revanced/revanced-integrations/compare/v0.100.0-dev.4...v0.100.0-dev.5) (2023-02-26)

### Features

* **youtube/hide-autoplay-button:** do not disable autoplay button when hidden ([519c2bd](519c2bd511))
* **youtube:** `hide-floating-microphone-button` patch ([cb77e96](cb77e96da9))
2023-02-26 22:17:18 +00:00
oSumAtrIX
a1d4fabaaf refactor(youtube/settings): remove unused code
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-26 23:15:36 +01:00
oSumAtrIX
66bcf12dc6 refactor(youtube/settings): remove deprecated settings
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-26 23:15:35 +01:00
oSumAtrIX
7dc6bb4428 refactor(youtube/settings): use default parameter
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-26 23:15:35 +01:00
oSumAtrIX
24162934ba refactor(youtube/hide-timestamp): use better descriptions
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-26 23:15:35 +01:00
oSumAtrIX
cb77e96da9 feat(youtube): hide-floating-microphone-button patch
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-26 23:15:34 +01:00
oSumAtrIX
519c2bd511 feat(youtube/hide-autoplay-button): do not disable autoplay button when hidden
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-26 23:15:34 +01:00
semantic-release-bot
8a8924ab09 chore(release): 0.100.0-dev.4 [skip ci]
# [0.100.0-dev.4](https://github.com/revanced/revanced-integrations/compare/v0.100.0-dev.3...v0.100.0-dev.4) (2023-02-26)

### Bug Fixes

* **youtube/general-ads:** hide any kind of buttoned ad ([0b3508b](0b3508bd8d))
2023-02-26 21:19:20 +00:00
oSumAtrIX
0b3508bd8d fix(youtube/general-ads): hide any kind of buttoned ad
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-26 22:17:31 +01:00
semantic-release-bot
db60d983e5 chore(release): 0.100.0-dev.3 [skip ci]
# [0.100.0-dev.3](https://github.com/revanced/revanced-integrations/compare/v0.100.0-dev.2...v0.100.0-dev.3) (2023-02-25)

### Bug Fixes

* **youtube/general-ads:** hide chapters in video description ([#326](https://github.com/revanced/revanced-integrations/issues/326)) ([f31e3a0](f31e3a02a0))
2023-02-25 15:26:37 +00:00
johnconner122
f31e3a02a0 fix(youtube/general-ads): hide chapters in video description (#326) 2023-02-25 16:24:45 +01:00
semantic-release-bot
f758b09676 chore(release): 0.100.0-dev.2 [skip ci]
# [0.100.0-dev.2](https://github.com/revanced/revanced-integrations/compare/v0.100.0-dev.1...v0.100.0-dev.2) (2023-02-24)

### Features

* **youtube/general-ads:** do not hide components in library tab ([3c00e58](3c00e58c13))
2023-02-24 23:13:28 +00:00
oSumAtrIX
3c00e58c13 feat(youtube/general-ads): do not hide components in library tab
This reverts commit fd975ecd

Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-25 00:09:48 +01:00
semantic-release-bot
0b83be989b chore(release): 0.100.0-dev.1 [skip ci]
# [0.100.0-dev.1](https://github.com/revanced/revanced-integrations/compare/v0.99.0...v0.100.0-dev.1) (2023-02-24)

### Features

* **youtube/general-ads:** hide image shelf from search results ([db6ce55](db6ce55477))
2023-02-24 03:16:12 +00:00
oSumAtrIX
db6ce55477 feat(youtube/general-ads): hide image shelf from search results
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-24 04:14:08 +01:00
semantic-release-bot
0b1b6b3682 chore(release): 0.99.0 [skip ci]
# [0.99.0](https://github.com/revanced/revanced-integrations/compare/v0.98.0...v0.99.0) (2023-02-24)

### Bug Fixes

* **youtube/general-ads:** check for quick actions in path instead of component identifier ([476902e](476902e9ce))
* **youtube/general-ads:** use correct setting to hide related videos in quick actions ([e626bd0](e626bd08c1))
* **youtube/general-ads:** use correct setting to hide related videos in quick actions ([05bfc68](05bfc68907))

### Features

* **youtube/general-ads:** hide quick actions in fullscreen ([ae862cb](ae862cbac6))
* **youtube/general-ads:** hide related videos in quick action ([cfc571c](cfc571c12c))
* **youtube/return-youtube-dislike:** support for shorts ([#312](https://github.com/revanced/revanced-integrations/issues/312)) ([0aef5e6](0aef5e60e2))
* **youtube:** remove patch `open-links-directly` ([dce882b](dce882b128))
2023-02-24 02:49:24 +00:00
oSumAtrIX
b612cbf2c0 chore: merge branch dev to main (#323) 2023-02-24 03:47:25 +01:00
semantic-release-bot
10fff6a0b8 chore(release): 0.99.0-dev.4 [skip ci]
# [0.99.0-dev.4](https://github.com/revanced/revanced-integrations/compare/v0.99.0-dev.3...v0.99.0-dev.4) (2023-02-24)

### Bug Fixes

* **youtube/general-ads:** check for quick actions in path instead of component identifier ([476902e](476902e9ce))
* **youtube/general-ads:** use correct setting to hide related videos in quick actions ([e626bd0](e626bd08c1))
* **youtube/general-ads:** use correct setting to hide related videos in quick actions ([05bfc68](05bfc68907))
2023-02-24 02:30:21 +00:00
oSumAtrIX
e626bd08c1 fix(youtube/general-ads): use correct setting to hide related videos in quick actions
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-24 03:28:27 +01:00
oSumAtrIX
476902e9ce fix(youtube/general-ads): check for quick actions in path instead of component identifier
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-24 03:28:26 +01:00
oSumAtrIX
05bfc68907 fix(youtube/general-ads): use correct setting to hide related videos in quick actions
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-24 03:28:26 +01:00
semantic-release-bot
c3364226b8 chore(release): 0.99.0-dev.3 [skip ci]
# [0.99.0-dev.3](https://github.com/revanced/revanced-integrations/compare/v0.99.0-dev.2...v0.99.0-dev.3) (2023-02-24)

### Features

* **youtube/return-youtube-dislike:** support for shorts ([#312](https://github.com/revanced/revanced-integrations/issues/312)) ([0aef5e6](0aef5e60e2))
2023-02-24 02:01:49 +00:00
LisoUseInAIKyrios
0aef5e60e2 feat(youtube/return-youtube-dislike): support for shorts (#312)
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-24 02:59:32 +01:00
semantic-release-bot
fb1a69a7ba chore(release): 0.99.0-dev.2 [skip ci]
# [0.99.0-dev.2](https://github.com/revanced/revanced-integrations/compare/v0.99.0-dev.1...v0.99.0-dev.2) (2023-02-23)

### Features

* **youtube/general-ads:** hide quick actions in fullscreen ([ae862cb](ae862cbac6))
* **youtube/general-ads:** hide related videos in quick action ([cfc571c](cfc571c12c))
2023-02-23 12:33:42 +00:00
oSumAtrIX
cfc571c12c feat(youtube/general-ads): hide related videos in quick action
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-23 13:31:15 +01:00
oSumAtrIX
ae862cbac6 feat(youtube/general-ads): hide quick actions in fullscreen
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-23 13:30:49 +01:00
oSumAtrIX
178b90b490 ci: fix backmerge direction
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-22 16:40:05 +01:00
semantic-release-bot
4b052b19a3 chore(release): 0.99.0-dev.1 [skip ci]
# [0.99.0-dev.1](https://github.com/revanced/revanced-integrations/compare/v0.98.0...v0.99.0-dev.1) (2023-02-22)

### Features

* **youtube:** remove patch `open-links-directly` ([dce882b](dce882b128))
2023-02-22 15:37:04 +00:00
oSumAtrIX
dce882b128 feat(youtube): remove patch open-links-directly
The patch did not serve any real purpose

Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-22 16:23:06 +01:00
semantic-release-bot
ccb5d81d46 chore(release): 0.98.0 [skip ci]
# [0.98.0](https://github.com/revanced/revanced-integrations/compare/v0.97.0...v0.98.0) (2023-02-22)

### Bug Fixes

* remove nullable annotation in Kotlin code ([b5a29fd](b5a29fdce1))
* **twitter:** make `hide-ads` patch compatible with any version ([6655988](665598836a))
* **youtube/hide-watch-in-vr:** fix descriptions ([96fcc0b](96fcc0b1c7))

### Features

* **twitter:** `hide-recommended-users` patch ([96eea3d](96eea3d4fc))
* **youtube/general-ads:** hide channel bar ([35c4266](35c4266e8b))
* **youtube/general-ads:** hide full-screen feed banner ([da1572c](da1572c28d))
* **youtube/general-ads:** hide horizontal video shelf ([fd975ec](fd975ecd2a))
* **youtube/open-links-directly:** skip every redirect url ([2d73b8b](2d73b8b29b))
2023-02-22 05:51:41 +00:00
oSumAtrIX
5ed7170018 chore: merge branch dev to main (#321) 2023-02-22 06:49:37 +01:00
oSumAtrIX
621ef63d86 ci: add backmerge target branch
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-22 06:45:15 +01:00
17 changed files with 732 additions and 591 deletions

View File

@@ -34,7 +34,7 @@
[
"@saithodev/semantic-release-backmerge",
{
backmergeBranches: ["dev"],
backmergeBranches: [{"from": "main", "to": "dev"}],
clearWorkspace: true
}
]

View File

@@ -1,3 +1,171 @@
## [0.100.2-dev.1](https://github.com/revanced/revanced-integrations/compare/v0.100.1...v0.100.2-dev.1) (2023-03-14)
### Bug Fixes
* **youtube/return-youtube-dislike:** fix right to left text layout ([#333](https://github.com/revanced/revanced-integrations/issues/333)) ([2dd1431](https://github.com/revanced/revanced-integrations/commit/2dd14313a64930acbb544f4ad971c51dcfbb80e1))
## [0.100.1](https://github.com/revanced/revanced-integrations/compare/v0.100.0...v0.100.1) (2023-03-14)
### Bug Fixes
* minor syntax issue ([1e1504d](https://github.com/revanced/revanced-integrations/commit/1e1504d118d656492df0bee30364e966a8dc99b4))
## [0.100.1-dev.1](https://github.com/revanced/revanced-integrations/compare/v0.100.0...v0.100.1-dev.1) (2023-03-14)
### Bug Fixes
* minor syntax issue ([1e1504d](https://github.com/revanced/revanced-integrations/commit/1e1504d118d656492df0bee30364e966a8dc99b4))
# [0.100.0](https://github.com/revanced/revanced-integrations/compare/v0.99.0...v0.100.0) (2023-03-14)
### Bug Fixes
* **youtube/general-ads:** hide any kind of buttoned ad ([0b3508b](https://github.com/revanced/revanced-integrations/commit/0b3508bd8dcd6e031f1a7625ee5214fd093ee3f5))
* **youtube/general-ads:** hide chapters in video description ([#326](https://github.com/revanced/revanced-integrations/issues/326)) ([f31e3a0](https://github.com/revanced/revanced-integrations/commit/f31e3a02a0965da0c1f901e9d6afcfe4f6f6b608))
* **youtube/hide-floating-microphone-button:** reboot when changing settings ([919f285](https://github.com/revanced/revanced-integrations/commit/919f2855edff0acc96c42ea733fff41a55211e48))
* **youtube/remember-video-quality:** treat any connection as wifi except mobile and bluetooth ([1f90f7b](https://github.com/revanced/revanced-integrations/commit/1f90f7b9cca2445c776f4f0c8af1ddd0c9bde5f0))
* **youtube/return-youtube-dislike:** improve segmented like/dislike layout ([416c695](https://github.com/revanced/revanced-integrations/commit/416c695837debefb4762d381f25157de480614cc))
### Features
* **youtube/general-ads:** do not hide components in library tab ([3c00e58](https://github.com/revanced/revanced-integrations/commit/3c00e58c13fa11da68ff21f4d76e341bc24c5737))
* **youtube/general-ads:** hide image shelf from search results ([db6ce55](https://github.com/revanced/revanced-integrations/commit/db6ce554779d58b23685b1794e17f89342abbd87))
* **youtube/general-ads:** hide new type of ad ([844bc3b](https://github.com/revanced/revanced-integrations/commit/844bc3b24fe9a2d6b69367d79ad99e452e8a7604))
* **youtube/general-ads:** hide new type of ad ([#331](https://github.com/revanced/revanced-integrations/issues/331)) ([7e64e05](https://github.com/revanced/revanced-integrations/commit/7e64e05709c63b4631e845799e756a678138813b))
* **youtube/hide-autoplay-button:** do not disable autoplay button when hidden ([519c2bd](https://github.com/revanced/revanced-integrations/commit/519c2bd5118db41fc512a665d9454b902134ba2c))
* **youtube:** `hide-floating-microphone-button` patch ([cb77e96](https://github.com/revanced/revanced-integrations/commit/cb77e96da91bb4707d8559757cd86a7583f8048b))
* **youtube:** remove `custom-video-buffer` patch ([#1718](https://github.com/revanced/revanced-integrations/issues/1718)) ([d5919a8](https://github.com/revanced/revanced-integrations/commit/d5919a8a2cff09bb884ea01ca6b01d8d2d0b8980))
# [0.100.0-dev.6](https://github.com/revanced/revanced-integrations/compare/v0.100.0-dev.5...v0.100.0-dev.6) (2023-03-14)
### Bug Fixes
* **youtube/hide-floating-microphone-button:** reboot when changing settings ([919f285](https://github.com/revanced/revanced-integrations/commit/919f2855edff0acc96c42ea733fff41a55211e48))
* **youtube/remember-video-quality:** treat any connection as wifi except mobile and bluetooth ([1f90f7b](https://github.com/revanced/revanced-integrations/commit/1f90f7b9cca2445c776f4f0c8af1ddd0c9bde5f0))
* **youtube/return-youtube-dislike:** improve segmented like/dislike layout ([416c695](https://github.com/revanced/revanced-integrations/commit/416c695837debefb4762d381f25157de480614cc))
### Features
* **youtube/general-ads:** hide new type of ad ([844bc3b](https://github.com/revanced/revanced-integrations/commit/844bc3b24fe9a2d6b69367d79ad99e452e8a7604))
* **youtube/general-ads:** hide new type of ad ([#331](https://github.com/revanced/revanced-integrations/issues/331)) ([7e64e05](https://github.com/revanced/revanced-integrations/commit/7e64e05709c63b4631e845799e756a678138813b))
* **youtube:** remove `custom-video-buffer` patch ([#1718](https://github.com/revanced/revanced-integrations/issues/1718)) ([d5919a8](https://github.com/revanced/revanced-integrations/commit/d5919a8a2cff09bb884ea01ca6b01d8d2d0b8980))
# [0.100.0-dev.6](https://github.com/revanced/revanced-integrations/compare/v0.100.0-dev.5...v0.100.0-dev.6) (2023-02-26)
### Bug Fixes
* **youtube/hide-floating-microphone-button:** reboot when changing settings ([919f285](https://github.com/revanced/revanced-integrations/commit/919f2855edff0acc96c42ea733fff41a55211e48))
# [0.100.0-dev.5](https://github.com/revanced/revanced-integrations/compare/v0.100.0-dev.4...v0.100.0-dev.5) (2023-02-26)
### Features
* **youtube/hide-autoplay-button:** do not disable autoplay button when hidden ([519c2bd](https://github.com/revanced/revanced-integrations/commit/519c2bd5118db41fc512a665d9454b902134ba2c))
* **youtube:** `hide-floating-microphone-button` patch ([cb77e96](https://github.com/revanced/revanced-integrations/commit/cb77e96da91bb4707d8559757cd86a7583f8048b))
# [0.100.0-dev.4](https://github.com/revanced/revanced-integrations/compare/v0.100.0-dev.3...v0.100.0-dev.4) (2023-02-26)
### Bug Fixes
* **youtube/general-ads:** hide any kind of buttoned ad ([0b3508b](https://github.com/revanced/revanced-integrations/commit/0b3508bd8dcd6e031f1a7625ee5214fd093ee3f5))
# [0.100.0-dev.3](https://github.com/revanced/revanced-integrations/compare/v0.100.0-dev.2...v0.100.0-dev.3) (2023-02-25)
### Bug Fixes
* **youtube/general-ads:** hide chapters in video description ([#326](https://github.com/revanced/revanced-integrations/issues/326)) ([f31e3a0](https://github.com/revanced/revanced-integrations/commit/f31e3a02a0965da0c1f901e9d6afcfe4f6f6b608))
# [0.100.0-dev.2](https://github.com/revanced/revanced-integrations/compare/v0.100.0-dev.1...v0.100.0-dev.2) (2023-02-24)
### Features
* **youtube/general-ads:** do not hide components in library tab ([3c00e58](https://github.com/revanced/revanced-integrations/commit/3c00e58c13fa11da68ff21f4d76e341bc24c5737))
# [0.100.0-dev.1](https://github.com/revanced/revanced-integrations/compare/v0.99.0...v0.100.0-dev.1) (2023-02-24)
### Features
* **youtube/general-ads:** hide image shelf from search results ([db6ce55](https://github.com/revanced/revanced-integrations/commit/db6ce554779d58b23685b1794e17f89342abbd87))
# [0.99.0](https://github.com/revanced/revanced-integrations/compare/v0.98.0...v0.99.0) (2023-02-24)
### Bug Fixes
* **youtube/general-ads:** check for quick actions in path instead of component identifier ([476902e](https://github.com/revanced/revanced-integrations/commit/476902e9cedbc068a815897dd22eabdb52dee84a))
* **youtube/general-ads:** use correct setting to hide related videos in quick actions ([e626bd0](https://github.com/revanced/revanced-integrations/commit/e626bd08c1249cb5594d15c77d06cae8ae27e055))
* **youtube/general-ads:** use correct setting to hide related videos in quick actions ([05bfc68](https://github.com/revanced/revanced-integrations/commit/05bfc689078beb9a21adc6c4555afe0862e304f7))
### Features
* **youtube/general-ads:** hide quick actions in fullscreen ([ae862cb](https://github.com/revanced/revanced-integrations/commit/ae862cbac6f9a9b717617469d202b48923a1d3b4))
* **youtube/general-ads:** hide related videos in quick action ([cfc571c](https://github.com/revanced/revanced-integrations/commit/cfc571c12cb012b86c8bfa8bf7df1c77b9711a21))
* **youtube/return-youtube-dislike:** support for shorts ([#312](https://github.com/revanced/revanced-integrations/issues/312)) ([0aef5e6](https://github.com/revanced/revanced-integrations/commit/0aef5e60e280b63490dac8d1b706e896fdf913a2))
* **youtube:** remove patch `open-links-directly` ([dce882b](https://github.com/revanced/revanced-integrations/commit/dce882b12809c074ae796b3551ddd82806bd084d))
# [0.99.0-dev.4](https://github.com/revanced/revanced-integrations/compare/v0.99.0-dev.3...v0.99.0-dev.4) (2023-02-24)
### Bug Fixes
* **youtube/general-ads:** check for quick actions in path instead of component identifier ([476902e](https://github.com/revanced/revanced-integrations/commit/476902e9cedbc068a815897dd22eabdb52dee84a))
* **youtube/general-ads:** use correct setting to hide related videos in quick actions ([e626bd0](https://github.com/revanced/revanced-integrations/commit/e626bd08c1249cb5594d15c77d06cae8ae27e055))
* **youtube/general-ads:** use correct setting to hide related videos in quick actions ([05bfc68](https://github.com/revanced/revanced-integrations/commit/05bfc689078beb9a21adc6c4555afe0862e304f7))
# [0.99.0-dev.3](https://github.com/revanced/revanced-integrations/compare/v0.99.0-dev.2...v0.99.0-dev.3) (2023-02-24)
### Features
* **youtube/return-youtube-dislike:** support for shorts ([#312](https://github.com/revanced/revanced-integrations/issues/312)) ([0aef5e6](https://github.com/revanced/revanced-integrations/commit/0aef5e60e280b63490dac8d1b706e896fdf913a2))
# [0.99.0-dev.2](https://github.com/revanced/revanced-integrations/compare/v0.99.0-dev.1...v0.99.0-dev.2) (2023-02-23)
### Features
* **youtube/general-ads:** hide quick actions in fullscreen ([ae862cb](https://github.com/revanced/revanced-integrations/commit/ae862cbac6f9a9b717617469d202b48923a1d3b4))
* **youtube/general-ads:** hide related videos in quick action ([cfc571c](https://github.com/revanced/revanced-integrations/commit/cfc571c12cb012b86c8bfa8bf7df1c77b9711a21))
# [0.99.0-dev.1](https://github.com/revanced/revanced-integrations/compare/v0.98.0...v0.99.0-dev.1) (2023-02-22)
### Features
* **youtube:** remove patch `open-links-directly` ([dce882b](https://github.com/revanced/revanced-integrations/commit/dce882b12809c074ae796b3551ddd82806bd084d))
# [0.98.0](https://github.com/revanced/revanced-integrations/compare/v0.97.0...v0.98.0) (2023-02-22)
### Bug Fixes
* remove nullable annotation in Kotlin code ([b5a29fd](https://github.com/revanced/revanced-integrations/commit/b5a29fdce195ab47edd61d1d684def1ac919297c))
* **twitter:** make `hide-ads` patch compatible with any version ([6655988](https://github.com/revanced/revanced-integrations/commit/665598836abfcead9c5e68ce7831a4137465df39))
* **youtube/hide-watch-in-vr:** fix descriptions ([96fcc0b](https://github.com/revanced/revanced-integrations/commit/96fcc0b1c70c277c99a99db9ca2d50f649a41a70))
### Features
* **twitter:** `hide-recommended-users` patch ([96eea3d](https://github.com/revanced/revanced-integrations/commit/96eea3d4fc096f389840481b146dcf1542cb9c43))
* **youtube/general-ads:** hide channel bar ([35c4266](https://github.com/revanced/revanced-integrations/commit/35c4266e8b8ad7cf9fb5d14cf6cbc8ae65cc78df))
* **youtube/general-ads:** hide full-screen feed banner ([da1572c](https://github.com/revanced/revanced-integrations/commit/da1572c28d20e2549d0e2a68591f23bb68d8cc9c))
* **youtube/general-ads:** hide horizontal video shelf ([fd975ec](https://github.com/revanced/revanced-integrations/commit/fd975ecd2a91ea7ac713d3b7badf373c7d53ad5c))
* **youtube/open-links-directly:** skip every redirect url ([2d73b8b](https://github.com/revanced/revanced-integrations/commit/2d73b8b29b14ab9ce20fa33ea4ebfa66984c5903))
# [0.98.0-dev.5](https://github.com/revanced/revanced-integrations/compare/v0.98.0-dev.4...v0.98.0-dev.5) (2023-02-22)

View File

@@ -35,16 +35,18 @@ public final class GeneralAdsPatch extends Filter {
var channelGuidelines = new BlockRule(SettingsEnum.ADREMOVER_HIDE_CHANNEL_GUIDELINES, "channel_guidelines_entry_banner");
var artistCard = new BlockRule(SettingsEnum.HIDE_ARTIST_CARDS, "official_card");
var selfSponsor = new BlockRule(SettingsEnum.ADREMOVER_SELF_SPONSOR_REMOVAL, "cta_shelf_card");
var chapterTeaser = new BlockRule(SettingsEnum.ADREMOVER_CHAPTER_TEASER_REMOVAL, "expandable_metadata");
var chapterTeaser = new BlockRule(SettingsEnum.ADREMOVER_CHAPTER_TEASER_REMOVAL, "expandable_metadata", "macro_markers_carousel");
var viewProducts = new BlockRule(SettingsEnum.ADREMOVER_VIEW_PRODUCTS, "product_item", "products_in_video");
var webLinkPanel = new BlockRule(SettingsEnum.ADREMOVER_WEB_SEARCH_RESULTS, "web_link_panel");
var horizontalVideoShelf = new BlockRule(SettingsEnum.ADREMOVER_HORIZONTAL_VIDEO_SHELF, "horizontal_video_shelf");
var channelBar = new BlockRule(SettingsEnum.ADREMOVER_CHANNEL_BAR, "channel_bar");
var relatedVideos = new BlockRule(SettingsEnum.ADREMOVER_RELATED_VIDEOS, "fullscreen_related_videos");
var quickActions = new BlockRule(SettingsEnum.ADREMOVER_QUICK_ACTIONS, "quick_actions");
var imageShelf = new BlockRule(SettingsEnum.ADREMOVER_IMAGE_SHELF, "image_shelf");
var graySeparator = new BlockRule(SettingsEnum.ADREMOVER_GRAY_SEPARATOR,
"cell_divider" // layout residue (gray line above the buttoned ad),
);
var buttonedAd = new BlockRule(SettingsEnum.ADREMOVER_BUTTONED_REMOVAL,
"video_display_full_buttoned_layout",
"_buttoned_layout",
"full_width_square_image_layout",
"_ad_with",
"landscape_image_wide_button_layout"
@@ -57,7 +59,9 @@ public final class GeneralAdsPatch extends Filter {
"watch_metadata_app_promo",
"video_display_full_layout",
"hero_promo_image",
"statement_banner"
"statement_banner",
"carousel_footered_layout",
"text_image_button_layout"
);
var movieAds = new BlockRule(
SettingsEnum.ADREMOVER_MOVIE_REMOVAL,
@@ -78,6 +82,8 @@ public final class GeneralAdsPatch extends Filter {
movieAds,
chapterTeaser,
communityGuidelines,
quickActions,
relatedVideos,
compactBanner,
inFeedSurvey,
viewProducts,
@@ -88,7 +94,7 @@ public final class GeneralAdsPatch extends Filter {
artistCard,
selfSponsor,
webLinkPanel,
horizontalVideoShelf,
imageShelf,
subscribersCommunityGuidelines,
channelMemberShelf
);

View File

@@ -3,8 +3,7 @@ package app.revanced.integrations.patches;
import app.revanced.integrations.settings.SettingsEnum;
public class HideAutoplayButtonPatch {
public static boolean isButtonShown() {
return SettingsEnum.HIDE_AUTOPLAY_BUTTON.getBoolean() == false;
return !SettingsEnum.HIDE_AUTOPLAY_BUTTON.getBoolean();
}
}

View File

@@ -0,0 +1,9 @@
package app.revanced.integrations.patches;
import app.revanced.integrations.settings.SettingsEnum;
public final class HideFloatingMicrophoneButtonPatch {
public static boolean hideFloatingMicrophoneButton(final boolean original) {
return SettingsEnum.HIDE_FLOATING_MICROPHONE_BUTTON.getBoolean() || original;
}
}

View File

@@ -1,9 +0,0 @@
package app.revanced.integrations.patches;
import app.revanced.integrations.settings.SettingsEnum;
public class HideTimePatch {
public static boolean hideTime() {
return SettingsEnum.HIDE_TIME.getBoolean();
}
}

View File

@@ -0,0 +1,9 @@
package app.revanced.integrations.patches;
import app.revanced.integrations.settings.SettingsEnum;
public class HideTimestampPatch {
public static boolean hideTimestamp() {
return SettingsEnum.HIDE_TIMESTAMP.getBoolean();
}
}

View File

@@ -1,25 +0,0 @@
package app.revanced.integrations.patches;
import android.net.Uri;
import app.revanced.integrations.settings.SettingsEnum;
public class OpenLinksDirectlyPatch {
private static final String YOUTUBE_REDIRECT_PATH = "redirect";
/**
* Parses the given YouTube redirect uri by extracting the redirect query.
*
* @param uri The YouTube redirect uri.
* @return The redirect query.
*/
public static Uri parseRedirectUri(String uri) {
if (SettingsEnum.OPEN_LINKS_DIRECTLY.getBoolean()) {
final var parsed = Uri.parse(uri);
if (parsed.getPath().equals(YOUTUBE_REDIRECT_PATH))
Uri.parse(parsed.getQueryParameter("q"));
}
return Uri.parse(uri);
}
}

View File

@@ -1,22 +1,25 @@
package app.revanced.integrations.patches;
import java.util.concurrent.atomic.AtomicReference;
import android.text.Spanned;
import app.revanced.integrations.returnyoutubedislike.ReturnYouTubeDislike;
import java.util.concurrent.atomic.AtomicReference;
/**
* Used by app.revanced.patches.youtube.layout.returnyoutubedislike.patch.ReturnYouTubeDislikePatch
*/
public class ReturnYouTubeDislikePatch {
/**
* Called when the video id changes
* Injection point
*/
public static void newVideoLoaded(String videoId) {
ReturnYouTubeDislike.newVideoLoaded(videoId);
}
/**
* Injection point
*
* Called when a litho text component is created
*/
public static void onComponentCreated(Object conversionContext, AtomicReference<Object> textRef) {
@@ -24,16 +27,22 @@ public class ReturnYouTubeDislikePatch {
}
/**
* Injection point
*
* Called when a Shorts dislike Spannable is created
*/
public static Spanned onShortsComponentCreated(Spanned dislike) {
return ReturnYouTubeDislike.onShortsComponentCreated(dislike);
}
/**
* Injection point
*
* Called when the like/dislike button is clicked
*
* @param vote -1 (dislike), 0 (none) or 1 (like)
*/
public static void sendVote(int vote) {
for (ReturnYouTubeDislike.Vote v : ReturnYouTubeDislike.Vote.values()) {
if (v.value == vote) {
ReturnYouTubeDislike.sendVote(v);
return;
}
}
ReturnYouTubeDislike.sendVote(vote);
}
}

View File

@@ -1,26 +0,0 @@
package app.revanced.integrations.patches;
import app.revanced.integrations.settings.SettingsEnum;
public class VideoBufferPatch {
public static int getMaxBuffer() {
int confVal = SettingsEnum.MAX_BUFFER.getInt();
if (confVal < 1) confVal = 1;
return confVal;
}
public static int getPlaybackBuffer() {
int confVal = SettingsEnum.PLAYBACK_MAX_BUFFER.getInt();
if (confVal < 1) confVal = 1;
return confVal;
}
public static int getReBuffer() {
int confVal = SettingsEnum.MAX_PLAYBACK_BUFFER_AFTER_REBUFFER.getInt();
if (confVal < 1) confVal = 1;
return confVal;
}
}

View File

@@ -1,21 +1,18 @@
package app.revanced.integrations.patches.playback.quality;
import android.annotation.SuppressLint;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.widget.Toast;
import app.revanced.integrations.settings.SettingsEnum;
import app.revanced.integrations.utils.LogHelper;
import app.revanced.integrations.utils.ReVancedUtils;
import app.revanced.integrations.utils.SharedPrefHelper;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collections;
import app.revanced.integrations.settings.SettingsEnum;
import app.revanced.integrations.utils.LogHelper;
import app.revanced.integrations.utils.ReVancedUtils;
import app.revanced.integrations.utils.SharedPrefHelper;
public class RememberVideoQualityPatch {
public static int selectedQuality1 = -2;
@@ -24,38 +21,37 @@ public class RememberVideoQualityPatch {
public static void changeDefaultQuality(int defaultQuality) {
Context context = ReVancedUtils.getContext();
if (isConnectedWifi(context)) {
try {
SharedPrefHelper.saveString(SharedPrefHelper.SharedPrefNames.REVANCED_PREFS, "wifi_quality", defaultQuality + "");
String message = "Changing default Wi-Fi quality to: " + defaultQuality;
LogHelper.printDebug(() -> message);
Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
} catch (Exception ex) {
LogHelper.printException(() -> "Failed to change default WI-FI quality", ex);
}
} else if (isConnectedMobile(context)) {
try {
SharedPrefHelper.saveString(SharedPrefHelper.SharedPrefNames.REVANCED_PREFS, "mobile_quality", defaultQuality + "");
String message = "Changing default mobile data quality to:" + defaultQuality;
LogHelper.printDebug(() -> message);
Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
} catch (Exception ex) {
LogHelper.printException(() -> "Failed to change default mobile data quality", ex);
}
} else {
var networkType = getNetworType(context);
if (networkType == NetworkType.NONE) {
String message = "No internet connection.";
LogHelper.printDebug(() -> message);
Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
} else {
var preferenceKey = "wifi_quality";
var networkTypeMessage = "WIFI";
if (networkType == NetworkType.MOBILE) {
networkTypeMessage = "mobile";
preferenceKey = "mobile_quality";
}
SharedPrefHelper.saveString(SharedPrefHelper.SharedPrefNames.REVANCED_PREFS, preferenceKey, defaultQuality + "");
String message = "Changing default " + networkTypeMessage + " quality to: " + defaultQuality;
Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
}
userChangedQuality = false;
}
public static int setVideoQuality(Object[] qualities, int quality, Object qInterface, String qIndexMethod) {
int preferredQuality;
Field[] fields;
if (!(newVideo || userChangedQuality) || qInterface == null) {
return quality;
}
Class<?> intType = Integer.TYPE;
ArrayList<Integer> iStreamQualities = new ArrayList<>();
try {
@@ -93,51 +89,48 @@ public class RememberVideoQualityPatch {
LogHelper.printException(() -> "Context is null or settings not initialized, returning quality: " + qualityToLog);
return quality;
}
if (isConnectedWifi(context)) {
preferredQuality = SharedPrefHelper.getInt(SharedPrefHelper.SharedPrefNames.REVANCED_PREFS, "wifi_quality", -2);
LogHelper.printDebug(() -> "Wi-Fi connection detected, preferred quality: " + preferredQuality);
} else if (isConnectedMobile(context)) {
preferredQuality = SharedPrefHelper.getInt(SharedPrefHelper.SharedPrefNames.REVANCED_PREFS, "mobile_quality", -2);
LogHelper.printDebug(() -> "Mobile data connection detected, preferred quality: " + preferredQuality);
} else {
var networkType = getNetworType(context);
if (networkType == NetworkType.NONE) {
LogHelper.printDebug(() -> "No Internet connection!");
return quality;
}
if (preferredQuality == -2) {
return quality;
}
for (int streamQuality2 : iStreamQualities) {
final int indexToLog = index;
LogHelper.printDebug(() -> "Quality at index " + indexToLog + ": " + streamQuality2);
index++;
}
for (Integer iStreamQuality : iStreamQualities) {
int streamQuality3 = iStreamQuality;
if (streamQuality3 <= preferredQuality) {
quality = streamQuality3;
} else {
var preferenceKey = "wifi_quality";
if (networkType == NetworkType.MOBILE) preferenceKey = "mobile_quality";
int preferredQuality = SharedPrefHelper.getInt(SharedPrefHelper.SharedPrefNames.REVANCED_PREFS, preferenceKey, -2);
if (preferredQuality == -2) return quality;
for (int streamQuality2 : iStreamQualities) {
final int indexToLog = index;
LogHelper.printDebug(() -> "Quality at index " + indexToLog + ": " + streamQuality2);
index++;
}
for (Integer iStreamQuality : iStreamQualities) {
int streamQuality3 = iStreamQuality;
if (streamQuality3 <= preferredQuality) {
quality = streamQuality3;
}
}
if (quality == -2) return quality;
int qualityIndex = iStreamQualities.indexOf(quality);
final int qualityToLog2 = quality;
LogHelper.printDebug(() -> "Index of quality " + qualityToLog2 + " is " + qualityIndex);
try {
Class<?> cl = qInterface.getClass();
Method m = cl.getMethod(qIndexMethod, Integer.TYPE);
LogHelper.printDebug(() -> "Method is: " + qIndexMethod);
m.invoke(qInterface, iStreamQualities.get(qualityIndex));
LogHelper.printDebug(() -> "Quality changed to: " + qualityIndex);
return qualityIndex;
} catch (Exception ex) {
LogHelper.printException(() -> "Failed to set quality", ex);
return qualityIndex;
}
}
if (quality == -2) {
return quality;
}
int qualityIndex = iStreamQualities.indexOf(quality);
final int qualityToLog2 = quality;
LogHelper.printDebug(() -> "Index of quality " + qualityToLog2 + " is " + qualityIndex);
try {
Class<?> cl = qInterface.getClass();
Method m = cl.getMethod(qIndexMethod, Integer.TYPE);
LogHelper.printDebug(() -> "Method is: " + qIndexMethod);
m.invoke(qInterface, iStreamQualities.get(qualityIndex));
LogHelper.printDebug(() -> "Quality changed to: " + qualityIndex);
return qualityIndex;
} catch (Exception ex) {
LogHelper.printException(() -> "Failed to set quality", ex);
return qualityIndex;
}
}
public static void userChangedQuality(int selectedQuality) {
// Do not remember a **new** quality if REMEMBER_VIDEO_QUALITY is false
if (!SettingsEnum.REMEMBER_VIDEO_QUALITY_LAST_SELECTED.getBoolean()) return;
selectedQuality1 = selectedQuality;
@@ -148,20 +141,23 @@ public class RememberVideoQualityPatch {
newVideo = true;
}
@SuppressLint("MissingPermission")
private static NetworkInfo getNetworkInfo(Context context) {
private static NetworkType getNetworType(Context context) {
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
return cm.getActiveNetworkInfo();
var networkInfo = cm.getActiveNetworkInfo();
if (networkInfo == null || !networkInfo.isConnected()) {
return NetworkType.NONE;
} else {
var type = networkInfo.getType();
return type == ConnectivityManager.TYPE_MOBILE || type == ConnectivityManager.TYPE_BLUETOOTH ? NetworkType.MOBILE : NetworkType.OTHER;
}
}
private static boolean isConnectedWifi(Context context) {
NetworkInfo info = getNetworkInfo(context);
return info != null && info.isConnected() && info.getType() == 1;
}
private static boolean isConnectedMobile(Context context) {
NetworkInfo info = getNetworkInfo(context);
return info != null && info.isConnected() && info.getType() == 0;
enum NetworkType {
MOBILE,
OTHER,
NONE
}
}

View File

@@ -1,9 +1,13 @@
package app.revanced.integrations.returnyoutubedislike.requests;
import static app.revanced.integrations.returnyoutubedislike.ReturnYouTubeDislike.Vote;
import androidx.annotation.NonNull;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.Objects;
import app.revanced.integrations.utils.LogHelper;
/**
* ReturnYouTubeDislike API estimated like/dislike/view counts.
@@ -12,7 +16,7 @@ import java.util.Objects;
* So these values may lag behind what YouTube shows.
*/
public final class RYDVoteData {
@NonNull
public final String videoId;
/**
@@ -20,46 +24,87 @@ public final class RYDVoteData {
*/
public final long viewCount;
private final long fetchedLikeCount;
private volatile long likeCount; // read/write from different threads
private volatile float likePercentage;
private final long fetchedDislikeCount;
private volatile long dislikeCount; // read/write from different threads
private volatile float dislikePercentage;
/**
* @throws JSONException if JSON parse error occurs, or if the values make no sense (ie: negative values)
*/
public RYDVoteData(@NonNull JSONObject json) throws JSONException {
videoId = json.getString("id");
viewCount = json.getLong("viewCount");
fetchedLikeCount = json.getLong("likes");
fetchedDislikeCount = json.getLong("dislikes");
if (viewCount < 0 || fetchedLikeCount < 0 || fetchedDislikeCount < 0) {
throw new JSONException("Unexpected JSON values: " + json);
}
likeCount = fetchedLikeCount;
dislikeCount = fetchedDislikeCount;
updatePercentages();
}
/**
* Estimated like count
*/
public final long likeCount;
public long getLikeCount() {
return likeCount;
}
/**
* Estimated dislike count
*/
public final long dislikeCount;
public long getDislikeCount() {
return dislikeCount;
}
/**
* Estimated percentage of likes for all votes. Value has range of [0, 1]
*
* A video with 400 positive votes, and 100 negative votes, has a likePercentage of 0.8
*/
public final float likePercentage;
public float getLikePercentage() {
return likePercentage;
}
/**
* Estimated percentage of dislikes for all votes. Value has range of [0, 1]
*
* A video with 400 positive votes, and 100 negative votes, has a dislikePercentage of 0.2
*/
public final float dislikePercentage;
/**
* @throws JSONException if JSON parse error occurs, or if the values make no sense (ie: negative values)
*/
public RYDVoteData(JSONObject json) throws JSONException {
Objects.requireNonNull(json);
videoId = json.getString("id");
viewCount = json.getLong("viewCount");
likeCount = json.getLong("likes");
dislikeCount = json.getLong("dislikes");
if (likeCount < 0 || dislikeCount < 0 || viewCount < 0) {
throw new JSONException("Unexpected JSON values: " + json);
}
likePercentage = (likeCount == 0 ? 0 : (float)likeCount / (likeCount + dislikeCount));
dislikePercentage = (dislikeCount == 0 ? 0 : (float)dislikeCount / (likeCount + dislikeCount));
public float getDislikePercentage() {
return dislikePercentage;
}
public void updateUsingVote(Vote vote) {
if (vote == Vote.LIKE) {
LogHelper.printDebug(() -> "Increasing like count");
likeCount = fetchedLikeCount + 1;
dislikeCount = fetchedDislikeCount;
} else if (vote == Vote.DISLIKE) {
LogHelper.printDebug(() -> "Increasing dislike count");
likeCount = fetchedLikeCount;
dislikeCount = fetchedDislikeCount + 1;
} else if (vote == Vote.LIKE_REMOVE) {
LogHelper.printDebug(() -> "Resetting like/dislike to fetched values");
likeCount = fetchedLikeCount;
dislikeCount = fetchedDislikeCount;
} else {
throw new IllegalStateException();
}
updatePercentages();
}
private void updatePercentages() {
likePercentage = (likeCount == 0 ? 0 : (float) likeCount / (likeCount + dislikeCount));
dislikePercentage = (dislikeCount == 0 ? 0 : (float) dislikeCount / (likeCount + dislikeCount));
}
@NonNull
@Override
public String toString() {
return "RYDVoteData{"
@@ -73,4 +118,5 @@ public final class RYDVoteData {
}
// equals and hashcode is not implemented (currently not needed)
}

View File

@@ -1,29 +1,27 @@
package app.revanced.integrations.returnyoutubedislike.requests;
import static app.revanced.integrations.returnyoutubedislike.requests.ReturnYouTubeDislikeRoutes.getRYDConnectionFromRoute;
import static app.revanced.integrations.sponsorblock.StringRef.str;
import android.util.Base64;
import android.widget.Toast;
import androidx.annotation.Nullable;
import app.revanced.integrations.requests.Requester;
import app.revanced.integrations.returnyoutubedislike.ReturnYouTubeDislike;
import app.revanced.integrations.utils.LogHelper;
import app.revanced.integrations.utils.ReVancedUtils;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.ProtocolException;
import java.net.SocketTimeoutException;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.util.Objects;
import app.revanced.integrations.requests.Requester;
import app.revanced.integrations.returnyoutubedislike.ReturnYouTubeDislike;
import app.revanced.integrations.utils.LogHelper;
import app.revanced.integrations.utils.ReVancedUtils;
import static app.revanced.integrations.returnyoutubedislike.requests.ReturnYouTubeDislikeRoutes.getRYDConnectionFromRoute;
import static app.revanced.integrations.sponsorblock.StringRef.str;
public class ReturnYouTubeDislikeApi {
/**
@@ -48,7 +46,13 @@ public class ReturnYouTubeDislikeApi {
/**
* Response code of a successful API call
*/
private static final int SUCCESS_HTTP_STATUS_CODE = 200;
private static final int HTTP_STATUS_CODE_SUCCESS = 200;
/**
* Response code indicating the video id is not for a video that can be voted for.
* (it's not a Short or a regular video, and it's likely a YouTube Story)
*/
private static final int HTTP_STATUS_CODE_NOT_FOUND = 404;
/**
* Indicates a client rate limit has been reached
@@ -57,9 +61,9 @@ public class ReturnYouTubeDislikeApi {
/**
* How long to wait until API calls are resumed, if a rate limit is hit.
* No clear guideline of how long to backoff. Using 60 seconds for now.
* No clear guideline of how long to backoff. Using 2 minutes for now.
*/
private static final int RATE_LIMIT_BACKOFF_SECONDS = 60;
private static final int RATE_LIMIT_BACKOFF_SECONDS = 120;
/**
* Last time a {@link #RATE_LIMIT_HTTP_STATUS_CODE} was reached.
@@ -133,6 +137,7 @@ public class ReturnYouTubeDislikeApi {
*
* @param maximumTimeToWait maximum time to wait
*/
@SuppressWarnings("UnusedReturnValue")
private static long randomlyWaitIfLocallyDebugging(long maximumTimeToWait) {
final boolean DEBUG_RANDOMLY_DELAY_NETWORK_CALLS = false; // set true to debug UI
if (DEBUG_RANDOMLY_DELAY_NETWORK_CALLS) {
@@ -183,6 +188,8 @@ public class ReturnYouTubeDislikeApi {
if (httpResponseCode == RATE_LIMIT_HTTP_STATUS_CODE) {
lastTimeRateLimitWasHit = System.currentTimeMillis();
//noinspection NonAtomicOperationOnVolatileField // don't care, field is used only as an estimate
numberOfRateLimitRequestsEncountered++;
LogHelper.printDebug(() -> "API rate limit was hit. Stopping API calls for the next "
+ RATE_LIMIT_BACKOFF_SECONDS + " seconds");
ReVancedUtils.runOnMainThread(() -> { // must show toasts on main thread
@@ -208,7 +215,6 @@ public class ReturnYouTubeDislikeApi {
fetchCallNumberOfFailures++;
} else if (rateLimitHit) {
fetchCallResponseTimeLast = FETCH_CALL_RESPONSE_TIME_VALUE_RATE_LIMIT;
numberOfRateLimitRequestsEncountered++;
} else {
fetchCallResponseTimeLast = responseTimeOfFetchCall;
}
@@ -228,7 +234,6 @@ public class ReturnYouTubeDislikeApi {
LogHelper.printDebug(() -> "Fetching votes for: " + videoId);
final long timeNetworkCallStarted = System.currentTimeMillis();
String connectionErrorMessageStringKey = "revanced_ryd_failure_connection_timeout";
try {
HttpURLConnection connection = getRYDConnectionFromRoute(ReturnYouTubeDislikeRoutes.GET_DISLIKES, videoId);
// request headers, as per https://returnyoutubedislike.com/docs/fetching
@@ -250,7 +255,7 @@ public class ReturnYouTubeDislikeApi {
return null;
}
if (responseCode == SUCCESS_HTTP_STATUS_CODE) {
if (responseCode == HTTP_STATUS_CODE_SUCCESS) {
final long timeNetworkCallEnded = System.currentTimeMillis(); // record end time before parsing
// do not disconnect, the same server connection will likely be used again soon
JSONObject json = Requester.parseJSONObject(connection);
@@ -263,13 +268,20 @@ public class ReturnYouTubeDislikeApi {
LogHelper.printException(() -> "Failed to parse video: " + videoId + " json: " + json, ex);
// fall thru to update statistics
}
} else if (responseCode == HTTP_STATUS_CODE_NOT_FOUND) {
// normal response when viewing YouTube Stories (cannot vote for these)
LogHelper.printDebug(() -> "Video has no like/dislikes (video is a YouTube Story?): " + videoId);
return null; // do not updated connection statistics
} else {
LogHelper.printException(() -> "Failed to fetch votes for video: " + videoId
+ " response code was: " + responseCode, null, str(connectionErrorMessageStringKey));
LogHelper.printException(() -> "Failed to fetch votes for video: " + videoId + " response code was: " + responseCode,
null, str("revanced_ryd_failure_connection_status_code", responseCode));
connection.disconnect(); // something went wrong, might as well disconnect
}
} catch (Exception ex) { // connection timed out, response timeout, or some other network error
LogHelper.printException(() -> "Failed to fetch votes", ex, str(connectionErrorMessageStringKey));
} catch (SocketTimeoutException ex) { // connection timed out, response timeout, or some other network error
LogHelper.printException(() -> "Failed to fetch votes", ex, str("revanced_ryd_failure_connection_timeout"));
} catch (Exception ex) {
// should never happen
LogHelper.printException(() -> "Failed to fetch votes", ex, str("revanced_ryd_failure_generic", ex.getMessage()));
}
updateStatistics(timeNetworkCallStarted, System.currentTimeMillis(), true, false);
@@ -299,7 +311,7 @@ public class ReturnYouTubeDislikeApi {
connection.disconnect(); // disconnect, as no more connections will be made for a little while
return null;
}
if (responseCode == SUCCESS_HTTP_STATUS_CODE) {
if (responseCode == HTTP_STATUS_CODE_SUCCESS) {
JSONObject json = Requester.parseJSONObject(connection);
String challenge = json.getString("challenge");
int difficulty = json.getInt("difficulty");
@@ -340,7 +352,7 @@ public class ReturnYouTubeDislikeApi {
connection.disconnect(); // disconnect, as no more connections will be made for a little while
return null;
}
if (responseCode == SUCCESS_HTTP_STATUS_CODE) {
if (responseCode == HTTP_STATUS_CODE_SUCCESS) {
String result = Requester.parseJson(connection);
if (result.equalsIgnoreCase("true")) {
LogHelper.printDebug(() -> "Registration confirmation successful for user: " + userId);
@@ -387,7 +399,7 @@ public class ReturnYouTubeDislikeApi {
connection.disconnect(); // disconnect, as no more connections will be made for a little while
return false;
}
if (responseCode == SUCCESS_HTTP_STATUS_CODE) {
if (responseCode == HTTP_STATUS_CODE_SUCCESS) {
JSONObject json = Requester.parseJSONObject(connection);
String challenge = json.getString("challenge");
int difficulty = json.getInt("difficulty");
@@ -431,7 +443,7 @@ public class ReturnYouTubeDislikeApi {
return false;
}
if (responseCode == SUCCESS_HTTP_STATUS_CODE) {
if (responseCode == HTTP_STATUS_CODE_SUCCESS) {
String result = Requester.parseJson(connection);
if (result.equalsIgnoreCase("true")) {
LogHelper.printDebug(() -> "Vote confirm successful for video: " + videoId);
@@ -469,9 +481,7 @@ public class ReturnYouTubeDislikeApi {
byte[] decodedChallenge = Base64.decode(challenge, Base64.NO_WRAP);
byte[] buffer = new byte[20];
for (int i = 4; i < 20; i++) { // FIXME replace with System.arrayCopy
buffer[i] = decodedChallenge[i - 4];
}
System.arraycopy(decodedChallenge, 0, buffer, 4, 16);
MessageDigest md;
try {
@@ -513,9 +523,9 @@ public class ReturnYouTubeDislikeApi {
private static int countLeadingZeroes(byte[] uInt8View) {
int zeroes = 0;
int value = 0;
for (int i = 0; i < uInt8View.length; i++) {
value = uInt8View[i] & 0xFF;
int value;
for (byte b : uInt8View) {
value = b & 0xFF;
if (value == 0) {
zeroes += 8;
} else {

View File

@@ -5,9 +5,6 @@ import app.revanced.integrations.utils.LogHelper;
import app.revanced.integrations.utils.ReVancedUtils;
import app.revanced.integrations.utils.SharedPrefHelper;
import java.util.ArrayList;
import java.util.List;
public enum SettingsEnum {
//Download Settings
// TODO: DOWNLOAD_PATH("revanced_download_path", Environment.getExternalStorageDirectory().getPath() + "/Download", ReturnType.STRING),
@@ -54,16 +51,18 @@ public enum SettingsEnum {
ADREMOVER_GRAY_SEPARATOR("revanced_adremover_separator", true, ReturnType.BOOLEAN),
ADREMOVER_VIEW_PRODUCTS("revanced_adremover_view_products", true, ReturnType.BOOLEAN),
ADREMOVER_WEB_SEARCH_RESULTS("revanced_adremover_web_search_result", true, ReturnType.BOOLEAN),
ADREMOVER_HORIZONTAL_VIDEO_SHELF("revanced_horizontal_video_shelf", true, ReturnType.BOOLEAN),
ADREMOVER_CHANNEL_BAR("revanced_hide_channel_bar", false, ReturnType.BOOLEAN),
ADREMOVER_QUICK_ACTIONS("revanced_hide_quick_actions", false, ReturnType.BOOLEAN),
ADREMOVER_RELATED_VIDEOS("revanced_hide_related_videos", false, ReturnType.BOOLEAN),
ADREMOVER_IMAGE_SHELF("revanced_hide_image_shelf", true, ReturnType.BOOLEAN),
// Action buttons
HIDE_LIKE_BUTTON("revanced_hide_like_button", false, ReturnType.BOOLEAN, false),
HIDE_DISLIKE_BUTTON("revanced_hide_dislike_button", false, ReturnType.BOOLEAN, false),
HIDE_DOWNLOAD_BUTTON("revanced_hide_download_button", false, ReturnType.BOOLEAN, false),
HIDE_PLAYLIST_BUTTON("revanced_hide_playlist_button", false, ReturnType.BOOLEAN, false),
HIDE_ACTION_BUTTON("revanced_hide_action_button", false, ReturnType.BOOLEAN, false),
HIDE_SHARE_BUTTON("revanced_hide_share_button", false, ReturnType.BOOLEAN, false),
HIDE_LIKE_BUTTON("revanced_hide_like_button", false, ReturnType.BOOLEAN),
HIDE_DISLIKE_BUTTON("revanced_hide_dislike_button", false, ReturnType.BOOLEAN),
HIDE_DOWNLOAD_BUTTON("revanced_hide_download_button", false, ReturnType.BOOLEAN),
HIDE_PLAYLIST_BUTTON("revanced_hide_playlist_button", false, ReturnType.BOOLEAN),
HIDE_ACTION_BUTTON("revanced_hide_action_button", false, ReturnType.BOOLEAN),
HIDE_SHARE_BUTTON("revanced_hide_share_button", false, ReturnType.BOOLEAN),
// Layout settings
DISABLE_STARTUP_SHORTS_PLAYER("revanced_startup_shorts_player_enabled", false, ReturnType.BOOLEAN),
@@ -89,21 +88,22 @@ public enum SettingsEnum {
HIDE_REEL_BUTTON("revanced_hide_reel_button", true, ReturnType.BOOLEAN, true),
HIDE_SHORTS_BUTTON("revanced_hide_shorts_button", true, ReturnType.BOOLEAN, true),
HIDE_SHORTS_COMMENTS_BUTTON("revanced_hide_shorts_comments_button", false, ReturnType.BOOLEAN),
HIDE_TIME("revanced_hide_time", false, ReturnType.BOOLEAN),
HIDE_TIMESTAMP("revanced_hide_timestamp", false, ReturnType.BOOLEAN),
HIDE_SEEKBAR("revanced_hide_seekbar", false, ReturnType.BOOLEAN),
HIDE_WATCH_IN_VR("revanced_hide_watch_in_vr", false, ReturnType.BOOLEAN, true),
HIDE_BREAKING_NEWS("revanced_hide_breaking_news", true, ReturnType.BOOLEAN, true),
HIDE_PLAYER_BUTTONS("revanced_hide_player_buttons", false, ReturnType.BOOLEAN, false),
HIDE_PLAYER_BUTTONS("revanced_hide_player_buttons", false, ReturnType.BOOLEAN),
HIDE_FLOATING_MICROPHONE_BUTTON("revanced_hide_floating_microphone_button", true, ReturnType.BOOLEAN, true),
// Misc. Settings
FIX_PLAYBACK("revanced_fix_playback", false, ReturnType.BOOLEAN, false),
CAPTIONS_ENABLED("revanced_autocaptions_enabled", false, ReturnType.BOOLEAN, false),
FIX_PLAYBACK("revanced_fix_playback", false, ReturnType.BOOLEAN),
CAPTIONS_ENABLED("revanced_autocaptions_enabled", false, ReturnType.BOOLEAN),
PREFERRED_AUTO_REPEAT("revanced_pref_auto_repeat", false, ReturnType.BOOLEAN),
USE_HDR_AUTO_BRIGHTNESS("revanced_pref_hdr_autobrightness", true, ReturnType.BOOLEAN),
TAP_SEEKING_ENABLED("revanced_enable_tap_seeking", true, ReturnType.BOOLEAN),
ENABLE_MINIMIZED_PLAYBACK("revanced_enable_minimized_playback", true, ReturnType.BOOLEAN),
OPEN_LINKS_DIRECTLY("revanced_uri_redirect", true, ReturnType.BOOLEAN, true),
DISABLE_ZOOM_HAPTICS("revanced_disable_zoom_haptics", true, ReturnType.BOOLEAN, false),
DISABLE_ZOOM_HAPTICS("revanced_disable_zoom_haptics", true, ReturnType.BOOLEAN),
ENABLE_EXTERNAL_BROWSER("revanced_enable_external_browser", true, ReturnType.BOOLEAN, true),
// Swipe controls
@@ -116,11 +116,6 @@ public enum SettingsEnum {
SWIPE_OVERLAY_BACKGROUND_ALPHA("revanced_swipe_overlay_background_alpha", 127, ReturnType.INTEGER),
SWIPE_MAGNITUDE_THRESHOLD("revanced_swipe_magnitude_threshold", 30f, ReturnType.FLOAT),
// Buffer settings
MAX_BUFFER("revanced_pref_max_buffer_ms", 120000, ReturnType.INTEGER),
PLAYBACK_MAX_BUFFER("revanced_pref_buffer_for_playback_ms", 2500, ReturnType.INTEGER),
MAX_PLAYBACK_BUFFER_AFTER_REBUFFER("revanced_pref_buffer_for_playback_after_rebuffer_ms", 5000, ReturnType.INTEGER),
// Debug settings
DEBUG("revanced_debug_enabled", false, ReturnType.BOOLEAN),
DEBUG_STACKTRACE("revanced_debug_stacktrace_enabled", false, ReturnType.BOOLEAN),
@@ -150,51 +145,7 @@ public enum SettingsEnum {
SB_IS_VIP("sb-is-vip", false, SharedPrefHelper.SharedPrefNames.SPONSOR_BLOCK, ReturnType.BOOLEAN),
SB_LAST_VIP_CHECK("sb-last-vip-check", 0L, SharedPrefHelper.SharedPrefNames.SPONSOR_BLOCK, ReturnType.LONG),
SB_SHOW_BROWSER_BUTTON("sb-browser-button", false, SharedPrefHelper.SharedPrefNames.SPONSOR_BLOCK, ReturnType.BOOLEAN),
SB_API_URL("sb-api-host-url", "https://sponsor.ajay.app", SharedPrefHelper.SharedPrefNames.SPONSOR_BLOCK, ReturnType.STRING),
//
// old deprecated settings, kept around to migrate user settings on existing installations
// FIXME: after a few months, eventually delete these settings
//
@Deprecated
DEPRECATED_HIDE_MIX_PLAYLISTS("revanced_mix_playlists_hidden", false, ReturnType.BOOLEAN, true),
@Deprecated
DEPRECATED_HIDE_LIKE_BUTTON("revanced_like_button", false, ReturnType.BOOLEAN, false),
@Deprecated
DEPRECATED_HIDE_DISLIKE_BUTTON("revanced_dislike_button", false, ReturnType.BOOLEAN, false),
@Deprecated
DEPRECATED_HIDE_DOWNLOAD_BUTTON("revanced_download_button", false, ReturnType.BOOLEAN, false),
@Deprecated
DEPRECATED_HIDE_PLAYLIST_BUTTON("revanced_playlist_button", false, ReturnType.BOOLEAN, false),
@Deprecated
DEPRECATED_HIDE_ACTION_BUTTON("revanced_action_button", false, ReturnType.BOOLEAN, false),
@Deprecated
DEPRECATED_HIDE_SHARE_BUTTON("revanced_share_button", false, ReturnType.BOOLEAN, false),
@Deprecated
DEPRECATED_FULLSCREEN_PANELS_SHOWN("revanced_fullscreen_panels_enabled", false, ReturnType.BOOLEAN),
@Deprecated
DEPRECATED_CREATE_BUTTON_ENABLED("revanced_create_button_enabled", false, ReturnType.BOOLEAN, true),
@Deprecated
DEPRECATED_SHORTS_BUTTON_SHOWN("revanced_shorts_button_enabled", false, ReturnType.BOOLEAN, true),
@Deprecated
DEPRECATED_REEL_BUTTON_SHOWN("revanced_reel_button_enabled", false, ReturnType.BOOLEAN, true),
@Deprecated
DEPRECATED_AUTOPLAY_BUTTON_SHOWN("revanced_autoplay_button_enabled", false, ReturnType.BOOLEAN, true),
@Deprecated
DEPRECATED_CAST_BUTTON_SHOWN("revanced_cast_button_enabled", false, ReturnType.BOOLEAN, true),
@Deprecated
DEPRECATED_BRANDING_SHOWN("revanced_branding_watermark_enabled", false, ReturnType.BOOLEAN),
@Deprecated
DEPRECATED_REMEMBER_VIDEO_QUALITY("revanced_remember_video_quality_selection", false, ReturnType.BOOLEAN),
@Deprecated
DEPRECATED_DOWNLOADS_BUTTON_SHOWN("revanced_downloads", true, ReturnType.BOOLEAN, true),
@Deprecated
DEPRECATED_COPY_VIDEO_URL_BUTTON_SHOWN("revanced_copy_video_url", true, ReturnType.BOOLEAN, true),
@Deprecated
DEPRECATED_COPY_VIDEO_URL_TIMESTAMP_BUTTON_SHOWN("revanced_copy_video_url_timestamp", true, ReturnType.BOOLEAN, true);
//
// end deprecated settings
//
SB_API_URL("sb-api-host-url", "https://sponsor.ajay.app", SharedPrefHelper.SharedPrefNames.SPONSOR_BLOCK, ReturnType.STRING);
private final String path;
private final Object defaultValue;
@@ -228,68 +179,6 @@ public enum SettingsEnum {
static {
load();
//
// temporary code to migrate user configuration of old settings into current settings
// FIXME: eventually delete this code
//
// old/new settings where old is default off, and new has inverted value and is default on
SettingsEnum[][] invertedSettingsToMigrate = {
{DEPRECATED_FULLSCREEN_PANELS_SHOWN, HIDE_FULLSCREEN_PANELS},
{DEPRECATED_CREATE_BUTTON_ENABLED, HIDE_CREATE_BUTTON},
{DEPRECATED_SHORTS_BUTTON_SHOWN, HIDE_SHORTS_BUTTON},
{DEPRECATED_REEL_BUTTON_SHOWN, HIDE_REEL_BUTTON},
{DEPRECATED_AUTOPLAY_BUTTON_SHOWN, HIDE_AUTOPLAY_BUTTON},
{DEPRECATED_CAST_BUTTON_SHOWN, HIDE_CAST_BUTTON},
{DEPRECATED_BRANDING_SHOWN, HIDE_VIDEO_WATERMARK},
{DEPRECATED_REMEMBER_VIDEO_QUALITY, REMEMBER_VIDEO_QUALITY_LAST_SELECTED},
};
for (SettingsEnum[] oldNewSetting : invertedSettingsToMigrate) {
// by default, old setting was default off
// migrate to new setting of default on
SettingsEnum oldSetting = oldNewSetting[0];
SettingsEnum newSetting = oldNewSetting[1];
// only need to check if old setting was turned on
if (oldSetting.getBoolean()) {
// this code will only run once
LogHelper.printInfo(() -> "Migrating setting: " + oldSetting + " of 'true' to new setting: "
+ newSetting + " of 'false'");
newSetting.saveValue(false); // set opposite of old value
oldSetting.saveValue(false); // clear old value
}
}
//
// renamed settings with new path names, but otherwise the new and old settings are identical
//
SettingsEnum[][] renamedSettings = {
{DEPRECATED_HIDE_MIX_PLAYLISTS, HIDE_MIX_PLAYLISTS},
{DEPRECATED_HIDE_LIKE_BUTTON, HIDE_LIKE_BUTTON},
{DEPRECATED_HIDE_DISLIKE_BUTTON, HIDE_DISLIKE_BUTTON},
{DEPRECATED_HIDE_DOWNLOAD_BUTTON, HIDE_DOWNLOAD_BUTTON},
{DEPRECATED_HIDE_PLAYLIST_BUTTON, HIDE_PLAYLIST_BUTTON},
{DEPRECATED_HIDE_ACTION_BUTTON, HIDE_ACTION_BUTTON},
{DEPRECATED_HIDE_SHARE_BUTTON, HIDE_SHARE_BUTTON},
{DEPRECATED_DOWNLOADS_BUTTON_SHOWN, DOWNLOADS_BUTTON_SHOWN},
{DEPRECATED_COPY_VIDEO_URL_BUTTON_SHOWN, COPY_VIDEO_URL_BUTTON_SHOWN},
{DEPRECATED_COPY_VIDEO_URL_TIMESTAMP_BUTTON_SHOWN, COPY_VIDEO_URL_TIMESTAMP_BUTTON_SHOWN},
};
for (SettingsEnum[] oldNewSetting : renamedSettings) {
SettingsEnum oldSetting = oldNewSetting[0];
SettingsEnum newSetting = oldNewSetting[1];
if (!oldSetting.value.equals(oldSetting.defaultValue)) {
LogHelper.printInfo(() -> "Migrating old setting of '" + oldSetting.value
+ "' from: " + oldSetting + " into replacement setting: " + newSetting);
newSetting.saveValue(oldSetting.value);
oldSetting.saveValue(oldSetting.getDefaultValue()); // reset old value
}
}
//
// end temporary code
//
}
private static void load() {
@@ -325,16 +214,6 @@ public enum SettingsEnum {
}
}
public static List<SettingsEnum> getAdRemovalSettings() {
List<SettingsEnum> list = new ArrayList<>();
for (SettingsEnum var : SettingsEnum.values()) {
if (var.toString().startsWith("ADREMOVER")) {
list.add(var);
}
}
return list;
}
/**
* Sets, but does _not_ persistently save the value.
*

View File

@@ -7,8 +7,8 @@ import app.revanced.integrations.utils.Event
*/
@Suppress("unused")
enum class PlayerType {
NONE, // this also includes when shorts are playing
HIDDEN,
NONE, // includes Shorts playback
HIDDEN, // also includes YouTube Shorts and Stories, if a regular video is minimized and a Short/Story is then opened
WATCH_WHILE_MINIMIZED,
WATCH_WHILE_MAXIMIZED,
WATCH_WHILE_FULLSCREEN,
@@ -42,6 +42,7 @@ enum class PlayerType {
currentPlayerType = value
onChange(currentPlayerType)
}
@Volatile // value is read/write from different threads
private var currentPlayerType = NONE
/**
@@ -51,7 +52,9 @@ enum class PlayerType {
}
/**
* Weather Shorts are being played.
* Check if the current player type is [NONE] or [HIDDEN]
*
* @return True, if nothing, a Short, or a Story is playing.
*/
fun isNoneOrHidden(): Boolean {
return this == NONE || this == HIDDEN

View File

@@ -1,3 +1,3 @@
org.gradle.jvmargs = -Xmx2048m
android.useAndroidX = true
version = 0.98.0-dev.5
version = 0.100.2-dev.1