mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 19:17:38 +08:00
25 lines
588 B
Go
25 lines
588 B
Go
package tlv
|
|
|
|
import "github.com/Mrs4s/MiraiGo/binary"
|
|
|
|
func T1F(isRoot bool, osName, osVersion, simOperatorName, apn []byte, networkType uint16) []byte {
|
|
return binary.NewWriterF(func(w *binary.Writer) {
|
|
w.WriteUInt16(0x1F)
|
|
w.WriteBytesShort(binary.NewWriterF(func(w *binary.Writer) {
|
|
w.WriteByte(func() byte {
|
|
if isRoot {
|
|
return 1
|
|
} else {
|
|
return 0
|
|
}
|
|
}())
|
|
w.WriteBytesShort(osName)
|
|
w.WriteBytesShort(osVersion)
|
|
w.WriteUInt16(networkType)
|
|
w.WriteBytesShort(simOperatorName)
|
|
w.WriteBytesShort([]byte{})
|
|
w.WriteBytesShort(apn)
|
|
}))
|
|
})
|
|
}
|