Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Commit

Permalink
device add udid, terminal page add favicon
Browse files Browse the repository at this point in the history
  • Loading branch information
codeskyblue committed Nov 6, 2017
1 parent 2b5272d commit 495aa51
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="icon" href="/assets/terminal.ico?v=1">
<title>atx-agent terminal</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/xterm.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/addons/fullscreen/fullscreen.min.css">
Expand Down
Binary file added assets/terminal.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,8 @@ func ServeHTTP(port int) error {
http.ServeFile(w, r, imagePath)
}
})
http.Handle("/assets/", http.FileServer(Assets))
http.Handle("/", m)
http.Handle("/assets/", http.StripPrefix("/assets", http.FileServer(Assets)))
httpServer = &http.Server{
Addr: ":" + strconv.Itoa(port),
}
Expand Down
9 changes: 6 additions & 3 deletions tunnelproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ func unsafeRunTunnelProxy(serverAddr string) error {
AgentVersion: version,
}
devInfo.HWAddr, _ = androidutils.HWAddrWLAN()

// Udid is ${Serial}-${MacAddress}-${model}
udid := props["ro.serialno"] + "-" + devInfo.HWAddr + "-" + props["ro.product.model"]
devInfo.Udid = udid

ws.WriteJSON(proto.CommonMessage{
Type: proto.DeviceInfoMessage,
Data: devInfo,
Expand All @@ -53,11 +58,9 @@ func unsafeRunTunnelProxy(serverAddr string) error {
return nil
})
for {
_, data, err := ws.ReadMessage()
_, _, err := ws.ReadMessage()
if err != nil {
return err
}
_ = data
// log.Printf("Websocket receive message: %v", string(data))
}
}

0 comments on commit 495aa51

Please sign in to comment.