diff --git a/patches/src/main/kotlin/app/revanced/patches/shared/misc/extension/SharedExtensionPatch.kt b/patches/src/main/kotlin/app/revanced/patches/shared/misc/extension/SharedExtensionPatch.kt index e572b98ed8..3d7a1e4443 100644 --- a/patches/src/main/kotlin/app/revanced/patches/shared/misc/extension/SharedExtensionPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/shared/misc/extension/SharedExtensionPatch.kt @@ -23,7 +23,7 @@ fun sharedExtensionPatch( hooks.forEach { it.fingerprint() } execute { context -> - if (context.classByType(EXTENSION_CLASS_DESCRIPTOR) == null) { + if (context.classBy { EXTENSION_CLASS_DESCRIPTOR in it.type } == null) { throw PatchException( "Shared extension has not been merged yet. This patch can not succeed without merging it.", ) diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/cast/HideCastButtonPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/cast/HideCastButtonPatch.kt index 1ba084384c..fa9d80d143 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/cast/HideCastButtonPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/cast/HideCastButtonPatch.kt @@ -29,7 +29,7 @@ val hideCastButtonPatch = bytecodePatch( SwitchPreference("revanced_hide_cast_button"), ) - val buttonClass = context.classByType("MediaRouteButton") + val buttonClass = context.classBy { "MediaRouteButton" in it.type } ?: throw PatchException("MediaRouteButton class not found.") buttonClass.mutableClass.methods.find { it.name == "setVisibility" }?.addInstructions(