diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/handle/HideHandlePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/handle/HideHandlePatch.kt
index 39ba6ef3c..7d32706d5 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/general/handle/HideHandlePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/general/handle/HideHandlePatch.kt
@@ -7,16 +7,19 @@ import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
-import app.revanced.patches.youtube.general.personalinformation.fingerprints.AccountSwitcherAccessibilityLabelFingerprint
+import app.revanced.patches.youtube.general.handle.fingerprints.AccountSwitcherAccessibilityLabelFingerprint
+import app.revanced.patches.youtube.utils.litho.LithoFilterPatch
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch
import app.revanced.patches.youtube.utils.settings.SettingsPatch
import app.revanced.util.integrations.Constants.GENERAL
+import app.revanced.util.integrations.Constants.PATCHES_PATH
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
@Patch(
name = "Hide handle",
- description = "Hides the handle in the account switcher.",
+ description = "Hides the handle in the account switcher and You tab.",
dependencies = [
+ LithoFilterPatch::class,
SettingsPatch::class,
SharedResourceIdPatch::class
],
@@ -44,6 +47,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
object HideHandlePatch : BytecodePatch(
setOf(AccountSwitcherAccessibilityLabelFingerprint)
) {
+ private const val FILTER_CLASS_DESCRIPTOR =
+ "$PATCHES_PATH/ads/HandlesFilter;"
+
override fun execute(context: BytecodeContext) {
AccountSwitcherAccessibilityLabelFingerprint.result?.let {
@@ -53,20 +59,22 @@ object HideHandlePatch : BytecodePatch(
addInstructions(
targetIndex + 2, """
- invoke-static {v$targetRegister}, $GENERAL->hideEmailAddress(I)I
+ invoke-static {v$targetRegister}, $GENERAL->hideHandle(I)I
move-result v$targetRegister
"""
)
}
} ?: throw AccountSwitcherAccessibilityLabelFingerprint.exception
+ LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
+
/**
* Add settings
*/
SettingsPatch.addPreference(
arrayOf(
"PREFERENCE: GENERAL_SETTINGS",
- "SETTINGS: HIDE_EMAIL_ADDRESS"
+ "SETTINGS: HIDE_HANDLE"
)
)
diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/handle/fingerprints/AccountSwitcherAccessibilityLabelFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/general/handle/fingerprints/AccountSwitcherAccessibilityLabelFingerprint.kt
index efa8a42a9..86a7c11aa 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/general/handle/fingerprints/AccountSwitcherAccessibilityLabelFingerprint.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/general/handle/fingerprints/AccountSwitcherAccessibilityLabelFingerprint.kt
@@ -1,4 +1,4 @@
-package app.revanced.patches.youtube.general.personalinformation.fingerprints
+package app.revanced.patches.youtube.general.handle.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.AccountSwitcherAccessibility
diff --git a/src/main/resources/youtube/settings/host/values/strings.xml b/src/main/resources/youtube/settings/host/values/strings.xml
index a8f0e6b04..a80cebeb9 100644
--- a/src/main/resources/youtube/settings/host/values/strings.xml
+++ b/src/main/resources/youtube/settings/host/values/strings.xml
@@ -299,9 +299,6 @@ Only available to some users who can use the speed overlay"
Crowdfunding box is shown
Crowdfunding box is hidden
Hide crowdfunding box
- Email address (handle) is shown
- Email address (handle) is hidden
- Hide email address (handle)
Emoji picker is shown
Emoji picker is hidden
Hide emoji picker
@@ -345,6 +342,9 @@ Only available to some users who can use the speed overlay"
Gray separators are shown
Gray separators are hidden
Hide gray separator
+ Handle is shown
+ Handle is hidden
+ Hide handle
Home button is shown
Home button is hidden
Hide home button
diff --git a/src/main/resources/youtube/settings/xml/revanced_prefs.xml b/src/main/resources/youtube/settings/xml/revanced_prefs.xml
index ab20a9455..ad8f39c65 100644
--- a/src/main/resources/youtube/settings/xml/revanced_prefs.xml
+++ b/src/main/resources/youtube/settings/xml/revanced_prefs.xml
@@ -179,12 +179,12 @@
-
-
+
+