mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-29 10:12:38 +02:00
Fix codesigning
This commit is contained in:
parent
69ee4a064e
commit
ffb622c183
1 changed files with 27 additions and 13 deletions
|
@ -6,6 +6,7 @@ import subprocess
|
||||||
import shutil
|
import shutil
|
||||||
import argparse
|
import argparse
|
||||||
import glob
|
import glob
|
||||||
|
import itertools
|
||||||
|
|
||||||
root = os.path.dirname(
|
root = os.path.dirname(
|
||||||
os.path.dirname(
|
os.path.dirname(
|
||||||
|
@ -18,6 +19,24 @@ def run(cmd):
|
||||||
subprocess.run(cmd, cwd=root, check=True)
|
subprocess.run(cmd, cwd=root, check=True)
|
||||||
|
|
||||||
|
|
||||||
|
def codesign(path, entitlements, identity):
|
||||||
|
run(
|
||||||
|
[
|
||||||
|
"codesign",
|
||||||
|
"--sign",
|
||||||
|
identity,
|
||||||
|
"--entitlements",
|
||||||
|
str(entitlements),
|
||||||
|
"--timestamp",
|
||||||
|
"--deep",
|
||||||
|
str(path),
|
||||||
|
"--force",
|
||||||
|
"--options",
|
||||||
|
"runtime",
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
# Parse arguments
|
# Parse arguments
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
|
@ -58,19 +77,14 @@ def main():
|
||||||
)
|
)
|
||||||
entitlements_plist_path = os.path.join(root, "install/macos/entitlements.plist")
|
entitlements_plist_path = os.path.join(root, "install/macos/entitlements.plist")
|
||||||
|
|
||||||
run(
|
for path in itertools.chain(
|
||||||
[
|
glob.glob(f"{app_path}/**/*.so", recursive=True),
|
||||||
"codesign",
|
glob.glob(f"{app_path}/**/*.dylib", recursive=True),
|
||||||
"--deep",
|
glob.glob(f"{app_path}/**/Python3", recursive=True),
|
||||||
"-s",
|
[app_path],
|
||||||
identity_name_application,
|
):
|
||||||
"-o",
|
codesign(path, entitlements_plist_path, identity_name_application)
|
||||||
"runtime",
|
print(f"○ Signed app bundle: {app_path}")
|
||||||
"--entitlements",
|
|
||||||
entitlements_plist_path,
|
|
||||||
app_path,
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
||||||
# Detect if create-dmg is installed
|
# Detect if create-dmg is installed
|
||||||
if not os.path.exists("/usr/local/bin/create-dmg"):
|
if not os.path.exists("/usr/local/bin/create-dmg"):
|
||||||
|
|
Loading…
Reference in a new issue