fix(youtube/hide-watch-in-vr): fix descriptions

Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
oSumAtrIX 2023-02-19 05:50:04 +01:00
parent 0d4b9c766b
commit f261e64b10
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4
2 changed files with 13 additions and 13 deletions

View File

@ -4,7 +4,7 @@ import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.AccessFlags import org.jf.dexlib2.AccessFlags
object WatchinVRFingerprint : MethodFingerprint( object WatchInVRFingerprint : MethodFingerprint(
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("Z"), "V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("Z"),
strings = listOf("menu_item_cardboard_vr") strings = listOf("menu_item_cardboard_vr")
) )

View File

@ -10,38 +10,38 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch 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.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference 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 @Patch
@DependsOn([IntegrationsPatch::class, SettingsPatch::class]) @DependsOn([IntegrationsPatch::class, SettingsPatch::class])
@Name("hide-watch-in-vr") @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 @WatchinVRCompatibility
@Version("0.0.1") @Version("0.0.1")
class WatchinVRPatch : BytecodePatch( class WatchInVRPatch : BytecodePatch(
listOf( listOf(
WatchinVRFingerprint WatchInVRFingerprint
) )
) { ) {
override fun execute(context: BytecodeContext): PatchResult { override fun execute(context: BytecodeContext): PatchResult {
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences( SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
SwitchPreference( SwitchPreference(
"revanced_hide_watch_in_vr", "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, false,
StringResource("revanced_hide_watch_in_vr_summary_on", "Watch in VR player setting is hidden"), StringResource("revanced_hide_watch_in_vr_summary_on", "VR 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_off", "VR setting is shown")
) )
) )
WatchinVRFingerprint.result!!.mutableMethod.addInstructions( WatchInVRFingerprint.result!!.mutableMethod.addInstructions(
0, """ 0, """
invoke-static {}, Lapp/revanced/integrations/patches/HideWatchinVRPatch;->hideWatchinVR()Z invoke-static {}, Lapp/revanced/integrations/patches/HideWatchInVRPatch;->hideWatchInVR()Z
move-result v0 move-result v0
if-eqz v0, :shown if-eqz v0, :shown
return-void return-void