ipsw-parser 1.9.0__tar.gz → 1.9.2__tar.gz

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.
Files changed (44) hide show
  1. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/.github/workflows/python-app.yml +7 -0
  2. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/PKG-INFO +1 -1
  3. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser/_version.py +3 -3
  4. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser/dsc.py +10 -6
  5. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser/ipsw.py +8 -3
  6. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser.egg-info/PKG-INFO +1 -1
  7. ipsw_parser-1.9.2/ipsw_parser.egg-info/scm_version.json +8 -0
  8. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/tests/test_archive_backends.py +10 -0
  9. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/tests/test_dsc.py +29 -3
  10. ipsw_parser-1.9.0/ipsw_parser.egg-info/scm_version.json +0 -8
  11. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/.gitattributes +0 -0
  12. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  13. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  14. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/.github/workflows/codeql.yml +0 -0
  15. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/.github/workflows/python-publish.yml +0 -0
  16. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/.gitignore +0 -0
  17. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/.pre-commit-config.yaml +0 -0
  18. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/CODE_OF_CONDUCT.md +0 -0
  19. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/LICENSE +0 -0
  20. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/README.md +0 -0
  21. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser/__init__.py +0 -0
  22. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser/__main__.py +0 -0
  23. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser/archive.py +0 -0
  24. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser/build_identity.py +0 -0
  25. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser/build_manifest.py +0 -0
  26. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser/component.py +0 -0
  27. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser/exceptions.py +0 -0
  28. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser/firmware.py +0 -0
  29. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser/process.py +0 -0
  30. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser/py.typed +0 -0
  31. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser.egg-info/SOURCES.txt +0 -0
  32. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser.egg-info/dependency_links.txt +0 -0
  33. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser.egg-info/entry_points.txt +0 -0
  34. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser.egg-info/requires.txt +0 -0
  35. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser.egg-info/scm_file_list.json +0 -0
  36. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser.egg-info/top_level.txt +0 -0
  37. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/pyproject.toml +0 -0
  38. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/pytest.ini +0 -0
  39. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/requirements.txt +0 -0
  40. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/setup.cfg +0 -0
  41. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/tests/test_firmware.py +0 -0
  42. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/tests/test_kernelcache.py +0 -0
  43. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/tests/test_process.py +0 -0
  44. {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/tests/test_sandbox_profiles.py +0 -0
@@ -15,6 +15,13 @@ jobs:
15
15
  matrix:
16
16
  python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13", "3.14" ]
17
17
  os: [ ubuntu-latest, macos-latest, windows-latest ]
18
+ # ubuntu-latest (26.04) has no prebuilt Python 3.9; keep covering it on 24.04.
19
+ exclude:
20
+ - python-version: "3.9"
21
+ os: ubuntu-latest
22
+ include:
23
+ - python-version: "3.9"
24
+ os: ubuntu-24.04
18
25
 
19
26
  steps:
20
27
  - uses: actions/checkout@v2
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ipsw-parser
3
- Version: 1.9.0
3
+ Version: 1.9.2
4
4
  Summary: python3 utility for parsing and extracting data from IPSW
5
5
  Author-email: doronz88 <doron88@gmail.com>
6
6
  Maintainer-email: doronz88 <doron88@gmail.com>
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '1.9.0'
22
- __version_tuple__ = version_tuple = (1, 9, 0)
21
+ __version__ = version = '1.9.2'
22
+ __version_tuple__ = version_tuple = (1, 9, 2)
23
23
 
24
- __commit_id__ = commit_id = 'g53f234674'
24
+ __commit_id__ = commit_id = 'ge54c7c84d'
@@ -14,7 +14,15 @@ DSC_DIRECTORIES = (
14
14
  # Some devices report the cryptex through its /System/Cryptexes/OS symlink instead
15
15
  "System/Cryptexes/OS/System/Library/Caches/com.apple.dyld",
16
16
  )
17
- DSC_NAMES = ("dyld_shared_cache_arm64", "dyld_shared_cache_arm64e")
17
+ # The main cache file is the one with no extension: its subcaches and symbols are named after it
18
+ # (`.01`, `.25.dylddata`, `.symbols`...). Its own name varies beyond the architecture, e.g.
19
+ # `dyld_shared_cache_arm64e_x1`.
20
+ DSC_NAME_PATTERN = "dyld_shared_cache_*"
21
+
22
+
23
+ def find_dsc(directory: Path) -> list[Path]:
24
+ """Return the main dyld shared cache files which are directly under ``directory``."""
25
+ return sorted(file for file in directory.glob(DSC_NAME_PATTERN) if "." not in file.name and file.is_file())
18
26
 
19
27
 
20
28
  def split_dsc(root: Path) -> list[Path]:
@@ -29,11 +37,7 @@ def split_dsc(root: Path) -> list[Path]:
29
37
  """
30
38
  split: list[Path] = []
31
39
  for directory in DSC_DIRECTORIES:
32
- for name in DSC_NAMES:
33
- dsc = root / directory / name
34
- if not dsc.exists():
35
- continue
36
-
40
+ for dsc in find_dsc(root / directory):
37
41
  logger.info(f"splitting DSC: {dsc}")
38
42
  try:
39
43
  run("ipsw", "dyld", "split", dsc, "-o", root)
@@ -13,6 +13,7 @@ from remotezip2 import RemoteZip # pyright: ignore[reportMissingTypeStubs]
13
13
  from ipsw_parser.archive import Archive, ArchiveEntry, DirectoryArchive, ZipArchive
14
14
  from ipsw_parser.build_manifest import BuildManifest
15
15
  from ipsw_parser.dsc import create_device_support_layout
16
+ from ipsw_parser.exceptions import IpswException
16
17
  from ipsw_parser.firmware import Firmware
17
18
 
18
19
  logger = logging.getLogger(__name__)
@@ -71,11 +72,15 @@ class IPSW:
71
72
  """Create an IPSW wrapper around an archive backend."""
72
73
  self.archive = archive
73
74
  self._logger = logging.getLogger(__file__)
75
+ try:
76
+ manifest_name = next(
77
+ f for f in self.archive.namelist() if f.startswith("BuildManifest") and f.endswith(".plist")
78
+ )
79
+ except StopIteration:
80
+ raise IpswException("archive does not contain a BuildManifest*.plist file") from None
74
81
  self.build_manifest = BuildManifest(
75
82
  self,
76
- self.archive.read(
77
- next(f for f in self.archive.namelist() if f.startswith("BuildManifest") and f.endswith(".plist"))
78
- ),
83
+ self.archive.read(manifest_name),
79
84
  )
80
85
 
81
86
  @cached_property
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ipsw-parser
3
- Version: 1.9.0
3
+ Version: 1.9.2
4
4
  Summary: python3 utility for parsing and extracting data from IPSW
5
5
  Author-email: doronz88 <doron88@gmail.com>
6
6
  Maintainer-email: doronz88 <doron88@gmail.com>
@@ -0,0 +1,8 @@
1
+ {
2
+ "tag": "1.9.2",
3
+ "distance": 0,
4
+ "node": "ge54c7c84dab7be7c8638dc40c76a94f58078173c",
5
+ "dirty": false,
6
+ "branch": "HEAD",
7
+ "node_date": "2026-11-19"
8
+ }
@@ -2,7 +2,10 @@ import plistlib
2
2
  from pathlib import Path
3
3
  from zipfile import ZipFile, ZipInfo
4
4
 
5
+ import pytest
6
+
5
7
  from ipsw_parser.archive import DirectoryArchive, ZipArchive
8
+ from ipsw_parser.exceptions import IpswException
6
9
  from ipsw_parser.ipsw import IPSW
7
10
 
8
11
 
@@ -56,6 +59,13 @@ def test_zip_archive_supports_same_ipsw_behavior(tmp_path: Path) -> None:
56
59
  assert ipsw.get_development_files() == ["Firmware/devel-file.bin"]
57
60
 
58
61
 
62
+ def test_archive_without_manifest_raises_clean_error(tmp_path: Path) -> None:
63
+ (tmp_path / "not-a-manifest.txt").write_bytes(b"nope")
64
+
65
+ with pytest.raises(IpswException, match="BuildManifest"):
66
+ IPSW(DirectoryArchive(tmp_path))
67
+
68
+
59
69
  def test_directory_extractall_copies_requested_members(tmp_path: Path) -> None:
60
70
  source = tmp_path / "source"
61
71
  source.mkdir()
@@ -8,11 +8,13 @@ from ipsw_parser.process import ProcessExecutionError
8
8
  CRYPTEX_SYMLINK_DSC = "System/Cryptexes/OS/System/Library/Caches/com.apple.dyld/dyld_shared_cache_arm64e"
9
9
  CRYPTEX_DSC = "private/preboot/Cryptexes/OS/System/Library/Caches/com.apple.dyld/dyld_shared_cache_arm64e"
10
10
  SYSTEM_DSC = "System/Library/Caches/com.apple.dyld/dyld_shared_cache_arm64e"
11
+ SUFFIXED_DSC = "System/Cryptexes/OS/System/Library/Caches/com.apple.dyld/dyld_shared_cache_arm64e_x1"
12
+ SUBCACHE_EXTENSIONS = (".01", ".25.dylddata", ".26.dyldreadonly", ".79.dyldlinkedit", ".symbols")
11
13
 
12
14
 
13
15
  def _create(root: Path, path: str) -> Path:
14
16
  file = root / path
15
- file.parent.mkdir(parents=True)
17
+ file.parent.mkdir(parents=True, exist_ok=True)
16
18
  file.write_bytes(b"dsc")
17
19
  return file
18
20
 
@@ -29,7 +31,7 @@ def commands(monkeypatch: pytest.MonkeyPatch) -> list[tuple[str, ...]]:
29
31
  return commands
30
32
 
31
33
 
32
- @pytest.mark.parametrize("path", [SYSTEM_DSC, CRYPTEX_DSC, CRYPTEX_SYMLINK_DSC])
34
+ @pytest.mark.parametrize("path", [SYSTEM_DSC, CRYPTEX_DSC, CRYPTEX_SYMLINK_DSC, SUFFIXED_DSC])
33
35
  def test_split_dsc_finds_the_cache(tmp_path: Path, commands: list[tuple[str, ...]], path: str) -> None:
34
36
  cache = _create(tmp_path, path)
35
37
 
@@ -37,6 +39,30 @@ def test_split_dsc_finds_the_cache(tmp_path: Path, commands: list[tuple[str, ...
37
39
  assert commands == [("ipsw", "dyld", "split", str(cache), "-o", str(tmp_path))]
38
40
 
39
41
 
42
+ @pytest.mark.parametrize("path", [SYSTEM_DSC, SUFFIXED_DSC])
43
+ def test_split_dsc_splits_only_the_main_cache_file(tmp_path: Path, commands: list[tuple[str, ...]], path: str) -> None:
44
+ cache = _create(tmp_path, path)
45
+ for extension in SUBCACHE_EXTENSIONS:
46
+ _create(tmp_path, path + extension)
47
+
48
+ assert dsc.split_dsc(tmp_path) == [cache]
49
+ assert commands == [("ipsw", "dyld", "split", str(cache), "-o", str(tmp_path))]
50
+
51
+
52
+ def test_split_dsc_splits_every_architecture(tmp_path: Path, commands: list[tuple[str, ...]]) -> None:
53
+ caches = [_create(tmp_path, SYSTEM_DSC[:-1]), _create(tmp_path, SYSTEM_DSC)]
54
+
55
+ assert dsc.split_dsc(tmp_path) == caches
56
+
57
+
58
+ def test_split_dsc_ignores_subcaches_without_their_main_cache(tmp_path: Path, commands: list[tuple[str, ...]]) -> None:
59
+ for extension in SUBCACHE_EXTENSIONS:
60
+ _create(tmp_path, SUFFIXED_DSC + extension)
61
+
62
+ assert dsc.split_dsc(tmp_path) == []
63
+ assert commands == []
64
+
65
+
40
66
  def test_split_dsc_extracts_a_cache_the_splitter_refuses(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
41
67
  cache = _create(tmp_path, CRYPTEX_DSC)
42
68
  commands: list[tuple[str, ...]] = []
@@ -56,7 +82,7 @@ def test_split_dsc_extracts_a_cache_the_splitter_refuses(tmp_path: Path, monkeyp
56
82
  ]
57
83
 
58
84
 
59
- @pytest.mark.parametrize("path", [CRYPTEX_DSC, CRYPTEX_SYMLINK_DSC])
85
+ @pytest.mark.parametrize("path", [CRYPTEX_DSC, CRYPTEX_SYMLINK_DSC, SUFFIXED_DSC])
60
86
  def test_device_support_layout_removes_the_split_cryptex_cache(
61
87
  tmp_path: Path, monkeypatch: pytest.MonkeyPatch, commands: list[tuple[str, ...]], path: str
62
88
  ) -> None:
@@ -1,8 +0,0 @@
1
- {
2
- "tag": "1.9.0",
3
- "distance": 0,
4
- "node": "g53f234674a3ecf6222b9041168f6c2f8e93e574d",
5
- "dirty": false,
6
- "branch": "HEAD",
7
- "node_date": "2026-10-28"
8
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes