fix(YouTube/Hide handle): handle is not hidden in You tab

This commit is contained in:
inotia00
2023-10-19 08:08:04 +09:00
parent 4edcbfa3fa
commit e27c316bd2
4 changed files with 19 additions and 11 deletions

View File

@ -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"
)
)

View File

@ -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