mirror of
https://github.com/whitechi73/OpenShamrock.git
synced 2024-08-14 13:12:17 +08:00
parent
02626489eb
commit
a3171b3111
@ -1,3 +1,5 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
id("com.android.library")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
@ -42,4 +44,8 @@ dependencies {
|
||||
implementation(project(":annotations"))
|
||||
|
||||
ksp(project(":processor"))
|
||||
}
|
||||
|
||||
tasks.withType<KotlinCompile>().configureEach {
|
||||
kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
|
||||
}
|
@ -1,3 +1,5 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
id("com.android.library")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
@ -99,4 +101,6 @@ dependencies {
|
||||
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
|
||||
}
|
||||
|
||||
|
||||
tasks.withType<KotlinCompile>().configureEach {
|
||||
kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
|
||||
}
|
@ -1,9 +1,12 @@
|
||||
package moe.fuqiuluo.qqinterface.servlet
|
||||
|
||||
import com.tencent.guild.api.transfile.IGuildTransFileApi
|
||||
import com.tencent.mobileqq.app.QQAppInterface
|
||||
import com.tencent.mobileqq.pskey.oidb.cmd0x102a.oidb_cmd0x102a
|
||||
import com.tencent.mobileqq.qroute.QRoute
|
||||
import io.ktor.client.request.get
|
||||
import io.ktor.client.request.header
|
||||
import moe.fuqiuluo.shamrock.remote.service.data.BigDataTicket
|
||||
import moe.fuqiuluo.shamrock.tools.GlobalClientNoRedirect
|
||||
import moe.fuqiuluo.shamrock.tools.slice
|
||||
import mqq.app.MobileQQ
|
||||
@ -73,6 +76,14 @@ internal object TicketSvc: BaseSvc() {
|
||||
return "uin=o$uin; skey=$skey; p_uin=o$uin; p_skey=$pskey; pt4_token=$pt4token"
|
||||
}
|
||||
|
||||
fun getBigdataTicket(): BigDataTicket? {
|
||||
return runCatching {
|
||||
QRoute.api(IGuildTransFileApi::class.java).bigDataTicket?.let {
|
||||
BigDataTicket(it.getSessionKey(), it.getSessionSig())
|
||||
}
|
||||
}.getOrNull()
|
||||
}
|
||||
|
||||
fun getCSRF(pskey: String = getPSKey(getUin())): String {
|
||||
if (pskey.isEmpty()) {
|
||||
return "0"
|
||||
@ -86,7 +97,7 @@ internal object TicketSvc: BaseSvc() {
|
||||
|
||||
suspend fun getCSRF(uin: String, domain: String): String {
|
||||
// 是不是要用Skey?
|
||||
return getBkn(getPSKey(uin, domain) ?: "")
|
||||
return getBkn(getPSKey(uin, domain) ?: getSKey(uin))
|
||||
}
|
||||
|
||||
fun getBkn(arg: String): String {
|
||||
|
@ -4,6 +4,6 @@ import moe.fuqiuluo.qqinterface.servlet.BaseSvc
|
||||
|
||||
internal object LightAppSvc: BaseSvc() {
|
||||
suspend fun adaptShare() {
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -1,12 +1,9 @@
|
||||
package moe.fuqiuluo.shamrock.remote.action.handlers
|
||||
|
||||
import com.tencent.guild.api.transfile.IGuildTransFileApi
|
||||
import com.tencent.mobileqq.qroute.QRoute
|
||||
import kotlinx.serialization.json.JsonElement
|
||||
import moe.fuqiuluo.qqinterface.servlet.TicketSvc
|
||||
import moe.fuqiuluo.shamrock.remote.action.ActionSession
|
||||
import moe.fuqiuluo.shamrock.remote.action.IActionHandler
|
||||
import moe.fuqiuluo.shamrock.remote.service.data.BigDataTicket
|
||||
import moe.fuqiuluo.shamrock.remote.service.data.Credentials
|
||||
import moe.fuqiuluo.shamrock.tools.EmptyJsonString
|
||||
import moe.fuqiuluo.symbols.OneBotHandler
|
||||
@ -22,18 +19,14 @@ internal object GetCookies: IActionHandler() {
|
||||
operator fun invoke(echo: JsonElement = EmptyJsonString): String {
|
||||
return ok(Credentials(
|
||||
cookie = TicketSvc.getCookie(),
|
||||
bigDataTicket = QRoute.api(IGuildTransFileApi::class.java).bigDataTicket?.let {
|
||||
BigDataTicket(it.sessionKey, it.sessionSig)
|
||||
}
|
||||
bigDataTicket = TicketSvc.getBigdataTicket()
|
||||
), echo)
|
||||
}
|
||||
|
||||
suspend operator fun invoke(domain: String, echo: JsonElement = EmptyJsonString): String {
|
||||
return ok(Credentials(
|
||||
cookie = TicketSvc.getCookie(domain),
|
||||
bigDataTicket = QRoute.api(IGuildTransFileApi::class.java).bigDataTicket?.let {
|
||||
BigDataTicket(it.sessionKey, it.sessionSig)
|
||||
}
|
||||
bigDataTicket = TicketSvc.getBigdataTicket()
|
||||
), echo)
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user