Skip to content

Commit c7ed389

Browse files
committed
Modify not allowed hook entry class has any constructor parameters in YukiHookXposedProcessor
1 parent 4230e4f commit c7ed389

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

yukihookapi-ksp-xposed/src/api/kotlin/com/highcapable/yukihookapi_ksp_xposed/YukiHookXposedProcessor.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ class YukiHookXposedProcessor : SymbolProcessorProvider {
146146
asSequence().filterIsInstance<KSClassDeclaration>().forEach {
147147
if (isInjectOnce) when {
148148
it.superTypes.any { type -> type.element.toString() == "IYukiHookXposedInit" } -> {
149+
if ((it.primaryConstructor?.parameters?.size ?: 0) > 0)
150+
problem(msg = "The hook entry class \"${it.simpleName.asString()}\" doesn't allowed any constructor parameters")
149151
val xInitPatchName = data.xInitClassName.ifBlank { "${it.simpleName.asString()}$XPOSED_CLASS_SHORT_NAME" }
150152
if (data.xInitClassName == it.simpleName.asString())
151153
problem(msg = "Duplicate entryClassName \"${data.xInitClassName}\"")

0 commit comments

Comments
 (0)