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.
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/.github/workflows/python-app.yml +7 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/PKG-INFO +1 -1
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser/_version.py +3 -3
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser/dsc.py +10 -6
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser/ipsw.py +8 -3
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser.egg-info/PKG-INFO +1 -1
- ipsw_parser-1.9.2/ipsw_parser.egg-info/scm_version.json +8 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/tests/test_archive_backends.py +10 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/tests/test_dsc.py +29 -3
- ipsw_parser-1.9.0/ipsw_parser.egg-info/scm_version.json +0 -8
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/.gitattributes +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/.github/workflows/codeql.yml +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/.github/workflows/python-publish.yml +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/.gitignore +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/.pre-commit-config.yaml +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/CODE_OF_CONDUCT.md +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/LICENSE +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/README.md +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser/__init__.py +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser/__main__.py +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser/archive.py +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser/build_identity.py +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser/build_manifest.py +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser/component.py +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser/exceptions.py +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser/firmware.py +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser/process.py +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser/py.typed +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser.egg-info/SOURCES.txt +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser.egg-info/dependency_links.txt +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser.egg-info/entry_points.txt +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser.egg-info/requires.txt +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser.egg-info/scm_file_list.json +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/ipsw_parser.egg-info/top_level.txt +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/pyproject.toml +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/pytest.ini +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/requirements.txt +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/setup.cfg +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/tests/test_firmware.py +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/tests/test_kernelcache.py +0 -0
- {ipsw_parser-1.9.0 → ipsw_parser-1.9.2}/tests/test_process.py +0 -0
- {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
|
|
@@ -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.
|
|
22
|
-
__version_tuple__ = version_tuple = (1, 9,
|
|
21
|
+
__version__ = version = '1.9.2'
|
|
22
|
+
__version_tuple__ = version_tuple = (1, 9, 2)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
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
|
-
|
|
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
|
|
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
|
|
@@ -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:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|