Modify add detail message when checkingInternal failure

This commit is contained in:
2022-08-14 03:01:54 +08:00
parent 60c3b923df
commit d81fdc9bb4

View File

@@ -230,6 +230,8 @@ inline fun Class<*>.allFields(result: (index: Int, field: Field) -> Unit) =
@PublishedApi
internal fun Class<*>.checkingInternal() {
if (name == classOf<YukiHookModuleStatus>().name) return
if (name == classOf<YukiHookAPI>().name || name.startsWith(prefix = "com.highcapable.yukihookapi.hook"))
throw RuntimeException("!!!DO NOT ALLOWED!!! You cannot hook or reflection to call the internal class of the YukiHookAPI itself")
if (name == classOf<YukiHookAPI>().name || name.startsWith(prefix = "com.highcapable.yukihookapi.hook")) throw RuntimeException(
"!!!DO NOT ALLOWED!!! You cannot hook or reflection to call the internal class of the YukiHookAPI itself, " +
"The called class is [$this]"
)
}