diff --git a/src/main/kotlin/app/revanced/patches/music/player/components/PlayerComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/music/player/components/PlayerComponentsPatch.kt index ffcdedd010..a8710246dd 100644 --- a/src/main/kotlin/app/revanced/patches/music/player/components/PlayerComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/player/components/PlayerComponentsPatch.kt @@ -635,7 +635,7 @@ object PlayerComponentsPatch : BaseBytecodePatch( .filter { (_, instruction) -> val reference = (instruction as? ReferenceInstruction)?.reference instruction.opcode == Opcode.INVOKE_VIRTUAL && - reference is MethodReference && + reference is MethodReference && reference.toString() == AUDIO_VIDEO_SWITCH_TOGGLE_VISIBILITY } .map { (index, _) -> index } diff --git a/src/main/kotlin/app/revanced/patches/reddit/layout/branding/packagename/ChangePackageNamePatch.kt b/src/main/kotlin/app/revanced/patches/reddit/layout/branding/packagename/ChangePackageNamePatch.kt index 5bfd6d575f..0eaa2087c8 100644 --- a/src/main/kotlin/app/revanced/patches/reddit/layout/branding/packagename/ChangePackageNamePatch.kt +++ b/src/main/kotlin/app/revanced/patches/reddit/layout/branding/packagename/ChangePackageNamePatch.kt @@ -90,7 +90,7 @@ object ChangePackageNamePatch : BaseResourcePatch( node.textContent = when (node.getAttribute("name")) { "provider_authority_appdata", "provider_authority_file", "provider_authority_userdata", "provider_workmanager_init" - -> node.textContent.replace(PACKAGE_NAME_REDDIT, redditPackageName) + -> node.textContent.replace(PACKAGE_NAME_REDDIT, redditPackageName) else -> continue } diff --git a/src/main/kotlin/app/revanced/patches/shared/gms/BaseGmsCoreSupportPatch.kt b/src/main/kotlin/app/revanced/patches/shared/gms/BaseGmsCoreSupportPatch.kt index 542b491e00..394b4114e4 100644 --- a/src/main/kotlin/app/revanced/patches/shared/gms/BaseGmsCoreSupportPatch.kt +++ b/src/main/kotlin/app/revanced/patches/shared/gms/BaseGmsCoreSupportPatch.kt @@ -238,7 +238,7 @@ abstract class BaseGmsCoreSupportPatch( in PERMISSIONS, in ACTIONS, in AUTHORITIES, - -> referencedString.replace("com.google", gmsCoreVendor) + -> referencedString.replace("com.google", gmsCoreVendor) // No vendor prefix for whatever reason... "subscribedfeeds" -> "$gmsCoreVendor.subscribedfeeds" @@ -279,7 +279,7 @@ abstract class BaseGmsCoreSupportPatch( when (string) { "$fromPackageName.SuggestionsProvider", "$fromPackageName.fileprovider", - -> string.replace(fromPackageName, toPackageName) + -> string.replace(fromPackageName, toPackageName) else -> null } diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/downloads/fingerprints/AccessibilityOfflineButtonSyncFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/general/downloads/fingerprints/AccessibilityOfflineButtonSyncFingerprint.kt index 3fb7757481..b41c7b4630 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/downloads/fingerprints/AccessibilityOfflineButtonSyncFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/downloads/fingerprints/AccessibilityOfflineButtonSyncFingerprint.kt @@ -20,7 +20,7 @@ internal object AccessibilityOfflineButtonSyncFingerprint : MethodFingerprint( return@custom false } - val endsWithMethodParameterList = parameterTypes.slice(parameterSize - 3..< parameterSize) + val endsWithMethodParameterList = parameterTypes.slice(parameterSize - 3..()?.name == "setImageDrawable" }.forEach { insertIndex -> - val (viewRegister, drawableRegister) = getInstruction(insertIndex).let { + val (viewRegister, drawableRegister) = getInstruction( + insertIndex + ).let { Pair(it.registerC, it.registerD) } replaceInstruction( diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemePatch.kt index f6c0d58a46..96e471de3a 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemePatch.kt @@ -145,7 +145,7 @@ object ThemePatch : BaseResourcePatch( node.textContent = when (node.getAttribute("name")) { "yt_white1", "yt_white1_opacity95", "yt_white1_opacity98", "yt_white2", "yt_white3", "yt_white4", - -> lightThemeColor + -> lightThemeColor else -> continue } diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/flyoutmenu/hide/PlayerFlyoutMenuPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/player/flyoutmenu/hide/PlayerFlyoutMenuPatch.kt index 12cf7f839f..0bd8a9ace7 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/flyoutmenu/hide/PlayerFlyoutMenuPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/flyoutmenu/hide/PlayerFlyoutMenuPatch.kt @@ -93,8 +93,10 @@ object PlayerFlyoutMenuPatch : BaseBytecodePatch( // region patch for hide '1080p Premium' label VideoQualityArrayFingerprint.resultOrThrow().mutableMethod.apply { - val qualityLabelIndex = VideoQualityArrayFingerprint.indexOfQualityLabelInstruction(this) + 1 - val qualityLabelRegister = getInstruction(qualityLabelIndex).registerA + val qualityLabelIndex = + VideoQualityArrayFingerprint.indexOfQualityLabelInstruction(this) + 1 + val qualityLabelRegister = + getInstruction(qualityLabelIndex).registerA val jumpIndex = indexOfFirstInstructionReversedOrThrow(qualityLabelIndex) { opcode == Opcode.INVOKE_INTERFACE && getReference()?.name == "hasNext" diff --git a/src/main/kotlin/app/revanced/patches/youtube/player/flyoutmenu/hide/fingerprints/VideoQualityArrayFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/player/flyoutmenu/hide/fingerprints/VideoQualityArrayFingerprint.kt index 0c6f6f2c9a..8de44d402d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/player/flyoutmenu/hide/fingerprints/VideoQualityArrayFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/player/flyoutmenu/hide/fingerprints/VideoQualityArrayFingerprint.kt @@ -34,7 +34,7 @@ internal object VideoQualityArrayFingerprint : MethodFingerprint( } val startsWithMethodParameterList = parameterTypes.slice(0..0) - val endsWithMethodParameterList = parameterTypes.slice(parameterSize - 2..< parameterSize) + val endsWithMethodParameterList = parameterTypes.slice(parameterSize - 2..() - reference?.returnType == "Z" && + reference?.returnType == "Z" && reference.parameterTypes.size == 0 && reference.name == autoNavStatusMethodName } diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/returnyoutubedislike/shorts/ReturnYouTubeDislikeShortsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/returnyoutubedislike/shorts/ReturnYouTubeDislikeShortsPatch.kt index f26911ea02..34009a515f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/returnyoutubedislike/shorts/ReturnYouTubeDislikeShortsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/returnyoutubedislike/shorts/ReturnYouTubeDislikeShortsPatch.kt @@ -68,7 +68,10 @@ object ReturnYouTubeDislikeShortsPatch : BytecodePatch( } if (SettingsPatch.upward1834) { - TextComponentPatch.hookSpannableString(INTEGRATIONS_RYD_CLASS_DESCRIPTOR, "onCharSequenceLoaded") + TextComponentPatch.hookSpannableString( + INTEGRATIONS_RYD_CLASS_DESCRIPTOR, + "onCharSequenceLoaded" + ) } } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/fingerprint/PlayerParameterBuilderFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/fingerprint/PlayerParameterBuilderFingerprint.kt index 39c7834cbe..6053c8064b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/fingerprint/PlayerParameterBuilderFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/fingerprint/PlayerParameterBuilderFingerprint.kt @@ -48,7 +48,7 @@ internal object PlayerParameterBuilderFingerprint : MethodFingerprint( } val startsWithMethodParameterList = parameterTypes.slice(0..5) - val endsWithMethodParameterList = parameterTypes.slice(parameterSize - 7..< parameterSize) + val endsWithMethodParameterList = parameterTypes.slice(parameterSize - 7..