59 Commits

Author SHA1 Message Date
4f1d19fcbd upgrade kotlin version to 1.9.22 2024-02-24 16:25:31 +08:00
9a85e4d537 replace all group_id and user_id to Long 2024-02-24 16:25:31 +08:00
fac92d8094 Merge remote-tracking branch 'origin/master' 2024-02-24 12:32:02 +08:00
605f58da47 Shamrock: Using the NT kernel to upload resources
Signed-off-by: 白池 <whitechi73@outlook.com>
2024-02-24 12:31:51 +08:00
d22f3ad1cb send_forward_msg(support at face...) 2024-02-24 02:14:56 +08:00
46ed966c18 Shamrock: recommend Lagrange
Signed-off-by: 白池 <whitechi73@outlook.com>
2024-02-24 01:01:41 +08:00
623dc5da07 Shamrock: fix all multimedia pic fetch
Signed-off-by: 白池 <whitechi73@outlook.com>
2024-02-24 00:34:28 +08:00
bd6d4f046c Shamrock: Remove rkey cache
Signed-off-by: 白池 <whitechi73@outlook.com>
2024-02-23 20:52:44 +08:00
9ad66f2f92 Shamrock: fix #251
Signed-off-by: 白池 <whitechi73@outlook.com>
2024-02-23 19:33:36 +08:00
b4c40e236a Shamrock: 快速序列化/反序列化 Protobuf
Signed-off-by: 白池 <whitechi73@outlook.com>
2024-02-23 18:23:02 +08:00
9bbcc2f160 Shamrock: 允许私聊接收multimedia资源图片 #251
Signed-off-by: 白池 <whitechi73@outlook.com>
2024-02-23 14:17:52 +08:00
00b355b877 Shamrock: fix #248
Signed-off-by: 白池 <whitechi73@outlook.com>
2024-02-23 08:36:34 +08:00
071ddbb69a Shamrock: update LICENSE
Signed-off-by: 白池 <whitechi73@outlook.com>
2024-02-22 18:13:55 +08:00
4d5c054bc4 Shamrock: 开源开发许可证
Signed-off-by: 白池 <whitechi73@outlook.com>
2024-02-22 18:12:31 +08:00
87629666f2 refactor send_forward_msg(暂时只支持收发文字消息) 2024-02-22 01:04:56 +08:00
75633f78c4 Shamrock: fix #248
Signed-off-by: 白池 <whitechi73@outlook.com>
2024-02-21 21:31:59 +08:00
c940aea153 Shamrock: Reusable and restrictive coroutine context
Signed-off-by: 白池 <whitechi73@outlook.com>
2024-02-21 15:17:53 +08:00
18126b1fda fix bug 2024-02-21 02:16:47 +08:00
e9884a5fa8 fix bug(暂未完成 请勿使用) 2024-02-21 02:16:47 +08:00
aa7b241dba refactor send_forward_msg(暂未完成 请勿使用) 2024-02-21 02:16:46 +08:00
c70f3eabfe Shamrock: typo BaseTransmitServlet.kt
Signed-off-by: 白池 <whitechi73@outlook.com>
2024-02-19 11:30:22 +08:00
1c65aab673 refactor send_forward_msg(暂未完成 请勿使用) 2024-02-19 04:14:26 +08:00
a5cdd64686 upgrade workflow 2024-02-19 04:13:50 +08:00
b07ca5bd03 fix linq 2024-02-19 04:13:49 +08:00
8f8580d542 Shamrock: remove debug log #242
Signed-off-by: 白池 <whitechi73@outlook.com>
2024-02-18 21:16:23 +08:00
0ed4480878 Shamrock: fix #242 2024-02-18 21:16:04 +08:00
c3e0031aa4 Shamrock: debug #242 2024-02-18 20:36:42 +08:00
388c963e88 Shamrock: fix markdown parser 2024-02-18 20:28:45 +08:00
4283651b1e Shamrock: fix comm_elem parser 2024-02-18 20:08:57 +08:00
50d7dfa06d Shamrock: support inline_keyboard msg 2024-02-18 20:00:37 +08:00
b3a2e605fb Shamrock: fix NT image acquisition 2024-02-18 18:52:56 +08:00
14bf5fc0a2 Shamrock: fix fakeReceiveSelfMsg 2024-02-18 07:51:43 +08:00
2c8b57a7dc Shamrock: fix #238 2024-02-18 07:45:48 +08:00
8e6c167987 Shamrock: fix #236 2024-02-18 07:37:47 +08:00
2c8094c8c8 Shamrock: 临时修补rkey缺失导致的qqnt图片无法获取 #236 2024-02-17 19:39:26 +08:00
62385d6f62 Shamrock: 修复合并转发获取图片错误 #236 2024-02-17 15:43:12 +08:00
3b210d7ed0 Shamrock: fix #236 2024-02-17 09:37:01 +08:00
63ce2d40bd Shamrock: fix get role by nt crash 2024-02-16 10:50:00 +08:00
36f8b6e54b Shamrock: Change the image upload source to a camera 2024-02-16 09:50:31 +08:00
58413044e9 Shamrock: typo log 2024-02-16 09:16:05 +08:00
3395cd9d95 Shamrock: 支持群临时消息推送携带群号以及群名称 2024-02-16 09:12:45 +08:00
494b1f1fd0 Shamrock: 允许禁止QQ启动无关紧要的进程服务 2024-02-16 00:09:35 +08:00
cf943fd13a Shamrock: atメッセージ優先nameパラメータ 2024-02-15 13:18:43 +08:00
9608b46799 Shamrock: 是正メッセージプッシュアイデンティティの取得が遅い 2024-02-15 13:14:37 +08:00
502956e3ec Shamrock: エイト・メッセージにニックネームの迅速なクエリを許可する 2024-02-15 13:01:34 +08:00
27b4c26da7 Shamrock: fix GlobalEventTransmitter x2 2024-02-11 14:28:07 +08:00
65f54360f8 Shamrock: not fix GlobalEventTransmitter x2 2024-02-11 14:06:10 +08:00
9a9fad975f Shamrock: not fix GlobalEventTransmitter 2024-02-11 13:57:58 +08:00
7153b21cd4 Shamrock: fix GlobalEventTransmitter 2024-02-11 13:42:28 +08:00
fdb2486090 Shamrock: Disable lost connection detection 2024-02-10 00:41:38 +08:00
d60b2a25d1 Update SECURITY.md 2024-02-09 08:04:40 +08:00
2d8dde6951 add history msg to database 2024-02-08 23:52:21 +08:00
78fd60dade Merge pull request #228 from Mythologyli/master
feat: get group applier uin from request msg
2024-02-08 22:34:40 +08:00
80dbf6af28 feat: get group applier uin from request msg 2024-02-08 22:27:55 +08:00
1e53753b5a Shamrock: fix #227 2024-02-08 20:17:51 +08:00
e727877268 Merge pull request #225 from MrXiaoM/fix-guild-message
修复 频道消息事件不符合 go-cqhttp 规范
2024-02-08 20:16:01 +08:00
63b69df3ea fix missing guild_id and channel_id 2024-02-08 14:51:14 +08:00
b03e02675b Shamrock: add timeout #223 2024-02-05 22:16:12 +08:00
e68a1ffd37 Shamrock: fix guild sync 2024-02-05 22:12:20 +08:00
216 changed files with 6190 additions and 2020 deletions

BIN
.github/jetbrains-variant-3.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

View File

@ -22,13 +22,13 @@ jobs:
fetch-depth: 0 fetch-depth: 0
- name: Setup JDK 17 - name: Setup JDK 17
uses: actions/setup-java@v4.0.0 uses: actions/setup-java@v4
with: with:
java-version: 17 java-version: 17
distribution: "adopt" distribution: "adopt"
- name: Cache Gradle Dependencies - name: Cache Gradle Dependencies
uses: actions/cache@v3 uses: actions/cache@v4
with: with:
path: | path: |
~/.gradle/caches ~/.gradle/caches
@ -38,7 +38,7 @@ jobs:
restore-keys: gradle-deps restore-keys: gradle-deps
- name: Cache Gradle Build - name: Cache Gradle Build
uses: actions/cache@v3 uses: actions/cache@v4
with: with:
path: | path: |
~/.gradle/caches/build-cache-* ~/.gradle/caches/build-cache-*
@ -82,19 +82,19 @@ jobs:
echo "|x86_64|$x86_64" >> $GITHUB_STEP_SUMMARY echo "|x86_64|$x86_64" >> $GITHUB_STEP_SUMMARY
- name: Upload ALL APK RELEASE - name: Upload ALL APK RELEASE
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: "${{ env.SHAMROCK_VERSION_ALL }}" name: "${{ env.SHAMROCK_VERSION_ALL }}"
path: "${{ env.APK_FILE_ALL }}" path: "${{ env.APK_FILE_ALL }}"
- name: Upload ARM64 APK RELEASE - name: Upload ARM64 APK RELEASE
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: "${{ env.SHAMROCK_VERSION_ARM64 }}" name: "${{ env.SHAMROCK_VERSION_ARM64 }}"
path: "${{ env.APK_FILE_ARM64 }}" path: "${{ env.APK_FILE_ARM64 }}"
- name: Upload X86_64 APK RELEASE - name: Upload X86_64 APK RELEASE
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: "${{ env.SHAMROCK_VERSION_x86_64 }}" name: "${{ env.SHAMROCK_VERSION_x86_64 }}"
path: "${{ env.APK_FILE_X86_64 }}" path: "${{ env.APK_FILE_X86_64 }}"

View File

@ -29,6 +29,7 @@
- 一键移植:本项目基于 go-cqhttp 的文档进行开发实现。 - 一键移植:本项目基于 go-cqhttp 的文档进行开发实现。
- 平行部署:可多平台部署,未来将会支持 Docker 部署的教程。 - 平行部署:可多平台部署,未来将会支持 Docker 部署的教程。
- 替代方案:[Lagrange.Core](https://github.com/LagrangeDev/Lagrange.Core)
## 权限声明 ## 权限声明
@ -46,13 +47,19 @@
<img src="https://github.com/whitechi73/OpenShamrock/assets/98259561/f04d60bc-ec40-41fc-bc15-62c146f1a1f1" width="160px" alt="Shamrock"> **我可爱吗?欢迎你的到来,这里是一个很大的地方,有着无限可能,主要是有你啦!** <img src="https://github.com/whitechi73/OpenShamrock/assets/98259561/f04d60bc-ec40-41fc-bc15-62c146f1a1f1" width="160px" alt="Shamrock"> **我可爱吗?欢迎你的到来,这里是一个很大的地方,有着无限可能,主要是有你啦!**
## 鸣谢
感谢[**JetBrains**](https://www.jetbrains.com/zh-cn/community/opensource/#support)提供的开源开发许可证JetBrains 通过为核心项目贡献者免费提供一套一流的开发者工具来支持非商业开源项目。
[<img src=".github/jetbrains-variant-3.png" width="200"/>](https://www.jetbrains.com/zh-cn/community/opensource/#support)
## 开源协议 ## 开源协议
本项目使用 [GPL-3.0](LICENSE) 协议开放源代码 本项目使用 [GPL-3.0](LICENSE) 协议开放源代码
```text ```text
Shamrock - OneBot standard QQ robot framework based on Xposed implementation Shamrock - OneBot standard QQ robot framework based on Xposed implementation
Copyright (C) 2023 Shamrock Team Copyright (C) 2023 ~ 2024 Shamrock Team
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
@ -102,3 +109,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
[contrib-image]: https://contrib.rocks/image?repo=whitechi73/OpenShamrock [contrib-image]: https://contrib.rocks/image?repo=whitechi73/OpenShamrock
[contrib-link]: https://github.com/whitechi73/OpenShamrock/graphs/contributors [contrib-link]: https://github.com/whitechi73/OpenShamrock/graphs/contributors

View File

@ -1,11 +1,19 @@
# Security Policy # Security Policy
## Support Version ## 支持的版本
| Version | Supported | | 版本 | 支持状态 |
| ------- | ------------------ | | ------- | ------------------ |
| 9.0.15 | :white_check_mark: |
| 8.9.75 | :white_check_mark: | | 8.9.75 | :white_check_mark: |
| 8.9.73 | :white_check_mark: | | 8.9.73 | :white_check_mark: |
| 8.9.98 | :white_check_mark: | | 8.9.98 | :white_check_mark: |
| < 8.9.68| :x: | | < 8.9.68| :x: |
## 频道支持性说明
如果需要使用`频道`相关功能请升级QQ到9.0.8版本
## Riru检测问题
QQ自`9.0.8`开始将会检测riru可能作为封号因素

View File

@ -7,3 +7,8 @@ java {
sourceCompatibility = JavaVersion.VERSION_17 sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17
} }
dependencies {
implementation(DEPENDENCY_PROTOBUF)
implementation(kotlinx("serialization-protobuf", "1.6.2"))
}

View File

@ -0,0 +1,12 @@
package moe.fuqiuluo.symbols
import kotlinx.serialization.decodeFromByteArray
import kotlinx.serialization.protobuf.ProtoBuf
import kotlin.reflect.KClass
interface Protobuf<T: Protobuf<T>>
inline fun <reified T: Protobuf<T>> ByteArray.decodeProtobuf(to: KClass<T>? = null): T {
return ProtoBuf.decodeFromByteArray(this)
}

View File

@ -17,7 +17,7 @@ android {
minSdk = 27 minSdk = 27
targetSdk = 34 targetSdk = 34
versionCode = getVersionCode() versionCode = getVersionCode()
versionName = "1.0.8" + ".r${getGitCommitCount()}." + getVersionName() versionName = "1.0.9" + ".r${getGitCommitCount()}." + getVersionName()
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables { vectorDrawables {
@ -92,7 +92,7 @@ android {
compose = true compose = true
} }
composeOptions { composeOptions {
kotlinCompilerExtensionVersion = "1.5.4" kotlinCompilerExtensionVersion = "1.5.10"
} }
packaging { packaging {
jniLibs { jniLibs {
@ -127,11 +127,6 @@ android {
} }
configureAppSigningConfigsForRelease(project) configureAppSigningConfigsForRelease(project)
packagingOptions {
jniLibs {
useLegacyPackaging = true
}
}
} }
fun configureAppSigningConfigsForRelease(project: Project) { fun configureAppSigningConfigsForRelease(project: Project) {

View File

@ -39,7 +39,6 @@ add_library(${CMAKE_PROJECT_NAME} SHARED
md5.cpp md5.cpp
cqcode.cpp cqcode.cpp
silk.cpp silk.cpp
group_honor.cpp
message.cpp message.cpp
shamrock.cpp) shamrock.cpp)

View File

@ -229,6 +229,16 @@ object ShamrockConfig {
return preferences.getBoolean("anti_qq_trace", true) return preferences.getBoolean("anti_qq_trace", true)
} }
fun isForbidUselessProcess(ctx: Context): Boolean {
val preferences = ctx.getSharedPreferences("config", 0)
return preferences.getBoolean("forbid_useless_process", false)
}
fun setForbidUselessProcess(ctx: Context, v: Boolean) {
val preferences = ctx.getSharedPreferences("config", 0)
preferences.edit().putBoolean("forbid_useless_process", v).apply()
}
fun setAntiTrace(ctx: Context, v: Boolean) { fun setAntiTrace(ctx: Context, v: Boolean) {
val preferences = ctx.getSharedPreferences("config", 0) val preferences = ctx.getSharedPreferences("config", 0)
preferences.edit().putBoolean("anti_qq_trace", v).apply() preferences.edit().putBoolean("anti_qq_trace", v).apply()
@ -289,6 +299,16 @@ object ShamrockConfig {
return preferences.getBoolean("enable_self_msg", false) return preferences.getBoolean("enable_self_msg", false)
} }
fun enableOldBDH(ctx: Context): Boolean {
val preferences = ctx.getSharedPreferences("config", 0)
return preferences.getBoolean("enable_old_bdh", false)
}
fun setEnableOldBDH(ctx: Context, v: Boolean) {
val preferences = ctx.getSharedPreferences("config", 0)
preferences.edit().putBoolean("enable_old_bdh", v).apply()
}
fun enableSyncMsgAsSentMsg(ctx: Context): Boolean { fun enableSyncMsgAsSentMsg(ctx: Context): Boolean {
val preferences = ctx.getSharedPreferences("config", 0) val preferences = ctx.getSharedPreferences("config", 0)
return preferences.getBoolean("enable_sync_msg_as_sent_msg", false) return preferences.getBoolean("enable_sync_msg_as_sent_msg", false)
@ -324,7 +344,6 @@ object ShamrockConfig {
"inject_packet" to preferences.getBoolean("inject_packet", false), "inject_packet" to preferences.getBoolean("inject_packet", false),
"debug" to preferences.getBoolean("debug", false), "debug" to preferences.getBoolean("debug", false),
"anti_qq_trace" to preferences.getBoolean("anti_qq_trace", true), "anti_qq_trace" to preferences.getBoolean("anti_qq_trace", true),
//"auto_clear" to preferences.getBoolean("auto_clear", false),
"ssl_private_pwd" to preferences.getString("ssl_private_pwd", ""), "ssl_private_pwd" to preferences.getString("ssl_private_pwd", ""),
"key_store" to preferences.getString("key_store", ""), "key_store" to preferences.getString("key_store", ""),
"enable_self_msg" to preferences.getBoolean("enable_self_msg", false), "enable_self_msg" to preferences.getBoolean("enable_self_msg", false),
@ -333,6 +352,8 @@ object ShamrockConfig {
"alive_reply" to preferences.getBoolean("alive_reply", false), "alive_reply" to preferences.getBoolean("alive_reply", false),
"enable_sync_msg_as_sent_msg" to preferences.getBoolean("enable_sync_msg_as_sent_msg", false), "enable_sync_msg_as_sent_msg" to preferences.getBoolean("enable_sync_msg_as_sent_msg", false),
"disable_auto_sync_setting" to preferences.getBoolean("disable_auto_sync_setting", false), "disable_auto_sync_setting" to preferences.getBoolean("disable_auto_sync_setting", false),
"forbid_useless_process" to preferences.getBoolean("forbid_useless_process", false),
"enable_old_bdh" to preferences.getBoolean("enable_old_bdh", false),
) )
} }

View File

@ -100,17 +100,16 @@ fun LabFragment() {
thickness = 0.2.dp thickness = 0.2.dp
) )
/*
Function( Function(
title = "自动清理QQ垃圾", title = "禁止无用进程",
desc = "也许会导致奇怪的问题(无效)。", desc = "禁止QQ生成无用进程浪费内存可能造成部分功能闪退。",
descColor = color, descColor = color,
isSwitch = ShamrockConfig.isAutoClean(ctx) isSwitch = ShamrockConfig.isForbidUselessProcess(ctx)
) { ) {
ShamrockConfig.setAutoClean(ctx, it) ShamrockConfig.setForbidUselessProcess(ctx, it)
ShamrockConfig.pushUpdate(ctx) ShamrockConfig.pushUpdate(ctx)
return@Function false return@Function true
}*/ }
Function( Function(
title = "自回复测试", title = "自回复测试",
@ -222,7 +221,7 @@ fun LabFragment() {
}.onSuccess { }.onSuccess {
Function( Function(
title = "反检测加强", title = "反检测加强",
desc = "可能导致某些设备频繁闪退", desc = "可能导致某些设备频繁闪退,将拦截环境包上报。",
descColor = color, descColor = color,
isSwitch = it.getBoolean("super_anti", false) isSwitch = it.getBoolean("super_anti", false)
) { v -> ) { v ->
@ -296,17 +295,16 @@ fun LabFragment() {
return@Function true return@Function true
} }
/*
Function( Function(
title = "使用纯数字ECHO", title = "启用旧版资源上传系统",
desc = "在部分强类型语言框架,需要打开开关。", desc = "如果NT内核无法上传资源打开开关。",
descColor = it, descColor = it,
isSwitch = ShamrockConfig.isEchoNumber(ctx) isSwitch = ShamrockConfig.enableOldBDH(ctx)
) { ) {
ShamrockConfig.setEchoNumber(ctx, it) ShamrockConfig.setEnableOldBDH(ctx, it)
ShamrockConfig.pushUpdate(ctx) ShamrockConfig.pushUpdate(ctx)
return@Function true return@Function true
}*/ }
} }
} }
} }

View File

@ -1,6 +1,6 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules. // Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins { plugins {
id("com.android.application") version "8.2.0" apply false id("com.android.application") version "8.2.0" apply false
id("org.jetbrains.kotlin.android") version "1.9.20" apply false id("org.jetbrains.kotlin.android") version "1.9.22" apply false
id("com.android.library") version "8.2.0" apply false id("com.android.library") version "8.2.0" apply false
} }

View File

@ -1,6 +1,7 @@
plugins { plugins {
kotlin("jvm") kotlin("jvm")
id("com.google.devtools.ksp") version "1.9.21-1.0.15" id("com.google.devtools.ksp") version "1.9.21-1.0.15"
kotlin("plugin.serialization") version "1.9.21"
} }
ksp { ksp {
@ -14,5 +15,8 @@ dependencies {
implementation("com.google.devtools.ksp:symbol-processing-api:1.9.21-1.0.15") implementation("com.google.devtools.ksp:symbol-processing-api:1.9.21-1.0.15")
implementation("com.squareup:kotlinpoet:1.14.2") implementation("com.squareup:kotlinpoet:1.14.2")
implementation(DEPENDENCY_PROTOBUF)
implementation(kotlinx("serialization-protobuf", "1.6.2"))
ksp("dev.zacsweers.autoservice:auto-service-ksp:1.1.0") ksp("dev.zacsweers.autoservice:auto-service-ksp:1.1.0")
} }

View File

@ -6,6 +6,7 @@ package moe.fuqiuluo.ksp.impl
import com.google.devtools.ksp.KspExperimental import com.google.devtools.ksp.KspExperimental
import com.google.devtools.ksp.getAnnotationsByType import com.google.devtools.ksp.getAnnotationsByType
import com.google.devtools.ksp.getClassDeclarationByName import com.google.devtools.ksp.getClassDeclarationByName
import com.google.devtools.ksp.getKotlinClassByName
import com.google.devtools.ksp.processing.CodeGenerator import com.google.devtools.ksp.processing.CodeGenerator
import com.google.devtools.ksp.processing.Dependencies import com.google.devtools.ksp.processing.Dependencies
import com.google.devtools.ksp.processing.KSPLogger import com.google.devtools.ksp.processing.KSPLogger
@ -26,12 +27,11 @@ class OneBotHandlerProcessor(
): SymbolProcessor { ): SymbolProcessor {
override fun process(resolver: Resolver): List<KSAnnotated> { override fun process(resolver: Resolver): List<KSAnnotated> {
val ActionManagerNode = resolver.getClassDeclarationByName("moe.fuqiuluo.shamrock.remote.action.ActionManager") val ActionManagerNode = resolver.getClassDeclarationByName("moe.fuqiuluo.shamrock.remote.action.ActionManager")
if (ActionManagerNode == null) { ?: resolver.getKotlinClassByName("moe.fuqiuluo.shamrock.remote.action.ActionManager")
logger.error("OneBotHandlerProcessor: ActionManager not found") ?: resolver.getClassDeclarationByName("ActionManager")
return emptyList()
}
val symbols = resolver.getSymbolsWithAnnotation(OneBotHandler::class.qualifiedName!!) val symbols = resolver.getSymbolsWithAnnotation(OneBotHandler::class.qualifiedName!!)
val unableToProcess = symbols.filterNot { it.validate() } val unableToProcess = symbols.filterNot { it.validate() }
if (ActionManagerNode != null) {
val oneBotHandlers = (symbols.filter { val oneBotHandlers = (symbols.filter {
it is KSClassDeclaration && it.validate() && it.classKind == ClassKind.OBJECT it is KSClassDeclaration && it.validate() && it.classKind == ClassKind.OBJECT
} as Sequence<KSClassDeclaration>).toList() } as Sequence<KSClassDeclaration>).toList()
@ -39,6 +39,7 @@ class OneBotHandlerProcessor(
if (oneBotHandlers.isNotEmpty()) { if (oneBotHandlers.isNotEmpty()) {
ActionManagerNode.accept(ActionManagerVisitor(oneBotHandlers), Unit) ActionManagerNode.accept(ActionManagerVisitor(oneBotHandlers), Unit)
} }
}
return unableToProcess.toList() return unableToProcess.toList()
} }

View File

@ -0,0 +1,77 @@
@file:Suppress("UNCHECKED_CAST")
package moe.fuqiuluo.ksp.impl
import com.google.devtools.ksp.isInternal
import com.google.devtools.ksp.isPrivate
import com.google.devtools.ksp.processing.CodeGenerator
import com.google.devtools.ksp.processing.Dependencies
import com.google.devtools.ksp.processing.KSPLogger
import com.google.devtools.ksp.processing.Resolver
import com.google.devtools.ksp.processing.SymbolProcessor
import com.google.devtools.ksp.symbol.ClassKind
import com.google.devtools.ksp.symbol.KSAnnotated
import com.google.devtools.ksp.symbol.KSClassDeclaration
import com.google.devtools.ksp.symbol.KSDeclaration
import com.google.devtools.ksp.validate
import com.squareup.kotlinpoet.FileSpec
import kotlinx.serialization.Serializable
class ProtobufProcessor(
private val codeGenerator: CodeGenerator,
private val logger: KSPLogger
): SymbolProcessor {
override fun process(resolver: Resolver): List<KSAnnotated> {
val symbols = resolver.getSymbolsWithAnnotation(Serializable::class.qualifiedName!!)
val unableToProcess = symbols.filterNot { it.validate() }
val actions = (symbols.filter {
it is KSClassDeclaration && it.validate() && it.classKind == ClassKind.CLASS
} as Sequence<KSClassDeclaration>).filter {
it.superTypes.any { superType ->
superType.resolve().declaration.qualifiedName?.asString() == "moe.fuqiuluo.symbols.Protobuf"
}
}.toList()
if (actions.isNotEmpty()) {
actions.forEachIndexed { index, clz ->
if (clz.isInternal()) return@forEachIndexed
if (clz.isPrivate()) return@forEachIndexed
val packageName = "protobuf.auto"
val fileSpecBuilder = FileSpec.scriptBuilder("FastProtobuf", packageName)
fileSpecBuilder.addImport("kotlinx.serialization.protobuf", "ProtoBuf")
fileSpecBuilder.addImport("kotlinx.serialization", "decodeFromByteArray")
fileSpecBuilder.addImport("kotlinx.serialization", "encodeToByteArray")
if (clz.parentDeclaration != null) {
fileSpecBuilder.addImport(clz.importPackage, clz.simpleName.asString())
} else {
fileSpecBuilder.addImport(clz.packageName.asString(), clz.simpleName.asString())
}
if (clz.typeParameters.isNotEmpty()) {
val genericType = clz.typeParameters.joinToString(", ") { it.name.asString() }
fileSpecBuilder.addStatement("""inline fun <$genericType> ${clz.simpleName.asString()}<$genericType>.toByteArray() = ProtoBuf.encodeToByteArray(this)""")
} else {
fileSpecBuilder.addStatement("inline fun ${clz.simpleName.asString()}.toByteArray() = ProtoBuf.encodeToByteArray(this)")
}
codeGenerator.createNewFile(
dependencies = Dependencies.ALL_FILES,
packageName = packageName,
fileName = "FP${clz.simpleName.asString().hashCode()}"
).use { outputStream ->
outputStream.writer().use {
fileSpecBuilder.build().writeTo(it)
}
}
}
}
return unableToProcess.toList()
}
private val KSDeclaration.importPackage: String
get() = if (parentDeclaration != null) {
parentDeclaration!!.importPackage + "." + parentDeclaration!!.simpleName.asString()
} else packageName.asString()
}

View File

@ -0,0 +1,17 @@
package moe.fuqiuluo.ksp.providers
import com.google.auto.service.AutoService
import com.google.devtools.ksp.processing.SymbolProcessor
import com.google.devtools.ksp.processing.SymbolProcessorEnvironment
import com.google.devtools.ksp.processing.SymbolProcessorProvider
import moe.fuqiuluo.ksp.impl.ProtobufProcessor
@AutoService(SymbolProcessorProvider::class)
class ProtobufProvider: SymbolProcessorProvider {
override fun create(environment: SymbolProcessorEnvironment): SymbolProcessor {
return ProtobufProcessor(
environment.codeGenerator,
environment.logger
)
}
}

View File

@ -2,6 +2,7 @@ plugins {
id("com.android.library") id("com.android.library")
id("org.jetbrains.kotlin.android") id("org.jetbrains.kotlin.android")
kotlin("plugin.serialization") version "1.9.21" kotlin("plugin.serialization") version "1.9.21"
id("com.google.devtools.ksp") version "1.9.21-1.0.15"
} }
android { android {
@ -38,4 +39,7 @@ dependencies {
implementation(kotlinx("serialization-protobuf", "1.6.2")) implementation(kotlinx("serialization-protobuf", "1.6.2"))
implementation(kotlinx("serialization-json", "1.6.2")) implementation(kotlinx("serialization-json", "1.6.2"))
implementation(project(":annotations"))
ksp(project(":processor"))
} }

View File

@ -2,9 +2,10 @@ package protobuf.fav
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
@Serializable @Serializable
data class WeiyunComm( data class WeiyunComm(
@ProtoNumber(1) val req: WeiyunCommonReq? = null, @ProtoNumber(1) val req: WeiyunCommonReq? = null,
@ProtoNumber(2) val resp: WeiyunCommonResp? = null @ProtoNumber(2) val resp: WeiyunCommonResp? = null
) ): Protobuf<WeiyunComm>

View File

@ -6,6 +6,7 @@ package protobuf.fav
import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
@Serializable @Serializable
data class WeiyunMsgHead( data class WeiyunMsgHead(
@ -27,4 +28,5 @@ data class WeiyunMsgHead(
@ProtoNumber(103) val promptMsg: String? = null, @ProtoNumber(103) val promptMsg: String? = null,
@ProtoNumber(111) val totalSpace: ULong = ULong.MIN_VALUE, @ProtoNumber(111) val totalSpace: ULong = ULong.MIN_VALUE,
@ProtoNumber(112) val usedSpace: ULong = ULong.MIN_VALUE, @ProtoNumber(112) val usedSpace: ULong = ULong.MIN_VALUE,
) ): Protobuf<WeiyunMsgHead>

View File

@ -6,6 +6,7 @@ import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.SerialName import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
import protobuf.qweb.QWebExtInfo import protobuf.qweb.QWebExtInfo
@Serializable @Serializable
@ -19,7 +20,7 @@ data class GetGuildFeedsReq(
@ProtoNumber(7) var u7: Int? = null, @ProtoNumber(7) var u7: Int? = null,
@ProtoNumber(8) var u8: Int? = null, @ProtoNumber(8) var u8: Int? = null,
@ProtoNumber(9) var u9: ByteArray? = null, @ProtoNumber(9) var u9: ByteArray? = null,
) ): Protobuf<GetGuildFeedsReq>
@Serializable @Serializable
data class GetGuildFeedsRsp( data class GetGuildFeedsRsp(
@ -27,7 +28,7 @@ data class GetGuildFeedsRsp(
@ProtoNumber(2) var isFinish: Int = 0, @ProtoNumber(2) var isFinish: Int = 0,
//@ProtoNumber(3) var feedAttchInfo: ByteArray? = null, //@ProtoNumber(3) var feedAttchInfo: ByteArray? = null,
//@ProtoNumber(4) var traceId: String? = null, //@ProtoNumber(4) var traceId: String? = null,
) ): Protobuf<GetGuildFeedsRsp>
@Serializable @Serializable
data class StFeed( data class StFeed(

View File

@ -0,0 +1,37 @@
@file:OptIn(ExperimentalSerializationApi::class)
package protobuf.lightapp
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
@Serializable
data class AdaptShareInfoReq(
//@ProtoNumber(1) var extInfo: Any? = null,
@ProtoNumber(2) var appid: String? = null,
@ProtoNumber(3) var title: String? = null,
@ProtoNumber(4) var desc: String? = null,
@ProtoNumber(5) var time: ULong? = null,
@ProtoNumber(6) var scene: UInt? = null,
@ProtoNumber(7) var templetType: UInt? = null,
@ProtoNumber(8) var businessType: UInt? = null,
@ProtoNumber(9) var picUrl: String? = null,
@ProtoNumber(10) var vidUrl: String? = null,
@ProtoNumber(11) var jumpUrl: String? = null,
@ProtoNumber(12) var iconUrl: String? = null,
@ProtoNumber(13) var verType: UInt? = null,
@ProtoNumber(14) var shareType: UInt? = null,
@ProtoNumber(15) var versionId: String? = null,
@ProtoNumber(16) var withShareTicket: UInt? = null,
@ProtoNumber(17) var webURL: String? = null,
//@ProtoNumber(18) var appidRich: Any? = null,
@ProtoNumber(19) var template: Template? = null,
//@ProtoNumber(20) var rcvOpenId: Any? = null,
): Protobuf<AdaptShareInfoReq>
@Serializable
data class Template(
@ProtoNumber(1) var templateId: UInt? = null,
@ProtoNumber(2) var templateData: ByteArray? = null,
)

View File

@ -0,0 +1,26 @@
package protobuf.message
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
@Serializable
data class AppShareInfo(
@ProtoNumber(1) var appshareId: UInt? = null,
@ProtoNumber(2) var appshareCookie: ByteArray? = null,
@ProtoNumber(3) var appshareResource: PluginInfo? = null,
)
@Serializable
data class PluginInfo(
@ProtoNumber(1) var resId: UInt = 0u,
@ProtoNumber(2) var pkgName: String = "",
@ProtoNumber(3) var newVer: UInt = 0u,
@ProtoNumber(4) var resType: UInt = 0u,
@ProtoNumber(5) var lanType: UInt = 0u,
@ProtoNumber(6) var priority: UInt = 0u,
@ProtoNumber(7) var resName: String = "",
@ProtoNumber(8) var resDesc: String = "",
@ProtoNumber(9) var resUrlBig: String = "",
@ProtoNumber(10) var resUrlSmall: String = "",
@ProtoNumber(11) var resConf: String = "",
)

View File

@ -0,0 +1,31 @@
package protobuf.message
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
@Serializable
data class ContentHead(
@ProtoNumber(1) val msgType: Int = Int.MIN_VALUE,
@ProtoNumber(2) val msgSubType: Int? = null,
@ProtoNumber(3) val divSeq: Int? = null,
@ProtoNumber(4) val msgViaRandom: Long = Long.MIN_VALUE,
@ProtoNumber(5) val sequence: Long? = null,
@ProtoNumber(6) val msgTime: Long? = null,
@ProtoNumber(7) val u2: Int? = null,
@ProtoNumber(8) val u6: Int? = null,
@ProtoNumber(9) val u7: Int? = null,
@ProtoNumber(11) val msgSeq: Long? = null,
@ProtoNumber(12) val msgRandom: Long = Long.MIN_VALUE,
@ProtoNumber(14) val u4: Long? = null,
@ProtoNumber(15) val forwardHead: ForwardHead? = null,
@ProtoNumber(28) val u5: Long? = null
)
@Serializable
data class ForwardHead(
@ProtoNumber(1) val u1: Int? = null,
@ProtoNumber(2) val u2: Int? = null,
@ProtoNumber(3) val u3: Int? = null,
@ProtoNumber(4) val ub641: String? = null,
@ProtoNumber(5) val avatar: String? = null
)

View File

@ -0,0 +1,64 @@
package protobuf.message
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
import protobuf.message.element.*
@OptIn(ExperimentalSerializationApi::class)
@Serializable
data class Elem(
@ProtoNumber(1) val text: TextMsg? = null,
@ProtoNumber(2) val face: FaceMsg? = null,
// @ProtoNumber(3) val onlineImage: OnlineImage? = null,
@ProtoNumber(4) val notOnlineImage: NotOnlineImage? = null,
// @ProtoNumber(5) var transElemInfo: TransElem? = null,
@ProtoNumber(6) val marketFace: MarketFace? = null,
// @ProtoNumber(7) var elemFlags: ElemFlags? = null,
@ProtoNumber(8) val customFace: CustomFace? = null,
@ProtoNumber(9) var elemFlags2: ElemFlags2? = null,
// @ProtoNumber(10) var funFace: FunFace? = null,
// @ProtoNumber(11) var secretFile: SecretFileMsg? = null,
// @ProtoNumber(12) var richMsg: RichMsg? = null,
// @ProtoNumber(13) var groupFile: GroupFile? = null,
// @ProtoNumber(14) var pubGroup: PubGroup? = null,
// @ProtoNumber(15) var marketTrans: MarketTrans? = null,
// @ProtoNumber(16) var extraInfo: ExtraInfo? = null,
// @ProtoNumber(17) var shakeWindow: ShakeWindow? = null,
// @ProtoNumber(18) var pubAccount: PubAccount? = null,
// @ProtoNumber(19) var videoFile: VideoFile? = null,
// @ProtoNumber(20) var tipsInfo: TipsInfo? = null,
// @ProtoNumber(21) var anonGroupMsg: AnonymousGroupMsg? = null,
// @ProtoNumber(22) var qqLiveOld: QQLiveOld? = null,
// @ProtoNumber(23) var lifeOnline: LifeOnlineAccount? = null,
// @ProtoNumber(24) var qqwalletMsg: QQWalletMsg? = null,
// @ProtoNumber(25) var crmElem: CrmElem? = null,
// @ProtoNumber(26) var conferenceTipsInfo: ConferenceTipsInfo? = null,
// @ProtoNumber(27) var redbagInfo: RedBagInfo? = null,
// @ProtoNumber(28) var lowVersionTips: LowVersionTips? = null,
// @ProtoNumber(29) var bankcodeCtrlInfo: ByteArray? = null,
// @ProtoNumber(30) var nearByMsg: NearByMessageType? = null,
// @ProtoNumber(31) var customElem: CustomElem? = null,
// @ProtoNumber(32) var locationInfo: LocationInfo? = null,
// @ProtoNumber(33) var pubAccInfo: PubAccInfo? = null,
// @ProtoNumber(34) var smallEmoji: SmallEmoji? = null,
// @ProtoNumber(35) var fsjMsgElem: FSJMessageElem? = null,
// @ProtoNumber(36) var arkApp: ArkAppElem? = null,
@ProtoNumber(37) val generalFlags: GeneralFlags? = null,
// @ProtoNumber(38) var hcFlashPic: CustomFace? = null,
// @ProtoNumber(39) var deliverGiftMsg: DeliverGiftMsg? = null,
// @ProtoNumber(40) var bitapp_msg: BitAppMsg? = null,
// @ProtoNumber(41) var openQqData: OpenQQData? = null,
// @ProtoNumber(42) var apolloMsg: ApolloActMsg? = null,
// @ProtoNumber(43) var groupPubAccInfo: GroupPubAccountInfo? = null,
// @ProtoNumber(44) var blessMsg: BlessingMessage? = null,
@ProtoNumber(45) var srcMsg: SourceMsg? = null,
// @ProtoNumber(46) var lolaMsg: LolaMsg? = null,
// @ProtoNumber(47) var groupBusinessMsg: GroupBusinessMsg? = null,
// @ProtoNumber(48) var msgWorkflowNotify: WorkflowNotifyMsg? = null,
// @ProtoNumber(49) var patElem: PatsElem? = null,
// @ProtoNumber(50) var groupPostElem: GroupPostElem? = null,
@ProtoNumber(51) val lightApp: LightAppElem? = null,
// @ProtoNumber(52) var eimInfo: EIMInfo? = null,
@ProtoNumber(53) val commonElem: CommonElem? = null,
)

View File

@ -1,57 +0,0 @@
@file:OptIn(ExperimentalSerializationApi::class)
package protobuf.message
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
@Serializable
data class MessageBody(
@ProtoNumber(1) val msgHead: MessageHead? = null,
@ProtoNumber(2) val contentHead: MessageContentHead? = null,
@ProtoNumber(3) val richMsg: RichMessage? = null,
)
@Serializable
data class RichMessage(
@ProtoNumber(1) val elements: MessageElementList? = null,
@ProtoNumber(2) val rawBuffer: ByteArray? = null,
)
@Serializable
data class MessageElementList(
@ProtoNumber(2) val elements: List<MessageElement>? = null
)
@Serializable
data class MessageElement(
@ProtoNumber(51) val json: JsonElement? = null,
)
@Serializable
data class JsonElement(
@ProtoNumber(1) val data: ByteArray? = null,
)
@Serializable
data class MessageHead(
@ProtoNumber(1) val peer: Long = Long.MIN_VALUE,
@ProtoNumber(2) val peerUid: String? = null,
@ProtoNumber(3) val flag: Int = Int.MIN_VALUE,
@ProtoNumber(5) val receiver: Long? = null,
@ProtoNumber(6) val receiverUid: String? = null,
)
@Serializable
data class MessageContentHead(
@ProtoNumber(1) val msgType: Int = Int.MIN_VALUE,
@ProtoNumber(2) val msgSubType: Int = Int.MIN_VALUE,
@ProtoNumber(4) val u1: Long = Long.MIN_VALUE,
@ProtoNumber(5) val msgSeq: Long = Long.MIN_VALUE,
@ProtoNumber(6) val msgTime: Long? = null,
@ProtoNumber(7) val u2: Int? = null,
@ProtoNumber(11) val u3: Long? = null,
@ProtoNumber(12) val msgRandom: Long = Long.MIN_VALUE,
@ProtoNumber(14) val u4: Long? = null,
@ProtoNumber(28) val u5: Long? = null,
)

View File

@ -0,0 +1,11 @@
package protobuf.message
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
@Serializable
data class MsgBody(
@ProtoNumber(1) val richText: RichText? = null,
@ProtoNumber(2) val msgContent: ByteArray? = null,
@ProtoNumber(3) val msgEncryptContent: ByteArray? = null
)

View File

@ -0,0 +1,9 @@
package protobuf.message
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
@Serializable
data class MsgControl(
@ProtoNumber(1) val msgFlag: Int? = null,
)

View File

@ -0,0 +1,28 @@
package protobuf.message
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
@Serializable
data class NotOnlineFile(
@ProtoNumber(1) var fileType: UInt? = null,
@ProtoNumber(2) var sig: ByteArray? = null,
@ProtoNumber(3) var fileUuid: ByteArray? = null,
@ProtoNumber(4) var fileMd5: ByteArray? = null,
@ProtoNumber(5) var fileName: ByteArray? = null,
@ProtoNumber(6) var fileSize: ULong? = null,
@ProtoNumber(7) var note: ByteArray? = null,
@ProtoNumber(8) var reserved: UInt? = null,
@ProtoNumber(9) var subcmd: UInt? = null,
@ProtoNumber(10) var microCloud: UInt? = null,
@ProtoNumber(11) var rptFileUrls: List<String>? = null,
@ProtoNumber(12) var downloadFlag: UInt? = null,
@ProtoNumber(50) var dangerEvel: UInt? = null,
@ProtoNumber(51) var lifeTime: UInt? = null,
@ProtoNumber(52) var uploadTime: UInt? = null,
@ProtoNumber(53) var absFileType: UInt? = null,
@ProtoNumber(54) var clientType: UInt? = null,
@ProtoNumber(55) var expireTime: UInt? = null,
@ProtoNumber(56) var pbReserve: ByteArray? = null,
@ProtoNumber(57) var fileidcrcMedia: String? = null,
)

View File

@ -0,0 +1,23 @@
package protobuf.message
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
@Serializable
data class PbSendMsgReq(
@ProtoNumber(1) val routingHead: RoutingHead? = null,
@ProtoNumber(2) val contentHead: ContentHead? = null,
@ProtoNumber(3) val msgBody: MsgBody? = null,
@ProtoNumber(4) val msgSeq: UInt? = null,
@ProtoNumber(5) val msgRand: UInt? = null,
@ProtoNumber(6) val syncCookie: ByteArray? = null,
@ProtoNumber(7) val appShare: AppShareInfo? = null,
@ProtoNumber(8) val msgVia: UInt? = null,
@ProtoNumber(9) val dataStatist: UInt? = null,
// @ProtoNumber(10) val multiMsgAssist: MultiMsgAssist? = null,
// @ProtoNumber(11) val inputNotifyInfo: InputNotifyInfo? = null,
@ProtoNumber(12) val ctrl: MsgControl? = null,
// @ProtoNumber(13) val receiptReq: ReceiptReq? = null,
@ProtoNumber(14) val multiSendSeq: UInt? = null
) : Protobuf<PbSendMsgReq>

View File

@ -0,0 +1,32 @@
package protobuf.message
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
@Serializable
data class Ptt(
@ProtoNumber(1) var fileType: UInt?=null,
@ProtoNumber(2) var srcUin: ULong?=null,
@ProtoNumber(3) var fileUuid: ByteArray?=null,
@ProtoNumber(4) var fileMd5: ByteArray?=null,
@ProtoNumber(5) var fileName: ByteArray?=null,
@ProtoNumber(6) var fileSize: UInt?=null,
@ProtoNumber(7) var reserve: ByteArray?=null,
@ProtoNumber(8) var fileId: UInt?=null,
@ProtoNumber(9) var serverIp: UInt?=null,
@ProtoNumber(10) var serverPort: UInt?=null,
@ProtoNumber(11) var boolValid: Boolean = false,
@ProtoNumber(12) var signature: ByteArray?=null,
@ProtoNumber(13) var shortcut: ByteArray?=null,
@ProtoNumber(14) var fileKey: ByteArray?=null,
@ProtoNumber(15) var magicPttIndex: UInt?=null,
@ProtoNumber(16) var voiceSwitch: UInt?=null,
@ProtoNumber(17) var pttUrl: ByteArray?=null,
@ProtoNumber(18) var groupFileKey: ByteArray?=null,
@ProtoNumber(19) var time: UInt?=null,
@ProtoNumber(20) var downPara: ByteArray?=null,
@ProtoNumber(29) var format: UInt?=null,
@ProtoNumber(30) var pbReserve: ByteArray?=null,
@ProtoNumber(31) var rptPttUrls: List<String>? = null,
@ProtoNumber(32) var downloadFlag: UInt?=null,
)

View File

@ -0,0 +1,11 @@
package protobuf.message
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
@Serializable
data class PushMsgBody(
@ProtoNumber(1) val msgHead: ResponseHead? = null,
@ProtoNumber(2) val contentHead: ContentHead? = null,
@ProtoNumber(3) val body: MsgBody? = null,
)

View File

@ -0,0 +1,33 @@
@file:OptIn(ExperimentalSerializationApi::class)
package protobuf.message
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
@Serializable
data class ResponseHead(
@ProtoNumber(1) val peer: Long = Long.MIN_VALUE,
@ProtoNumber(2) val peerUid: String? = null,
@ProtoNumber(3) val flag: Int = Int.MIN_VALUE,
@ProtoNumber(4) val appId: Int = Int.MIN_VALUE,
@ProtoNumber(5) val receiver: Long? = null,
@ProtoNumber(6) val receiverUid: String? = null,
@ProtoNumber(7) val forward: ResponseForward? = null,
@ProtoNumber(8) val responseGrp: ResponseGrp? = null,
)
@Serializable
data class ResponseForward(
@ProtoNumber(6) val friendName: String? = null,
@ProtoNumber(11) val u1: Int? = null,
)
@Serializable
data class ResponseGrp(
@ProtoNumber(1) val groupCode: ULong = ULong.MIN_VALUE,
@ProtoNumber(4) val memberCard: String? = null,
@ProtoNumber(5) val u1: Int? = null,
@ProtoNumber(7) val groupName: String? = null,
@ProtoNumber(10) val u2: Int? = null,
)

View File

@ -0,0 +1,31 @@
@file:OptIn(ExperimentalSerializationApi::class)
package protobuf.message
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
@Serializable
data class RichText(
@ProtoNumber(1) val attr: Attr? = null,
@ProtoNumber(2) val elements: List<Elem>? = null,
@ProtoNumber(3) val not_online_file: NotOnlineFile? = null,
@ProtoNumber(4) val ptt: Ptt? = null,
@ProtoNumber(5) val tmp_ptt: TmpPtt? = null,
@ProtoNumber(6) val trans_211_tmp_msg: Trans211TmpMsg? = null,
)
@Serializable
data class Attr(
@ProtoNumber(1) val codePage: Int? = null,
@ProtoNumber(2) val time: UInt? = null,
@ProtoNumber(3) val random: UInt? = null,
@ProtoNumber(4) val color: UInt? = null,
@ProtoNumber(5) val size: UInt? = null,
@ProtoNumber(6) val effect: UInt? = null,
@ProtoNumber(7) val charSet: UInt? = null,
@ProtoNumber(8) val pitchAndFamily: UInt? = null,
@ProtoNumber(9) val fontName: String? = null,
@ProtoNumber(10) val reserve_data: ByteArray? = null,
)

View File

@ -0,0 +1,14 @@
package protobuf.message
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
import protobuf.message.routing.*
@Serializable
data class RoutingHead(
@ProtoNumber(1) val c2c: C2C? = null,
@ProtoNumber(2) val grp: Grp? = null,
@ProtoNumber(3) val grpTmp: GrpTmp? = null,
@ProtoNumber(6) val wpaTmp: WPATmp? = null,
@ProtoNumber(15) val trans0X211: Trans0X211? = null
)

View File

@ -0,0 +1,20 @@
package protobuf.message
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
@Serializable
data class TmpPtt(
@ProtoNumber(1) var fileType: UInt? = null,
@ProtoNumber(2) var fileUuid: ByteArray? = null,
@ProtoNumber(3) var fileMd5: ByteArray? = null,
@ProtoNumber(4) var fileName: ByteArray? = null,
@ProtoNumber(5) var fileSize: UInt? = null,
@ProtoNumber(6) var pttTimes: UInt? = null,
@ProtoNumber(7) var userType: UInt? = null,
@ProtoNumber(8) var ptttransFlag: UInt? = null,
@ProtoNumber(9) var busiType: UInt? = null,
@ProtoNumber(10) var msgId: ULong? = null,
@ProtoNumber(30) var pbReserve: ByteArray? = null,
@ProtoNumber(31) var pttEncodeData: ByteArray? = null,
)

View File

@ -0,0 +1,10 @@
package protobuf.message
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
@Serializable
data class Trans211TmpMsg(
@ProtoNumber(1) var msgBody: ByteArray? = null,
@ProtoNumber(2) var c2cCmd: UInt? = null,
)

View File

@ -0,0 +1,11 @@
package protobuf.message.element
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
@Serializable
data class CommonElem(
@ProtoNumber(1) val serviceType: Int? = null,
@ProtoNumber(2) val elem: ByteArray? = null,
@ProtoNumber(3) val businessType: Int? = null,
)

View File

@ -0,0 +1,49 @@
package protobuf.message.element
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
@Serializable
data class CustomFace(
@ProtoNumber(1) var guid: ByteArray? = null,
@ProtoNumber(2) var filePath: String? = null,
@ProtoNumber(3) var shortcut: String? = null,
@ProtoNumber(4) var buffer: ByteArray? = null,
@ProtoNumber(5) var flag: ByteArray? = null,
@ProtoNumber(6) var oldData: ByteArray? = null,
@ProtoNumber(7) var fileId: UInt? = null,
@ProtoNumber(8) var serverIp: UInt? = null,
@ProtoNumber(9) var serverPort: UInt? = null,
@ProtoNumber(10) var fileType: UInt? = null, // 66
@ProtoNumber(11) var signature: ByteArray? = null,
@ProtoNumber(12) var useful: UInt? = null,
@ProtoNumber(13) var md5: ByteArray? = null,
@ProtoNumber(14) var thumbUrl: String? = null,
@ProtoNumber(15) var bigUrl: String? = null,
@ProtoNumber(16) var origUrl: String? = null,
@ProtoNumber(17) var bizType: UInt? = null,
@ProtoNumber(18) var repeatIndex: UInt? = null,
@ProtoNumber(19) var repeatImage: UInt? = null,
@ProtoNumber(20) var imageType: UInt? = null,
@ProtoNumber(21) var index: UInt? = null,
@ProtoNumber(22) var width: UInt? = null,
@ProtoNumber(23) var height: UInt? = null,
@ProtoNumber(24) var source: UInt? = null,
@ProtoNumber(25) var size: UInt? = null,
@ProtoNumber(26) var origin: UInt? = null,
@ProtoNumber(27) var thumbWidth: UInt? = null,
@ProtoNumber(28) var thumbHeight: UInt? = null,
@ProtoNumber(29) var showLen: UInt? = null,
@ProtoNumber(30) var downloadLen: UInt? = null,
@ProtoNumber(31) var url400: String? = null,
@ProtoNumber(32) var width400: UInt? = null,
@ProtoNumber(33) var height400: UInt? = null,
@ProtoNumber(34) var pbReserve: PbReserve? = null,
){
companion object{
@Serializable
data class PbReserve(
@ProtoNumber(1) var field1: Int? = null
)
}
}

View File

@ -0,0 +1,38 @@
package protobuf.message.element
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
@Serializable
data class ElemFlags2(
@ProtoNumber(1) var color_text_id: UInt? = null,
@ProtoNumber(2) var msg_id: ULong? = null,
@ProtoNumber(3) var whisper_session_id: UInt? = null,
@ProtoNumber(4) var ptt_change_bit: UInt? = null,
@ProtoNumber(5) var vip_status: UInt? = null,
@ProtoNumber(6) var compatible_id: UInt? = null,
@ProtoNumber(7) var rpt_insts: List<Inst>? = null,
@ProtoNumber(8) var msg_rpt_cnt: UInt? = null,
@ProtoNumber(9) var src_inst: Inst? = null,
@ProtoNumber(10) var longtitude: UInt? = null,
@ProtoNumber(11) var latitude: UInt? = null,
@ProtoNumber(12) var custom_font: UInt? = null,
@ProtoNumber(13) var pc_support_def: PcSupportDef? = null,
@ProtoNumber(14) var crm_flags: UInt? = null,
)
@Serializable
data class Inst(
@ProtoNumber(1) var app_id: UInt? = null,
@ProtoNumber(2) var inst_id: UInt? = null,
)
@Serializable
data class PcSupportDef(
@ProtoNumber(1) var pc_ptl_begin: UInt? = null,
@ProtoNumber(2) var pc_ptl_end: UInt? = null,
@ProtoNumber(3) var mac_ptl_begin: UInt? = null,
@ProtoNumber(4) var mac_ptl_end: UInt? = null,
@ProtoNumber(5) var rpt_ptls_support: List<Int>? = null,
@ProtoNumber(6) var rpt_ptls_not_support: List<Int>? = null,
)

View File

@ -0,0 +1,12 @@
package protobuf.message.element
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
@Serializable
data class FaceMsg(
@ProtoNumber(1) val id: Int? = null,
@ProtoNumber(2) var old: ByteArray? = null,
@ProtoNumber(11) var buf: ByteArray? = null,
)

View File

@ -0,0 +1,28 @@
package protobuf.message.element
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
@Serializable
data class GeneralFlags(
@ProtoNumber(1) val bubbleDiyTextId: UInt? = null,
@ProtoNumber(2) val groupFlagNew: UInt? = null,
@ProtoNumber(3) val uin: ULong? = null,
@ProtoNumber(4) val rpId: ByteArray? = null,
@ProtoNumber(5) val prpFold: UInt? = null,
@ProtoNumber(6) val longTextFlag: UInt? = null,
@ProtoNumber(7) val longTextResid: ByteArray? = null,
@ProtoNumber(8) val groupType: UInt? = null,
@ProtoNumber(9) val toUinFlag: UInt? = null,
@ProtoNumber(10) val glamourLevel: UInt? = null,
@ProtoNumber(11) val memberLevel: UInt? = null,
@ProtoNumber(12) val groupRankSeq: ULong? = null,
@ProtoNumber(13) val olympicTorch: UInt? = null,
@ProtoNumber(14) val babyqGuideMsgCookie: ByteArray? = null,
@ProtoNumber(15) val expertFlag: UInt? = null,
@ProtoNumber(16) val bubbleSubId: UInt? = null,
@ProtoNumber(17) val pendantId: ULong? = null,
@ProtoNumber(18) val rpIndex: ByteArray? = null,
@ProtoNumber(19) val reserve: ByteArray? = null,
)

View File

@ -0,0 +1,9 @@
package protobuf.message.element
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
@Serializable
data class LightAppElem(
@ProtoNumber(1) val data: ByteArray? = null,
)

View File

@ -0,0 +1,21 @@
package protobuf.message.element
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
@Serializable
data class MarketFace(
@ProtoNumber(1) var faceName: String? = null,
@ProtoNumber(2) var itemType: Int? = null,
@ProtoNumber(3) var faceInfo: Int? = null,
@ProtoNumber(4) var faceId: String? = null,
@ProtoNumber(5) var tabId: Int? = null,
@ProtoNumber(6) var subType: Int? = null,
@ProtoNumber(7) var key: ByteArray? = null,
@ProtoNumber(8) var param: ByteArray? = null,
@ProtoNumber(9) var mediaType: Int? = null,
@ProtoNumber(10) var imageWidth: Int? = null,
@ProtoNumber(11) var imageHeight: Int? = null,
@ProtoNumber(12) var mobileparam: ByteArray? = null,
@ProtoNumber(13) var pbReserve: ByteArray? = null,
)

View File

@ -0,0 +1,46 @@
package protobuf.message.element
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
@Serializable
data class NotOnlineImage(
@ProtoNumber(1) val filePath: ByteArray? = null,
@ProtoNumber(2) val fileLen: UInt? = null,
@ProtoNumber(3) val downloadPath: ByteArray? = null,
@ProtoNumber(4) val oldVerSendFile: ByteArray? = null,
@ProtoNumber(5) val imgType: UInt? = null,
@ProtoNumber(6) val previewsImage: ByteArray? = null,
@ProtoNumber(7) val picMd5: ByteArray? = null,
@ProtoNumber(8) val picHeight: UInt? = null,
@ProtoNumber(9) val picWidth: UInt? = null,
@ProtoNumber(10) val resId: ByteArray? = null,
@ProtoNumber(11) val flag: ByteArray? = null,
@ProtoNumber(12) val thumbUrl: String? = null,
@ProtoNumber(13) val original: UInt? = null,
@ProtoNumber(14) val bigUrl: String? = null,
@ProtoNumber(15) val origUrl: String? = null,
@ProtoNumber(16) val bizType: UInt? = null,
@ProtoNumber(17) val result: UInt? = null,
@ProtoNumber(18) val index: UInt? = null,
@ProtoNumber(19) val opFaceBuf: ByteArray? = null,
@ProtoNumber(20) val oldPicMd5: Boolean = false,
@ProtoNumber(21) val thumbWidth: UInt? = null,
@ProtoNumber(22) val thumbHeight: UInt? = null,
@ProtoNumber(23) val fileId: UInt? = null,
@ProtoNumber(24) val showLen: UInt? = null,
@ProtoNumber(25) val downloadLen: UInt? = null,
@ProtoNumber(26) val url400: String? = null,
@ProtoNumber(27) val width400: UInt? = null,
@ProtoNumber(28) val height400: UInt? = null,
@ProtoNumber(29) val pbReserve: PbReserve? = null,
) {
companion object {
@Serializable
data class PbReserve(
@ProtoNumber(1) var field1: Int? = null,
@ProtoNumber(8) var field8: String? = null,
@ProtoNumber(30) var url: String? = null
)
}
}

View File

@ -0,0 +1,30 @@
package protobuf.message.element
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
import protobuf.message.Elem
@Serializable
data class SourceMsg(
@ProtoNumber(1) var origSeqs: List<Int>? = null,
@ProtoNumber(2) var senderUin: ULong? = null,
@ProtoNumber(3) var time: ULong? = null,
@ProtoNumber(4) var flag: UInt? = null,
@ProtoNumber(5) var elems: List<Elem>? = null,
@ProtoNumber(6) var type: UInt? = null,
@ProtoNumber(7) var richMsg: ByteArray? = null,
@ProtoNumber(8) var pbReserve: PbReserve? = null,
@ProtoNumber(9) var srcMsg: ByteArray? = null,
@ProtoNumber(10) var toUin: ULong? = null,
@ProtoNumber(11) var troopName: String? = null,
) {
companion object {
@Serializable
data class PbReserve(
@ProtoNumber(3) var field3: ULong? = null,
@ProtoNumber(6) var senderUid: String? = null,
@ProtoNumber(7) var receiverUid: String? = null,
@ProtoNumber(8) var field8: Int? = null,
)
}
}

View File

@ -0,0 +1,14 @@
package protobuf.message.element
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
@Serializable
data class TextMsg(
@ProtoNumber(1) val str: String? = null,
@ProtoNumber(2) val link: String? = null,
@ProtoNumber(3) val attr6Buf: ByteArray? = null,
@ProtoNumber(4) val attr7Buf: ByteArray? = null,
@ProtoNumber(11) val buf: ByteArray? = null,
@ProtoNumber(12) val pbReserve: ByteArray? = null,
)

View File

@ -0,0 +1,53 @@
package protobuf.message.element.commelem
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
@Serializable
data class ButtonExtra(
@ProtoNumber(1) val field1: Object1? = null,
) : Protobuf<ButtonExtra>
@Serializable
data class Object1(
@ProtoNumber(1) val rows: List<Row>? = null,
@ProtoNumber(2) val appid: Int? = null,
)
@Serializable
data class Row(
@ProtoNumber(1) val buttons: List<Button>? = null,
)
@Serializable
data class Button(
@ProtoNumber(1) val id: Int? = null,
@ProtoNumber(2) val renderData: RenderData? = null,
@ProtoNumber(3) val action: Action? = null,
)
@Serializable
data class RenderData(
@ProtoNumber(1) val label: String? = null,
@ProtoNumber(2) val visitedLabel: String? = null,
@ProtoNumber(3) val style: Int? = null,
)
@Serializable
data class Action(
@ProtoNumber(1) val type: Int? = null,
@ProtoNumber(2) val permission: Permission? = null,
@ProtoNumber(4) val unsupportTips: String? = null,
@ProtoNumber(5) val data: String? = null,
@ProtoNumber(6) val reply: Boolean? = null,
@ProtoNumber(7) val enter: Boolean? = null,
)
@Serializable
data class Permission(
@ProtoNumber(1) val type: Int? = null,
@ProtoNumber(2) val specifyRoleIds: List<String>? = null,
@ProtoNumber(3) val specifyUserIds: List<String>? = null,
)

View File

@ -0,0 +1,10 @@
package protobuf.message.element.commelem
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
@Serializable
data class MarkdownExtra(
@ProtoNumber(1) val content: String? = null,
) : Protobuf<MarkdownExtra>

View File

@ -0,0 +1,12 @@
package protobuf.message.element.commelem
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
@Serializable
data class PokeExtra(
@ProtoNumber(1) val type: Int? = null,
@ProtoNumber(7) val field7: Int? = null,
@ProtoNumber(8) val field8: Int? = null
) : Protobuf<PokeExtra>

View File

@ -0,0 +1,17 @@
package protobuf.message.element.commelem
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
@Serializable
data class QFaceExtra(
@ProtoNumber(1) val packId: String? = null,
@ProtoNumber(2) val stickerId: String? = null,
@ProtoNumber(3) val faceId: Int? = null,
@ProtoNumber(4) val field4: Int? = null,
@ProtoNumber(5) val field5: Int? = null,
@ProtoNumber(6) val field6: String? = null,
@ProtoNumber(7) val faceText: String? = null,
@ProtoNumber(9) val field9: Int? = null
) : Protobuf<QFaceExtra>

View File

@ -0,0 +1,63 @@
@file:OptIn(ExperimentalSerializationApi::class)
package protobuf.message.longmsg
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
@Serializable
data class LongMsgSettings(
@ProtoNumber(1) val field1: Int? = null,
@ProtoNumber(2) val field2: Int? = null,
@ProtoNumber(3) val field3: Int? = null,
@ProtoNumber(4) val field4: Int? = null,
)
@Serializable
data class LongMsgUid(
@ProtoNumber(2) val uid: String? = null,
)
@Serializable
data class RecvLongMsgInfo(
@ProtoNumber(1) val uid: LongMsgUid? = null,
@ProtoNumber(2) val resId: String? = null,
@ProtoNumber(3) val u1: Int? = null,
)
@Serializable
data class SendLongMsgInfo(
@ProtoNumber(1) val type: Int? = null,
@ProtoNumber(2) val uid: LongMsgUid? = null,
@ProtoNumber(3) val groupUin: Int? = null,
@ProtoNumber(4) val payload: ByteArray? = null,
)
@Serializable
data class LongMsgReq(
@ProtoNumber(1) val recvInfo: RecvLongMsgInfo? = null,
@ProtoNumber(2) val sendInfo: SendLongMsgInfo? = null,
@ProtoNumber(15) val setting: LongMsgSettings? = null,
): Protobuf<LongMsgReq>
@Serializable
data class LongMsgRsp(
@ProtoNumber(1) val recvResult: RecvLongMsgResult? = null,
@ProtoNumber(2) val sendResult: SendLongMsgResult? = null,
@ProtoNumber(15) val setting: LongMsgSettings? = null
): Protobuf<LongMsgRsp> {
companion object {
@Serializable
data class SendLongMsgResult(
@ProtoNumber(3) val resId: String? = null,
)
@Serializable
data class RecvLongMsgResult(
@ProtoNumber(3) val resId: String? = null,
@ProtoNumber(4) val payload: ByteArray? = null,
)
}
}

View File

@ -0,0 +1,24 @@
@file:OptIn(ExperimentalSerializationApi::class)
package protobuf.message.longmsg
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
import protobuf.message.PushMsgBody
@Serializable
data class LongMsgContent(
@ProtoNumber(1) val body: List<PushMsgBody>? = null
)
@Serializable
data class LongMsgAction(
@ProtoNumber(1) val command: String? = null,
@ProtoNumber(2) val data: LongMsgContent? = null
)
@Serializable
data class LongMsgPayload(
@ProtoNumber(2) val action: List<LongMsgAction>? = null
): Protobuf<LongMsgPayload>

View File

@ -0,0 +1,55 @@
@file:OptIn(ExperimentalSerializationApi::class)
package protobuf.message.multimedia
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
@Serializable
data class RichMediaForPicData(
@ProtoNumber(1) val info: MediaInfo?,
@ProtoNumber(2) val display: DisplayMediaInfo?,
): Protobuf<RichMediaForPicData> {
companion object {
@Serializable
data class MediaInfo(
@ProtoNumber(1) val picture: Picture? = null,
)
@Serializable
data class Picture(
@ProtoNumber(1) val info: PictureInfo? = null,
@ProtoNumber(2) val fileId: String? = null,
@ProtoNumber(4) val time: ULong? = null,
)
@Serializable
data class PictureInfo(
@ProtoNumber(2) val md5Hex: String? = null,
@ProtoNumber(3) val sha: String? = null,
@ProtoNumber(4) val name: String? = null,
@ProtoNumber(6) val width: Int? = null,
@ProtoNumber(7) val height: Int? = null,
)
}
}
@Serializable
data class DisplayMediaInfo(
@ProtoNumber(1) val show: Show? = null,
) {
companion object {
@Serializable
data class Show(
@ProtoNumber(2) val text: String? = null,
@ProtoNumber(12) val download: Download? = null
)
@Serializable
data class Download(
@ProtoNumber(30) val url: String? = null,
)
}
}

View File

@ -0,0 +1,14 @@
package protobuf.message.routing
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
@Serializable
data class C2C(
@ProtoNumber(1) val uin: UInt? = null,
@ProtoNumber(2) val uid: String? = null,
@ProtoNumber(3) val field3: UInt? = null,
@ProtoNumber(4) val sig: UInt? = null,
@ProtoNumber(5) val receiverUin: UInt? = null,
@ProtoNumber(6) val receiverUid: String? = null
)

View File

@ -0,0 +1,9 @@
package protobuf.message.routing
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
@Serializable
data class Grp (
@ProtoNumber(1) var groupCode: UInt? = null,
)

View File

@ -0,0 +1,10 @@
package protobuf.message.routing
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
@Serializable
data class GrpTmp (
@ProtoNumber(1) var groupCode: UInt? = null,
@ProtoNumber(2) var ToUin: UInt? = null,
)

View File

@ -0,0 +1,11 @@
package protobuf.message.routing
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
@Serializable
data class Trans0X211(
@ProtoNumber(1) val toUin: ULong? = null,
@ProtoNumber(2) val ccCmd: UInt? = null,
@ProtoNumber(8) val uid: String? = null
)

View File

@ -0,0 +1,10 @@
package protobuf.message.routing
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
@Serializable
data class WPATmp (
@ProtoNumber(1) val toUin: Int? = null,
@ProtoNumber(2) val sig: ByteArray? = null,
)

View File

@ -2,11 +2,13 @@ package protobuf.oidb
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
@Serializable @Serializable
data class TrpcOidb( data class TrpcOidb(
@ProtoNumber(1) val cmd: Int = Int.MIN_VALUE, @ProtoNumber(1) val cmd: Int = Int.MIN_VALUE,
@ProtoNumber(2) val service: Int = Int.MIN_VALUE, @ProtoNumber(2) val service: Int = Int.MIN_VALUE,
@ProtoNumber(4) val buffer: ByteArray, @ProtoNumber(4) val buffer: ByteArray,
//@ProtoNumber(11) val traceParams: Map<String, String> = mapOf(),
@ProtoNumber(12) val flag: Int = Int.MIN_VALUE, @ProtoNumber(12) val flag: Int = Int.MIN_VALUE,
) ): Protobuf<TrpcOidb>

View File

@ -0,0 +1,272 @@
@file:OptIn(ExperimentalSerializationApi::class)
package protobuf.oidb.cmd0x11c5
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
@Serializable
data class NtV2RichMediaReq(
@ProtoNumber(1) val head: MultiMediaReqHead,
@ProtoNumber(2) val upload: UploadReq? = null, // 100
@ProtoNumber(3) val download: DownloadReq? = null,
@ProtoNumber(4) val downloadRkey: DownloadRkeyReq? = null,
@ProtoNumber(5) val delete: DeleteReq? = null,
@ProtoNumber(6) val uploadCompleted: UploadCompletedReq? = null,
@ProtoNumber(7) val msgInfoAuth: MsgInfoAuthReq? = null,
@ProtoNumber(8) val uploadKeyRenewal: UploadKeyRenewalReq? = null,
@ProtoNumber(9) val downloadSafe: DownloadSafeReq? = null,
@ProtoNumber(99) val extension: ByteArray? = null,
): Protobuf<NtV2RichMediaReq>
@Serializable
data class DownloadSafeReq(
@ProtoNumber(1) val index: IndexNode,
)
@Serializable
data class UploadKeyRenewalReq(
@ProtoNumber(1) val oldUkey: String,
@ProtoNumber(2) val subType: UInt,
)
@Serializable
data class MsgInfoAuthReq(
@ProtoNumber(1) val msg: ByteArray,
@ProtoNumber(2) val authTime: ULong,
)
@Serializable
data class UploadCompletedReq(
@ProtoNumber(1) val srvSendMsg: Boolean,
@ProtoNumber(2) val clientRandomId: ULong,
@ProtoNumber(3) val msgInfo: MsgInfo,
@ProtoNumber(4) val clientSeq: UInt,
)
@Serializable
data class MsgInfo(
@ProtoNumber(1) val msgInfoBody: List<MsgInfoBody>,
@ProtoNumber(2) val extBizInfo: ExtBizInfo,
)
@Serializable
data class MsgInfoBody(
@ProtoNumber(1) val index: IndexNode? = null,
@ProtoNumber(2) val picture: PictureInfo? = null,
@ProtoNumber(3) val video: VideoInfo? = null,
@ProtoNumber(4) val audio: AudioInfo? = null,
@ProtoNumber(5) val fileExist: Boolean? = null,
@ProtoNumber(6) val hashSum: ByteArray? = null,
)
@Serializable
class VideoInfo
@Serializable
class AudioInfo
@Serializable
data class PictureInfo(
@ProtoNumber(1) val urlPath: String,
@ProtoNumber(2) val ext: PicUrlExtInfo? = null,
@ProtoNumber(3) val domain: String? = null
)
@Serializable
data class PicUrlExtInfo(
@ProtoNumber(1) val originalParameter: String? = null,
@ProtoNumber(2) val bigParameter: String? = null,
@ProtoNumber(3) val thumbParameter: String? = null
)
@Serializable
data class DeleteReq(
@ProtoNumber(1) val index: List<IndexNode>,
@ProtoNumber(2) val needRecallMsg: Boolean? = null,
@ProtoNumber(3) val msgSeq: ULong? = null,
@ProtoNumber(4) val msgRandom: ULong? = null,
@ProtoNumber(5) val msgTime: ULong? = null,
)
@Serializable
data class DownloadRkeyReq(
@ProtoNumber(1) val types: List<Int>
)
@Serializable
data class UploadReq(
@ProtoNumber(1) val uploadInfo: List<UploadInfo>,
@ProtoNumber(2) val tryFastUploadCompleted: Boolean? = null,
@ProtoNumber(3) val srvSendMsg: Boolean? = null,
@ProtoNumber(4) val clientRandomId: ULong = ULong.MIN_VALUE,
@ProtoNumber(5) val compatQMsgSceneType: UInt? = null,
@ProtoNumber(6) val extBizInfo: ExtBizInfo? = null,
@ProtoNumber(7) val clientSeq: UInt? = null,
@ProtoNumber(8) val noNeedCompatMsg: Boolean = false,
)
@Serializable
data class ExtBizInfo(
@ProtoNumber(1) val pic: PicExtBizInfo? = null,
@ProtoNumber(2) val video: VideoExtBizInfo? = null,
@ProtoNumber(3) val ptt: PttExtBizInfo? = null,
@ProtoNumber(10) val busiType: UInt,
)
@Serializable
data class PttExtBizInfo(
@ProtoNumber(1) val srcUin: ULong,
@ProtoNumber(2) val pttScene: UInt,
@ProtoNumber(3) val pttType: UInt,
@ProtoNumber(4) val changeVoice: UInt,
@ProtoNumber(5) val waveform: ByteArray? = null,
@ProtoNumber(6) val autoConvertText: UInt? = null,
@ProtoNumber(11) val bytesReserve: ByteArray? = null,
@ProtoNumber(12) val bytesPbReserve: ByteArray? = null,
@ProtoNumber(13) val bytesGeneralFlags: ByteArray? = null,
)
@Serializable
data class VideoExtBizInfo(
@ProtoNumber(1) val fromScene: UInt,
@ProtoNumber(2) val toScene: UInt,
@ProtoNumber(3) val bytesPbReserve: ByteArray,
)
@Serializable
data class PicExtBizInfo(
@ProtoNumber(1) val bizType: UInt,
@ProtoNumber(2) val textSummary: String,
@ProtoNumber(11) val bytesPbReserveC2c: ByteArray? = null,
@ProtoNumber(12) val bytesPbReserveTroop: ByteArray? = null,
@ProtoNumber(1001) val fromScene: UInt? = null,
@ProtoNumber(1002) val toScene: UInt? = null,
@ProtoNumber(1003) val oldFileId: UInt? = null,
)
@Serializable
data class UploadInfo(
@ProtoNumber(1) val fileInfo: FileInfo,
@ProtoNumber(2) val subFileType: UInt
)
@Serializable
data class FileInfo(
@ProtoNumber(1) val fileSize: ULong,
@ProtoNumber(2) val md5: String,
@ProtoNumber(3) val sha1: String,
@ProtoNumber(4) val name: String,
@ProtoNumber(5) val fileType: FileType,
@ProtoNumber(6) val width: UInt,
@ProtoNumber(7) val height: UInt,
@ProtoNumber(8) val time: UInt,
@ProtoNumber(9) val original: UInt,
)
@Serializable
data class FileType(
@ProtoNumber(1) val fileType: UInt = 0u,
@ProtoNumber(2) val picFormat: UInt = 0u,
@ProtoNumber(3) val videoFormat: UInt? = null,
@ProtoNumber(4) val voiceFormat: UInt? = null,
)
@Serializable
data class DownloadReq(
@ProtoNumber(1) val index: IndexNode,
@ProtoNumber(2) val ext: DownloadExt,
)
@Serializable
data class DownloadExt(
@ProtoNumber(1) val pic: PicDownloadExt? = null,
@ProtoNumber(2) val video: VideoDownloadExt,
@ProtoNumber(3) val voice: PttDownloadExt? = null,
)
@Serializable
class PicDownloadExt
@Serializable
class PttDownloadExt
@Serializable
data class VideoDownloadExt(
@ProtoNumber(1) val busiType: UInt?,
@ProtoNumber(2) val sceneType: UInt? = null,
@ProtoNumber(3) val subBusiType: UInt?,
@ProtoNumber(4) val msgCodecConfig: CodecConfigReq,
@ProtoNumber(5) val flag: UInt?,
)
@Serializable
data class CodecConfigReq(
@ProtoNumber(1) val platformChipinfo: String,
@ProtoNumber(2) val osVer: String,
@ProtoNumber(3) val deviceName: String,
)
@Serializable
data class IndexNode(
@ProtoNumber(1) val fileInfo: FileInfo,
@ProtoNumber(2) val fileUuid: String,
@ProtoNumber(3) val storeId: UInt, // 0为旧服务器 1为nt服务器
@ProtoNumber(4) val uploadTime: ULong,
@ProtoNumber(5) val ttl: ULong,
@ProtoNumber(6) val subType: UInt,
@ProtoNumber(7) val storeAppId: UInt? = null
)
@Serializable
data class MultiMediaReqHead(
@ProtoNumber(1) val commonHead: CommonHead,
@ProtoNumber(2) val sceneInfo: SceneInfo,
@ProtoNumber(3) val clientMeta: ClientMeta
)
@Serializable
data class ClientMeta(
@ProtoNumber(1) val agentType: UInt,
)
@Serializable
data class SceneInfo(
@ProtoNumber(101) val requestType: UInt,
@ProtoNumber(102) val businessType: UInt,
@ProtoNumber(103) val appType: UInt? = null,
@ProtoNumber(200) var sceneType: UInt? = null,
@ProtoNumber(201) var c2c: C2CUserInfo? = null,
@ProtoNumber(202) var grp: GroupUserInfo? = null,
@ProtoNumber(203) var channel: ChannelUserInfo? = null,
@ProtoNumber(205) val byteArr: ByteArray?= null
)
@Serializable
data class ChannelUserInfo(
@ProtoNumber(1) val guildId: ULong,
@ProtoNumber(2) val channelId: ULong,
@ProtoNumber(3) val channelType: UInt,
)
@Serializable
data class GroupUserInfo(
@ProtoNumber(1) val uin: ULong,
)
@Serializable
data class C2CUserInfo(
@ProtoNumber(1) val accountType: UInt,
@ProtoNumber(2) val uid: String,
@ProtoNumber(3) val byteArr: ByteArray? = null
)
@Serializable
data class CommonHead(
@ProtoNumber(1) val requestId: ULong,
@ProtoNumber(2) val cmd: UInt,
@ProtoNumber(3) val msg: String? = null
)

View File

@ -0,0 +1,139 @@
@file:OptIn(ExperimentalSerializationApi::class)
package protobuf.oidb.cmd0x11c5
import com.google.protobuf.Internal.EMPTY_BYTE_ARRAY
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
@Serializable
data class NtV2RichMediaRsp(
@ProtoNumber(1) val head: RspHead,
@ProtoNumber(2) val upload: UploadRsp?,
@ProtoNumber(3) val download: DownloadRsp?,
@ProtoNumber(4) val downloadRkeyRsp: DownloadRkeyRsp?,
@ProtoNumber(5) val delete: DeleteRsp?,
@ProtoNumber(6) val uploadCompleted: UploadCompletedRsp?,
@ProtoNumber(7) val msgInfoAuth: MsgInfoAuthRsp?,
@ProtoNumber(8) val uploadKeyRenew: UploadKeyRenewalRsp?,
@ProtoNumber(9) val downloadSafe: DownloadSafeRsp?,
@ProtoNumber(99) val extension: ByteArray? = null,
): Protobuf<NtV2RichMediaRsp>
@Serializable
class DownloadSafeRsp
@Serializable
data class UploadKeyRenewalRsp(
@ProtoNumber(1) val ukey: String,
@ProtoNumber(2) val ukeyTtlSec: ULong,
)
@Serializable
data class MsgInfoAuthRsp(
@ProtoNumber(1) val authCode: UInt = 0u,
@ProtoNumber(2) val msg: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoNumber(3) val resultTime: ULong = 0u,
)
@Serializable
data class UploadCompletedRsp(
@ProtoNumber(1) val msgSeq: ULong
)
@Serializable
class DeleteRsp
@Serializable
data class DownloadRkeyRsp(
@ProtoNumber(1) val rkeys: List<RKeyInfo>
)
@Serializable
data class RKeyInfo(
@ProtoNumber(1) val rkey: String,
@ProtoNumber(2) val rkeyTtlSec: ULong,
@ProtoNumber(3) val storeId: UInt = 0u,
@ProtoNumber(4) val rkeyCreateTime: UInt?,
@ProtoNumber(4) val type: UInt?,
)
@Serializable
data class DownloadRsp(
@ProtoNumber(1) val rkeyParam: String,
@ProtoNumber(2) val rkeyTtlSec: ULong,
@ProtoNumber(3) val downloadInfo: DownloadInfo?,
@ProtoNumber(4) val rkeyCreateTime: UInt?
)
@Serializable
data class DownloadInfo(
@ProtoNumber(1) val domain: String,
@ProtoNumber(2) val urlPath: String? = null,
@ProtoNumber(3) val httpsPort: Int = Int.MIN_VALUE,
@ProtoNumber(4) val ipv4: List<Ipv4>,
@ProtoNumber(5) val ipv6: List<Ipv6>,
@ProtoNumber(6) val picUrlExtInfo: PicUrlExtInfo?,
@ProtoNumber(7) val videoExtInfo: VideoExtInfo? = null,
)
@Serializable
data class VideoExtInfo(
@ProtoNumber(1) val videoCodecFormat: UInt,
)
@Serializable
data class UploadRsp(
@ProtoNumber(1) val ukey: String,
@ProtoNumber(2) val ukeyTtlSec: ULong,
@ProtoNumber(3) val ipv4: List<Ipv4>,
@ProtoNumber(4) val ipv6: List<Ipv6>,
@ProtoNumber(5) val msgSeq: ULong,
@ProtoNumber(6) val msgInfo: MsgInfo? = null,
@ProtoNumber(7) val ext: List<RichmediaStorageTransInfo>? = null,
@ProtoNumber(8) val compatQMsg: ByteArray? = null,
@ProtoNumber(10) val subFileInfos: List<SubFileInfo>? = null,
)
@Serializable
data class SubFileInfo(
@ProtoNumber(1) val subType: UInt,
@ProtoNumber(2) val ukey: String,
@ProtoNumber(3) val ukeyTTLSec: ULong,
@ProtoNumber(4) val ipv4: List<Ipv4>,
@ProtoNumber(5) val ipv6: List<Ipv6>,
)
@Serializable
data class RichmediaStorageTransInfo(
@ProtoNumber(1) val subType: UInt = UInt.MIN_VALUE,
@ProtoNumber(2) val extType: UInt = UInt.MIN_VALUE,
@ProtoNumber(3) val extValue: ByteArray? = null,
)
@Serializable
data class Ipv4(
@ProtoNumber(1) val outIp: Int = Int.MIN_VALUE,
@ProtoNumber(2) val outPort: Int = Int.MIN_VALUE,
@ProtoNumber(3) val inIp: Int = Int.MIN_VALUE,
@ProtoNumber(4) val inPort: Int = Int.MIN_VALUE,
@ProtoNumber(5) val ipType: Int = Int.MIN_VALUE,
)
@Serializable
data class Ipv6(
@ProtoNumber(1) val outIp: ByteArray? = null,
@ProtoNumber(2) val outPort: Int = Int.MIN_VALUE,
@ProtoNumber(3) val inIp: ByteArray? = null,
@ProtoNumber(4) val inPort: Int = Int.MIN_VALUE,
@ProtoNumber(5) val ipType: Int = Int.MIN_VALUE,
)
@Serializable
data class RspHead(
@ProtoNumber(1) val commonHead: CommonHead,
@ProtoNumber(2) val retCode: UInt = 0u,
@ProtoNumber(3) val msg: String
)

View File

@ -5,6 +5,7 @@ package protobuf.oidb.cmd0x6d7
import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
import protobuf.group_file_common.FolderInfo import protobuf.group_file_common.FolderInfo
@Serializable @Serializable
@ -13,7 +14,7 @@ data class Oidb0x6d7ReqBody(
@ProtoNumber(2) val deleteFolder: DeleteFolderReq? = null, @ProtoNumber(2) val deleteFolder: DeleteFolderReq? = null,
@ProtoNumber(3) val moveFolder: MoveFolderReq? = null, @ProtoNumber(3) val moveFolder: MoveFolderReq? = null,
@ProtoNumber(4) val renameFolder: RenameFolderReq? = null, @ProtoNumber(4) val renameFolder: RenameFolderReq? = null,
) ): Protobuf<Oidb0x6d7ReqBody>
@Serializable @Serializable
data class CreateFolderReq( data class CreateFolderReq(
@ -53,7 +54,7 @@ data class Oidb0x6d7RespBody(
@ProtoNumber(2) val deleteFolder: DeleteFolderResp? = null, @ProtoNumber(2) val deleteFolder: DeleteFolderResp? = null,
@ProtoNumber(3) val moveFolder: MoveFolderResp? = null, @ProtoNumber(3) val moveFolder: MoveFolderResp? = null,
@ProtoNumber(4) val renameFolder: RenameFolderResp? = null, @ProtoNumber(4) val renameFolder: RenameFolderResp? = null,
) ): Protobuf<Oidb0x6d7RespBody>
@Serializable @Serializable
data class CreateFolderResp( data class CreateFolderResp(

View File

@ -2,6 +2,7 @@ package protobuf.oidb.cmd0x9082
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
@Serializable @Serializable
data class Oidb0x9082( data class Oidb0x9082(
@ -11,4 +12,4 @@ data class Oidb0x9082(
@ProtoNumber(5) val flag: UInt = UInt.MIN_VALUE, @ProtoNumber(5) val flag: UInt = UInt.MIN_VALUE,
@ProtoNumber(6) val u1: UInt = UInt.MIN_VALUE, @ProtoNumber(6) val u1: UInt = UInt.MIN_VALUE,
@ProtoNumber(7) val u2: UInt = UInt.MIN_VALUE, @ProtoNumber(7) val u2: UInt = UInt.MIN_VALUE,
) ): Protobuf<Oidb0x9082>

View File

@ -2,11 +2,12 @@ package protobuf.oidb.cmd0xf16
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
@Serializable @Serializable
data class Oidb0xf16( data class Oidb0xf16(
@ProtoNumber(1) var setGroupRemarkReq: SetGroupRemarkReq? = null, @ProtoNumber(1) var setGroupRemarkReq: SetGroupRemarkReq? = null,
) ): Protobuf<Oidb0xf16>
@Serializable @Serializable
data class SetGroupRemarkReq( data class SetGroupRemarkReq(

View File

@ -5,6 +5,7 @@ package protobuf.oidb.cmd0xf88
import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
@Serializable @Serializable
data class Oidb0xf88Req( data class Oidb0xf88Req(
@ -12,12 +13,12 @@ data class Oidb0xf88Req(
@ProtoNumber(2) val memberId: ULong, @ProtoNumber(2) val memberId: ULong,
@ProtoNumber(3) val tinyId: ULong, @ProtoNumber(3) val tinyId: ULong,
@ProtoNumber(4) val guildId: ULong, @ProtoNumber(4) val guildId: ULong,
) ): Protobuf<Oidb0xf88Req>
@Serializable @Serializable
data class Oidb0xf88Rsp( data class Oidb0xf88Rsp(
@ProtoNumber(1) val userInfo: GProUserInfo? @ProtoNumber(1) val userInfo: GProUserInfo?
) ): Protobuf<Oidb0xf88Rsp>
@Serializable @Serializable
data class GProUserInfo( data class GProUserInfo(

View File

@ -4,6 +4,7 @@ package protobuf.oidb.cmd0xfc2
import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
@Serializable @Serializable
data class Oidb0xfc2ReqBody( data class Oidb0xfc2ReqBody(
@ -16,7 +17,7 @@ data class Oidb0xfc2ReqBody(
@ProtoNumber(300) var msgApplyDownloadReq: Oidb0xfc2MsgApplyDownloadReq? = null, @ProtoNumber(300) var msgApplyDownloadReq: Oidb0xfc2MsgApplyDownloadReq? = null,
//@ProtoNumber(400) var msg_apply_preview_req: Any? = null, //@ProtoNumber(400) var msg_apply_preview_req: Any? = null,
//@ProtoNumber(500) var msg_apply_security_strike_req: Any? = null, //@ProtoNumber(500) var msg_apply_security_strike_req: Any? = null,
) ): Protobuf<Oidb0xfc2ReqBody>
@Serializable @Serializable
data class Oidb0xfc2RspBody( data class Oidb0xfc2RspBody(
@ -27,7 +28,7 @@ data class Oidb0xfc2RspBody(
@ProtoNumber(310) var msgApplyDownloadRsp: Oidb0xfc2MsgApplyDownloadRsp? = null, @ProtoNumber(310) var msgApplyDownloadRsp: Oidb0xfc2MsgApplyDownloadRsp? = null,
//@ProtoNumber(410) var msg_apply_preview_rsp: Any? = null, //@ProtoNumber(410) var msg_apply_preview_rsp: Any? = null,
//@ProtoNumber(510) var msg_apply_security_strike_rsp: Any? = null, //@ProtoNumber(510) var msg_apply_security_strike_rsp: Any? = null,
) ): Protobuf<Oidb0xfc2RspBody>
@Serializable @Serializable
data class Oidb0xfc2MsgApplyDownloadRsp( data class Oidb0xfc2MsgApplyDownloadRsp(

View File

@ -5,17 +5,18 @@ package protobuf.oidb.cmx0xf57
import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
@Serializable @Serializable
data class Oidb0xf57Req( data class Oidb0xf57Req(
@ProtoNumber(1) val filter: Oidb0xf57Filter, @ProtoNumber(1) val filter: Oidb0xf57Filter,
@ProtoNumber(2) val guildInfo: Oidb0xf57GuildInfo, @ProtoNumber(2) val guildInfo: Oidb0xf57GuildInfo,
) ): Protobuf<Oidb0xf57Req>
@Serializable @Serializable
data class Oidb0xf57Rsp( data class Oidb0xf57Rsp(
@ProtoNumber(1) val metaInfo: Oidb0xf57MetaInfo, @ProtoNumber(1) val metaInfo: Oidb0xf57MetaInfo,
) ): Protobuf<Oidb0xf57Rsp>
@Serializable @Serializable
data class Oidb0xf57MetaInfo( data class Oidb0xf57MetaInfo(

View File

@ -2,12 +2,13 @@ package protobuf.push
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
@Serializable @Serializable
data class C2CCommonTipsEvent( data class C2CCommonTipsEvent(
@ProtoNumber(7) val params: List<PokeParam>? = null, @ProtoNumber(7) val params: List<PokeParam>? = null,
@ProtoNumber(8) val xmlTips: String? = null, @ProtoNumber(8) val xmlTips: String? = null,
) ): Protobuf<C2CCommonTipsEvent>
@Serializable @Serializable
data class PokeParam( data class PokeParam(

View File

@ -2,11 +2,12 @@ package protobuf.push
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
@Serializable @Serializable
data class C2CRecallEvent( data class C2CRecallEvent(
@ProtoNumber(1) val head: C2CRecallHead? = null, @ProtoNumber(1) val head: C2CRecallHead? = null,
) ): Protobuf<C2CRecallEvent>
@Serializable @Serializable
data class C2CRecallHead( data class C2CRecallHead(

View File

@ -2,11 +2,12 @@ package protobuf.push
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
@Serializable @Serializable
data class FriendApplyEvent( data class FriendApplyEvent(
@ProtoNumber(1) val head: FriendApplyHead? = null, @ProtoNumber(1) val head: FriendApplyHead? = null,
) ): Protobuf<FriendApplyEvent>
@Serializable @Serializable

View File

@ -2,10 +2,11 @@ package protobuf.push
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
@Serializable @Serializable
data class GroupAdminChangeEvent( data class GroupAdminChangeEvent(
@ProtoNumber(1) val groupCode: Long, @ProtoNumber(1) val groupCode: Long,
@ProtoNumber(4) val operation: GroupAdminChangedOperation? = null @ProtoNumber(4) val operation: GroupAdminChangedOperation? = null
) ): Protobuf<GroupAdminChangeEvent>

View File

@ -2,10 +2,11 @@ package protobuf.push
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
@Serializable @Serializable
data class GroupApplyEvent( data class GroupApplyEvent(
@ProtoNumber(1) val groupCode: Long = Long.MIN_VALUE, @ProtoNumber(1) val groupCode: Long = Long.MIN_VALUE,
@ProtoNumber(3) val applierUid: String = "", @ProtoNumber(3) val applierUid: String = "",
@ProtoNumber(5) val applyMsg: String? = null, @ProtoNumber(5) val applyMsg: String? = null,
) ): Protobuf<GroupApplyEvent>

View File

@ -2,13 +2,14 @@ package protobuf.push
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
@Serializable @Serializable
data class GroupBanEvent( data class GroupBanEvent(
@ProtoNumber(1) val groupCode: ULong = ULong.MIN_VALUE, @ProtoNumber(1) val groupCode: ULong = ULong.MIN_VALUE,
@ProtoNumber(4) val operatorUid: String = "", @ProtoNumber(4) val operatorUid: String = "",
@ProtoNumber(5) val target: GroupBanTarget? = null, @ProtoNumber(5) val target: GroupBanTarget? = null,
) ): Protobuf<GroupBanEvent>
@Serializable @Serializable
data class GroupBanTarget( data class GroupBanTarget(

View File

@ -2,6 +2,7 @@ package protobuf.push
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
@Serializable @Serializable
data class GroupCommonTipsEvent( data class GroupCommonTipsEvent(
@ -11,7 +12,7 @@ data class GroupCommonTipsEvent(
@ProtoNumber(26) val baseTips: List<GroupBaseTips>? = null, @ProtoNumber(26) val baseTips: List<GroupBaseTips>? = null,
@ProtoNumber(33) val essenceMsgInfo: List<EssenceMsgInfo>? = null, @ProtoNumber(33) val essenceMsgInfo: List<EssenceMsgInfo>? = null,
@ProtoNumber(37) val msgSeq: ULong = ULong.MIN_VALUE, @ProtoNumber(37) val msgSeq: ULong = ULong.MIN_VALUE,
) ): Protobuf<GroupCommonTipsEvent>
@Serializable @Serializable
data class EssenceMsgInfo( data class EssenceMsgInfo(

View File

@ -2,9 +2,10 @@ package protobuf.push
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
@Serializable @Serializable
data class GroupInviteEvent( data class GroupInviteEvent(
@ProtoNumber(1) val groupCode: Long, @ProtoNumber(1) val groupCode: Long,
@ProtoNumber(5) val inviterUid: String, @ProtoNumber(5) val inviterUid: String,
) ): Protobuf<GroupInviteEvent>

View File

@ -2,11 +2,12 @@ package protobuf.push
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
@Serializable @Serializable
data class GroupInvitedApplyEvent( data class GroupInvitedApplyEvent(
@ProtoNumber(2) val applyInfo: GroupInvitedApplyInfo? = null, @ProtoNumber(2) val applyInfo: GroupInvitedApplyInfo? = null,
) ): Protobuf<GroupInvitedApplyEvent>
@Serializable @Serializable
data class GroupInvitedApplyInfo( data class GroupInvitedApplyInfo(

View File

@ -2,6 +2,7 @@ package protobuf.push
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
@Serializable @Serializable
data class GroupListChangeEvent( data class GroupListChangeEvent(
@ -9,4 +10,4 @@ data class GroupListChangeEvent(
@ProtoNumber(3) val memberUid: String = "", @ProtoNumber(3) val memberUid: String = "",
@ProtoNumber(4) val type: Int = Int.MIN_VALUE, @ProtoNumber(4) val type: Int = Int.MIN_VALUE,
@ProtoNumber(5) val operatorUid: String = "", @ProtoNumber(5) val operatorUid: String = "",
) ): Protobuf<GroupListChangeEvent>

View File

@ -2,13 +2,14 @@ package protobuf.push
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber import kotlinx.serialization.protobuf.ProtoNumber
import protobuf.message.MessageBody import moe.fuqiuluo.symbols.Protobuf
import protobuf.message.PushMsgBody
@Serializable @Serializable
data class MessagePush( data class MessagePush(
@ProtoNumber(1) val msgBody: MessageBody? = null, @ProtoNumber(1) val msgBody: PushMsgBody? = null,
@ProtoNumber(4) val clientInfo: MessagePushClientInfo? = null, @ProtoNumber(4) val clientInfo: MessagePushClientInfo? = null,
) ): Protobuf<MessagePush>
@Serializable @Serializable
data class MessagePushClientInfo( data class MessagePushClientInfo(

View File

@ -5,6 +5,7 @@ package protobuf.qweb
import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber import kotlinx.serialization.protobuf.ProtoNumber
import moe.fuqiuluo.symbols.Protobuf
@Serializable @Serializable
data class QWebReq( data class QWebReq(
@ -19,7 +20,7 @@ data class QWebReq(
//@ProtoNumber(9) var Crypto: Any? = null, //@ProtoNumber(9) var Crypto: Any? = null,
@ProtoNumber(10) var extinfo: List<QWebExtInfo>? = null, @ProtoNumber(10) var extinfo: List<QWebExtInfo>? = null,
//@ProtoNumber(11) var contentType: Any? = null, //@ProtoNumber(11) var contentType: Any? = null,
) ): Protobuf<QWebReq>
@Serializable @Serializable
data class QWebExtInfo( data class QWebExtInfo(
@ -34,4 +35,4 @@ data class QWebRsp(
//@ProtoNumber(3) var errMsg: String? = null, //@ProtoNumber(3) var errMsg: String? = null,
@ProtoNumber(4) var buffer: ByteArray? = null, @ProtoNumber(4) var buffer: ByteArray? = null,
//@ProtoNumber(5) var Extinfo: List<QWebExtInfo>? = null, //@ProtoNumber(5) var Extinfo: List<QWebExtInfo>? = null,
) ): Protobuf<QWebRsp>

View File

@ -0,0 +1,19 @@
package com.tencent.guild.api.transfile;
import androidx.annotation.Nullable;
import com.tencent.mobileqq.qroute.QRouteApi;
import com.tencent.qqnt.kernel.nativeinterface.BigDataTicket;
public interface IGuildTransFileApi extends QRouteApi {
//@Nullable
//ArrayList<ServerAddress> getBigDataIpList(boolean z, @Nullable IpType ipType);
@Nullable
BigDataTicket getBigDataTicket();
//@Nullable
//ArrayList<ServerAddress> getIpDirectList(@Nullable String str, @Nullable IpType ipType);
void pullConfigIfNeed();
}

View File

@ -0,0 +1,26 @@
package com.tencent.libra.download;
import androidx.annotation.NonNull;
import com.tencent.libra.request.Option;
public interface ILibraDownloader {
class PicDownLoadListener {
Option mOption;
public PicDownLoadListener(@NonNull Option option) {
this.mOption = option;
}
public void onResult(boolean success, int code) {
}
}
boolean canDownload(Option option);
void cancel(Option option);
void downLoad(Option option, PicDownLoadListener picDownLoadListener);
boolean needDownloadOnWorkThread();
}

View File

@ -0,0 +1,4 @@
package com.tencent.libra.request;
public class Option {
}

View File

@ -0,0 +1,29 @@
package com.tencent.mobileqq.perf.block;
import android.os.Bundle;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import epic.EIPCClient;
import epic.EIPCResult;
import kotlin.Metadata;
import kotlin.jvm.JvmStatic;
public final class BinderMethodProxy {
@NotNull
public static final BinderMethodProxy INSTANCE;
static {
INSTANCE = new BinderMethodProxy();
}
@JvmStatic
public static EIPCResult callServer(@NotNull EIPCClient client, @Nullable String module, @Nullable String action, @Nullable Bundle bundle) {
//MainBlockMethodMonitor.onMethodStart();
//EIPCResult callServer = client.callServer(str, str2, bundle);
//MainBlockMethodMonitor.onMethodEnd();
//return callServer;
return null;
}
}

View File

@ -0,0 +1,13 @@
package com.tencent.mobileqq.qipc;
import epic.EIPCClient;
public class QIPCClientHelper {
public static synchronized QIPCClientHelper getInstance() {
return null;
}
public EIPCClient getClient() {
return null;
}
}

View File

@ -0,0 +1,7 @@
package com.tencent.mobileqq.qmmkv;
public class MMKVOptionEntity {
public String decodeString(String str, String str2) {
return "";
}
}

View File

@ -0,0 +1,9 @@
package com.tencent.mobileqq.qmmkv;
import android.content.Context;
public class QMMKV {
public static MMKVOptionEntity from(Context context, String str) {
return null;
}
}

View File

@ -0,0 +1,11 @@
package com.tencent.qqnt.aio.api;
import com.tencent.libra.download.ILibraDownloader;
import com.tencent.mobileqq.qroute.QRouteApi;
import org.jetbrains.annotations.NotNull;
public interface IAIOPicDownloaderProvider extends QRouteApi {
@NotNull
ILibraDownloader provideDownloader();
}

View File

@ -1,7 +1,9 @@
package com.tencent.qqnt.kernel.api.impl; package com.tencent.qqnt.kernel.api.impl;
import com.tencent.qqnt.kernel.nativeinterface.IGetTempChatInfoCallback;
import com.tencent.qqnt.kernel.nativeinterface.IKernelMsgListener; import com.tencent.qqnt.kernel.nativeinterface.IKernelMsgListener;
import com.tencent.qqnt.kernel.nativeinterface.IOperateCallback; import com.tencent.qqnt.kernel.nativeinterface.IOperateCallback;
import com.tencent.qqnt.kernel.nativeinterface.RichMediaElementGetReq;
import com.tencent.qqnt.kernel.nativeinterface.RichMediaFilePathInfo; import com.tencent.qqnt.kernel.nativeinterface.RichMediaFilePathInfo;
import com.tencent.qqnt.kernel.nativeinterface.TempChatPrepareInfo; import com.tencent.qqnt.kernel.nativeinterface.TempChatPrepareInfo;
@ -9,6 +11,10 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
public class MsgService { public class MsgService {
void getRichMediaElement(@NotNull RichMediaElementGetReq req) {
}
public void addMsgListener(IKernelMsgListener listener) { public void addMsgListener(IKernelMsgListener listener) {
} }
@ -24,4 +30,8 @@ public class MsgService {
public void prepareTempChat(TempChatPrepareInfo tempChatPrepareInfo, IOperateCallback cb) { public void prepareTempChat(TempChatPrepareInfo tempChatPrepareInfo, IOperateCallback cb) {
} }
public void getTempChatInfo(int chatType, @Nullable String uid, @Nullable IGetTempChatInfoCallback cb) {
}
} }

View File

@ -0,0 +1,30 @@
package com.tencent.qqnt.kernel.nativeinterface;
public final class BigDataTicket {
public String sessionKey;
public String sessionSig;
public BigDataTicket() {
this.sessionSig = "";
this.sessionKey = "";
}
public String getSessionKey() {
return this.sessionKey;
}
public String getSessionSig() {
return this.sessionSig;
}
public String toString() {
return "BigDataTicket{sessionSig=" + this.sessionSig + ",sessionKey=" + this.sessionKey + ",}";
}
public BigDataTicket(String str, String str2) {
this.sessionSig = "";
this.sessionKey = "";
this.sessionSig = str;
this.sessionKey = str2;
}
}

View File

@ -0,0 +1,5 @@
package com.tencent.qqnt.kernel.nativeinterface;
public interface IGetTempChatInfoCallback {
void onResult(int code, String msg, TempChatInfo info);
}

View File

@ -79,6 +79,10 @@ public final class InlineKeyboardButton {
return "InlineKeyboardButton{id=" + this.id + ",label=" + this.label + ",visitedLabel=" + this.visitedLabel + ",style=" + this.style + ",type=" + this.type + ",clickLimit=" + this.clickLimit + ",unsupportTips=" + this.unsupportTips + ",data=" + this.data + ",atBotShowChannelList=" + this.atBotShowChannelList + ",permissionType=" + this.permissionType + ",specifyRoleIds=" + this.specifyRoleIds + ",specifyTinyids=" + this.specifyTinyids + ",}"; return "InlineKeyboardButton{id=" + this.id + ",label=" + this.label + ",visitedLabel=" + this.visitedLabel + ",style=" + this.style + ",type=" + this.type + ",clickLimit=" + this.clickLimit + ",unsupportTips=" + this.unsupportTips + ",data=" + this.data + ",atBotShowChannelList=" + this.atBotShowChannelList + ",permissionType=" + this.permissionType + ",specifyRoleIds=" + this.specifyRoleIds + ",specifyTinyids=" + this.specifyTinyids + ",}";
} }
public InlineKeyboardButton(String str, String str2, String str3, int i, int i2, int i3, String str4, String str5, boolean z, int i4, ArrayList<String> arrayList, ArrayList<String> arrayList2, boolean z2, int i5, boolean z3, ArrayList<SubscribeMsgTemplateID> arrayList3) {
}
public InlineKeyboardButton(String str, String str2, String str3, int i2, int i3, int i4, String str4, String str5, boolean z, int i5, ArrayList<String> arrayList, ArrayList<String> arrayList2) { public InlineKeyboardButton(String str, String str2, String str3, int i2, int i3, int i4, String str4, String str5, boolean z, int i5, ArrayList<String> arrayList, ArrayList<String> arrayList2) {
this.id = ""; this.id = "";
this.label = ""; this.label = "";

View File

@ -264,6 +264,10 @@ public final class PicElement implements IKernelModel {
this.transferStatus = num; this.transferStatus = num;
} }
public int getStoreID() {
return 0;
}
public String toString() { public String toString() {
return "PicElement{picSubType=" + this.picSubType + ",fileName=" + this.fileName + ",fileSize=" + this.fileSize + ",picWidth=" + this.picWidth + ",picHeight=" + this.picHeight + ",original=" + this.original + ",md5HexStr=" + this.md5HexStr + ",sourcePath=" + this.sourcePath + ",thumbPath=" + this.thumbPath + ",transferStatus=" + this.transferStatus + ",progress=" + this.progress + ",picType=" + this.picType + ",invalidState=" + this.invalidState + ",fileUuid=" + this.fileUuid + ",fileSubId=" + this.fileSubId + ",thumbFileSize=" + this.thumbFileSize + ",fileBizId=" + this.fileBizId + ",downloadIndex=" + this.downloadIndex + ",summary=" + this.summary + ",emojiFrom=" + this.emojiFrom + ",emojiWebUrl=" + this.emojiWebUrl + ",emojiAd=" + this.emojiAd + ",emojiMall=" + this.emojiMall + ",emojiZplan=" + this.emojiZplan + ",originImageMd5=" + this.originImageMd5 + ",originImageUrl=" + this.originImageUrl + ",importRichMediaContext=" + this.importRichMediaContext + ",isFlashPic=" + this.isFlashPic + ",}"; return "PicElement{picSubType=" + this.picSubType + ",fileName=" + this.fileName + ",fileSize=" + this.fileSize + ",picWidth=" + this.picWidth + ",picHeight=" + this.picHeight + ",original=" + this.original + ",md5HexStr=" + this.md5HexStr + ",sourcePath=" + this.sourcePath + ",thumbPath=" + this.thumbPath + ",transferStatus=" + this.transferStatus + ",progress=" + this.progress + ",picType=" + this.picType + ",invalidState=" + this.invalidState + ",fileUuid=" + this.fileUuid + ",fileSubId=" + this.fileSubId + ",thumbFileSize=" + this.thumbFileSize + ",fileBizId=" + this.fileBizId + ",downloadIndex=" + this.downloadIndex + ",summary=" + this.summary + ",emojiFrom=" + this.emojiFrom + ",emojiWebUrl=" + this.emojiWebUrl + ",emojiAd=" + this.emojiAd + ",emojiMall=" + this.emojiMall + ",emojiZplan=" + this.emojiZplan + ",originImageMd5=" + this.originImageMd5 + ",originImageUrl=" + this.originImageUrl + ",importRichMediaContext=" + this.importRichMediaContext + ",isFlashPic=" + this.isFlashPic + ",}";
} }

View File

@ -0,0 +1,118 @@
package com.tencent.qqnt.kernel.nativeinterface;
public final class RichMediaElementGetReq implements IKernelModel {
public int chatType;
public int downSourceType;
public int downloadType;
public long elementId;
public long fileModelId;
public String filePath;
public long msgId;
public String peerUid;
public int thumbSize;
public int triggerType;
public RichMediaElementGetReq() {
this.peerUid = "";
this.filePath = "";
}
public int getChatType() {
return this.chatType;
}
public int getDownSourceType() {
return this.downSourceType;
}
public int getDownloadType() {
return this.downloadType;
}
public long getElementId() {
return this.elementId;
}
public long getFileModelId() {
return this.fileModelId;
}
public String getFilePath() {
return this.filePath;
}
public long getMsgId() {
return this.msgId;
}
public String getPeerUid() {
return this.peerUid;
}
public int getThumbSize() {
return this.thumbSize;
}
public int getTriggerType() {
return this.triggerType;
}
public void setChatType(int i2) {
this.chatType = i2;
}
public void setDownSourceType(int i2) {
this.downSourceType = i2;
}
public void setDownloadType(int i2) {
this.downloadType = i2;
}
public void setElementId(long j2) {
this.elementId = j2;
}
public void setFileModelId(long j2) {
this.fileModelId = j2;
}
public void setFilePath(String str) {
this.filePath = str;
}
public void setMsgId(long j2) {
this.msgId = j2;
}
public void setPeerUid(String str) {
this.peerUid = str;
}
public void setThumbSize(int i2) {
this.thumbSize = i2;
}
public void setTriggerType(int i2) {
this.triggerType = i2;
}
public String toString() {
return "RichMediaElementGetReq{msgId=" + this.msgId + ",peerUid=" + this.peerUid + ",chatType=" + this.chatType + ",elementId=" + this.elementId + ",downloadType=" + this.downloadType + ",thumbSize=" + this.thumbSize + ",filePath=" + this.filePath + ",fileModelId=" + this.fileModelId + ",downSourceType=" + this.downSourceType + ",triggerType=" + this.triggerType + ",}";
}
public RichMediaElementGetReq(long j2, String str, int i2, long j3, int i3, int i4, String str2, long j4, int i5, int i6) {
this.peerUid = "";
this.filePath = "";
this.msgId = j2;
this.peerUid = str;
this.chatType = i2;
this.elementId = j3;
this.downloadType = i3;
this.thumbSize = i4;
this.filePath = str2;
this.fileModelId = j4;
this.downSourceType = i5;
this.triggerType = i6;
}
}

View File

@ -0,0 +1,4 @@
package com.tencent.qqnt.kernel.nativeinterface;
public class SubscribeMsgTemplateID {
}

View File

@ -0,0 +1,4 @@
package epic;
public class EIPCClient {
}

View File

@ -0,0 +1,11 @@
package epic;
import android.os.Bundle;
public class EIPCResult {
public Bundle data;
public boolean isSuccess() {
return false;
}
}

View File

@ -31,10 +31,24 @@ public class oidb_cmd0xb77 {
// public final PBUInt32Field service_id = PBField.initUInt32(0); // public final PBUInt32Field service_id = PBField.initUInt32(0);
// public final PBStringField xml = PBField.initString(""); // public final PBStringField xml = PBField.initString("");
//}; //};
//public oidb_cmd0xb77$MiniAppMsgBody mini_app_msg_body = new oidb_cmd0xb77$MiniAppMsgBody(); public MiniAppMsgBody mini_app_msg_body = new MiniAppMsgBody();
public final PBUInt64Field recv_guild_id = PBField.initUInt64(0); public final PBUInt64Field recv_guild_id = PBField.initUInt64(0);
} }
public static class MiniAppMsgBody extends MessageMicro<MiniAppMsgBody> {
//static final MessageMicro.FieldMap __fieldMap__ = MessageMicro.initFieldMap(
// new int[]{8, 18, 26, 32, 42, 50, 82}, new String[]{"mini_app_appid", "mini_app_path", "web_page_url", "mini_app_type", "title", "desc", "json_str"}
//, new Object[]{0L, "", "", 0, "", "", ""}, oidb_cmd0xb77$MiniAppMsgBody.class);
public final PBUInt64Field mini_app_appid = PBField.initUInt64(0);
public final PBStringField mini_app_path = PBField.initString("");
public final PBStringField web_page_url = PBField.initString("");
public final PBUInt32Field mini_app_type = PBField.initUInt32(0);
public final PBStringField title = PBField.initString("");
public final PBStringField desc = PBField.initString("");
public final PBStringField json_str = PBField.initString("");
}
public static class ArkMsgBody extends MessageMicro<ArkMsgBody> { public static class ArkMsgBody extends MessageMicro<ArkMsgBody> {
public final PBStringField app = PBField.initString(""); public final PBStringField app = PBField.initString("");
public final PBStringField view = PBField.initString(""); public final PBStringField view = PBField.initString("");

View File

@ -26,7 +26,7 @@ buildscript {
} }
} }
dependencies { dependencies {
classpath("com.android.tools:r8:8.2.26") classpath("com.android.tools:r8:8.2.47")
} }
} }

View File

@ -11,14 +11,15 @@ import io.ktor.utils.io.core.BytePacketBuilder
import io.ktor.utils.io.core.readBytes import io.ktor.utils.io.core.readBytes
import io.ktor.utils.io.core.writeFully import io.ktor.utils.io.core.writeFully
import io.ktor.utils.io.core.writeInt import io.ktor.utils.io.core.writeInt
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import kotlinx.coroutines.suspendCancellableCoroutine import kotlinx.coroutines.suspendCancellableCoroutine
import kotlinx.coroutines.withTimeoutOrNull import kotlinx.coroutines.withTimeoutOrNull
import kotlinx.serialization.encodeToByteArray import kotlinx.serialization.encodeToByteArray
import kotlinx.serialization.protobuf.ProtoBuf
import moe.fuqiuluo.shamrock.tools.slice import moe.fuqiuluo.shamrock.tools.slice
import moe.fuqiuluo.shamrock.utils.DeflateTools import moe.fuqiuluo.shamrock.utils.DeflateTools
import moe.fuqiuluo.shamrock.utils.PlatformUtils import moe.fuqiuluo.shamrock.utils.PlatformUtils
@ -27,11 +28,13 @@ import moe.fuqiuluo.shamrock.xposed.helper.internal.DynamicReceiver
import moe.fuqiuluo.shamrock.xposed.helper.internal.IPCRequest import moe.fuqiuluo.shamrock.xposed.helper.internal.IPCRequest
import protobuf.oidb.TrpcOidb import protobuf.oidb.TrpcOidb
import mqq.app.MobileQQ import mqq.app.MobileQQ
import protobuf.auto.toByteArray
import tencent.im.oidb.oidb_sso import tencent.im.oidb.oidb_sso
import kotlin.coroutines.CoroutineContext
import kotlin.coroutines.resume import kotlin.coroutines.resume
internal abstract class BaseSvc { internal abstract class BaseSvc {
companion object { companion object Default: CoroutineScope {
val currentUin: String val currentUin: String
get() = app.currentAccountUin get() = app.currentAccountUin
@ -46,7 +49,7 @@ internal abstract class BaseSvc {
val seq = MsfCore.getNextSeq() val seq = MsfCore.getNextSeq()
val buffer = withTimeoutOrNull(timeout) { val buffer = withTimeoutOrNull(timeout) {
suspendCancellableCoroutine { continuation -> suspendCancellableCoroutine { continuation ->
GlobalScope.launch(Dispatchers.Default) { launch(Dispatchers.Default) {
DynamicReceiver.register(IPCRequest(cmd, seq) { DynamicReceiver.register(IPCRequest(cmd, seq) {
val buffer = it.getByteArrayExtra("buffer")!! val buffer = it.getByteArrayExtra("buffer")!!
continuation.resume(buffer) continuation.resume(buffer)
@ -75,7 +78,7 @@ internal abstract class BaseSvc {
val seq = MsfCore.getNextSeq() val seq = MsfCore.getNextSeq()
val buffer = withTimeoutOrNull<ByteArray?>(timeout) { val buffer = withTimeoutOrNull<ByteArray?>(timeout) {
suspendCancellableCoroutine { continuation -> suspendCancellableCoroutine { continuation ->
GlobalScope.launch(Dispatchers.Default) { launch(Dispatchers.Default) {
DynamicReceiver.register(IPCRequest(cmd, seq) { DynamicReceiver.register(IPCRequest(cmd, seq) {
val buffer = it.getByteArrayExtra("buffer")!! val buffer = it.getByteArrayExtra("buffer")!!
continuation.resume(buffer) continuation.resume(buffer)
@ -125,9 +128,9 @@ internal abstract class BaseSvc {
cmd = cmdId, cmd = cmdId,
service = serviceId, service = serviceId,
buffer = buffer, buffer = buffer,
flag = 0 flag = 1
) )
to.putWupBuffer(ProtoBuf.encodeToByteArray(oidb)) to.putWupBuffer(oidb.toByteArray())
to.addAttribute("req_pb_protocol_flag", true) to.addAttribute("req_pb_protocol_flag", true)
if (seq != -1) { if (seq != -1) {
@ -143,6 +146,11 @@ internal abstract class BaseSvc {
toServiceMsg.addAttribute("shamrock_seq", seq) toServiceMsg.addAttribute("shamrock_seq", seq)
app.sendToService(toServiceMsg) app.sendToService(toServiceMsg)
} }
@OptIn(ExperimentalCoroutinesApi::class)
override val coroutineContext: CoroutineContext by lazy {
Dispatchers.IO.limitedParallelism(12)
}
} }
protected fun send(toServiceMsg: ToServiceMsg) { protected fun send(toServiceMsg: ToServiceMsg) {
@ -153,7 +161,7 @@ internal abstract class BaseSvc {
val seq = MsfCore.getNextSeq() val seq = MsfCore.getNextSeq()
val buffer = withTimeoutOrNull<ByteArray?>(timeout) { val buffer = withTimeoutOrNull<ByteArray?>(timeout) {
suspendCancellableCoroutine { continuation -> suspendCancellableCoroutine { continuation ->
GlobalScope.launch(Dispatchers.Default) { launch(Dispatchers.Default) {
DynamicReceiver.register(IPCRequest(toServiceMsg.serviceCmd, seq) { DynamicReceiver.register(IPCRequest(toServiceMsg.serviceCmd, seq) {
val buffer = it.getByteArrayExtra("buffer")!! val buffer = it.getByteArrayExtra("buffer")!!
continuation.resume(buffer) continuation.resume(buffer)

View File

@ -88,16 +88,16 @@ internal object CardSvc: BaseSvc() {
return rsp.signed_ark_msg.get() return rsp.signed_ark_msg.get()
} }
suspend fun getProfileCard(uin: String): Result<Card> { suspend fun getProfileCard(uin: Long): Result<Card> {
return getProfileCardFromCache(uin).onFailure { return getProfileCardFromCache(uin).onFailure {
return refreshAndGetProfileCard(uin) return refreshAndGetProfileCard(uin)
} }
} }
fun getProfileCardFromCache(uin: String): Result<Card> { fun getProfileCardFromCache(uin: Long): Result<Card> {
val profileDataService = app val profileDataService = app
.getRuntimeService(IProfileDataService::class.java, "all") .getRuntimeService(IProfileDataService::class.java, "all")
val card = profileDataService.getProfileCard(uin, true) val card = profileDataService.getProfileCard(uin.toString(), true)
return if (card == null || card.strNick.isNullOrEmpty()) { return if (card == null || card.strNick.isNullOrEmpty()) {
Result.failure(Exception("unable to fetch profile card")) Result.failure(Exception("unable to fetch profile card"))
} else { } else {
@ -105,7 +105,7 @@ internal object CardSvc: BaseSvc() {
} }
} }
suspend fun refreshAndGetProfileCard(uin: String): Result<Card> { suspend fun refreshAndGetProfileCard(uin: Long): Result<Card> {
val dataService = app val dataService = app
.getRuntimeService(IProfileDataService::class.java, "all") .getRuntimeService(IProfileDataService::class.java, "all")
val card = refreshCardLock.withLock { val card = refreshCardLock.withLock {
@ -122,7 +122,7 @@ internal object CardSvc: BaseSvc() {
} }
}) })
app.getRuntimeService(IProfileProtocolService::class.java, "all") app.getRuntimeService(IProfileProtocolService::class.java, "all")
.requestProfileCard(app.currentUin, uin, 12, 0L, 0.toByte(), 0L, 0L, null, "", 0L, 10004, null, 0.toByte()) .requestProfileCard(app.currentUin, uin.toString(), 12, 0L, 0.toByte(), 0L, 0L, null, "", 0L, 10004, null, 0.toByte())
} }
} }
return if (card == null || card.strNick.isNullOrEmpty()) { return if (card == null || card.strNick.isNullOrEmpty()) {

View File

@ -1,21 +1,20 @@
package moe.fuqiuluo.qqinterface.servlet package moe.fuqiuluo.qqinterface.servlet
import kotlinx.serialization.encodeToByteArray import kotlinx.serialization.encodeToByteArray
import kotlinx.serialization.protobuf.ProtoBuf import protobuf.auto.toByteArray
import protobuf.oidb.cmd0x9082.Oidb0x9082 import protobuf.oidb.cmd0x9082.Oidb0x9082
internal object ChatSvc: BaseSvc() { internal object ChatSvc: BaseSvc() {
fun setGroupMessageCommentFace(peer: Long, msgSeq: ULong, faceIndex: String, isSet: Boolean) { fun setGroupMessageCommentFace(peer: Long, msgSeq: ULong, faceIndex: String, isSet: Boolean) {
val serviceId = if (isSet) 1 else 2 val serviceId = if (isSet) 1 else 2
sendOidb("OidbSvcTrpcTcp.0x9082_$serviceId", 36994, serviceId, ProtoBuf.encodeToByteArray( sendOidb("OidbSvcTrpcTcp.0x9082_$serviceId", 36994, serviceId, Oidb0x9082(
Oidb0x9082(
peer = peer.toULong(), peer = peer.toULong(),
msgSeq = msgSeq, msgSeq = msgSeq,
faceIndex = faceIndex, faceIndex = faceIndex,
flag = 1u, flag = 1u,
u1 = 0u, u1 = 0u,
u2 = 0u u2 = 0u
) ).toByteArray())
))
} }
} }

Some files were not shown because too many files have changed in this diff Show More