forked from electricbubble/gidevice
-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
housearrest.go
56 lines (44 loc) 路 1.43 KB
/
housearrest.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
package libimobiledevice
const HouseArrestServiceName = "com.apple.mobile.house_arrest"
const (
CommandTypeVendDocuments CommandType = "VendDocuments"
CommandTypeVendContainer CommandType = "VendContainer"
)
func NewHouseArrestClient(innerConn InnerConn) *HouseArrestClient {
return &HouseArrestClient{
newServicePacketClient(innerConn),
}
}
type HouseArrestClient struct {
client *servicePacketClient
}
func (c *HouseArrestClient) NewBasicRequest(cmdType CommandType, bundleID string) *HouseArrestBasicRequest {
return &HouseArrestBasicRequest{
Command: cmdType,
Identifier: bundleID,
}
}
func (c *HouseArrestClient) NewDocumentsRequest(bundleID string) *HouseArrestBasicRequest {
return c.NewBasicRequest(CommandTypeVendDocuments, bundleID)
}
func (c *HouseArrestClient) NewContainerRequest(bundleID string) *HouseArrestBasicRequest {
return c.NewBasicRequest(CommandTypeVendContainer, bundleID)
}
func (c *HouseArrestClient) NewXmlPacket(req interface{}) (Packet, error) {
return c.client.NewXmlPacket(req)
}
func (c *HouseArrestClient) SendPacket(pkt Packet) (err error) {
return c.client.SendPacket(pkt)
}
func (c *HouseArrestClient) ReceivePacket() (respPkt Packet, err error) {
return c.client.ReceivePacket()
}
func (c *HouseArrestClient) InnerConn() InnerConn {
return c.client.innerConn
}
type (
HouseArrestBasicRequest struct {
Command CommandType `plist:"Command"`
Identifier string `plist:"Identifier"`
}
)