diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/watchinvr/fingerprints/WatchinVRFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/watchinvr/fingerprints/WatchInVRFingerprint.kt similarity index 86% rename from src/main/kotlin/app/revanced/patches/youtube/layout/watchinvr/fingerprints/WatchinVRFingerprint.kt rename to src/main/kotlin/app/revanced/patches/youtube/layout/watchinvr/fingerprints/WatchInVRFingerprint.kt index febf7b3a7..0ab19418e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/watchinvr/fingerprints/WatchinVRFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/watchinvr/fingerprints/WatchInVRFingerprint.kt @@ -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") ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/watchinvr/patch/WatchinVRPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/watchinvr/patch/WatchInVRPatch.kt similarity index 82% rename from src/main/kotlin/app/revanced/patches/youtube/layout/watchinvr/patch/WatchinVRPatch.kt rename to src/main/kotlin/app/revanced/patches/youtube/layout/watchinvr/patch/WatchInVRPatch.kt index d2915f3bc..b7b5e3bb1 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/watchinvr/patch/WatchinVRPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/watchinvr/patch/WatchInVRPatch.kt @@ -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.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.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.misc.integrations.patch.IntegrationsPatch +import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch @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