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