Skip to content

Commit

Permalink
feature ipad protocol & fix error image panic.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrs4s committed Nov 13, 2020
1 parent b51d8b4 commit c1739db
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion client/entities.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ const (
Member

AndroidPhone ClientProtocol = 1
AndroidPad ClientProtocol = 2
IPad ClientProtocol = 2
AndroidWatch ClientProtocol = 3
)

Expand Down
10 changes: 5 additions & 5 deletions client/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ var SystemDeviceInfo = &DeviceInfo{
IMEI: "468356291846738",
AndroidId: []byte("MIRAI.123456.001"),
APN: []byte("wifi"),
Protocol: AndroidPad,
Protocol: IPad,
Version: &Version{
Incremental: []byte("5891938"),
Release: []byte("10"),
Expand Down Expand Up @@ -171,10 +171,10 @@ func genVersionInfo(p ClientProtocol) *versionInfo {
SubSigmap: 0x10400,
MainSigMap: 34869472,
}
case AndroidPad: // Dumped from qq-hd v5.8.9
case IPad:
return &versionInfo{
ApkId: "com.tencent.minihd.qq",
AppId: 537065549,
AppId: 537065739,
SortVersionName: "5.8.9",
BuildTime: 1595836208,
ApkSign: []byte{170, 57, 120, 244, 31, 217, 111, 249, 145, 74, 102, 158, 24, 100, 116, 199},
Expand All @@ -201,7 +201,7 @@ func (info *DeviceInfo) ToJson() []byte {
IMEI: info.IMEI,
Protocol: func() int {
switch info.Protocol {
case AndroidPad:
case IPad:
return 0
case AndroidPhone:
return 1
Expand Down Expand Up @@ -238,7 +238,7 @@ func (info *DeviceInfo) ReadJson(d []byte) error {
case 2:
info.Protocol = AndroidWatch
default:
info.Protocol = AndroidPad
info.Protocol = IPad
}
SystemDeviceInfo.GenNewGuid()
SystemDeviceInfo.GenNewTgtgtKey()
Expand Down
2 changes: 1 addition & 1 deletion client/notify.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type (
// grayTipProcessor 提取出来专门用于处理群内 notify tips
func (c *QQClient) grayTipProcessor(groupId int64, tipInfo *notify.GeneralGrayTipInfo) {
switch tipInfo.TemplId {
case 10043, 1136: // 戳一戳
case 10043, 1136, 1132: // 戳一戳
var sender int64 = 0
receiver := c.Uin
for _, templ := range tipInfo.MsgTemplParam {
Expand Down
3 changes: 3 additions & 0 deletions message/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,9 @@ func ParseMessageElems(elems []*msg.Elem) []IMessageElement {
}
}
if elem.CustomFace != nil {
if len(elem.CustomFace.Md5) == 0 {
continue
}
res = append(res, &ImageElement{
Filename: elem.CustomFace.FilePath,
Size: elem.CustomFace.Size,
Expand Down

0 comments on commit c1739db

Please sign in to comment.