diff --git a/client/global.go b/client/global.go index 2b8a1db3..878d08e7 100644 --- a/client/global.go +++ b/client/global.go @@ -146,10 +146,12 @@ func (info *DeviceInfo) ReadJson(d []byte) error { return err } info.Display = []byte(f.Display) - info.Product = []byte(f.Product) - info.Device = []byte(f.Device) - info.Board = []byte(f.Board) - info.Model = []byte(f.Model) + if f.Product != "" { + info.Product = []byte(f.Product) + info.Device = []byte(f.Device) + info.Board = []byte(f.Board) + info.Model = []byte(f.Model) + } info.FingerPrint = []byte(f.FingerPrint) info.BootId = []byte(f.BootId) info.ProcVersion = []byte(f.ProcVersion) diff --git a/message/message.go b/message/message.go index 10c57c42..ffb246de 100644 --- a/message/message.go +++ b/message/message.go @@ -419,7 +419,13 @@ func ParseMessageElems(elems []*msg.Elem) []IMessageElement { } if elem.Text != nil { if len(elem.Text.Attr6Buf) == 0 { - res = append(res, NewText(elem.Text.Str)) + res = append(res, NewText(func() string { + // 这么处理应该没问题 + if strings.Contains(elem.Text.Str, "\r") && !strings.Contains(elem.Text.Str, "\r\n") { + return strings.ReplaceAll(elem.Text.Str, "\r", "\r\n") + } + return elem.Text.Str + }())) } else { att6 := binary.NewReader(elem.Text.Attr6Buf) att6.ReadBytes(7)