Skip to content

Commit

Permalink
fix(youtube/hide-watch-in-vr): fix descriptions
Browse files Browse the repository at this point in the history
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
  • Loading branch information
oSumAtrIX committed Feb 20, 2023
1 parent 0d4b9c7 commit f261e64
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Expand Up @@ -4,7 +4,7 @@ import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.AccessFlags

object WatchinVRFingerprint : MethodFingerprint(
object WatchInVRFingerprint : MethodFingerprint(
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("Z"),
strings = listOf("menu_item_cardboard_vr")
)
Expand Up @@ -10,38 +10,38 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
import app.revanced.patches.youtube.layout.watchinvr.annotations.WatchinVRCompatibility
import app.revanced.patches.youtube.layout.watchinvr.fingerprints.WatchinVRFingerprint
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.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference

@Patch
@DependsOn([IntegrationsPatch::class, SettingsPatch::class])
@Name("hide-watch-in-vr")
@Description("Hides the Watch in VR option in the player settings flyout panel.")
@Description("Hides the option to watch in VR from the player settings flyout panel.")
@WatchinVRCompatibility
@Version("0.0.1")
class WatchinVRPatch : BytecodePatch(
class WatchInVRPatch : BytecodePatch(
listOf(
WatchinVRFingerprint
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"),
StringResource("revanced_hide_watch_in_vr_title", "Hide VR setting"),
false,
StringResource("revanced_hide_watch_in_vr_summary_on", "Watch in VR player setting is hidden"),
StringResource("revanced_hide_watch_in_vr_summary_off", "Watch in VR player setting is shown")
StringResource("revanced_hide_watch_in_vr_summary_on", "VR setting is hidden"),
StringResource("revanced_hide_watch_in_vr_summary_off", "VR setting is shown")
)
)

WatchinVRFingerprint.result!!.mutableMethod.addInstructions(
WatchInVRFingerprint.result!!.mutableMethod.addInstructions(
0, """
invoke-static {}, Lapp/revanced/integrations/patches/HideWatchinVRPatch;->hideWatchinVR()Z
invoke-static {}, Lapp/revanced/integrations/patches/HideWatchInVRPatch;->hideWatchInVR()Z
move-result v0
if-eqz v0, :shown
return-void
Expand Down

0 comments on commit f261e64

Please sign in to comment.