Skip to content

Commit

Permalink
update default device
Browse files Browse the repository at this point in the history
  • Loading branch information
lz1998 committed Nov 29, 2020
1 parent 5531a3f commit ade18ee
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion service/bot/bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package bot
import (
"io/ioutil"
"os"
"strings"
"time"

"github.com/Mrs4s/MiraiGo/client"
Expand All @@ -17,10 +18,14 @@ func InitDevice(path string) {
if !util.PathExists(path) {
log.Warn("虚拟设备信息不存在, 将自动生成随机设备.")
client.GenRandomDevice()
client.SystemDeviceInfo.Display = []byte(strings.Replace(string(client.SystemDeviceInfo.Display), "MIRAI", "GMC", -1))
client.SystemDeviceInfo.FingerPrint = []byte(strings.Replace(string(client.SystemDeviceInfo.FingerPrint), "MIRAI", "GMC", -1))
client.SystemDeviceInfo.FingerPrint = []byte(strings.Replace(string(client.SystemDeviceInfo.FingerPrint), "mirai", "gmc", -1))
client.SystemDeviceInfo.FingerPrint = []byte(strings.Replace(string(client.SystemDeviceInfo.FingerPrint), "mamoe", "pbbot", -1))
client.SystemDeviceInfo.Device = []byte("gmc")
client.SystemDeviceInfo.Board = []byte("gmc")
client.SystemDeviceInfo.Model = []byte("gmc")
client.SystemDeviceInfo.Brand = []byte("protobufbot")
client.SystemDeviceInfo.Brand = []byte("pbbot")
client.SystemDeviceInfo.Product = []byte("gmc")
_ = ioutil.WriteFile(path, client.SystemDeviceInfo.ToJson(), 0644)
log.Infof("已生成设备信息并保存到 %s 文件.", path)
Expand Down

0 comments on commit ade18ee

Please sign in to comment.