diff --git a/yukihookapi-ksp-xposed/src/api/kotlin/com/highcapable/yukihookapi_ksp_xposed/YukiHookXposedProcessor.kt b/yukihookapi-ksp-xposed/src/api/kotlin/com/highcapable/yukihookapi_ksp_xposed/YukiHookXposedProcessor.kt index e829d33e..755b3cf4 100644 --- a/yukihookapi-ksp-xposed/src/api/kotlin/com/highcapable/yukihookapi_ksp_xposed/YukiHookXposedProcessor.kt +++ b/yukihookapi-ksp-xposed/src/api/kotlin/com/highcapable/yukihookapi_ksp_xposed/YukiHookXposedProcessor.kt @@ -138,7 +138,7 @@ class YukiHookXposedProcessor : SymbolProcessorProvider { ) injectClass(it.packageName.asString(), it.simpleName.asString(), modulePackageName) } else error(msg = "HookEntryClass \"${it.simpleName.asString()}\" must be implements YukiHookXposedInitProxy") - else error(msg = "@InjectYukiHookWithXposed only can be use in once times") + else error(msg = "\"@InjectYukiHookWithXposed\" only can be use in once times") /** 仅处理第一个标记的类 - 再次处理将拦截并报错 */ injectOnce = false } @@ -216,12 +216,12 @@ class YukiHookXposedProcessor : SymbolProcessorProvider { */ private fun injectClass(packageName: String, className: String, modulePackageName: String) = environment(ignoredError = true) { - if (modulePackageName.isNotBlank()) warn(msg = "You set the customize module package name to \"$modulePackageName\",please check for yourself if it is correct") + if (modulePackageName.isNotBlank()) warn(msg = "You set the customize module package name to \"$modulePackageName\", please check for yourself if it is correct") val realPackageName = modulePackageName.ifBlank { if (packageName.contains(".hook.") || packageName.endsWith(".hook")) packageName.split(".hook")[0] - else error(msg = "Cannot identify your App's package name,please manually configure the package name") + else error(msg = "Cannot identify your App's package name, please manually configure the package name") } codeGenerator.createNewFile( Dependencies.ALL_FILES, diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/YukiHookCreater.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/YukiHookCreater.kt index d6bea0d3..634c8d48 100644 --- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/YukiHookCreater.kt +++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/YukiHookCreater.kt @@ -99,7 +99,7 @@ class YukiHookCreater(private val packageParam: PackageParam, private val hookCl @YukiPrivateApi fun hook(): Result { if (YukiHookAPI.hasXposedBridge.not()) return Result() - return if (hookMembers.isEmpty()) error("Hook Members is empty,hook aborted") + return if (hookMembers.isEmpty()) error("Hook Members is empty, hook aborted") else Result().also { Thread { /** 延迟使得方法取到返回值 */ diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/ConstructorFinder.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/ConstructorFinder.kt index 92d1d1b9..ada7e6b3 100644 --- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/ConstructorFinder.kt +++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/ConstructorFinder.kt @@ -230,7 +230,7 @@ class ConstructorFinder( ) remedyPlans.clear() } - } else yLoggerW(msg = "RemedyPlan is empty,forgot it? [${hookTag}]") + } else yLoggerW(msg = "RemedyPlan is empty, forgot it? [${hookTag}]") } /** diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/MethodFinder.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/MethodFinder.kt index 0f907d32..ab6e4caf 100644 --- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/MethodFinder.kt +++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/MethodFinder.kt @@ -279,7 +279,7 @@ class MethodFinder( ) remedyPlans.clear() } - } else yLoggerW(msg = "RemedyPlan is empty,forgot it? [${hookTag}]") + } else yLoggerW(msg = "RemedyPlan is empty, forgot it? [${hookTag}]") } /** diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/param/HookParam.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/param/HookParam.kt index 55d391f3..ccdff2e3 100644 --- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/param/HookParam.kt +++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/param/HookParam.kt @@ -69,7 +69,7 @@ class HookParam(private val createrInstance: YukiHookCreater, private val wrappe * @return [Any] * @throws IllegalStateException 如果对象为空 */ - val instance get() = wrapper.instance ?: error("HookParam instance got null,Is this a static member?") + val instance get() = wrapper.instance ?: error("HookParam instance got null! Is this a static member?") /** * 获取当前 Hook 实例的类对象 @@ -271,8 +271,8 @@ class HookParam(private val createrInstance: YukiHookCreater, private val wrappe * @throws IllegalStateException 如果目标方法参数对象数组为空或 [index] 下标不存在 */ fun set(any: T?) { - if (args.isEmpty()) error("HookParam method args is empty,mabe not has args") - if (index > args.lastIndex) error("HookParam method args index out of bounds,max is ${args.lastIndex}") + if (args.isEmpty()) error("HookParam method args is empty, mabe not has args") + if (index > args.lastIndex) error("HookParam method args index out of bounds, max is ${args.lastIndex}") wrapper.setArgs(index, any) } diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/xposed/prefs/YukiHookModulePrefs.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/xposed/prefs/YukiHookModulePrefs.kt index e8631bfc..bd0f5c3e 100644 --- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/xposed/prefs/YukiHookModulePrefs.kt +++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/xposed/prefs/YukiHookModulePrefs.kt @@ -85,7 +85,7 @@ class YukiHookModulePrefs(private val context: Context? = null) { private fun checkApi() { if (YukiHookAPI.isLoadedFromBaseContext) error("YukiHookModulePrefs not allowed in Custom Hook API") if (YukiHookAPI.hasXposedBridge && YukiHookXposedBridge.modulePackageName.isBlank()) - error("Xposed modulePackageName load failed,please reset and rebuild it") + error("Xposed modulePackageName load failed, please reset and rebuild it") } /** @@ -107,11 +107,11 @@ class YukiHookModulePrefs(private val context: Context? = null) { get() = try { checkApi() context?.getSharedPreferences(prefsName, Context.MODE_WORLD_READABLE) - ?: error("If you want to use module prefs,you must set the context instance first") + ?: error("If you want to use module prefs, you must set the context instance first") } catch (_: Throwable) { checkApi() context?.getSharedPreferences(prefsName, Context.MODE_PRIVATE) - ?: error("If you want to use module prefs,you must set the context instance first") + ?: error("If you want to use module prefs, you must set the context instance first") } /** 设置全局可读可写 */