Skip to content

Commit

Permalink
去掉第三方adb库
Browse files Browse the repository at this point in the history
  • Loading branch information
IoTServ committed Feb 24, 2021
1 parent 92364ae commit f3aa31e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions config/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ func (cm *ConfigModel) RunAdbCmd(cmd []string) (string, error) {
return string(outbytes), err
}

func (cm *ConfigModel) KillAdbServer() (string, error) {
return cm.RunAdbCmd([]string{"kill-server"})
}

func (cm *ConfigModel) StartAdbServer() (string, error) {
return cm.RunAdbCmd([]string{"start-server"})
}
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.15
require (
github.com/OpenIoTHub/service-register v0.1.11
github.com/gin-gonic/gin v1.6.3
github.com/go-bindata/go-bindata v3.1.2+incompatible // indirect
github.com/grandcat/zeroconf v1.0.0
github.com/urfave/cli/v2 v2.2.0
gopkg.in/yaml.v2 v2.2.8
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14=
github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M=
github.com/go-bindata/go-bindata v3.1.2+incompatible/go.mod h1:xK8Dsgwmeed+BBsSy2XTopBn/8uK2HWuGSnA11C3Joo=
github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A=
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q=
Expand Down
2 changes: 1 addition & 1 deletion services/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
var AndroidAdbDeviceWithOpenIoTHubMap = make(map[string]*config.AndroidAdbDeviceWithOpenIoTHub)

func Run(c *cli.Context) (err error) {
out, err := RunAdbCommand([]string{"kill-server"})
out, err := config.ConfigModelVar.KillAdbServer()
log.Println(out)
if err != nil {
log.Println(err)
Expand Down
2 changes: 2 additions & 0 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ github.com/gin-gonic/gin/binding
github.com/gin-gonic/gin/internal/bytesconv
github.com/gin-gonic/gin/internal/json
github.com/gin-gonic/gin/render
# github.com/go-bindata/go-bindata v3.1.2+incompatible
## explicit
# github.com/go-playground/locales v0.13.0
github.com/go-playground/locales
github.com/go-playground/locales/currency
Expand Down

0 comments on commit f3aa31e

Please sign in to comment.