mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-04 09:45:19 +08:00
Changed Finder function
This commit is contained in:
@@ -65,7 +65,7 @@ class ConstructorFinder(
|
||||
private var modifiers: ModifierRules? = null
|
||||
|
||||
/**
|
||||
* [Constructor] 参数个数
|
||||
* 设置 [Constructor] 参数个数
|
||||
*
|
||||
* 你可以不使用 [param] 指定参数类型而是仅使用此变量指定参数个数
|
||||
*
|
||||
@@ -74,7 +74,7 @@ class ConstructorFinder(
|
||||
var paramCount = -1
|
||||
|
||||
/**
|
||||
* [Constructor] 筛选条件
|
||||
* 设置 [Constructor] 标识符筛选条件
|
||||
*
|
||||
* - ❗存在多个 [BaseFinder.IndexTypeCondition] 时除了 [order] 只会生效最后一个
|
||||
* @param initiate 方法体
|
||||
@@ -86,11 +86,18 @@ class ConstructorFinder(
|
||||
}
|
||||
|
||||
/**
|
||||
* [Constructor] 参数
|
||||
* 设置 [Constructor] 空参数、无参数
|
||||
*
|
||||
* @return [BaseFinder.IndexTypeCondition]
|
||||
*/
|
||||
fun emptyParam() = paramCount(num = 0)
|
||||
|
||||
/**
|
||||
* 设置 [Constructor] 参数
|
||||
*
|
||||
* 如果同时使用了 [paramCount] 则 [paramTypes] 的数量必须与 [paramCount] 完全匹配
|
||||
*
|
||||
* - ❗无参 [Constructor] 不要使用此方法
|
||||
* - ❗无参 [Constructor] 请使用 [emptyParam] 设置查询条件
|
||||
*
|
||||
* - ❗有参 [Constructor] 必须使用此方法设定参数或使用 [paramCount] 指定个数
|
||||
*
|
||||
@@ -99,7 +106,7 @@ class ConstructorFinder(
|
||||
* @return [BaseFinder.IndexTypeCondition]
|
||||
*/
|
||||
fun param(vararg paramType: Any): IndexTypeCondition {
|
||||
if (paramType.isEmpty()) error("paramTypes is empty, please delete param() method")
|
||||
if (paramType.isEmpty()) error("paramTypes is empty, please use emptyParam() instead")
|
||||
paramTypes = ArrayList<Class<*>>().apply { paramType.forEach { add(it.compat() ?: UndefinedType) } }.toTypedArray()
|
||||
return IndexTypeCondition(IndexConfigType.MATCH)
|
||||
}
|
||||
@@ -111,7 +118,7 @@ class ConstructorFinder(
|
||||
fun order() = IndexTypeCondition(IndexConfigType.ORDER)
|
||||
|
||||
/**
|
||||
* [Constructor] 参数个数
|
||||
* 设置 [Constructor] 参数个数
|
||||
*
|
||||
* 你可以不使用 [param] 指定参数类型而是仅使用此方法指定参数个数
|
||||
*
|
||||
|
@@ -55,14 +55,14 @@ class FieldFinder(
|
||||
private var modifiers: ModifierRules? = null
|
||||
|
||||
/**
|
||||
* [Field] 名称
|
||||
* 设置 [Field] 名称
|
||||
*
|
||||
* - ❗若不填写名称则必须存在一个其它条件 - 默认模糊查找并取第一个匹配的 [Field]
|
||||
*/
|
||||
var name = ""
|
||||
|
||||
/**
|
||||
* [Field] 类型
|
||||
* 设置 [Field] 类型
|
||||
*
|
||||
* - ❗只能是 [Class]、[String]、[VariousClass]
|
||||
*
|
||||
@@ -71,7 +71,7 @@ class FieldFinder(
|
||||
var type: Any? = null
|
||||
|
||||
/**
|
||||
* [Field] 筛选条件
|
||||
* 设置 [Field] 标识符筛选条件
|
||||
*
|
||||
* 可不设置筛选条件 - 默认模糊查找并取第一个匹配的 [Field]
|
||||
*
|
||||
@@ -91,7 +91,7 @@ class FieldFinder(
|
||||
fun order() = IndexTypeCondition(IndexConfigType.ORDER)
|
||||
|
||||
/**
|
||||
* [Field] 名称
|
||||
* 设置 [Field] 名称
|
||||
*
|
||||
* - ❗若不填写名称则必须存在一个其它条件 - 默认模糊查找并取第一个匹配的 [Field]
|
||||
*
|
||||
@@ -105,7 +105,7 @@ class FieldFinder(
|
||||
}
|
||||
|
||||
/**
|
||||
* [Field] 类型
|
||||
* 设置 [Field] 类型
|
||||
*
|
||||
* - 可不填写类型 - 默认模糊查找并取第一个匹配的 [Field]
|
||||
*
|
||||
|
@@ -65,14 +65,14 @@ class MethodFinder(
|
||||
private var modifiers: ModifierRules? = null
|
||||
|
||||
/**
|
||||
* [Method] 名称
|
||||
* 设置 [Method] 名称
|
||||
*
|
||||
* - ❗若不填写名称则必须存在一个其它条件 - 默认模糊查找并取第一个匹配的 [Method]
|
||||
*/
|
||||
var name = ""
|
||||
|
||||
/**
|
||||
* [Method] 参数个数
|
||||
* 设置 [Method] 参数个数
|
||||
*
|
||||
* 你可以不使用 [param] 指定参数类型而是仅使用此变量指定参数个数
|
||||
*
|
||||
@@ -90,7 +90,7 @@ class MethodFinder(
|
||||
var returnType: Any? = null
|
||||
|
||||
/**
|
||||
* [Method] 筛选条件
|
||||
* 设置 [Method] 标识符筛选条件
|
||||
*
|
||||
* 可不设置筛选条件 - 默认模糊查找并取第一个匹配的 [Method]
|
||||
*
|
||||
@@ -104,11 +104,18 @@ class MethodFinder(
|
||||
}
|
||||
|
||||
/**
|
||||
* [Method] 参数
|
||||
* 设置 [Method] 空参数、无参数
|
||||
*
|
||||
* @return [BaseFinder.IndexTypeCondition]
|
||||
*/
|
||||
fun emptyParam() = paramCount(num = 0)
|
||||
|
||||
/**
|
||||
* 设置 [Method] 参数
|
||||
*
|
||||
* 如果同时使用了 [paramCount] 则 [paramTypes] 的数量必须与 [paramCount] 完全匹配
|
||||
*
|
||||
* - ❗无参 [Method] 不要使用此方法
|
||||
* - ❗无参 [Method] 请使用 [emptyParam] 设置查询条件
|
||||
*
|
||||
* - ❗有参 [Method] 必须使用此方法设定参数或使用 [paramCount] 指定个数
|
||||
*
|
||||
@@ -117,7 +124,7 @@ class MethodFinder(
|
||||
* @return [BaseFinder.IndexTypeCondition]
|
||||
*/
|
||||
fun param(vararg paramType: Any): IndexTypeCondition {
|
||||
if (paramType.isEmpty()) error("paramTypes is empty, please delete param() method")
|
||||
if (paramType.isEmpty()) error("paramTypes is empty, please use emptyParam() instead")
|
||||
paramTypes = ArrayList<Class<*>>().apply { paramType.forEach { add(it.compat() ?: UndefinedType) } }.toTypedArray()
|
||||
return IndexTypeCondition(IndexConfigType.MATCH)
|
||||
}
|
||||
@@ -129,7 +136,7 @@ class MethodFinder(
|
||||
fun order() = IndexTypeCondition(IndexConfigType.ORDER)
|
||||
|
||||
/**
|
||||
* [Method] 名称
|
||||
* 设置 [Method] 名称
|
||||
*
|
||||
* - ❗若不填写名称则必须存在一个其它条件 - 默认模糊查找并取第一个匹配的 [Method]
|
||||
*
|
||||
@@ -143,7 +150,7 @@ class MethodFinder(
|
||||
}
|
||||
|
||||
/**
|
||||
* [Method] 参数个数
|
||||
* 设置 [Method] 参数个数
|
||||
*
|
||||
* 你可以不使用 [param] 指定参数类型而是仅使用此方法指定参数个数
|
||||
*
|
||||
@@ -159,7 +166,7 @@ class MethodFinder(
|
||||
}
|
||||
|
||||
/**
|
||||
* [Method] 返回值
|
||||
* 设置 [Method] 返回值
|
||||
*
|
||||
* 可不填写返回值 - 默认模糊查找并取第一个匹配的 [Method]
|
||||
*
|
||||
|
Reference in New Issue
Block a user