mirror of
https://github.com/ReVanced/revanced-patcher.git
synced 2024-11-10 01:02:22 +01:00
fix: Check for class type exactly instead of with contains (#310)
This commit is contained in:
parent
525beda18e
commit
69f2f20fd9
3 changed files with 5 additions and 2 deletions
|
@ -128,7 +128,7 @@ class Fingerprint internal constructor(
|
||||||
fun match(
|
fun match(
|
||||||
context: BytecodePatchContext,
|
context: BytecodePatchContext,
|
||||||
method: Method,
|
method: Method,
|
||||||
) = match(context, method, context.classByType(method.definingClass)!!.immutableClass)
|
) = match(context, method, context.classBy { method.definingClass == it.type }!!.immutableClass)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Match using a [Method].
|
* Match using a [Method].
|
||||||
|
|
|
@ -104,6 +104,7 @@ class BytecodePatchContext internal constructor(private val config: PatcherConfi
|
||||||
* @param type The type of the class.
|
* @param type The type of the class.
|
||||||
* @return A proxy for the first class that matches the type.
|
* @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 }
|
fun classByType(type: String) = classBy { type in it.type }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -179,7 +179,9 @@ internal object ClassMerger {
|
||||||
callback: MutableClass.() -> Unit,
|
callback: MutableClass.() -> Unit,
|
||||||
) {
|
) {
|
||||||
callback(targetClass)
|
callback(targetClass)
|
||||||
this.classByType(targetClass.superclass ?: return)?.mutableClass?.let {
|
|
||||||
|
targetClass.superclass ?: return
|
||||||
|
this.classBy { targetClass.superclass == it.type }?.mutableClass?.let {
|
||||||
traverseClassHierarchy(it, callback)
|
traverseClassHierarchy(it, callback)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue