Modify change function name onHookLogMsg to onDebuggingMsg in MemberBaseFinder

This commit is contained in:
2022-09-08 03:21:24 +08:00
parent 537a6acb22
commit c9dae11a18
4 changed files with 11 additions and 11 deletions

View File

@@ -139,10 +139,10 @@ abstract class MemberBaseFinder internal constructor(
} }
/** /**
* Hook 过程中开启 [YukiHookAPI.Configs.isDebug] 输出调试信息 * 开启 [YukiHookAPI.Configs.isDebug] 且在 [YukiHookBridge.hasXposedBridge] 且在 Hook 过程中情况下输出调试信息
* @param msg 调试日志内容 * @param msg 调试日志内容
*/ */
internal fun onHookLogMsg(msg: String) { internal fun onDebuggingMsg(msg: String) {
if (YukiHookAPI.Configs.isDebug && YukiHookBridge.hasXposedBridge && hookInstance != null) yLoggerI(msg = msg) if (YukiHookAPI.Configs.isDebug && YukiHookBridge.hasXposedBridge && hookInstance != null) yLoggerI(msg = msg)
} }

View File

@@ -202,7 +202,7 @@ class ConstructorFinder @PublishedApi internal constructor(
isBindToHooker = isBind isBindToHooker = isBind
setInstance(isBind, result) setInstance(isBind, result)
}.result { ms -> }.result { ms ->
memberInstances.takeIf { it.isNotEmpty() }?.forEach { onHookLogMsg(msg = "Find Constructor [$it] takes ${ms}ms [${hookTag}]") } memberInstances.takeIf { it.isNotEmpty() }?.forEach { onDebuggingMsg(msg = "Find Constructor [$it] takes ${ms}ms [${hookTag}]") }
} }
} }
@@ -266,13 +266,13 @@ class ConstructorFinder @PublishedApi internal constructor(
setInstance(isBindToHooker, it.first.result) setInstance(isBindToHooker, it.first.result)
}.result { ms -> }.result { ms ->
memberInstances.takeIf { it.isNotEmpty() } memberInstances.takeIf { it.isNotEmpty() }
?.forEach { onHookLogMsg(msg = "Find Constructor [$it] takes ${ms}ms [${hookTag}]") } ?.forEach { onDebuggingMsg(msg = "Find Constructor [$it] takes ${ms}ms [${hookTag}]") }
} }
isFindSuccess = true isFindSuccess = true
it.second.onFindCallback?.invoke(memberInstances.constructors()) it.second.onFindCallback?.invoke(memberInstances.constructors())
remedyPlansCallback?.invoke() remedyPlansCallback?.invoke()
memberInstances.takeIf { it.isNotEmpty() } memberInstances.takeIf { it.isNotEmpty() }
?.forEach { onHookLogMsg(msg = "Constructor [$it] trying ${p + 1} times success by RemedyPlan [${hookTag}]") } ?.forEach { onDebuggingMsg(msg = "Constructor [$it] trying ${p + 1} times success by RemedyPlan [${hookTag}]") }
return@run return@run
}.onFailure { }.onFailure {
lastError = it lastError = it

View File

@@ -194,7 +194,7 @@ class FieldFinder @PublishedApi internal constructor(
runBlocking { runBlocking {
setInstance(result) setInstance(result)
}.result { ms -> }.result { ms ->
memberInstances.takeIf { it.isNotEmpty() }?.forEach { onHookLogMsg(msg = "Find Field [$it] takes ${ms}ms [${hookTag}]") } memberInstances.takeIf { it.isNotEmpty() }?.forEach { onDebuggingMsg(msg = "Find Field [$it] takes ${ms}ms [${hookTag}]") }
} }
Result() Result()
} else Result(isNoSuch = true, Throwable("classSet is null")) } else Result(isNoSuch = true, Throwable("classSet is null"))
@@ -245,13 +245,13 @@ class FieldFinder @PublishedApi internal constructor(
setInstance(it.first.result) setInstance(it.first.result)
}.result { ms -> }.result { ms ->
memberInstances.takeIf { it.isNotEmpty() } memberInstances.takeIf { it.isNotEmpty() }
?.forEach { onHookLogMsg(msg = "Find Field [$it] takes ${ms}ms [${hookTag}]") } ?.forEach { onDebuggingMsg(msg = "Find Field [$it] takes ${ms}ms [${hookTag}]") }
} }
isFindSuccess = true isFindSuccess = true
it.second.onFindCallback?.invoke(memberInstances.fields()) it.second.onFindCallback?.invoke(memberInstances.fields())
remedyPlansCallback?.invoke() remedyPlansCallback?.invoke()
memberInstances.takeIf { it.isNotEmpty() } memberInstances.takeIf { it.isNotEmpty() }
?.forEach { onHookLogMsg(msg = "Field [$it] trying ${p + 1} times success by RemedyPlan [${hookTag}]") } ?.forEach { onDebuggingMsg(msg = "Field [$it] trying ${p + 1} times success by RemedyPlan [${hookTag}]") }
return@run return@run
}.onFailure { }.onFailure {
lastError = it lastError = it

View File

@@ -274,7 +274,7 @@ class MethodFinder @PublishedApi internal constructor(
isBindToHooker = isBind isBindToHooker = isBind
setInstance(isBind, result) setInstance(isBind, result)
}.result { ms -> }.result { ms ->
memberInstances.takeIf { it.isNotEmpty() }?.forEach { onHookLogMsg(msg = "Find Method [$it] takes ${ms}ms [${hookTag}]") } memberInstances.takeIf { it.isNotEmpty() }?.forEach { onDebuggingMsg(msg = "Find Method [$it] takes ${ms}ms [${hookTag}]") }
} }
} }
@@ -339,13 +339,13 @@ class MethodFinder @PublishedApi internal constructor(
setInstance(isBindToHooker, it.first.result) setInstance(isBindToHooker, it.first.result)
}.result { ms -> }.result { ms ->
memberInstances.takeIf { it.isNotEmpty() } memberInstances.takeIf { it.isNotEmpty() }
?.forEach { onHookLogMsg(msg = "Find Method [$it] takes ${ms}ms [${hookTag}]") } ?.forEach { onDebuggingMsg(msg = "Find Method [$it] takes ${ms}ms [${hookTag}]") }
} }
isFindSuccess = true isFindSuccess = true
it.second.onFindCallback?.invoke(memberInstances.methods()) it.second.onFindCallback?.invoke(memberInstances.methods())
remedyPlansCallback?.invoke() remedyPlansCallback?.invoke()
memberInstances.takeIf { it.isNotEmpty() } memberInstances.takeIf { it.isNotEmpty() }
?.forEach { onHookLogMsg(msg = "Method [$it] trying ${p + 1} times success by RemedyPlan [${hookTag}]") } ?.forEach { onDebuggingMsg(msg = "Method [$it] trying ${p + 1} times success by RemedyPlan [${hookTag}]") }
return@run return@run
}.onFailure { }.onFailure {
lastError = it lastError = it