mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-04 09:45:19 +08:00
add ignoredError
function
This commit is contained in:
@@ -262,6 +262,17 @@ class ConstructorFinder(
|
||||
return this
|
||||
}
|
||||
|
||||
/**
|
||||
* 忽略任何错误发出的警告
|
||||
*
|
||||
* - 若 [isNotIgnoredHookingFailure] 为 false 则自动忽略
|
||||
* @return [Result] 可继续向下监听
|
||||
*/
|
||||
fun ignoredError(): Result {
|
||||
isShutErrorPrinting = true
|
||||
return this
|
||||
}
|
||||
|
||||
/**
|
||||
* [Constructor] 实例处理类
|
||||
*
|
||||
|
@@ -152,6 +152,17 @@ class FieldFinder(
|
||||
return this
|
||||
}
|
||||
|
||||
/**
|
||||
* 忽略任何错误发出的警告
|
||||
*
|
||||
* - 若 [isNotIgnoredHookingFailure] 为 false 则自动忽略
|
||||
* @return [Result] 可继续向下监听
|
||||
*/
|
||||
fun ignoredError(): Result {
|
||||
isShutErrorPrinting = true
|
||||
return this
|
||||
}
|
||||
|
||||
/**
|
||||
* [Field] 实例变量处理类
|
||||
* @param instance 当前 [Field] 所在类的实例对象
|
||||
|
@@ -290,6 +290,17 @@ class MethodFinder(
|
||||
return this
|
||||
}
|
||||
|
||||
/**
|
||||
* 忽略任何错误发出的警告
|
||||
*
|
||||
* - 若 [isNotIgnoredHookingFailure] 为 false 则自动忽略
|
||||
* @return [Result] 可继续向下监听
|
||||
*/
|
||||
fun ignoredError(): Result {
|
||||
isShutErrorPrinting = true
|
||||
return this
|
||||
}
|
||||
|
||||
/**
|
||||
* [Method] 实例处理类
|
||||
* @param instance 当前 [Method] 所在类的实例对象
|
||||
|
@@ -47,6 +47,9 @@ abstract class BaseFinder(
|
||||
open val classSet: Class<*>? = null
|
||||
) {
|
||||
|
||||
/** 是否开启忽略错误警告功能 */
|
||||
internal var isShutErrorPrinting = false
|
||||
|
||||
/** 是否使用了重查找功能 */
|
||||
internal var isUsingRemedyPlan = false
|
||||
|
||||
@@ -76,7 +79,7 @@ abstract class BaseFinder(
|
||||
if (isAlwaysPrint) print()
|
||||
else Thread {
|
||||
SystemClock.sleep(10)
|
||||
if (isNotIgnoredHookingFailure && !isUsingRemedyPlan) print()
|
||||
if (isNotIgnoredHookingFailure && !isUsingRemedyPlan && !isShutErrorPrinting) print()
|
||||
}.start()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user