File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ import (
1919 log "github.com/sirupsen/logrus"
2020)
2121
22+ var Path = "device"
23+
2224func RandDevice (randGen * rand.Rand ) * client.DeviceInfo {
2325 device := & client.DeviceInfo {
2426 AndroidId : []byte ("MIRAI.123456.001" ),
@@ -109,7 +111,7 @@ func GetDevice(seed int64, clientProtocol int32) *client.DeviceInfo {
109111 randGen = rand .New (rand .NewSource (time .Now ().UnixNano ()))
110112 }
111113 // 默认 device/device-qq.json
112- devicePath := path .Join ("device" , fmt .Sprintf ("device-%d.json" , seed ))
114+ devicePath := path .Join (Path , fmt .Sprintf ("device-%d.json" , seed ))
113115
114116 // 优先使用参数目录
115117 if config .Device != "" {
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package gmc_android
22
33import (
44 "github.com/ProtobufBot/Go-Mirai-Client/pkg/config"
5+ "github.com/ProtobufBot/Go-Mirai-Client/pkg/device"
56 "github.com/ProtobufBot/Go-Mirai-Client/pkg/gmc"
67
78 log "github.com/sirupsen/logrus"
@@ -25,6 +26,11 @@ func SetLogPath(logPath string) {
2526 gmc .LogPath = logPath
2627}
2728
29+ // SetDevicePath 设置设备信息路径
30+ func SetDevicePath (devicePath string ) {
31+ device .Path = devicePath
32+ }
33+
2834// Start 启动主程序
2935func Start () {
3036 gmc .Start ()
You can’t perform that action at this time.
0 commit comments