-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathbridge_interface.go
68 lines (58 loc) · 1.47 KB
/
bridge_interface.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package main
import (
"fmt"
uj "github.com/nanoscopic/ujsonin/v2/mod"
)
type TunPair struct {
from int
to int
}
func (self TunPair) String() string {
return fmt.Sprintf("%d:%d",self.from,self.to)
}
type Screenshot struct {
format string
data []byte
}
type BridgeDevInfo struct {
udid string
}
// detect( onDevConnect func( bridge CliBridge ) )
type BridgeRoot interface {
//OnConnect( dev BridgeDev )
//OnDisconnect( dev BridgeDev )
list() []BridgeDevInfo
GetDevs(*Config) []string
}
type iProc struct {
pid int32
name string
}
type BridgeDev interface {
getUdid() string
tunnel( pairs []TunPair, onready func() )
info( names []string ) map[string]string
gestalt( names []string ) map[string]string
gestaltnode( names []string ) map[string]uj.JNode
ps() []iProc
screenshot() Screenshot
cfa( onStart func(), onStop func(interface{}) )
wda( onStart func(), onStop func(interface{}) )
destroy()
setProcTracker( procTracker ProcTracker )
NewBackupVideo( port int, onStop func( interface{} ) ) BackupVideo
GetPid( appname string ) uint64
AppInfo( bundleId string ) uj.JNode
InstallApp( appPath string ) bool
LaunchApp( bundleId string ) bool
NewSyslogMonitor( handleLogItem func( msg string, app string ) )
Kill( pid uint64 )
KillBid( bid string )
Launch( bid string )
SetConfig( devConfig *CDevice )
SetDevice( device *Device )
SetCustom( name string, val interface{} )
}
type BackupVideo interface {
GetFrame() []byte
}