mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-04 17:55:24 +08:00
Added duplicate entryClassName checking
This commit is contained in:
@@ -121,6 +121,7 @@ class YukiHookXposedProcessor : SymbolProcessorProvider {
|
|||||||
if (isInjectOnce) when {
|
if (isInjectOnce) when {
|
||||||
it.superTypes.any { type -> type.element.toString() == "IYukiHookXposedInit" } -> {
|
it.superTypes.any { type -> type.element.toString() == "IYukiHookXposedInit" } -> {
|
||||||
val ecName = entryClassName.ifBlank { "${it.simpleName.asString()}$xposedClassShortName" }
|
val ecName = entryClassName.ifBlank { "${it.simpleName.asString()}$xposedClassShortName" }
|
||||||
|
if (entryClassName == it.simpleName.asString()) error(msg = "Duplicate entryClassName \"$entryClassName\"")
|
||||||
injectAssets(
|
injectAssets(
|
||||||
codePath = (it.location as? FileLocation?)?.filePath ?: "",
|
codePath = (it.location as? FileLocation?)?.filePath ?: "",
|
||||||
sourcePath = sourcePath,
|
sourcePath = sourcePath,
|
||||||
@@ -146,11 +147,11 @@ class YukiHookXposedProcessor : SymbolProcessorProvider {
|
|||||||
var entryClassName = ""
|
var entryClassName = ""
|
||||||
e.arguments.forEach { pease ->
|
e.arguments.forEach { pease ->
|
||||||
if (pease.name?.asString() == "sourcePath")
|
if (pease.name?.asString() == "sourcePath")
|
||||||
sourcePath = pease.value.toString()
|
sourcePath = pease.value.toString().trim()
|
||||||
if (pease.name?.asString() == "modulePackageName")
|
if (pease.name?.asString() == "modulePackageName")
|
||||||
modulePackageName = pease.value.toString()
|
modulePackageName = pease.value.toString().trim()
|
||||||
if (pease.name?.asString() == "entryClassName")
|
if (pease.name?.asString() == "entryClassName")
|
||||||
entryClassName = pease.value.toString()
|
entryClassName = pease.value.toString().trim()
|
||||||
}
|
}
|
||||||
if ((modulePackageName.startsWith(".") ||
|
if ((modulePackageName.startsWith(".") ||
|
||||||
modulePackageName.endsWith(".") ||
|
modulePackageName.endsWith(".") ||
|
||||||
|
Reference in New Issue
Block a user