This commit is contained in:
parent
10ed0dc703
commit
f818241731
@ -5,7 +5,4 @@ LABEL authors="Kane"
|
||||
|
||||
WORKDIR /opt
|
||||
ADD target/Mirai-bot-0.0.1-SNAPSHOT.jar /opt/Mirai-bot.jar
|
||||
ADD android_pad.json /opt/android_pad.json
|
||||
ADD device.json /opt/device.json
|
||||
ADD KFCFactory.json /opt/KFCFactory.json
|
||||
ENTRYPOINT java -jar /opt/Mirai-bot.jar
|
||||
|
@ -1,12 +0,0 @@
|
||||
{
|
||||
"9.0.56": {
|
||||
"base_url": "https://qsign.trpgbot.com",
|
||||
"type": "fuqiuluo/unidbg-fetch-qsign",
|
||||
"key": "114514"
|
||||
},
|
||||
"9.0.95": {
|
||||
"base_url": "https://qsign.trpgbot.com",
|
||||
"type": "fuqiuluo/unidbg-fetch-qsign",
|
||||
"key": "114514"
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
{
|
||||
"apk_id": "com.tencent.mobileqq",
|
||||
"app_id": 537220362,
|
||||
"sub_app_id": 537220362,
|
||||
"app_key": "0S200MNJT807V3GE",
|
||||
"sort_version_name": "9.0.56.16830",
|
||||
"build_time": 1713424357,
|
||||
"apk_sign": "a6b745bf24a2c277527716f6f36eb68d",
|
||||
"sdk_version": "6.0.0.2560",
|
||||
"sso_version": 21,
|
||||
"misc_bitmap": 150470524,
|
||||
"main_sig_map": 34869472,
|
||||
"sub_sig_map": 66560,
|
||||
"dump_time": 1713424357,
|
||||
"qua": "V1_AND_SQ_9.0.56_6372_YYB_D",
|
||||
"protocol_type": 6
|
||||
}
|
30
device.json
30
device.json
@ -1,30 +0,0 @@
|
||||
{
|
||||
"deviceInfoVersion": 3,
|
||||
"data": {
|
||||
"display": "MIRAI.056598.001",
|
||||
"product": "mirai",
|
||||
"device": "mirai",
|
||||
"board": "mirai",
|
||||
"brand": "mamoe",
|
||||
"model": "mirai",
|
||||
"bootloader": "unknown",
|
||||
"fingerprint": "mamoe/mirai/mirai:10/MIRAI.200122.001/9082187:user/release-keys",
|
||||
"bootId": "26692CCB-72A7-BF68-942E-0D435E0ACE47",
|
||||
"procVersion": "Linux version 3.0.31-8RRLhiT0 (android-build@xxx.xxx.xxx.xxx.com)",
|
||||
"baseBand": "",
|
||||
"version": {
|
||||
"incremental": "5891938",
|
||||
"release": "10",
|
||||
"codename": "REL"
|
||||
},
|
||||
"simInfo": "T-Mobile",
|
||||
"osType": "android",
|
||||
"macAddress": "02:00:00:00:00:00",
|
||||
"wifiBSSID": "02:00:00:00:00:00",
|
||||
"wifiSSID": "<unknown ssid>",
|
||||
"imsiMd5": "53763c791f940fddcb65d09ed3700272",
|
||||
"imei": "867739141234828",
|
||||
"apn": "wifi",
|
||||
"androidId": "aa28d5bd4d1d1822"
|
||||
}
|
||||
}
|
20
pom.xml
20
pom.xml
@ -53,6 +53,17 @@
|
||||
<name>HuaweiCloud</name>
|
||||
<url>https://mirrors.huaweicloud.com/repository/maven</url>
|
||||
</repository>
|
||||
<!-- Maven 官方仓库 -->
|
||||
<repository>
|
||||
<id>MavenOfficial</id>
|
||||
<name>MavenOfficial</name>
|
||||
<url>https://repo.maven.apache.org/maven2</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>MavenOfficial</id>
|
||||
<name>MavenOfficial</name>
|
||||
<url>https://repo.maven.apache.org/maven2</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
@ -109,9 +120,16 @@
|
||||
</dependency>
|
||||
|
||||
<!-- 核心 机器人 -->
|
||||
<!-- https://mvnrepository.com/artifact/top.mrxiaom.mirai/overflow-core -->
|
||||
<dependency>
|
||||
<groupId>top.mrxiaom.mirai</groupId>
|
||||
<artifactId>overflow-core</artifactId>
|
||||
<version>1.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.mamoe</groupId>
|
||||
<artifactId>mirai-core-jvm</artifactId>
|
||||
<artifactId>mirai-core-api-jvm</artifactId>
|
||||
<version>2.16.0</version>
|
||||
</dependency>
|
||||
|
||||
|
@ -2,15 +2,15 @@ package info.alinadace.miraibot.bean
|
||||
|
||||
import info.alinadace.miraibot.annotation.BotFunction
|
||||
import info.alinadace.miraibot.configuration.BotConfig
|
||||
import info.alinadace.miraibot.enums.LoginType
|
||||
import info.alinadace.miraibot.service.Service
|
||||
import kotlinx.coroutines.async
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import net.mamoe.mirai.Bot
|
||||
import net.mamoe.mirai.BotFactory
|
||||
import net.mamoe.mirai.auth.BotAuthorization
|
||||
import net.mamoe.mirai.event.Event
|
||||
import net.mamoe.mirai.utils.BotConfiguration
|
||||
import org.springframework.context.annotation.Bean
|
||||
import org.springframework.context.annotation.Configuration
|
||||
import top.mrxiaom.overflow.BotBuilder
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
/**
|
||||
@ -23,15 +23,13 @@ class BotConfiguration {
|
||||
|
||||
@Bean
|
||||
fun bot(config: BotConfig): Bot {
|
||||
return when (config.type) {
|
||||
LoginType.PASSWORD -> BotFactory.newBot(config.id, config.password) {
|
||||
extracted()
|
||||
}
|
||||
|
||||
LoginType.QRCODE -> BotFactory.newBot(config.id, BotAuthorization.byQRCode()) {
|
||||
extracted()
|
||||
val connect = runBlocking {
|
||||
val bot = async {
|
||||
BotBuilder.positive(config.ws).token(config.token).connect() ?: throw Exception("Bot connect failed")
|
||||
}
|
||||
bot.await()
|
||||
}
|
||||
return connect
|
||||
}
|
||||
|
||||
@Bean("functionMap")
|
||||
|
@ -15,18 +15,31 @@ class BotConfig {
|
||||
/**
|
||||
* 机器人QQ号
|
||||
*/
|
||||
@Deprecated(message = "内部认证已失效")
|
||||
final var id: Long = 0L
|
||||
|
||||
/**
|
||||
* 机器人密码
|
||||
*/
|
||||
@Deprecated(message = "内部认证已失效")
|
||||
final var password: String = ""
|
||||
|
||||
/**
|
||||
* 机器人登录方式
|
||||
*/
|
||||
@Deprecated(message = "内部认证已失效")
|
||||
final var type: LoginType = LoginType.PASSWORD
|
||||
|
||||
/**
|
||||
* 机器人ws地址
|
||||
*/
|
||||
final var ws: String = ""
|
||||
|
||||
/**
|
||||
* 机器人token
|
||||
*/
|
||||
final var token: String = ""
|
||||
|
||||
/**
|
||||
* 管理员QQ
|
||||
*/
|
||||
@ -34,10 +47,13 @@ class BotConfig {
|
||||
|
||||
constructor()
|
||||
|
||||
constructor(id: Long, password: String, type: LoginType, admin: Long) {
|
||||
constructor(id: Long, password: String, type: LoginType, ws: String, token: String, admin: Long) {
|
||||
this.id = id
|
||||
this.password = password
|
||||
this.type = type
|
||||
this.ws = ws
|
||||
this.token = token
|
||||
this.admin = admin
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user