mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-06 02:35:40 +08:00
Fix Windows Build Fail Error
This commit is contained in:
@@ -162,24 +162,29 @@ class YukiHookXposedProcessor : SymbolProcessorProvider {
|
|||||||
environment {
|
environment {
|
||||||
if (codePath.isBlank()) error(msg = "Project CodePath not available")
|
if (codePath.isBlank()) error(msg = "Project CodePath not available")
|
||||||
if (sourcePath.isBlank()) error(msg = "Project SourcePath not available")
|
if (sourcePath.isBlank()) error(msg = "Project SourcePath not available")
|
||||||
val projectPath = when (File.separator) {
|
val separator = when {
|
||||||
"\\" -> sourcePath.replace("/", "\\")
|
codePath.contains("\\") -> "\\"
|
||||||
"/" -> sourcePath.replace("\\", "/")
|
codePath.contains("/") -> "/"
|
||||||
|
else -> kotlin.error("Unix File Separator unknown")
|
||||||
|
}
|
||||||
|
val projectPath = when {
|
||||||
|
codePath.contains("\\") -> sourcePath.replace("/", "\\")
|
||||||
|
codePath.contains("/") -> sourcePath.replace("\\", "/")
|
||||||
else -> kotlin.error("Unix File Separator unknown")
|
else -> kotlin.error("Unix File Separator unknown")
|
||||||
}.let {
|
}.let {
|
||||||
if (codePath.contains(it))
|
if (codePath.contains(it))
|
||||||
codePath.split(it)[0] + it
|
codePath.split(it)[0] + it
|
||||||
else error(msg = "Project Source Path \"$it\" not matched")
|
else error(msg = "Project Source Path \"$it\" not matched")
|
||||||
}
|
}
|
||||||
File("$projectPath${File.separator}assets").also { assFile ->
|
File("$projectPath${separator}assets").also { assFile ->
|
||||||
if (File("$projectPath${File.separator}AndroidManifest.xml").exists()) {
|
if (File("$projectPath${separator}AndroidManifest.xml").exists()) {
|
||||||
if (!assFile.exists() || !assFile.isDirectory) {
|
if (!assFile.exists() || !assFile.isDirectory) {
|
||||||
assFile.delete()
|
assFile.delete()
|
||||||
assFile.mkdirs()
|
assFile.mkdirs()
|
||||||
}
|
}
|
||||||
File("${assFile.absolutePath}${File.separator}xposed_init")
|
File("${assFile.absolutePath}${separator}xposed_init")
|
||||||
.writeText(text = "$packageName.$className$xposedClassShortName")
|
.writeText(text = "$packageName.$className$xposedClassShortName")
|
||||||
File("${assFile.absolutePath}${File.separator}yukihookapi_init")
|
File("${assFile.absolutePath}${separator}yukihookapi_init")
|
||||||
.writeText(text = "$packageName.$className")
|
.writeText(text = "$packageName.$className")
|
||||||
} else error(msg = "Project Source Path \"$sourcePath\" verify failed! Is this an Android Project?")
|
} else error(msg = "Project Source Path \"$sourcePath\" verify failed! Is this an Android Project?")
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user