diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/data/ConstructorRulesData.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/data/ConstructorRulesData.kt index a36def15..dfdee4ff 100644 --- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/data/ConstructorRulesData.kt +++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/data/ConstructorRulesData.kt @@ -49,7 +49,7 @@ internal class ConstructorRulesData internal constructor( override val isInitialize get() = super.isInitializeOfSuper || paramTypes != null || paramCount >= 0 || - paramCountRange != IntRange.EMPTY || paramCountConditions != null + paramCountRange.isEmpty().not() || paramCountConditions != null override fun hashCode(other: Any?) = super.hashCode(other) + "[$paramTypes][$paramCount][$paramCountRange]".hashCode() } \ No newline at end of file diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/data/MemberRulesData.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/data/MemberRulesData.kt index b9601dec..f547bc2f 100644 --- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/data/MemberRulesData.kt +++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/data/MemberRulesData.kt @@ -49,7 +49,7 @@ internal open class MemberRulesData internal constructor( * 判断 [matchCount]、[matchCountRange] 规则是否已经初始化 (设置了任意一个参数) * @return [Boolean] */ - internal val isInitializeOfMatch get() = matchCount >= 0 || matchCountRange != IntRange.EMPTY + internal val isInitializeOfMatch get() = matchCount >= 0 || matchCountRange.isEmpty().not() /** * 判断 [BaseRulesData] 规则是否已经初始化 (设置了任意一个参数) diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/data/MethodRulesData.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/data/MethodRulesData.kt index 88c0a180..7d93c465 100644 --- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/data/MethodRulesData.kt +++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/data/MethodRulesData.kt @@ -56,7 +56,7 @@ internal class MethodRulesData internal constructor( override val isInitialize get() = super.isInitializeOfSuper || name.isNotBlank() || nameConditions != null || paramTypes != null || - paramCount >= 0 || paramCountRange != IntRange.EMPTY || paramCountConditions != null || returnType != null + paramCount >= 0 || paramCountRange.isEmpty().not() || paramCountConditions != null || returnType != null override fun hashCode(other: Any?) = super.hashCode(other) + "[$name][$nameConditions][$paramTypes][$paramCount][$paramCountRange][$returnType]".hashCode() diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/type/NameConditions.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/type/NameConditions.kt index 0b2f3463..2420d85d 100644 --- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/type/NameConditions.kt +++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/type/NameConditions.kt @@ -270,7 +270,7 @@ class NameConditions @PublishedApi internal constructor() { if (cdsContains != null) cdsContains?.apply { conditions = conditions && it.contains(first, second) } if (cdsMatches != null) cdsMatches?.apply { conditions = conditions && it.matches(regex = this) } if (cdsLength >= 0) conditions = conditions && it.length == cdsLength - if (cdsLengthRange != IntRange.EMPTY) conditions = conditions && it.length in cdsLengthRange + if (cdsLengthRange.isEmpty().not()) conditions = conditions && it.length in cdsLengthRange } return conditions } @@ -290,7 +290,7 @@ class NameConditions @PublishedApi internal constructor() { if (cdsContains != null) cdsContains?.apply { conditions += " " } if (cdsMatches != null) cdsMatches?.apply { conditions += " " } if (cdsLength >= 0) conditions += " " - if (cdsLengthRange != IntRange.EMPTY) conditions += " " + if (cdsLengthRange.isEmpty().not()) conditions += " " return "[${conditions.trim()}]" } } \ No newline at end of file