mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-11 20:14:35 +02:00
feat(YouTube): change patch name Language switch
→ Enable language switch
This commit is contained in:
parent
5a0c85cac2
commit
e0492ff1c2
@ -2,7 +2,7 @@ package app.revanced.patches.youtube.misc.language
|
|||||||
|
|
||||||
import app.revanced.extensions.exception
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||||
@ -10,11 +10,12 @@ import app.revanced.patcher.patch.annotation.Patch
|
|||||||
import app.revanced.patches.youtube.misc.language.fingerprints.GeneralPrefsFingerprint
|
import app.revanced.patches.youtube.misc.language.fingerprints.GeneralPrefsFingerprint
|
||||||
import app.revanced.patches.youtube.misc.language.fingerprints.GeneralPrefsLegacyFingerprint
|
import app.revanced.patches.youtube.misc.language.fingerprints.GeneralPrefsLegacyFingerprint
|
||||||
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
||||||
|
import app.revanced.util.integrations.Constants.MISC_PATH
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
|
|
||||||
@Patch(
|
@Patch(
|
||||||
name = "Language switch",
|
name = "Enable language switch",
|
||||||
description = "Add language switch toggle.",
|
description = "Enable/disable language switch toggle.",
|
||||||
dependencies = [SettingsPatch::class],
|
dependencies = [SettingsPatch::class],
|
||||||
compatiblePackages = [
|
compatiblePackages = [
|
||||||
CompatiblePackage(
|
CompatiblePackage(
|
||||||
@ -53,14 +54,25 @@ object LanguageSelectorPatch : BytecodePatch(
|
|||||||
val targetIndex = it.scanResult.patternScanResult!!.endIndex
|
val targetIndex = it.scanResult.patternScanResult!!.endIndex
|
||||||
val targetRegister = getInstruction<OneRegisterInstruction>(targetIndex).registerA
|
val targetRegister = getInstruction<OneRegisterInstruction>(targetIndex).registerA
|
||||||
|
|
||||||
addInstruction(
|
addInstructions(
|
||||||
targetIndex,
|
targetIndex, """
|
||||||
"const/4 v$targetRegister, 0x1"
|
invoke-static {}, $MISC_PATH/LanguageSelectorPatch;->enableLanguageSwitch()Z
|
||||||
|
move-result v$targetRegister
|
||||||
|
"""
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsPatch.updatePatchStatus("language-switch")
|
/**
|
||||||
|
* Add settings
|
||||||
|
*/
|
||||||
|
SettingsPatch.addPreference(
|
||||||
|
arrayOf(
|
||||||
|
"SETTINGS: ENABLE_LANGUAGE_SWITCH"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
SettingsPatch.updatePatchStatus("enable-language-switch")
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -111,6 +111,9 @@ Only available to some users who can use the speed overlay"</string>
|
|||||||
<string name="revanced_enable_external_browser_summary_off">External browser is disabled</string>
|
<string name="revanced_enable_external_browser_summary_off">External browser is disabled</string>
|
||||||
<string name="revanced_enable_external_browser_summary_on">External browser is enabled</string>
|
<string name="revanced_enable_external_browser_summary_on">External browser is enabled</string>
|
||||||
<string name="revanced_enable_external_browser_title">Enable external browser</string>
|
<string name="revanced_enable_external_browser_title">Enable external browser</string>
|
||||||
|
<string name="revanced_enable_language_switch_summary_off">Language switch is disabled</string>
|
||||||
|
<string name="revanced_enable_language_switch_summary_on">Language switch is enabled</string>
|
||||||
|
<string name="revanced_enable_language_switch_title">Enable language switch</string>
|
||||||
<string name="revanced_enable_new_comment_popup_panels_summary_off">New comment popup panels is disabled</string>
|
<string name="revanced_enable_new_comment_popup_panels_summary_off">New comment popup panels is disabled</string>
|
||||||
<string name="revanced_enable_new_comment_popup_panels_summary_on">New comment popup panels is enabled</string>
|
<string name="revanced_enable_new_comment_popup_panels_summary_on">New comment popup panels is enabled</string>
|
||||||
<string name="revanced_enable_new_comment_popup_panels_title">Enable new comment popup panels</string>
|
<string name="revanced_enable_new_comment_popup_panels_title">Enable new comment popup panels</string>
|
||||||
|
@ -251,6 +251,9 @@
|
|||||||
<!-- SETTINGS: ENABLE_EXTERNAL_BROWSER
|
<!-- SETTINGS: ENABLE_EXTERNAL_BROWSER
|
||||||
<SwitchPreference android:title="@string/revanced_enable_external_browser_title" android:key="revanced_enable_external_browser" android:defaultValue="true" android:summaryOn="@string/revanced_enable_external_browser_summary_on" android:summaryOff="@string/revanced_enable_external_browser_summary_off" />SETTINGS: ENABLE_EXTERNAL_BROWSER -->
|
<SwitchPreference android:title="@string/revanced_enable_external_browser_title" android:key="revanced_enable_external_browser" android:defaultValue="true" android:summaryOn="@string/revanced_enable_external_browser_summary_on" android:summaryOff="@string/revanced_enable_external_browser_summary_off" />SETTINGS: ENABLE_EXTERNAL_BROWSER -->
|
||||||
|
|
||||||
|
<!-- SETTINGS: ENABLE_LANGUAGE_SWITCH
|
||||||
|
<SwitchPreference android:title="@string/revanced_enable_language_switch_title" android:key="revanced_enable_language_switch" android:defaultValue="true" android:summaryOn="@string/revanced_enable_language_switch_summary_on" android:summaryOff="@string/revanced_enable_language_switch_summary_off" />SETTINGS: ENABLE_LANGUAGE_SWITCH -->
|
||||||
|
|
||||||
<!-- SETTINGS: ENABLE_NEW_SPLASH_ANIMATION
|
<!-- SETTINGS: ENABLE_NEW_SPLASH_ANIMATION
|
||||||
<SwitchPreference android:title="@string/revanced_enable_new_splash_animation_title" android:key="revanced_enable_new_splash_animation" android:defaultValue="false" android:summaryOn="@string/revanced_enable_new_splash_animation_summary_on" android:summaryOff="@string/revanced_enable_new_splash_animation_summary_off" />SETTINGS: ENABLE_NEW_SPLASH_ANIMATION -->
|
<SwitchPreference android:title="@string/revanced_enable_new_splash_animation_title" android:key="revanced_enable_new_splash_animation" android:defaultValue="false" android:summaryOn="@string/revanced_enable_new_splash_animation_summary_on" android:summaryOff="@string/revanced_enable_new_splash_animation_summary_off" />SETTINGS: ENABLE_NEW_SPLASH_ANIMATION -->
|
||||||
|
|
||||||
@ -355,6 +358,7 @@
|
|||||||
<Preference android:title="disable-quic-protocol" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
<Preference android:title="disable-quic-protocol" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||||
<Preference android:title="enable-debug-logging" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
<Preference android:title="enable-debug-logging" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||||
<Preference android:title="enable-external-browser" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
<Preference android:title="enable-external-browser" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||||
|
<Preference android:title="enable-language-switch" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||||
<Preference android:title="enable-new-splash-animation" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
<Preference android:title="enable-new-splash-animation" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||||
<Preference android:title="enable-open-links-directly" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
<Preference android:title="enable-open-links-directly" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||||
<Preference android:title="force-opus-codec" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
<Preference android:title="force-opus-codec" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||||
@ -414,7 +418,6 @@
|
|||||||
<Preference android:title="hide-tooltip-content" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
<Preference android:title="hide-tooltip-content" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||||
<Preference android:title="icons" android:summary="@string/revanced_icons_default" android:selectable="false"/>
|
<Preference android:title="icons" android:summary="@string/revanced_icons_default" android:selectable="false"/>
|
||||||
<Preference android:title="labels" android:summary="@string/revanced_labels_default" android:selectable="false"/>
|
<Preference android:title="labels" android:summary="@string/revanced_labels_default" android:selectable="false"/>
|
||||||
<Preference android:title="language-switch" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
|
||||||
<Preference android:title="microg-support" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
<Preference android:title="microg-support" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||||
<Preference android:title="return-youtube-dislike" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
<Preference android:title="return-youtube-dislike" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||||
<Preference android:title="sponsorblock" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
<Preference android:title="sponsorblock" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user