From c9dae11a18e00f3b23f26e32612e2df0fb792507 Mon Sep 17 00:00:00 2001 From: fankesyooni Date: Thu, 8 Sep 2022 03:21:24 +0800 Subject: [PATCH] Modify change function name onHookLogMsg to onDebuggingMsg in MemberBaseFinder --- .../yukihookapi/hook/core/finder/base/MemberBaseFinder.kt | 4 ++-- .../hook/core/finder/members/ConstructorFinder.kt | 6 +++--- .../yukihookapi/hook/core/finder/members/FieldFinder.kt | 6 +++--- .../yukihookapi/hook/core/finder/members/MethodFinder.kt | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/base/MemberBaseFinder.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/base/MemberBaseFinder.kt index 02a17def..f46f3129 100644 --- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/base/MemberBaseFinder.kt +++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/base/MemberBaseFinder.kt @@ -139,10 +139,10 @@ abstract class MemberBaseFinder internal constructor( } /** - * Hook 过程中开启了 [YukiHookAPI.Configs.isDebug] 输出调试信息 + * 在开启 [YukiHookAPI.Configs.isDebug] 且在 [YukiHookBridge.hasXposedBridge] 且在 Hook 过程中情况下输出调试信息 * @param msg 调试日志内容 */ - internal fun onHookLogMsg(msg: String) { + internal fun onDebuggingMsg(msg: String) { if (YukiHookAPI.Configs.isDebug && YukiHookBridge.hasXposedBridge && hookInstance != null) yLoggerI(msg = msg) } diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/ConstructorFinder.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/ConstructorFinder.kt index e5920367..a1c0e647 100644 --- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/ConstructorFinder.kt +++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/ConstructorFinder.kt @@ -202,7 +202,7 @@ class ConstructorFinder @PublishedApi internal constructor( isBindToHooker = isBind setInstance(isBind, result) }.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) }.result { ms -> 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 it.second.onFindCallback?.invoke(memberInstances.constructors()) remedyPlansCallback?.invoke() 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 }.onFailure { lastError = it diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/FieldFinder.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/FieldFinder.kt index 4c2c45b9..ce420dfc 100644 --- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/FieldFinder.kt +++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/FieldFinder.kt @@ -194,7 +194,7 @@ class FieldFinder @PublishedApi internal constructor( runBlocking { setInstance(result) }.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() } else Result(isNoSuch = true, Throwable("classSet is null")) @@ -245,13 +245,13 @@ class FieldFinder @PublishedApi internal constructor( setInstance(it.first.result) }.result { ms -> 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 it.second.onFindCallback?.invoke(memberInstances.fields()) remedyPlansCallback?.invoke() 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 }.onFailure { lastError = it diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/MethodFinder.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/MethodFinder.kt index e6f1002a..83bacd48 100644 --- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/MethodFinder.kt +++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/MethodFinder.kt @@ -274,7 +274,7 @@ class MethodFinder @PublishedApi internal constructor( isBindToHooker = isBind setInstance(isBind, result) }.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) }.result { ms -> 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 it.second.onFindCallback?.invoke(memberInstances.methods()) remedyPlansCallback?.invoke() 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 }.onFailure { lastError = it