Skip to content

Commit

Permalink
build: 2.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
cssxsh committed Nov 9, 2022
1 parent af97554 commit 398c6d5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 29 deletions.
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ plugins {
kotlin("jvm") version "1.7.20"
kotlin("plugin.serialization") version "1.7.20"

id("net.mamoe.mirai-console") version "2.13.0-RC2"
id("net.mamoe.mirai-console") version "2.13.0"
id("me.him188.maven-central-publish") version "1.0.0-dev-3"
id("me.him188.kotlin-jvm-blocking-bridge") version "2.2.0-172.1"
}

group = "xyz.cssxsh.mirai"
version = "2.2.3"
version = "2.2.4"

mavenCentralPublish {
useCentralS01()
Expand Down Expand Up @@ -39,7 +39,7 @@ dependencies {
// test
testImplementation(kotlin("test"))
testImplementation("org.slf4j:slf4j-simple:2.0.3")
testImplementation("net.mamoe:mirai-logging-slf4j:2.13.0-RC2")
testImplementation("net.mamoe:mirai-logging-slf4j:2.13.0")
testImplementation("org.icepear.echarts:echarts-java:1.0.7")
testCompileOnly("org.projectlombok:lombok:1.18.24")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,31 +68,6 @@ public object MiraiSeleniumLoginSolver : LoginSolver(), BotConfigurationAlterer
}
}

@Deprecated(
"Please use onSolveDeviceVerification instead",
replaceWith = ReplaceWith("onSolveDeviceVerification(bot, url, null)"),
level = DeprecationLevel.WARNING
)
override suspend fun onSolveUnsafeDeviceLoginVerify(bot: Bot, url: String): String? {
val start = System.currentTimeMillis()
val timeout = System.getProperty(TIMEOUT_PROPERTY)?.toLong() ?: 600_000L

return useRemoteWebDriver(DriverConfig) { driver ->
driver.setDeviceMetrics(400, 700, 0, true)
driver.get(url)
driver.executeScript("""return alert("处理完成后请关闭所有窗口")""")

while (coroutineContext.isActive) {
if (driver.windowHandles.isNullOrEmpty()) break
delay(1000)

if (System.currentTimeMillis() - start > timeout) break
}

null
}
}

override fun alterConfiguration(botId: Long, configuration: BotConfiguration): BotConfiguration {
configuration.loginSolver = this

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public object MiraiSeleniumPlugin : KotlinPlugin(
JvmPluginDescription(
id = "xyz.cssxsh.mirai.plugin.mirai-selenium-plugin",
name = "mirai-selenium-plugin",
version = "2.2.3",
version = "2.2.4",
) {
author("cssxsh")
}
Expand Down Expand Up @@ -166,5 +166,6 @@ public object MiraiSeleniumPlugin : KotlinPlugin(
SeleniumCommand.unregister()
destroy(enable = false)
clear()
cancel("mirai-selenium-plugin on disable")
}
}

0 comments on commit 398c6d5

Please sign in to comment.