mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 19:17:38 +08:00
fix '\r' .
This commit is contained in:
parent
0a8d9254f8
commit
ed30f7ad59
@ -146,10 +146,12 @@ func (info *DeviceInfo) ReadJson(d []byte) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
info.Display = []byte(f.Display)
|
info.Display = []byte(f.Display)
|
||||||
|
if f.Product != "" {
|
||||||
info.Product = []byte(f.Product)
|
info.Product = []byte(f.Product)
|
||||||
info.Device = []byte(f.Device)
|
info.Device = []byte(f.Device)
|
||||||
info.Board = []byte(f.Board)
|
info.Board = []byte(f.Board)
|
||||||
info.Model = []byte(f.Model)
|
info.Model = []byte(f.Model)
|
||||||
|
}
|
||||||
info.FingerPrint = []byte(f.FingerPrint)
|
info.FingerPrint = []byte(f.FingerPrint)
|
||||||
info.BootId = []byte(f.BootId)
|
info.BootId = []byte(f.BootId)
|
||||||
info.ProcVersion = []byte(f.ProcVersion)
|
info.ProcVersion = []byte(f.ProcVersion)
|
||||||
|
@ -419,7 +419,13 @@ func ParseMessageElems(elems []*msg.Elem) []IMessageElement {
|
|||||||
}
|
}
|
||||||
if elem.Text != nil {
|
if elem.Text != nil {
|
||||||
if len(elem.Text.Attr6Buf) == 0 {
|
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 {
|
} else {
|
||||||
att6 := binary.NewReader(elem.Text.Attr6Buf)
|
att6 := binary.NewReader(elem.Text.Attr6Buf)
|
||||||
att6.ReadBytes(7)
|
att6.ReadBytes(7)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user