From a6a74e289db1fe04db230d1e864cb9e752f9a01d Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Mon, 11 Nov 2024 02:25:17 +0100 Subject: [PATCH] perf: Check for extension without a class proxy --- .../patches/shared/misc/extension/SharedExtensionPatch.kt | 4 ++-- 1 file 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 33c3ddf154..7460ddd111 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 @@ -20,7 +20,7 @@ fun sharedExtensionPatch( extendWith("extensions/shared.rve") execute { - if (classBy { EXTENSION_CLASS_DESCRIPTOR in it.type } == null) { + if (classes.none { EXTENSION_CLASS_DESCRIPTOR == it.type }) { throw PatchException( "Shared extension has not been merged yet. This patch can not succeed without merging it.", ) @@ -35,7 +35,7 @@ fun sharedExtensionPatch( */ fun getCurrentJarFilePath(): String { val className = object {}::class.java.enclosingClass.name.replace('.', '/') + ".class" - val classUrl = object {}::class.java.classLoader.getResource(className) + val classUrl = object {}::class.java.classLoader?.getResource(className) if (classUrl != null) { val urlString = classUrl.toString()