Skip to content

DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.

fix(ci): bind codesign certificate extraction prefix correctly

idealclover2ad0e4e6612d
diff --git a/.github/scripts/ios-testflight.py b/.github/scripts/ios-testflight.py
index 5cb91997..662ecc84 100644
--- a/.github/scripts/ios-testflight.py
+++ b/.github/scripts/ios-testflight.py
@@ -143,7 +143,7 @@ def verify():
require(config['ios']['buildNumber'] == os.environ['BUILD_NUMBER'], 'Embedded Expo build number mismatch')
require(config['extra']['thirdPartyNotices'] == Path('THIRD_PARTY_NOTICES.md').read_text(), 'Missing third-party notices')
run('codesign', '--verify', '--deep', '--strict', str(app))
- run('codesign', '-d', '--extract-certificates', str(root / 'signed-cert-'), str(app))
+ run('codesign', '-d', f'--extract-certificates={root / "signed-cert-"}', str(app))
leaf_hash = hashlib.sha1((root / 'signed-cert-0').read_bytes()).hexdigest().upper()
require(leaf_hash == os.environ['SIGNING_IDENTITY'], 'Exported signing certificate mismatch')
profile = plistlib.loads(run('security', 'cms', '-D', '-i', str(app / 'embedded.mobileprovision')))
diff --git a/.github/scripts/test_ios_testflight.py b/.github/scripts/test_ios_testflight.py
index 5b6c5e4c..5d9c963e 100644
--- a/.github/scripts/test_ios_testflight.py
+++ b/.github/scripts/test_ios_testflight.py
@@ -2,6 +2,8 @@ import copy
import datetime as dt
import hashlib
import importlib.util
+import json
+import plistlib
import os
from pathlib import Path
import random
@@ -128,6 +130,44 @@ class ProfileTests(unittest.TestCase):
self.validate(identities={self.identity, other})
+class VerifyCommandTests(unittest.TestCase):
+ def test_certificate_extraction_prefix_is_attached_to_optional_argument(self):
+ class ExtractionReached(Exception):
+ pass
+
+ with tempfile.TemporaryDirectory() as temporary:
+ root = Path(temporary)
+ (root / 'export').mkdir()
+ (root / 'export/fixture.ipa').write_bytes(b'fixture')
+ app = root / 'verified/Payload/Fixture.app'
+ app.mkdir(parents=True)
+ (app / 'Info.plist').write_bytes(plistlib.dumps({
+ 'CFBundleIdentifier': helper.BUNDLE_ID,
+ 'CFBundleShortVersionString': '0.24.0',
+ 'CFBundleVersion': '2140.80.1',
+ 'CFBundleSupportedPlatforms': ['iPhoneOS'],
+ 'CFBundleExecutable': 'Fixture',
+ }))
+ (app / 'Fixture').write_bytes(b'executable')
+ (app / 'main.jsbundle').write_bytes(b'bundle')
+ (app / 'EXConstants.bundle').mkdir()
+ (app / 'EXConstants.bundle/app.config').write_text(json.dumps({
+ 'version': '0.24.0',
+ 'ios': {'bundleIdentifier': helper.BUNDLE_ID, 'buildNumber': '2140.80.1'},
+ 'extra': {'thirdPartyNotices': Path('THIRD_PARTY_NOTICES.md').read_text()},
+ }))
+
+ def external_command(*args):
+ if args[:2] == ('codesign', '-d'):
+ self.assertEqual(args, ('codesign', '-d', f'--extract-certificates={root / "signed-cert-"}', str(app)))
+ raise ExtractionReached()
+ self.assertIn(args[0], ('ditto', 'codesign'))
+ return b''
+
+ with patch.dict(os.environ, {'SIGNING_ROOT': str(root), 'IOS_VERSION': '0.24.0', 'BUILD_NUMBER': '2140.80.1'}), patch.object(helper, 'run', side_effect=external_command), self.assertRaises(ExtractionReached):
+ helper.verify()
+
+
class CleanupTests(unittest.TestCase):
def test_absent_signing_root_is_noop(self):
with patch.dict(os.environ, {}, clear=True):