1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 19:17:38 +08:00

feature ipad protocol & fix error image panic.

This commit is contained in:
Mrs4s 2020-11-13 19:38:25 +08:00
parent b51d8b417c
commit c1739dba15
4 changed files with 10 additions and 7 deletions

View File

@ -252,7 +252,7 @@ const (
Member Member
AndroidPhone ClientProtocol = 1 AndroidPhone ClientProtocol = 1
AndroidPad ClientProtocol = 2 IPad ClientProtocol = 2
AndroidWatch ClientProtocol = 3 AndroidWatch ClientProtocol = 3
) )

View File

@ -106,7 +106,7 @@ var SystemDeviceInfo = &DeviceInfo{
IMEI: "468356291846738", IMEI: "468356291846738",
AndroidId: []byte("MIRAI.123456.001"), AndroidId: []byte("MIRAI.123456.001"),
APN: []byte("wifi"), APN: []byte("wifi"),
Protocol: AndroidPad, Protocol: IPad,
Version: &Version{ Version: &Version{
Incremental: []byte("5891938"), Incremental: []byte("5891938"),
Release: []byte("10"), Release: []byte("10"),
@ -171,10 +171,10 @@ func genVersionInfo(p ClientProtocol) *versionInfo {
SubSigmap: 0x10400, SubSigmap: 0x10400,
MainSigMap: 34869472, MainSigMap: 34869472,
} }
case AndroidPad: // Dumped from qq-hd v5.8.9 case IPad:
return &versionInfo{ return &versionInfo{
ApkId: "com.tencent.minihd.qq", ApkId: "com.tencent.minihd.qq",
AppId: 537065549, AppId: 537065739,
SortVersionName: "5.8.9", SortVersionName: "5.8.9",
BuildTime: 1595836208, BuildTime: 1595836208,
ApkSign: []byte{170, 57, 120, 244, 31, 217, 111, 249, 145, 74, 102, 158, 24, 100, 116, 199}, ApkSign: []byte{170, 57, 120, 244, 31, 217, 111, 249, 145, 74, 102, 158, 24, 100, 116, 199},
@ -201,7 +201,7 @@ func (info *DeviceInfo) ToJson() []byte {
IMEI: info.IMEI, IMEI: info.IMEI,
Protocol: func() int { Protocol: func() int {
switch info.Protocol { switch info.Protocol {
case AndroidPad: case IPad:
return 0 return 0
case AndroidPhone: case AndroidPhone:
return 1 return 1
@ -238,7 +238,7 @@ func (info *DeviceInfo) ReadJson(d []byte) error {
case 2: case 2:
info.Protocol = AndroidWatch info.Protocol = AndroidWatch
default: default:
info.Protocol = AndroidPad info.Protocol = IPad
} }
SystemDeviceInfo.GenNewGuid() SystemDeviceInfo.GenNewGuid()
SystemDeviceInfo.GenNewTgtgtKey() SystemDeviceInfo.GenNewTgtgtKey()

View File

@ -33,7 +33,7 @@ type (
// grayTipProcessor 提取出来专门用于处理群内 notify tips // grayTipProcessor 提取出来专门用于处理群内 notify tips
func (c *QQClient) grayTipProcessor(groupId int64, tipInfo *notify.GeneralGrayTipInfo) { func (c *QQClient) grayTipProcessor(groupId int64, tipInfo *notify.GeneralGrayTipInfo) {
switch tipInfo.TemplId { switch tipInfo.TemplId {
case 10043, 1136: // 戳一戳 case 10043, 1136, 1132: // 戳一戳
var sender int64 = 0 var sender int64 = 0
receiver := c.Uin receiver := c.Uin
for _, templ := range tipInfo.MsgTemplParam { for _, templ := range tipInfo.MsgTemplParam {

View File

@ -432,6 +432,9 @@ func ParseMessageElems(elems []*msg.Elem) []IMessageElement {
} }
} }
if elem.CustomFace != nil { if elem.CustomFace != nil {
if len(elem.CustomFace.Md5) == 0 {
continue
}
res = append(res, &ImageElement{ res = append(res, &ImageElement{
Filename: elem.CustomFace.FilePath, Filename: elem.CustomFace.FilePath,
Size: elem.CustomFace.Size, Size: elem.CustomFace.Size,