forked from alibaba/tidevice
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add missing, change launch kill from false to true
- Loading branch information
1 parent
f20fa00
commit b026902
Showing
3 changed files
with
39 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -145,3 +145,4 @@ usbmuxd-dumpdata | |
.DS_Store | ||
tmp/ | ||
*.pem | ||
dumpdata/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
|
||
"""Created on Wed Jan 11 2023 17:00:08 by codeskyblue | ||
""" | ||
|
||
from .exceptions import MuxServiceError | ||
from ._safe_socket import PlistSocketProxy | ||
from ._proto import PROGRAM_NAME | ||
|
||
|
||
class Session: | ||
def __init__(self, s: PlistSocketProxy, session_id: str): | ||
self.__ps = s | ||
self.__session_id = session_id | ||
|
||
def get_plistsocket(self) -> PlistSocketProxy: | ||
return self.__ps | ||
|
||
def close(self): | ||
s = self.__ps | ||
s.send_packet({ | ||
"Request": "StopSession", | ||
"ProtocolVersion": '2', | ||
"Label": PROGRAM_NAME, | ||
"SessionID": self.__session_id, | ||
}) | ||
s.recv_packet() | ||
|
||
def __enter__(self): | ||
return self.__ps | ||
|
||
def __exit__(self, exc_type, exc_val, exc_tb): | ||
self.close() | ||
self.__ps.close() | ||
|