Compare commits

..

4 Commits

Author SHA1 Message Date
semantic-release-bot
fce8df8284 chore(release): 2.100.0 [skip ci]
# [2.100.0](https://github.com/revanced/revanced-patches/compare/v2.99.0...v2.100.0) (2022-10-30)

### Features

* `hide-watch-in-vr` patch ([#911](https://github.com/revanced/revanced-patches/issues/911)) ([df84368](6ec99045d7))
2022-10-30 12:03:30 +00:00
inotia00
6ec99045d7 feat: hide-watch-in-vr patch (#911)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-10-30 13:01:40 +01:00
semantic-release-bot
757784b038 chore(release): 2.99.0 [skip ci]
# [2.99.0](https://github.com/revanced/revanced-patches/compare/v2.98.0...v2.99.0) (2022-10-29)

### Features

* **youtube/sponsorblock:** skip segments once automatically ([#907](https://github.com/revanced/revanced-patches/issues/907)) ([cbce50c](7e06f23e29))
2022-10-29 21:15:08 +00:00
thebestnom
7e06f23e29 feat(youtube/sponsorblock): skip segments once automatically (#907) 2022-10-29 23:13:15 +02:00
8 changed files with 102 additions and 2 deletions

View File

@@ -1,3 +1,17 @@
# [2.100.0](https://github.com/revanced/revanced-patches/compare/v2.99.0...v2.100.0) (2022-10-30)
### Features
* `hide-watch-in-vr` patch ([#911](https://github.com/revanced/revanced-patches/issues/911)) ([8ea0b20](https://github.com/revanced/revanced-patches/commit/8ea0b20e96df53211039df0468b2d4a735a381f1))
# [2.99.0](https://github.com/revanced/revanced-patches/compare/v2.98.0...v2.99.0) (2022-10-29)
### Features
* **youtube/sponsorblock:** skip segments once automatically ([#907](https://github.com/revanced/revanced-patches/issues/907)) ([afc7588](https://github.com/revanced/revanced-patches/commit/afc75882062a9316dbc28a9dc4f990cf88b52654))
# [2.98.0](https://github.com/revanced/revanced-patches/compare/v2.97.0...v2.98.0) (2022-10-29)

View File

@@ -76,6 +76,7 @@ The official Patch bundle provided by ReVanced and the community.
| `hide-cast-button` | Hides the cast button in the video player. | all |
| `sponsorblock` | Integrate SponsorBlock. | 17.41.37 |
| `hide-autoplay-button` | Hides the autoplay button in the video player. | 17.41.37 |
| `hide-watch-in-vr` | Hides the Watch in VR option from the player settings flyout panel. | 17.41.37 |
| `hide-album-cards` | Hides the album cards below the artist description. | 17.41.37 |
| `disable-auto-player-popup-panels` | Disable automatic popup panels (playlist or live chat) on video player. | 17.41.37 |
| `disable-auto-captions` | Disable forced captions from being automatically enabled. | 17.41.37 |

View File

@@ -1,2 +1,2 @@
kotlin.code.style = official
version = 2.98.0
version = 2.100.0

File diff suppressed because one or more lines are too long

View File

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

View File

@@ -0,0 +1,16 @@
package app.revanced.patches.youtube.layout.watchinvr.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.watchinvr.annotations.WatchinVRCompatibility
import org.jf.dexlib2.AccessFlags
@Name("watch-in-vr-fingerprint")
@WatchinVRCompatibility
@Version("0.0.1")
object WatchinVRFingerprint : MethodFingerprint(
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("Z"),
strings = listOf("menu_item_cardboard_vr")
)

View File

@@ -0,0 +1,55 @@
package app.revanced.patches.youtube.layout.watchinvr.patch
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.youtube.layout.watchinvr.annotations.WatchinVRCompatibility
import app.revanced.patches.youtube.layout.watchinvr.fingerprints.WatchinVRFingerprint
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
import app.revanced.patches.youtube.misc.settings.framework.components.impl.SwitchPreference
@Patch
@DependsOn([IntegrationsPatch::class, SettingsPatch::class])
@Name("hide-watch-in-vr")
@Description("Hides the Watch in VR option from the player settings flyout panel.")
@WatchinVRCompatibility
@Version("0.0.1")
class WatchinVRPatch : BytecodePatch(
listOf(
WatchinVRFingerprint
)
) {
override fun execute(context: BytecodeContext): PatchResult {
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
SwitchPreference(
"revanced_hide_watch_in_vr",
StringResource("revanced_hide_watch_in_vr_title", "Hide Watch in VR option"),
false,
StringResource("revanced_hide_watch_in_vr_summary_on", "Watch in VR option is hidden"),
StringResource("revanced_hide_watch_in_vr_summary_off", "Watch in VR option is shown")
)
)
WatchinVRFingerprint.result!!.mutableMethod.addInstructions(
0, """
invoke-static {}, Lapp/revanced/integrations/patches/HideWatchinVRPatch;->hideWatchinVR()Z
move-result v0
if-eqz v0, :shown
return-void
:shown
nop
"""
)
return PatchResultSuccess()
}
}

View File

@@ -51,6 +51,7 @@
<string name="skipped_filler">Skipped filler</string>
<string name="skipped_unsubmitted">Skipped unsubmitted segment</string>
<string name="skip_automatically">Skip automatically</string>
<string name="skip_automatically_once">Skip automatically once</string>
<string name="skip_showbutton">Show a skip button</string>
<string name="skip_ignore">Don\'t do anything</string>
<string name="skip_sponsor">Skip segment</string>