Commit 4ca18848 authored by Him188's avatar Him188

Update pom.xml

parent f2ddcb7e
package net.mamoe.mirai;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
......@@ -33,10 +32,6 @@ public class MiraiAPI {
MiraiMain.main(args);
}
public static void setLogger(PrintStream stream){
MiraiServer.getInstance().getLogger().setOutPutStream(stream);
}
public static String getMiraiVersion(){
return MiraiServer.MIRAI_VERSION;
}
......
......@@ -26,19 +26,6 @@
<systemPath>${project.basedir}/lib/jpcap.jar</systemPath>
</dependency>
<dependency>
<groupId>org.pcap4j</groupId>
<artifactId>pcap4j-core</artifactId>
<version>1.8.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.pcap4j</groupId>
<artifactId>pcap4j-packetfactory-static</artifactId>
<version>1.8.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
......@@ -92,13 +79,6 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
......@@ -113,19 +93,6 @@
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>net.mamoe.mirai.MiraiMain</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
......
......@@ -116,10 +116,6 @@ public final class Bot implements Closeable {
this.contacts.qqs.clear();
}
public void addFriend(long qq) {
}
/* PRIVATE */
private static final AtomicInteger _id = new AtomicInteger(0);
......
......@@ -287,6 +287,7 @@ internal class BotNetworkHandlerImpl(private val bot: Bot) : BotNetworkHandler {
is ServerLoginResponseFailedPacket -> {
socket.loginFuture?.complete(packet.loginState)
bot.close()
return
}
......
......@@ -18,7 +18,7 @@ object Protocol {
//add("183.60.56.29")
arrayOf(
//"sz3.tencent.com",
"sz3.tencent.com",
"sz4.tencent.com",
"sz5.tencent.com",
"sz6.tencent.com",
......
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import net.mamoe.mirai.Bot
import net.mamoe.mirai.network.packet.login.LoginState
import net.mamoe.mirai.utils.BotAccount
import net.mamoe.mirai.utils.Console
import java.util.*
import java.util.concurrent.TimeUnit
/**
* 筛选掉无法登录(冻结/设备锁/UNKNOWN)的 qq
......@@ -64,28 +66,36 @@ val qqList = "2535777366----abc123456\n" +
"2534037598----abc123456\n"
fun main() {
suspend fun main() {
val goodBotList = Collections.synchronizedList(mutableListOf<Bot>())
qqList.split("\n").forEach {
GlobalScope.launch {
val strings = it.split("----")
val bot = Bot(BotAccount(strings[0].toLong(), strings[1].let { password ->
if (password.endsWith(".")) {
return@let password.substring(0, password.length - 1)
}
return@let password
}), Console())
withContext(Dispatchers.Default) {
qqList.split("\n")
.filterNot { it.isEmpty() }
.map { it.split("----") }
.map { Pair(it[0].toLong(), it[1]) }
.forEach { (qq, password) ->
launch {
val bot = Bot(
BotAccount(
qq,
if (password.endsWith(".")) password.substring(0, password.length - 1) else password
),
Console()
)
bot.network.tryLogin().whenComplete { state, _ ->
withContext(Dispatchers.IO) {
bot.network.tryLogin().get(3, TimeUnit.MILLISECONDS)
}.let { state ->
if (!(state == LoginState.BLOCKED || state == LoginState.DEVICE_LOCK || state == LoginState.WRONG_PASSWORD)) {
goodBotList.add(bot)
} else {
}
}
}
}
}
Thread.sleep(9 * 3000)
println(goodBotList.joinToString("\n") { it.account.qqNumber.toString() + " " + it.account.password })
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment