From 53383e103d723ee1578e9217fe2afca3e0350a0b Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Wed, 16 Oct 2024 01:29:27 +0200 Subject: [PATCH] remove usage of deprecated APIs --- .../patches/shared/misc/extension/SharedExtensionPatch.kt | 2 +- .../patches/youtube/layout/buttons/cast/HideCastButtonPatch.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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(