feat(onebot): TierB ③ — RE'd OIDB actions (ark share / doubt friends / robot-add)
All recovered from QQNT wrapper.linux.node via IDA — NapCat ships these as
kernel-only with no portable packet wire, so each cmd + protobuf was traced
from the binary (worker ctor cmd/subcmd via BaseOidbWorker::DoSendOidbReq;
field tags from the per-feature EncodeRequest). All uin-form OIDB (envelope
reserved=1, matching the NT worker flag=1). One commit for easy rollback.
New OIDB services + byte-oracle tests (fixed-wire, mutation-resistant):
- 0x9130_0 getBuddyRecommendContactArkJson → share_peer/send_ark_share (user)
- 0x8b7_5 getGroupRecommendContactArkJson → share_peer/send_ark_share (group),
share_group_ex/send_group_ark_share (NapCat's getArkJsonGroupShare
was NOT RE'd; routed to this confident equivalent — documented)
- 0xd69_0 getDoubtBuddyReq → get_doubt_friends_add_request
- 0xd69_0 approvalDoubtBuddyReq → set_doubt_friends_add_request (approve only)
- 0xf00_3 modifyGroupExtInfoV2 → set_group_robot_add_option (EXTInfo tags
30/31; GroupExtFilter is client-side gating, not on the wire)
NOT shipped (kernel-.so-side, no static cmd recoverable from this binary —
honest, no guessed packets): get_robot_uin_range (trpc method-routed),
create_collection/get_collection_list (Weiyun multi-step), trans_group_file.
Doubt-list string field NAMES (nick/source/msg) are medium-confidence
(generic serializer); uid+reqTime are high. READ path, so a mislabel is
cosmetic, never a wire/ban risk. Wired through bridge friend/contacts/
groupAdmin apis; proto-defs + per-file subpath exports registered.
This commit is contained in:
21 files changed
+931
No files matched your search
@@ -59,6 +59,18 @@
|
||||
"types": "./src/oidb-actions/base.ts",
|
||||
"default": "./src/oidb-actions/base.ts"
|
||||
},
|
||||
"./oidb-actions/contact-ark": {
|
||||
"types": "./src/oidb-actions/contact-ark.ts",
|
||||
"default": "./src/oidb-actions/contact-ark.ts"
|
||||
},
|
||||
"./oidb-actions/doubt-buddy": {
|
||||
"types": "./src/oidb-actions/doubt-buddy.ts",
|
||||
"default": "./src/oidb-actions/doubt-buddy.ts"
|
||||
},
|
||||
"./oidb-actions/group-ext": {
|
||||
"types": "./src/oidb-actions/group-ext.ts",
|
||||
"default": "./src/oidb-actions/group-ext.ts"
|
||||
},
|
||||
"./oidb-actions/group-album": {
|
||||
"types": "./src/oidb-actions/group-album.ts",
|
||||
"default": "./src/oidb-actions/group-album.ts"
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
// Recommend-contact ARK card protobufs, RE'd from QQNT wrapper.linux.node.
|
||||
//
|
||||
// Buddy: OidbSvcTrpcTcp.0x9130_0 (getBuddyRecommendContactArkJson) — encoder
|
||||
// `buddy_recommend_contact_ark_json.cc::EncodeRequest` writes {1:uin,
|
||||
// 2:phone,3:jump_url}; decoder reads {1:ark json}.
|
||||
// Group: OidbSvcTrpcTcp.0x8b7_5 (getGroupRecommendContactArkJson) — encoder
|
||||
// `group_get_ark_json_worker.cc::EncodeRequest` writes {1:reqType=1,
|
||||
// 2:groupCode,5:flag=1}; response (group_info_mgr.cc `[gp_get_ark_json]`)
|
||||
// reads {1:bussness_error_code, 5:ark_json}.
|
||||
// Both return a server-built ark JSON string (the share card payload).
|
||||
|
||||
import type { pb, uint_32 } from '@snowluma/proton';
|
||||
|
||||
export interface OidbBuddyRecommendArkReq {
|
||||
uin?: pb<1, uint_32>;
|
||||
phoneNum?: pb<2, string>;
|
||||
jumpUrl?: pb<3, string>;
|
||||
}
|
||||
export interface OidbBuddyRecommendArkResp {
|
||||
arkJson?: pb<1, string>;
|
||||
}
|
||||
|
||||
export interface OidbGroupRecommendArkReq {
|
||||
reqType?: pb<1, uint_32>;
|
||||
groupCode?: pb<2, uint_32>;
|
||||
flag?: pb<5, uint_32>;
|
||||
}
|
||||
export interface OidbGroupRecommendArkResp {
|
||||
errCode?: pb<1, uint_32>;
|
||||
arkJson?: pb<5, string>;
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
// Doubt-buddy (可能认识的人 / 被过滤的好友申请) protobufs, RE'd from QQNT
|
||||
// wrapper.linux.node. Both get + approval ride OidbSvcTrpcTcp.0xd69_0
|
||||
// (worker ctors both pass cmd=0xd69, sub=0; codec `doubt_codec.cc`).
|
||||
//
|
||||
// GET request (EncodeRequest sub_3F3DC20): {1:const 1, 2:{1:num, 2:uk}}.
|
||||
// reqId is NOT serialized (kernel uses it only for JS callback correlation).
|
||||
// GET response: status (==1 ok) + body{1:repeated item, 2:reason}.
|
||||
// Per-item: uid(1) and reqTime(9,u64) are HIGH confidence (read verbatim
|
||||
// from the codec). The string tags' semantic NAMES (nick/source/msg) come
|
||||
// from the GENERIC buddy serializer registry, not a doubt-specific table,
|
||||
// so they are MEDIUM confidence — but this is a READ, so a mislabel is
|
||||
// cosmetic, never a malformed-packet/ban risk. We model the ones NapCat
|
||||
// surfaces and leave the rest unmapped.
|
||||
// APPROVAL request (EncodeRequest sub_3F3EC90): {1:uid, 2:uid, [3:u32],
|
||||
// [4:str]}. tags 3/4 are emitted only when present; NapCat passes empty
|
||||
// str1/str2, so the approve flow is just {1:uid, 2:uid}.
|
||||
|
||||
import type { pb, pb_repeated, uint_32, uint_64 } from '@snowluma/proton';
|
||||
|
||||
export interface OidbDoubtGetReqInner {
|
||||
num?: pb<1, uint_32>;
|
||||
uk?: pb<2, string>;
|
||||
}
|
||||
export interface OidbDoubtGetReq {
|
||||
field1?: pb<1, uint_32>;
|
||||
inner?: pb<2, OidbDoubtGetReqInner>;
|
||||
}
|
||||
|
||||
export interface OidbDoubtItem {
|
||||
uid?: pb<1, string>; // HIGH (kStrTargetUid)
|
||||
nick?: pb<2, string>; // MEDIUM (generic Nick attr 20002)
|
||||
source?: pb<5, string>; // MEDIUM
|
||||
reqTime?: pb<9, uint_64>; // HIGH (attr 60001)
|
||||
msg?: pb<11, string>; // MEDIUM
|
||||
}
|
||||
export interface OidbDoubtGetRespBody {
|
||||
list?: pb_repeated<1, OidbDoubtItem>;
|
||||
reason?: pb<2, string>;
|
||||
}
|
||||
export interface OidbDoubtGetResp {
|
||||
status?: pb<1, uint_32>;
|
||||
body?: pb<2, OidbDoubtGetRespBody>;
|
||||
}
|
||||
|
||||
// tag1 and tag2 come from two DIFFERENT kernel attrs (21503 vs 21001), but
|
||||
// both are uid-class and NapCat sends the same friendUid into both — so the
|
||||
// service sets them to the same value. They are NOT equal by schema design.
|
||||
export interface OidbDoubtApprovalReq {
|
||||
uid?: pb<1, string>;
|
||||
targetUid?: pb<2, string>;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Group ext-info modify (robot-add option), RE'd from QQNT
|
||||
// wrapper.linux.node — OidbSvcTrpcTcp.0xf00_3 (modifyGroupExtInfoV2,
|
||||
// codec `group_ext_list_modify_codec.cc`). Worker ctor sub_4180800 passes
|
||||
// cmd=0xf00, sub=3, flag=1 (uin form).
|
||||
//
|
||||
// Wire (EncodeModifyGroupExtInfoReq sub_4180B80 + ...Params sub_4180980):
|
||||
// ModifyGroupExtInfoReq{ 1:groupCode, 2:GroupExtInfo{ 1:groupCode,
|
||||
// 2:EXTInfo{ 30:inviteRobotMemberSwitch, 31:inviteRobotMemberExamine } } }
|
||||
// The GroupExtFilter that modifyGroupExtInfoV2 takes as its 2nd arg is
|
||||
// CLIENT-SIDE ONLY (it gates which EXTInfo fields the encoder emits); it is
|
||||
// NOT a wire field. So presence of EXTInfo tag 30/31 IS the write signal.
|
||||
// NOTE: proto3 omits zero-valued scalars, so a value of 0 will not transmit;
|
||||
// the robot toggles are non-zero in practice (QQ avoids 0 for set-states).
|
||||
// Response (DecodeModifyGroupExtInfoRsp sub_4180DB0): {1:groupCode, 2:result}.
|
||||
|
||||
import type { pb, int_32, uint_32 } from '@snowluma/proton';
|
||||
|
||||
export interface OidbGroupExtBody {
|
||||
inviteRobotMemberSwitch?: pb<30, uint_32>;
|
||||
inviteRobotMemberExamine?: pb<31, uint_32>;
|
||||
}
|
||||
export interface OidbGroupExtInfo {
|
||||
groupCode?: pb<1, uint_32>;
|
||||
ext?: pb<2, OidbGroupExtBody>;
|
||||
}
|
||||
export interface OidbModifyGroupExtReq {
|
||||
groupCode?: pb<1, uint_32>;
|
||||
info?: pb<2, OidbGroupExtInfo>;
|
||||
}
|
||||
export interface OidbModifyGroupExtResp {
|
||||
groupCode?: pb<1, uint_32>;
|
||||
result?: pb<2, int_32>;
|
||||
}
|
||||
Reference in new issue
Block a user