feat: add mclogin command

This commit is contained in:
2024-10-11 20:49:32 +08:00
parent 2ac7d3b20b
commit 217364ffb8
13 files changed
+331 -4

No files matched your search

@@ -46,5 +46,6 @@ data class Config(
val cloudflareR2BucketName: String,
val cloudflareR2PublicUrl: String,
val apiSpaceKey: String,
val apiRtastKey: String
val apiRtastKey: String,
val azureAppClientId: String,
)
@@ -0,0 +1,19 @@
/*
* Copyright © 2024 RTAkland
* Author: RTAkland
* Date: 2024/10/11
*/
package cn.rtast.fancybot.entity.mc.oauth
import com.google.gson.annotations.SerializedName
data class DeviceCodeResponse(
@SerializedName("user_code")
val userCode: String,
@SerializedName("device_code")
val deviceCode: String,
@SerializedName("verification_uri")
val verificationUri: String
)
@@ -0,0 +1,28 @@
/*
* Copyright © 2024 RTAkland
* Author: RTAkland
* Date: 2024/10/11
*/
package cn.rtast.fancybot.entity.mc.oauth
import com.google.gson.annotations.SerializedName
data class LoginXboxLivePayload(
@SerializedName("Properties")
val properties: Properties,
@SerializedName("RelyingParty")
val relyingParty: String = "http://auth.xboxlive.com",
@SerializedName("TokenType")
val tokenType: String = "JWT",
) {
data class Properties(
@SerializedName("RpsTicket")
val rpsTicket: String,
@SerializedName("AuthMethod")
val authMethod: String = "RPS",
@SerializedName("SiteName")
val siteName: String = "user.auth.xboxlive.com",
)
}
@@ -0,0 +1,25 @@
/*
* Copyright © 2024 RTAkland
* Author: RTAkland
* Date: 2024/10/11
*/
package cn.rtast.fancybot.entity.mc.oauth
import com.google.gson.annotations.SerializedName
data class LoginXboxLiveResponse(
@SerializedName("Token")
val token: String,
@SerializedName("DisplayClaims")
val displayClaims: DisplayClaims,
) {
data class DisplayClaims(
val xui: List<XUI>
)
data class XUI(
val uhs: String
)
}
@@ -0,0 +1,26 @@
/*
* Copyright © 2024 RTAkland
* Author: RTAkland
* Date: 2024/10/11
*/
package cn.rtast.fancybot.entity.mc.oauth
import com.google.gson.annotations.SerializedName
data class ObtainXSTSPayload(
@SerializedName("Properties")
val properties: Properties,
@SerializedName("RelyingParty")
val relyingParty: String = "rp://api.minecraftservices.com/",
@SerializedName("TokenType")
val tokenType: String = "JWT",
) {
data class Properties(
@SerializedName("UserTokens")
val userTokens: List<String>,
@SerializedName("SandboxId")
val sandboxId: String = "RETAIL",
)
}
@@ -0,0 +1,18 @@
/*
* Copyright © 2024 RTAkland
* Author: RTAkland
* Date: 2024/10/11
*/
package cn.rtast.fancybot.entity.mc.oauth
import cn.rtast.fancybot.entity.mc.oauth.LoginXboxLiveResponse.DisplayClaims
import com.google.gson.annotations.SerializedName
data class ObtainXSTSResponse(
@SerializedName("Token")
val token: String,
@SerializedName("DisplayClaims")
val displayClaims: DisplayClaims,
)
@@ -0,0 +1,15 @@
/*
* Copyright © 2024 RTAkland
* Author: RTAkland
* Date: 2024/10/11
*/
package cn.rtast.fancybot.entity.mc.oauth
import com.google.gson.annotations.SerializedName
data class RedeemCodeResponse(
@SerializedName("access_token")
val accessToken: String,
)