pymobiledevice3 6.0.1__py3-none-any.whl → 6.1.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '6.0.1'
32
- __version_tuple__ = version_tuple = (6, 0, 1)
31
+ __version__ = version = '6.1.1'
32
+ __version_tuple__ = version_tuple = (6, 1, 1)
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -33,7 +33,7 @@ def syslog_live_old(service_provider: LockdownClient):
33
33
  print(line)
34
34
 
35
35
 
36
- def format_line(color, pid, syslog_entry, include_label):
36
+ def format_line(color, pid, syslog_entry, include_label: bool, image_offset: bool = False) -> Optional[str]:
37
37
  log_level_colors = {
38
38
  SyslogLogLevel.NOTICE.name: "white",
39
39
  SyslogLogLevel.INFO.name: "white",
@@ -50,6 +50,7 @@ def format_line(color, pid, syslog_entry, include_label):
50
50
  image_name = posixpath.basename(syslog_entry.image_name)
51
51
  message = syslog_entry.message
52
52
  process_name = posixpath.basename(filename)
53
+ image_offset_str = f"+0x{syslog_entry.image_offset:x}" if image_offset and image_name else ""
53
54
  label = ""
54
55
 
55
56
  if (pid != -1) and (syslog_pid != pid):
@@ -63,13 +64,15 @@ def format_line(color, pid, syslog_entry, include_label):
63
64
  process_name = click.style(process_name, "magenta")
64
65
  if len(image_name) > 0:
65
66
  image_name = click.style(image_name, "magenta")
67
+ if image_offset:
68
+ image_offset_str = click.style(image_offset_str, "blue")
66
69
  syslog_pid = click.style(syslog_pid, "cyan")
67
70
  log_level_color = log_level_colors[level]
68
71
  level = click.style(level, log_level_color)
69
72
  label = click.style(label, "cyan")
70
73
  message = click.style(message, log_level_color)
71
74
 
72
- line_format = "{timestamp} {process_name}{{{image_name}}}[{pid}] <{level}>: {message}"
75
+ line_format = "{timestamp} {process_name}{{{image_name}{image_offset_str}}}[{pid}] <{level}>: {message}"
73
76
 
74
77
  if include_label:
75
78
  line_format += f" {label}"
@@ -81,6 +84,7 @@ def format_line(color, pid, syslog_entry, include_label):
81
84
  pid=syslog_pid,
82
85
  level=level,
83
86
  message=message,
87
+ image_offset_str=image_offset_str,
84
88
  )
85
89
 
86
90
  return line
@@ -96,6 +100,7 @@ def syslog_live(
96
100
  include_label: bool,
97
101
  regex: list[str],
98
102
  insensitive_regex: list[str],
103
+ image_offset: bool = False,
99
104
  ) -> None:
100
105
  match_regex = [re.compile(f".*({r}).*", re.DOTALL) for r in regex]
101
106
  match_regex += [re.compile(f".*({r}).*", re.IGNORECASE | re.DOTALL) for r in insensitive_regex]
@@ -109,8 +114,8 @@ def syslog_live(
109
114
  if process_name and posixpath.basename(syslog_entry.filename) != process_name:
110
115
  continue
111
116
 
112
- line_no_style = format_line(False, pid, syslog_entry, include_label)
113
- line = format_line(user_requested_colored_output(), pid, syslog_entry, include_label)
117
+ line_no_style = format_line(False, pid, syslog_entry, include_label, image_offset)
118
+ line = format_line(user_requested_colored_output(), pid, syslog_entry, include_label, image_offset)
114
119
 
115
120
  skip = False
116
121
 
@@ -172,6 +177,7 @@ def syslog_live(
172
177
  @click.option("include_label", "--label", is_flag=True, help="should include label")
173
178
  @click.option("-e", "--regex", multiple=True, help="filter only lines matching given regex")
174
179
  @click.option("-ei", "--insensitive-regex", multiple=True, help="filter only lines matching given regex (insensitive)")
180
+ @click.option("-im", "--image-offset", is_flag=True, help="Include image offset in log line")
175
181
  def cli_syslog_live(
176
182
  service_provider: LockdownServiceProvider,
177
183
  out: Optional[TextIO],
@@ -182,11 +188,21 @@ def cli_syslog_live(
182
188
  include_label: bool,
183
189
  regex: list[str],
184
190
  insensitive_regex: list[str],
191
+ image_offset: bool,
185
192
  ) -> None:
186
193
  """view live syslog lines"""
187
194
 
188
195
  syslog_live(
189
- service_provider, out, pid, process_name, match, match_insensitive, include_label, regex, insensitive_regex
196
+ service_provider,
197
+ out,
198
+ pid,
199
+ process_name,
200
+ match,
201
+ match_insensitive,
202
+ include_label,
203
+ regex,
204
+ insensitive_regex,
205
+ image_offset,
190
206
  )
191
207
 
192
208
 
@@ -43,6 +43,7 @@ class SyslogEntry:
43
43
  timestamp: datetime
44
44
  level: SyslogLogLevel
45
45
  image_name: str
46
+ image_offset: int
46
47
  filename: str
47
48
  message: str
48
49
  label: typing.Optional[SyslogLabel] = None
@@ -93,8 +94,12 @@ def parse_syslog_entry(data: bytes) -> SyslogEntry:
93
94
  message_size = struct.unpack("<H", data[offset : offset + 2])[0]
94
95
  offset += 2
95
96
 
96
- # Skip 6 bytes
97
- offset += 6
97
+ # Skip 2 bytes
98
+ offset += 2
99
+
100
+ # Parse sender_image_offset (4 bytes, little-endian unsigned int)
101
+ sender_image_offset = struct.unpack("<I", data[offset : offset + 4])[0]
102
+ offset += 4
98
103
 
99
104
  # Parse subsystem_size (4 bytes, little-endian unsigned int)
100
105
  subsystem_size = struct.unpack("<I", data[offset : offset + 4])[0]
@@ -134,6 +139,7 @@ def parse_syslog_entry(data: bytes) -> SyslogEntry:
134
139
  timestamp=timestamp,
135
140
  level=SyslogLogLevel(level),
136
141
  image_name=image_name,
142
+ image_offset=sender_image_offset,
137
143
  filename=filename,
138
144
  message=message,
139
145
  label=label,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pymobiledevice3
3
- Version: 6.0.1
3
+ Version: 6.1.1
4
4
  Summary: Pure python3 implementation for working with iDevices (iPhone, etc...)
5
5
  Author-email: doronz88 <doron88@gmail.com>, matan <matan1008@gmail.com>
6
6
  Maintainer-email: doronz88 <doron88@gmail.com>, matan <matan1008@gmail.com>
@@ -8,7 +8,7 @@ misc/understanding_idevice_protocol_layers.md,sha256=8tEqRXWOUPoxOJLZVh7C7H9JGCh
8
8
  misc/usbmux_sniff.sh,sha256=iWtbucOEQ9_UEFXk9x-2VNt48Jg5zrPsnUbZ_LfZxwA,212
9
9
  pymobiledevice3/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  pymobiledevice3/__main__.py,sha256=hpLgWH1Pmwkf1pX-JvYkfJUkphpEb4YhoRV3qQUwbOs,12718
11
- pymobiledevice3/_version.py,sha256=L46iiAhgbehSMhT8JATTVAPNNB1a16B69BZiNy8IzXs,704
11
+ pymobiledevice3/_version.py,sha256=l32oVUgUnO6ltDf818t_qGcGLAohlgEniySryMjAboE,704
12
12
  pymobiledevice3/bonjour.py,sha256=y1Zd-__GnvK2ShxmvqFpNfi5NGF6PEWGcuKp8mJVFNA,13419
13
13
  pymobiledevice3/ca.py,sha256=5_Y4F-zDFX_KeDL-M_TRCKKyrRRb9h1lBE8MGTWv91o,10606
14
14
  pymobiledevice3/common.py,sha256=FZzF0BQYV5fCEUPbLo6jbt2Ig9s5YwR8AvX_iR124Ew,329
@@ -47,7 +47,7 @@ pymobiledevice3/cli/provision.py,sha256=SofHAYdmxb54n9KSRyPKol6jOMUXN1hBACr2VBQr
47
47
  pymobiledevice3/cli/remote.py,sha256=xkIVR4bu1Vdpw-sswH1b-pekBM6rV6AS7YUeYQU5UyY,12375
48
48
  pymobiledevice3/cli/restore.py,sha256=xwiUIofoyCMxDSgRq4bndAn5GNUq1P-RcC446M_6I7Y,8085
49
49
  pymobiledevice3/cli/springboard.py,sha256=hVoLqLU_gHxXa6q17ar61lc2ovmWejeu-rvxQpHXWD0,3094
50
- pymobiledevice3/cli/syslog.py,sha256=NwUzgqUBgHsnx-nVqH9f4A9yQJbXrIoTLIoyqmKTwTc,7543
50
+ pymobiledevice3/cli/syslog.py,sha256=MV3fsg3lFKha2gYr6L_-7oiLXrk9QB_hH1nxNNbm3Gw,8112
51
51
  pymobiledevice3/cli/usbmux.py,sha256=Bx-5OSxEbHBhLeYaRt9LvZzp3RIazn49Q86pFi-EtpQ,2354
52
52
  pymobiledevice3/cli/version.py,sha256=N7UY328WNR6FpQ2w7aACyL74XQxkRmi53WV5SVlCgCo,345
53
53
  pymobiledevice3/cli/webinspector.py,sha256=dUsaaZZBV2OQPaYCj8C809ElO0O-G-NSSLvj7x26L94,16705
@@ -121,7 +121,7 @@ pymobiledevice3/services/mobile_config.py,sha256=2UmdqYNikznxI6bA2lkyIWS3NcHg3pT
121
121
  pymobiledevice3/services/mobile_image_mounter.py,sha256=PZEN9O7XtLW9VH1qNTJ19zo_tFZhX68bTX0O-Uy9sck,15034
122
122
  pymobiledevice3/services/mobilebackup2.py,sha256=M2sVY-vXl6f25QFom-z5bUkeTdA4Twbiw1tH-4Tb79M,18303
123
123
  pymobiledevice3/services/notification_proxy.py,sha256=mk4kxLRi6aDTXKOazgldliZG4q0bME7jBcxPyJsSpDw,2125
124
- pymobiledevice3/services/os_trace.py,sha256=VS4LYGuc3pFLNAEZdgp6pvs2cCQwjmkBfgRGbpHUx2U,7195
124
+ pymobiledevice3/services/os_trace.py,sha256=nTODlyWvb10fpqWHDU3m7i9sADIMF0ezfyo9Ql2BZa8,7422
125
125
  pymobiledevice3/services/pcapd.py,sha256=Gd6xN9eBHnLIQ5M2LM-y4Z-eCquxVEnSKuyBECwZlRs,11960
126
126
  pymobiledevice3/services/power_assertion.py,sha256=hh-9tpPbNctAegsV0IYE3ilikT-o4t758-y3u0Td9wM,1212
127
127
  pymobiledevice3/services/preboard.py,sha256=QJ1miS0e2lY9y4sS4GxsMZh-uxKDeDi6upgPTyqTpfs,894
@@ -167,9 +167,9 @@ pymobiledevice3/services/web_protocol/switch_to.py,sha256=TCdVrMfsvd18o-vZ0owVrE
167
167
  pymobiledevice3/tunneld/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
168
168
  pymobiledevice3/tunneld/api.py,sha256=Lwl1OdhPTgX6Zqezy8T4dEcXRfaEPwyGNClioTx3fUc,2338
169
169
  pymobiledevice3/tunneld/server.py,sha256=dMEZAv_X-76l0vSalpq4x0IVkbE-MNGR77T-u1TiHuE,25752
170
- pymobiledevice3-6.0.1.dist-info/licenses/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
171
- pymobiledevice3-6.0.1.dist-info/METADATA,sha256=GGX1Mzg-hTIM5QtT3J05RpH9LQEkR4EDRHk7cyKmWmw,17416
172
- pymobiledevice3-6.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
173
- pymobiledevice3-6.0.1.dist-info/entry_points.txt,sha256=jJMlOanHlVwUxcY__JwvKeWPrvBJr_wJyEq4oHIZNKE,66
174
- pymobiledevice3-6.0.1.dist-info/top_level.txt,sha256=MjZoRqcWPOh5banG-BbDOnKEfsS3kCxqV9cv-nzyg2Q,21
175
- pymobiledevice3-6.0.1.dist-info/RECORD,,
170
+ pymobiledevice3-6.1.1.dist-info/licenses/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
171
+ pymobiledevice3-6.1.1.dist-info/METADATA,sha256=nUu3EVqSYV3BVCHn_F4I1OaDv66Ii8by8os7iqk7_dU,17416
172
+ pymobiledevice3-6.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
173
+ pymobiledevice3-6.1.1.dist-info/entry_points.txt,sha256=jJMlOanHlVwUxcY__JwvKeWPrvBJr_wJyEq4oHIZNKE,66
174
+ pymobiledevice3-6.1.1.dist-info/top_level.txt,sha256=MjZoRqcWPOh5banG-BbDOnKEfsS3kCxqV9cv-nzyg2Q,21
175
+ pymobiledevice3-6.1.1.dist-info/RECORD,,