ipsw-parser 1.8.1__tar.gz → 1.8.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 (42) hide show
  1. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/PKG-INFO +1 -1
  2. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/ipsw_parser/_version.py +3 -3
  3. ipsw_parser-1.8.2/ipsw_parser/dsc.py +87 -0
  4. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/ipsw_parser.egg-info/PKG-INFO +1 -1
  5. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/ipsw_parser.egg-info/SOURCES.txt +1 -0
  6. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/ipsw_parser.egg-info/scm_file_list.json +1 -0
  7. ipsw_parser-1.8.2/ipsw_parser.egg-info/scm_version.json +8 -0
  8. ipsw_parser-1.8.2/tests/test_dsc.py +87 -0
  9. ipsw_parser-1.8.1/ipsw_parser/dsc.py +0 -62
  10. ipsw_parser-1.8.1/ipsw_parser.egg-info/scm_version.json +0 -8
  11. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/.gitattributes +0 -0
  12. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  13. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  14. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/.github/workflows/codeql.yml +0 -0
  15. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/.github/workflows/python-app.yml +0 -0
  16. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/.github/workflows/python-publish.yml +0 -0
  17. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/.gitignore +0 -0
  18. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/.pre-commit-config.yaml +0 -0
  19. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/CODE_OF_CONDUCT.md +0 -0
  20. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/LICENSE +0 -0
  21. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/README.md +0 -0
  22. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/ipsw_parser/__init__.py +0 -0
  23. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/ipsw_parser/__main__.py +0 -0
  24. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/ipsw_parser/archive.py +0 -0
  25. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/ipsw_parser/build_identity.py +0 -0
  26. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/ipsw_parser/build_manifest.py +0 -0
  27. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/ipsw_parser/component.py +0 -0
  28. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/ipsw_parser/exceptions.py +0 -0
  29. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/ipsw_parser/firmware.py +0 -0
  30. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/ipsw_parser/ipsw.py +0 -0
  31. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/ipsw_parser/process.py +0 -0
  32. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/ipsw_parser.egg-info/dependency_links.txt +0 -0
  33. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/ipsw_parser.egg-info/entry_points.txt +0 -0
  34. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/ipsw_parser.egg-info/requires.txt +0 -0
  35. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/ipsw_parser.egg-info/top_level.txt +0 -0
  36. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/pyproject.toml +0 -0
  37. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/pytest.ini +0 -0
  38. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/requirements.txt +0 -0
  39. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/setup.cfg +0 -0
  40. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/tests/test_archive_backends.py +0 -0
  41. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/tests/test_process.py +0 -0
  42. {ipsw_parser-1.8.1 → ipsw_parser-1.8.2}/tests/test_sandbox_profiles.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ipsw-parser
3
- Version: 1.8.1
3
+ Version: 1.8.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.8.1'
22
- __version_tuple__ = version_tuple = (1, 8, 1)
21
+ __version__ = version = '1.8.2'
22
+ __version_tuple__ = version_tuple = (1, 8, 2)
23
23
 
24
- __commit_id__ = commit_id = 'gaa9b8c1bd'
24
+ __commit_id__ = commit_id = 'g7fae59bd2'
@@ -0,0 +1,87 @@
1
+ import logging
2
+ import plistlib
3
+ from datetime import datetime
4
+ from pathlib import Path
5
+
6
+ from ipsw_parser.process import ProcessExecutionError, run
7
+
8
+ logger = logging.getLogger(__name__)
9
+
10
+
11
+ DSC_DIRECTORIES = (
12
+ "System/Library/Caches/com.apple.dyld",
13
+ "private/preboot/Cryptexes/OS/System/Library/Caches/com.apple.dyld",
14
+ # Some devices report the cryptex through its /System/Cryptexes/OS symlink instead
15
+ "System/Cryptexes/OS/System/Library/Caches/com.apple.dyld",
16
+ )
17
+ DSC_NAMES = ("dyld_shared_cache_arm64", "dyld_shared_cache_arm64e")
18
+
19
+
20
+ def split_dsc(root: Path) -> list[Path]:
21
+ """
22
+ Split dyld shared caches found under ``root`` into their images.
23
+
24
+ ``ipsw dyld split`` does it using Xcode's own extractor, which refuses a cache whose code
25
+ signature does not match (a patched one, for instance). Such a cache is extracted using
26
+ ``ipsw dyld extract`` instead.
27
+
28
+ :returns: The shared caches which were split.
29
+ """
30
+ split: list[Path] = []
31
+ for directory in DSC_DIRECTORIES:
32
+ for name in DSC_NAMES:
33
+ dsc = root / directory / name
34
+ if not dsc.exists():
35
+ continue
36
+
37
+ logger.info(f"splitting DSC: {dsc}")
38
+ try:
39
+ run("ipsw", "dyld", "split", dsc, "-o", root)
40
+ except ProcessExecutionError as e:
41
+ logger.warning(f"`ipsw dyld split` failed, extracting the images of {dsc} instead: {e}")
42
+ run("ipsw", "dyld", "extract", dsc, "--all", "--output", root)
43
+ split.append(dsc)
44
+ return split
45
+
46
+
47
+ def get_device_support_path(product_type: str, product_version: str, product_build_version: str) -> Path:
48
+ """Return the Xcode DeviceSupport path for the given product metadata."""
49
+ device_support_path = Path("~/Library/Developer/Xcode/iOS DeviceSupport").expanduser()
50
+ device_support_path /= f"{product_type} {product_version} ({product_build_version})"
51
+ return device_support_path
52
+
53
+
54
+ def create_device_support_layout(
55
+ product_type: str, product_version: str, product_build_version: str, root_path: Path
56
+ ) -> Path:
57
+ """
58
+ Create the Xcode DeviceSupport layout for extracted symbol files.
59
+
60
+ :raises FileNotFoundError: if ``root_path`` holds no dyld shared cache to split.
61
+ """
62
+ device_support_path = get_device_support_path(product_type, product_version, product_build_version)
63
+
64
+ # Split DSC files
65
+ if not split_dsc(root_path):
66
+ raise FileNotFoundError(f"no dyld shared cache was found under {root_path}")
67
+
68
+ # Clean up the cryptex DSC files after splitting
69
+ for directory in DSC_DIRECTORIES[1:]:
70
+ cryptex_dsc_dir = root_path / directory
71
+ if cryptex_dsc_dir.exists():
72
+ for file in cryptex_dsc_dir.iterdir():
73
+ file.unlink()
74
+
75
+ # Create the device support metadata files
76
+ (device_support_path / "Info.plist").write_bytes(
77
+ plistlib.dumps({
78
+ "DSC Extractor Version": "1228.0.0.0.0",
79
+ "DateCollected": datetime.now(),
80
+ "Version": "16.0",
81
+ })
82
+ )
83
+ (device_support_path / ".finalized").write_bytes(plistlib.dumps({}))
84
+ (device_support_path / ".processed_dyld_shared_cache_arm64e").touch()
85
+ (device_support_path / ".processing_lock").touch()
86
+
87
+ return device_support_path
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ipsw-parser
3
- Version: 1.8.1
3
+ Version: 1.8.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>
@@ -33,5 +33,6 @@ ipsw_parser.egg-info/scm_file_list.json
33
33
  ipsw_parser.egg-info/scm_version.json
34
34
  ipsw_parser.egg-info/top_level.txt
35
35
  tests/test_archive_backends.py
36
+ tests/test_dsc.py
36
37
  tests/test_process.py
37
38
  tests/test_sandbox_profiles.py
@@ -26,6 +26,7 @@
26
26
  "pytest.ini",
27
27
  "requirements.txt",
28
28
  "tests/test_archive_backends.py",
29
+ "tests/test_dsc.py",
29
30
  "tests/test_process.py",
30
31
  "tests/test_sandbox_profiles.py"
31
32
  ]
@@ -0,0 +1,8 @@
1
+ {
2
+ "tag": "1.8.2",
3
+ "distance": 0,
4
+ "node": "g7fae59bd2f7f087145f91cc5978c17d00dc983ba",
5
+ "dirty": false,
6
+ "branch": "HEAD",
7
+ "node_date": "2026-10-12"
8
+ }
@@ -0,0 +1,87 @@
1
+ from pathlib import Path
2
+
3
+ import pytest
4
+
5
+ from ipsw_parser import dsc
6
+ from ipsw_parser.process import ProcessExecutionError
7
+
8
+ CRYPTEX_SYMLINK_DSC = "System/Cryptexes/OS/System/Library/Caches/com.apple.dyld/dyld_shared_cache_arm64e"
9
+ CRYPTEX_DSC = "private/preboot/Cryptexes/OS/System/Library/Caches/com.apple.dyld/dyld_shared_cache_arm64e"
10
+ SYSTEM_DSC = "System/Library/Caches/com.apple.dyld/dyld_shared_cache_arm64e"
11
+
12
+
13
+ def _create(root: Path, path: str) -> Path:
14
+ file = root / path
15
+ file.parent.mkdir(parents=True)
16
+ file.write_bytes(b"dsc")
17
+ return file
18
+
19
+
20
+ @pytest.fixture
21
+ def commands(monkeypatch: pytest.MonkeyPatch) -> list[tuple[str, ...]]:
22
+ commands: list[tuple[str, ...]] = []
23
+
24
+ def run(*argv: object) -> str:
25
+ commands.append(tuple(str(arg) for arg in argv))
26
+ return ""
27
+
28
+ monkeypatch.setattr(dsc, "run", run)
29
+ return commands
30
+
31
+
32
+ @pytest.mark.parametrize("path", [SYSTEM_DSC, CRYPTEX_DSC, CRYPTEX_SYMLINK_DSC])
33
+ def test_split_dsc_finds_the_cache(tmp_path: Path, commands: list[tuple[str, ...]], path: str) -> None:
34
+ cache = _create(tmp_path, path)
35
+
36
+ assert dsc.split_dsc(tmp_path) == [cache]
37
+ assert commands == [("ipsw", "dyld", "split", str(cache), "-o", str(tmp_path))]
38
+
39
+
40
+ def test_split_dsc_extracts_a_cache_the_splitter_refuses(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
41
+ cache = _create(tmp_path, CRYPTEX_DSC)
42
+ commands: list[tuple[str, ...]] = []
43
+
44
+ def run(*argv: object) -> str:
45
+ commands.append(tuple(str(arg) for arg in argv))
46
+ if argv[2] == "split":
47
+ raise ProcessExecutionError(list(commands[-1]), 1, "", "code signature for page 0 is incorrect")
48
+ return ""
49
+
50
+ monkeypatch.setattr(dsc, "run", run)
51
+
52
+ assert dsc.split_dsc(tmp_path) == [cache]
53
+ assert commands == [
54
+ ("ipsw", "dyld", "split", str(cache), "-o", str(tmp_path)),
55
+ ("ipsw", "dyld", "extract", str(cache), "--all", "--output", str(tmp_path)),
56
+ ]
57
+
58
+
59
+ @pytest.mark.parametrize("path", [CRYPTEX_DSC, CRYPTEX_SYMLINK_DSC])
60
+ def test_device_support_layout_removes_the_split_cryptex_cache(
61
+ tmp_path: Path, monkeypatch: pytest.MonkeyPatch, commands: list[tuple[str, ...]], path: str
62
+ ) -> None:
63
+ device_support = tmp_path / "DeviceSupport"
64
+ symbols = device_support / "Symbols"
65
+ cache = _create(symbols, path)
66
+ monkeypatch.setattr(dsc, "get_device_support_path", lambda *args: device_support)
67
+
68
+ assert dsc.create_device_support_layout("iPhone15,2", "16.0", "20A362", symbols) == device_support
69
+
70
+ assert len(commands) == 1
71
+ assert not cache.exists()
72
+ assert (device_support / ".finalized").exists()
73
+
74
+
75
+ def test_device_support_layout_is_not_finalized_without_a_cache(
76
+ tmp_path: Path, monkeypatch: pytest.MonkeyPatch, commands: list[tuple[str, ...]]
77
+ ) -> None:
78
+ device_support = tmp_path / "DeviceSupport"
79
+ symbols = device_support / "Symbols"
80
+ symbols.mkdir(parents=True)
81
+ monkeypatch.setattr(dsc, "get_device_support_path", lambda *args: device_support)
82
+
83
+ with pytest.raises(FileNotFoundError):
84
+ dsc.create_device_support_layout("iPhone15,2", "16.0", "20A362", symbols)
85
+
86
+ assert commands == []
87
+ assert not (device_support / ".finalized").exists()
@@ -1,62 +0,0 @@
1
- import logging
2
- import plistlib
3
- from datetime import datetime
4
- from pathlib import Path
5
-
6
- from ipsw_parser.process import run
7
-
8
- logger = logging.getLogger(__name__)
9
-
10
-
11
- def split_dsc(root: Path) -> None:
12
- """Split dyld shared caches found under ``root`` using ``ipsw dyld split``."""
13
- dsc_paths = [
14
- root / "System/Library/Caches/com.apple.dyld/dyld_shared_cache_arm64",
15
- root / "System/Library/Caches/com.apple.dyld/dyld_shared_cache_arm64e",
16
- root / "private/preboot/Cryptexes/OS/System/Library/Caches/com.apple.dyld/dyld_shared_cache_arm64",
17
- root / "private/preboot/Cryptexes/OS/System/Library/Caches/com.apple.dyld/dyld_shared_cache_arm64e",
18
- ]
19
-
20
- for dsc in dsc_paths:
21
- if not dsc.exists():
22
- continue
23
-
24
- logger.info(f"splitting DSC: {dsc}")
25
- run("ipsw", "dyld", "split", dsc, "-o", root)
26
-
27
-
28
- def get_device_support_path(product_type: str, product_version: str, product_build_version: str) -> Path:
29
- """Return the Xcode DeviceSupport path for the given product metadata."""
30
- device_support_path = Path("~/Library/Developer/Xcode/iOS DeviceSupport").expanduser()
31
- device_support_path /= f"{product_type} {product_version} ({product_build_version})"
32
- return device_support_path
33
-
34
-
35
- def create_device_support_layout(
36
- product_type: str, product_version: str, product_build_version: str, root_path: Path
37
- ) -> Path:
38
- """Create the Xcode DeviceSupport layout for extracted symbol files."""
39
- device_support_path = get_device_support_path(product_type, product_version, product_build_version)
40
-
41
- # Split DSC files
42
- split_dsc(root_path)
43
-
44
- # Clean up the cryptex DSC files after splitting
45
- cryptex_dsc_dir = root_path / "private/preboot/Cryptexes/OS/System/Library/Caches/com.apple.dyld"
46
- if cryptex_dsc_dir.exists():
47
- for file in cryptex_dsc_dir.iterdir():
48
- file.unlink()
49
-
50
- # Create the device support metadata files
51
- (device_support_path / "Info.plist").write_bytes(
52
- plistlib.dumps({
53
- "DSC Extractor Version": "1228.0.0.0.0",
54
- "DateCollected": datetime.now(),
55
- "Version": "16.0",
56
- })
57
- )
58
- (device_support_path / ".finalized").write_bytes(plistlib.dumps({}))
59
- (device_support_path / ".processed_dyld_shared_cache_arm64e").touch()
60
- (device_support_path / ".processing_lock").touch()
61
-
62
- return device_support_path
@@ -1,8 +0,0 @@
1
- {
2
- "tag": "1.8.1",
3
- "distance": 0,
4
- "node": "gaa9b8c1bd4f082171d75db2cf05ae21f5a9548ea",
5
- "dirty": false,
6
- "branch": "HEAD",
7
- "node_date": "2026-10-11"
8
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes