diff --git a/src/main/kotlin/app/revanced/patcher/Fingerprint.kt b/src/main/kotlin/app/revanced/patcher/Fingerprint.kt index 4d4594b..78e6c4d 100644 --- a/src/main/kotlin/app/revanced/patcher/Fingerprint.kt +++ b/src/main/kotlin/app/revanced/patcher/Fingerprint.kt @@ -128,7 +128,7 @@ class Fingerprint internal constructor( fun match( context: BytecodePatchContext, method: Method, - ) = match(context, method, context.classByType(method.definingClass)!!.immutableClass) + ) = match(context, method, context.classBy { method.definingClass == it.type }!!.immutableClass) /** * Match using a [Method]. diff --git a/src/main/kotlin/app/revanced/patcher/patch/BytecodePatchContext.kt b/src/main/kotlin/app/revanced/patcher/patch/BytecodePatchContext.kt index 56bd6d2..a569831 100644 --- a/src/main/kotlin/app/revanced/patcher/patch/BytecodePatchContext.kt +++ b/src/main/kotlin/app/revanced/patcher/patch/BytecodePatchContext.kt @@ -104,6 +104,7 @@ class BytecodePatchContext internal constructor(private val config: PatcherConfi * @param type The type of the class. * @return A proxy for the first class that matches the type. */ + @Deprecated("Use classBy { type in it.type } instead.", ReplaceWith("classBy { type in it.type }")) fun classByType(type: String) = classBy { type in it.type } /** diff --git a/src/main/kotlin/app/revanced/patcher/util/ClassMerger.kt b/src/main/kotlin/app/revanced/patcher/util/ClassMerger.kt index 6f917bb..9850a4e 100644 --- a/src/main/kotlin/app/revanced/patcher/util/ClassMerger.kt +++ b/src/main/kotlin/app/revanced/patcher/util/ClassMerger.kt @@ -179,7 +179,9 @@ internal object ClassMerger { callback: MutableClass.() -> Unit, ) { callback(targetClass) - this.classByType(targetClass.superclass ?: return)?.mutableClass?.let { + + targetClass.superclass ?: return + this.classBy { targetClass.superclass == it.type }?.mutableClass?.let { traverseClassHierarchy(it, callback) } }