ipsw-parser 1.3.8__tar.gz → 1.4.0__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 (32) hide show
  1. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/PKG-INFO +8 -5
  2. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/README.md +5 -3
  3. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/ipsw_parser/__main__.py +26 -10
  4. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/ipsw_parser/_version.py +9 -4
  5. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/ipsw_parser/build_identity.py +12 -36
  6. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/ipsw_parser/component.py +0 -9
  7. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/ipsw_parser.egg-info/PKG-INFO +8 -5
  8. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/ipsw_parser.egg-info/SOURCES.txt +0 -1
  9. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/ipsw_parser.egg-info/requires.txt +1 -0
  10. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/requirements.txt +2 -1
  11. ipsw_parser-1.3.8/ipsw_parser/img4.py +0 -138
  12. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/.gitattributes +0 -0
  13. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  14. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  15. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/.github/workflows/codeql.yml +0 -0
  16. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/.github/workflows/python-app.yml +0 -0
  17. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/.github/workflows/python-publish.yml +0 -0
  18. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/.gitignore +0 -0
  19. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/.pre-commit-config.yaml +0 -0
  20. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/CODE_OF_CONDUCT.md +0 -0
  21. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/LICENSE +0 -0
  22. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/ipsw_parser/__init__.py +0 -0
  23. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/ipsw_parser/build_manifest.py +0 -0
  24. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/ipsw_parser/exceptions.py +0 -0
  25. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/ipsw_parser/firmware.py +0 -0
  26. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/ipsw_parser/ipsw.py +0 -0
  27. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/ipsw_parser.egg-info/dependency_links.txt +0 -0
  28. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/ipsw_parser.egg-info/entry_points.txt +0 -0
  29. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/ipsw_parser.egg-info/top_level.txt +0 -0
  30. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/pyproject.toml +0 -0
  31. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/pytest.ini +0 -0
  32. {ipsw_parser-1.3.8 → ipsw_parser-1.4.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: ipsw-parser
3
- Version: 1.3.8
3
+ Version: 1.4.0
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>
@@ -701,18 +701,21 @@ Requires-Dist: cached_property
701
701
  Requires-Dist: plumbum
702
702
  Requires-Dist: pyimg4>=0.8.6
703
703
  Requires-Dist: requests
704
+ Requires-Dist: remotezip2
704
705
  Provides-Extra: test
705
706
  Requires-Dist: pytest; extra == "test"
706
707
 
708
+ # ipsw-parser
709
+
707
710
  [![Python application](https://github.com/doronz88/ipsw_parser/workflows/Python%20application/badge.svg)](https://github.com/doronz88/ipsw_parser/actions/workflows/python-app.yml "Python application action")
708
711
  [![Pypi version](https://img.shields.io/pypi/v/ipsw_parser.svg)](https://pypi.org/project/ipsw_parser/ "PyPi package")
709
712
  [![Downloads](https://static.pepy.tech/personalized-badge/ipsw_parser?period=total&units=none&left_color=grey&right_color=blue&left_text=Downloads)](https://pepy.tech/project/ipsw_parser)
710
713
 
711
- # Overview
714
+ ## Overview
712
715
 
713
716
  python3 utility for parsing and extracting data from IPSW.
714
717
 
715
- # Installation
718
+ ## Installation
716
719
 
717
720
  ```shell
718
721
  python3 -m pip install ipsw-parser
@@ -721,7 +724,7 @@ python3 -m pip install ipsw-parser
721
724
  Additionally, if you installed [blacktop/ipsw](https://github.com/blacktop/ipsw), the IPSW extraction will also contain
722
725
  the split DSC.
723
726
 
724
- # Usage
727
+ ## Usage
725
728
 
726
729
  ```
727
730
  Usage: ipsw-parser [OPTIONS] COMMAND [ARGS]...
@@ -1,12 +1,14 @@
1
+ # ipsw-parser
2
+
1
3
  [![Python application](https://github.com/doronz88/ipsw_parser/workflows/Python%20application/badge.svg)](https://github.com/doronz88/ipsw_parser/actions/workflows/python-app.yml "Python application action")
2
4
  [![Pypi version](https://img.shields.io/pypi/v/ipsw_parser.svg)](https://pypi.org/project/ipsw_parser/ "PyPi package")
3
5
  [![Downloads](https://static.pepy.tech/personalized-badge/ipsw_parser?period=total&units=none&left_color=grey&right_color=blue&left_text=Downloads)](https://pepy.tech/project/ipsw_parser)
4
6
 
5
- # Overview
7
+ ## Overview
6
8
 
7
9
  python3 utility for parsing and extracting data from IPSW.
8
10
 
9
- # Installation
11
+ ## Installation
10
12
 
11
13
  ```shell
12
14
  python3 -m pip install ipsw-parser
@@ -15,7 +17,7 @@ python3 -m pip install ipsw-parser
15
17
  Additionally, if you installed [blacktop/ipsw](https://github.com/blacktop/ipsw), the IPSW extraction will also contain
16
18
  the split DSC.
17
19
 
18
- # Usage
20
+ ## Usage
19
21
 
20
22
  ```
21
23
  Usage: ipsw-parser [OPTIONS] COMMAND [ARGS]...
@@ -1,11 +1,12 @@
1
1
  #!/usr/bin/env python3
2
2
  import logging
3
3
  from pathlib import Path
4
- from typing import IO, Optional
4
+ from typing import Optional
5
5
  from zipfile import ZipFile
6
6
 
7
7
  import click
8
8
  import coloredlogs
9
+ from remotezip2 import RemoteZip
9
10
 
10
11
  from ipsw_parser.ipsw import IPSW
11
12
 
@@ -23,6 +24,14 @@ logger = logging.getLogger(__name__)
23
24
 
24
25
  PEM_DB_ENV_VAR = 'IPSW_PARSER_PEM_DB'
25
26
 
27
+
28
+ def handle_ipsw_argument(ctx: click.Context, param: click.Argument, value: str) -> IPSW:
29
+ if value.startswith('http://') or value.startswith('https://'):
30
+ return IPSW(RemoteZip(value))
31
+ return IPSW(ZipFile(Path(value).expanduser()))
32
+
33
+
34
+ ipsw_argument = click.argument('ipsw', callback=handle_ipsw_argument)
26
35
  pem_db_option = click.option('--pem-db', envvar=PEM_DB_ENV_VAR,
27
36
  help='Path DB file url (can be either a filesystem path or an HTTP URL). '
28
37
  'Alternatively, use the IPSW_PARSER_PEM_DB envvar.')
@@ -35,10 +44,9 @@ def cli() -> None:
35
44
 
36
45
 
37
46
  @cli.command('info')
38
- @click.argument('file', type=click.Path(exists=True, file_okay=True, dir_okay=False))
39
- def info(file) -> None:
47
+ @ipsw_argument
48
+ def info(ipsw) -> None:
40
49
  """ Parse given .ipsw basic info """
41
- ipsw = IPSW(ZipFile(file))
42
50
  print(f'SupportedProductTypes: {ipsw.build_manifest.supported_product_types}')
43
51
  print(f'ProductVersion: {ipsw.build_manifest.product_version}')
44
52
  print(f'ProductBuildVersion: {ipsw.build_manifest.product_build_version}')
@@ -51,28 +59,36 @@ def info(file) -> None:
51
59
 
52
60
 
53
61
  @cli.command('extract')
54
- @click.argument('file', type=click.Path(exists=True, file_okay=True, dir_okay=False))
62
+ @ipsw_argument
55
63
  @click.argument('output', type=click.Path(exists=False))
56
64
  @pem_db_option
57
- def extract(file: IO, output: str, pem_db: Optional[str]) -> None:
65
+ def extract(ipsw: IPSW, output: str, pem_db: Optional[str]) -> None:
58
66
  """ Extract .ipsw into filesystem layout """
59
67
  output = Path(output)
60
68
 
61
69
  if not output.exists():
62
70
  output.mkdir(parents=True, exist_ok=True)
63
71
 
64
- ipsw = IPSW(ZipFile(file))
65
72
  ipsw.build_manifest.build_identities[0].extract(output, pem_db=pem_db)
66
73
  ipsw.archive.extractall(
67
74
  path=output, members=[f for f in ipsw.archive.filelist if f.filename.startswith('Firmware')])
68
75
 
69
76
 
77
+ @cli.command('extract-kernel')
78
+ @ipsw_argument
79
+ @click.argument('output', type=click.Path(exists=False))
80
+ @click.option('--arch', help='Arch name to extract using lipo')
81
+ def extract_kernel(ipsw: IPSW, output: str, arch: Optional[str]) -> None:
82
+ """ Extract kernelcache from given .ipsw into given output filename """
83
+ Path(output).write_bytes(ipsw.build_manifest.build_identities[0].get_kernelcache_payload(arch=arch))
84
+
85
+
70
86
  @cli.command('device-support')
71
- @click.argument('file', type=click.Path(exists=True, file_okay=True, dir_okay=False))
87
+ @ipsw_argument
72
88
  @pem_db_option
73
- def device_support(file: IO, pem_db: Optional[str]) -> None:
89
+ def device_support(ipsw: IPSW, pem_db: Optional[str]) -> None:
74
90
  """ Create DeviceSupport directory """
75
- IPSW(ZipFile(file)).create_device_support(pem_db=pem_db)
91
+ ipsw.create_device_support(pem_db=pem_db)
76
92
 
77
93
 
78
94
  if __name__ == '__main__':
@@ -1,8 +1,13 @@
1
- # file generated by setuptools_scm
1
+ # file generated by setuptools-scm
2
2
  # don't change, don't track in version control
3
+
4
+ __all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
5
+
3
6
  TYPE_CHECKING = False
4
7
  if TYPE_CHECKING:
5
- from typing import Tuple, Union
8
+ from typing import Tuple
9
+ from typing import Union
10
+
6
11
  VERSION_TUPLE = Tuple[Union[int, str], ...]
7
12
  else:
8
13
  VERSION_TUPLE = object
@@ -12,5 +17,5 @@ __version__: str
12
17
  __version_tuple__: VERSION_TUPLE
13
18
  version_tuple: VERSION_TUPLE
14
19
 
15
- __version__ = version = '1.3.8'
16
- __version_tuple__ = version_tuple = (1, 3, 8)
20
+ __version__ = version = '1.4.0'
21
+ __version_tuple__ = version_tuple = (1, 4, 0)
@@ -110,42 +110,6 @@ class BuildIdentity(UserDict):
110
110
  def get_component(self, name: str, **args) -> Component:
111
111
  return Component(self, name, **args)
112
112
 
113
- def populate_tss_request_parameters(self, parameters: dict, additional_keys: Optional[list[str]] = None) -> None:
114
- """ equivalent to idevicerestore:tss_parameters_add_from_manifest """
115
- key_list = ['ApBoardID', 'ApChipID']
116
- if additional_keys is None:
117
- key_list += ['UniqueBuildID', 'Ap,OSLongVersion', 'Ap,OSReleaseType', 'Ap,ProductType', 'Ap,SDKPlatform',
118
- 'Ap,SikaFuse', 'Ap,Target', 'Ap,TargetType', 'ApBoardID', 'ApChipID',
119
- 'ApSecurityDomain', 'BMU,BoardID', 'BMU,ChipID', 'BbChipID', 'BbProvisioningManifestKeyHash',
120
- 'BbActivationManifestKeyHash', 'BbCalibrationManifestKeyHash', 'Ap,ProductMarketingVersion',
121
- 'BbFactoryActivationManifestKeyHash', 'BbFDRSecurityKeyHash', 'BbSkeyId', 'SE,ChipID',
122
- 'Savage,ChipID', 'Savage,PatchEpoch', 'Yonkers,BoardID', 'Yonkers,ChipID',
123
- 'Yonkers,PatchEpoch', 'Rap,BoardID', 'Rap,ChipID', 'Rap,SecurityDomain', 'Baobab,BoardID',
124
- 'Baobab,ChipID', 'Baobab,ManifestEpoch', 'Baobab,SecurityDomain', 'eUICC,ChipID',
125
- 'PearlCertificationRootPub', 'Timer,BoardID,1', 'Timer,BoardID,2', 'Timer,ChipID,1',
126
- 'Timer,ChipID,2', 'Timer,SecurityDomain,1', 'Timer,SecurityDomain,2', 'Manifest',
127
- ]
128
- else:
129
- key_list += additional_keys
130
-
131
- for k in key_list:
132
- try:
133
- v = self[k]
134
- if isinstance(v, str) and v.startswith('0x'):
135
- v = int(v, 16)
136
- parameters[k] = v
137
- except KeyError:
138
- pass
139
-
140
- if additional_keys is None:
141
- # special treat for RequiresUIDMode
142
- info = self.get('Info')
143
- if info is None:
144
- return
145
- requires_uid_mode = info.get('RequiresUIDMode')
146
- if requires_uid_mode is not None:
147
- parameters['RequiresUIDMode'] = requires_uid_mode
148
-
149
113
  def extract_dsc(self, output: Path, pem_db: Optional[str] = None) -> None:
150
114
  build_identity = self.build_manifest.build_identities[0]
151
115
  if not build_identity.has_component('Cryptex1,SystemOS'):
@@ -158,6 +122,18 @@ class BuildIdentity(UserDict):
158
122
  sub_path=Path('System'), pem_db=pem_db)
159
123
  _split_dsc(output)
160
124
 
125
+ def get_kernelcache_payload(self, arch: Optional[str] = None) -> bytes:
126
+ im4p = IM4P(self.build_manifest.build_identities[0].get_component('KernelCache').data)
127
+ im4p.payload.decompress()
128
+ payload = im4p.payload.output().data
129
+ if arch is None:
130
+ return payload
131
+
132
+ with TemporaryDirectory() as temp_dir:
133
+ kernel_output = Path(temp_dir) / 'kernel'
134
+ local['ipsw']('macho', 'lipo', '-a', arch, kernel_output)
135
+ return Path(next(kernel_output.parent.glob(f'*.{arch}'))).read_bytes()
136
+
161
137
  def extract(self, output: Path, pem_db: Optional[str] = None) -> None:
162
138
  logger.info(f'extracting into: {output}')
163
139
 
@@ -4,7 +4,6 @@ import os.path
4
4
  from cached_property import cached_property
5
5
 
6
6
  from ipsw_parser.exceptions import IpswException
7
- from ipsw_parser.img4 import stitch_component
8
7
 
9
8
 
10
9
  class TSSResponse(dict):
@@ -64,11 +63,3 @@ class Component:
64
63
  self.logger.debug(f'Extracting {os.path.basename(self.path)} ({self.path})')
65
64
  return self.build_identity.build_manifest.ipsw.read(self.path)
66
65
  return self._data
67
-
68
- @cached_property
69
- def personalized_data(self):
70
- if self._tss is None:
71
- raise IpswException(f'TSS ticket must be supplied for personalizing component: {self.name}')
72
-
73
- # stitch ApImg4Ticket into IMG4 file
74
- return stitch_component(self.name, self.data, self._tss)
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: ipsw-parser
3
- Version: 1.3.8
3
+ Version: 1.4.0
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>
@@ -701,18 +701,21 @@ Requires-Dist: cached_property
701
701
  Requires-Dist: plumbum
702
702
  Requires-Dist: pyimg4>=0.8.6
703
703
  Requires-Dist: requests
704
+ Requires-Dist: remotezip2
704
705
  Provides-Extra: test
705
706
  Requires-Dist: pytest; extra == "test"
706
707
 
708
+ # ipsw-parser
709
+
707
710
  [![Python application](https://github.com/doronz88/ipsw_parser/workflows/Python%20application/badge.svg)](https://github.com/doronz88/ipsw_parser/actions/workflows/python-app.yml "Python application action")
708
711
  [![Pypi version](https://img.shields.io/pypi/v/ipsw_parser.svg)](https://pypi.org/project/ipsw_parser/ "PyPi package")
709
712
  [![Downloads](https://static.pepy.tech/personalized-badge/ipsw_parser?period=total&units=none&left_color=grey&right_color=blue&left_text=Downloads)](https://pepy.tech/project/ipsw_parser)
710
713
 
711
- # Overview
714
+ ## Overview
712
715
 
713
716
  python3 utility for parsing and extracting data from IPSW.
714
717
 
715
- # Installation
718
+ ## Installation
716
719
 
717
720
  ```shell
718
721
  python3 -m pip install ipsw-parser
@@ -721,7 +724,7 @@ python3 -m pip install ipsw-parser
721
724
  Additionally, if you installed [blacktop/ipsw](https://github.com/blacktop/ipsw), the IPSW extraction will also contain
722
725
  the split DSC.
723
726
 
724
- # Usage
727
+ ## Usage
725
728
 
726
729
  ```
727
730
  Usage: ipsw-parser [OPTIONS] COMMAND [ARGS]...
@@ -20,7 +20,6 @@ ipsw_parser/build_manifest.py
20
20
  ipsw_parser/component.py
21
21
  ipsw_parser/exceptions.py
22
22
  ipsw_parser/firmware.py
23
- ipsw_parser/img4.py
24
23
  ipsw_parser/ipsw.py
25
24
  ipsw_parser.egg-info/PKG-INFO
26
25
  ipsw_parser.egg-info/SOURCES.txt
@@ -5,6 +5,7 @@ cached_property
5
5
  plumbum
6
6
  pyimg4>=0.8.6
7
7
  requests
8
+ remotezip2
8
9
 
9
10
  [test]
10
11
  pytest
@@ -4,4 +4,5 @@ coloredlogs
4
4
  cached_property
5
5
  plumbum
6
6
  pyimg4>=0.8.6
7
- requests
7
+ requests
8
+ remotezip2
@@ -1,138 +0,0 @@
1
- import logging
2
-
3
- import pyimg4
4
- from pyimg4 import IM4P
5
-
6
- logger = logging.getLogger(__name__)
7
-
8
- COMPONENT_FOURCC = {
9
- 'ACIBT': 'acib',
10
- 'ACIBTLPEM': 'lpbt',
11
- 'ACIWIFI': 'aciw',
12
- 'ANE': 'anef',
13
- 'ANS': 'ansf',
14
- 'AOP': 'aopf',
15
- 'AVE': 'avef',
16
- 'Alamo': 'almo',
17
- 'Ap,ANE1': 'ane1',
18
- 'Ap,ANE2': 'ane2',
19
- 'Ap,ANE3': 'ane3',
20
- 'Ap,AudioAccessibilityBootChime': 'auac',
21
- 'Ap,AudioBootChime': 'aubt',
22
- 'Ap,AudioPowerAttachChime': 'aupr',
23
- 'Ap,BootabilityBrainTrustCache': 'trbb',
24
- 'Ap,CIO': 'ciof',
25
- 'Ap,HapticAssets': 'hpas',
26
- 'Ap,LocalBoot': 'lobo',
27
- 'Ap,LocalPolicy': 'lpol',
28
- 'Ap,NextStageIM4MHash': 'nsih',
29
- 'Ap,RecoveryOSPolicyNonceHash': 'ronh',
30
- 'Ap,RestoreANE1': 'ran1',
31
- 'Ap,RestoreANE2': 'ran2',
32
- 'Ap,RestoreANE3': 'ran3',
33
- 'Ap,RestoreCIO': 'rcio',
34
- 'Ap,RestoreTMU': 'rtmu',
35
- 'Ap,Scorpius': 'scpf',
36
- 'Ap,SystemVolumeCanonicalMetadata': 'msys',
37
- 'Ap,TMU': 'tmuf',
38
- 'Ap,VolumeUUID': 'vuid',
39
- 'Ap,rOSLogo1': 'rlg1',
40
- 'Ap,rOSLogo2': 'rlg2',
41
- 'AppleLogo': 'logo',
42
- 'AudioCodecFirmware': 'acfw',
43
- 'BatteryCharging': 'glyC',
44
- 'BatteryCharging0': 'chg0',
45
- 'BatteryCharging1': 'chg1',
46
- 'BatteryFull': 'batF',
47
- 'BatteryLow0': 'bat0',
48
- 'BatteryLow1': 'bat1',
49
- 'BatteryPlugin': 'glyP',
50
- 'CFELoader': 'cfel',
51
- 'CrownFirmware': 'crwn',
52
- 'DCP': 'dcpf',
53
- 'Dali': 'dali',
54
- 'DeviceTree': 'dtre',
55
- 'Diags': 'diag',
56
- 'EngineeringTrustCache': 'dtrs',
57
- 'ExtDCP': 'edcp',
58
- 'GFX': 'gfxf',
59
- 'Hamm': 'hamf',
60
- 'Homer': 'homr',
61
- 'ISP': 'ispf',
62
- 'InputDevice': 'ipdf',
63
- 'KernelCache': 'krnl',
64
- 'LLB': 'illb',
65
- 'LeapHaptics': 'lphp',
66
- 'Liquid': 'liqd',
67
- 'LoadableTrustCache': 'ltrs',
68
- 'LowPowerWallet0': 'lpw0',
69
- 'LowPowerWallet1': 'lpw1',
70
- 'LowPowerWallet2': 'lpw2',
71
- 'MacEFI': 'mefi',
72
- 'MtpFirmware': 'mtpf',
73
- 'Multitouch': 'mtfw',
74
- 'NeedService': 'nsrv',
75
- 'OS': 'OS\0\0',
76
- 'OSRamdisk': 'osrd',
77
- 'PEHammer': 'hmmr',
78
- 'PERTOS': 'pert',
79
- 'PHLEET': 'phlt',
80
- 'PMP': 'pmpf',
81
- 'PersonalizedDMG': 'pdmg',
82
- 'RBM': 'rmbt',
83
- 'RTP': 'rtpf',
84
- 'Rap,SoftwareBinaryDsp1': 'sbd1',
85
- 'Rap,RTKitOS': 'rkos',
86
- 'Rap,RestoreRTKitOS': 'rrko',
87
- 'RecoveryMode': 'recm',
88
- 'RestoreANS': 'rans',
89
- 'RestoreDCP': 'rdcp',
90
- 'RestoreDeviceTree': 'rdtr',
91
- 'RestoreExtDCP': 'recp',
92
- 'RestoreKernelCache': 'rkrn',
93
- 'RestoreLogo': 'rlgo',
94
- 'RestoreRTP': 'rrtp',
95
- 'RestoreRamDisk': 'rdsk',
96
- 'RestoreSEP': 'rsep',
97
- 'RestoreTrustCache': 'rtsc',
98
- 'SCE': 'scef',
99
- 'SCE1Firmware': 'sc1f',
100
- 'SEP': 'sepi',
101
- 'SIO': 'siof',
102
- 'StaticTrustCache': 'trst',
103
- 'SystemLocker': 'lckr',
104
- 'SystemVolume': 'isys',
105
- 'WCHFirmwareUpdater': 'wchf',
106
- 'ftap': 'ftap',
107
- 'ftsp': 'ftsp',
108
- 'iBEC': 'ibec',
109
- 'iBSS': 'ibss',
110
- 'iBoot': 'ibot',
111
- 'iBootData': 'ibdt',
112
- 'iBootDataStage1': 'ibd1',
113
- 'iBootTest': 'itst',
114
- 'rfta': 'rfta',
115
- 'rfts': 'rfts',
116
- 'Ap,DCP2': 'dcp2',
117
- }
118
-
119
-
120
- def stitch_component(name: str, im4p_data: bytes, tss):
121
- logger.info(f'Personalizing IMG4 component {name}...')
122
-
123
- im4p = IM4P(data=im4p_data)
124
-
125
- # patch fourcc
126
- fourcc = COMPONENT_FOURCC.get(name)
127
- if fourcc is not None:
128
- im4p.fourcc = fourcc
129
-
130
- # hack if we have a *-TBM entry for the give
131
- tbm_dict = tss.get(f'{name}-TBM')
132
-
133
- im4r = None
134
- if tbm_dict is not None:
135
- im4r = pyimg4.IM4R()
136
- for key in tbm_dict.keys():
137
- im4r.add_property(pyimg4.RestoreProperty(fourcc=key, value=tbm_dict[key]))
138
- return pyimg4.IMG4(im4p=im4p, im4m=tss.ap_img4_ticket, im4r=im4r).output()
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes