Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions | Variables
dart_codesign Namespace Reference

Functions

 SignBinary (identity, binary)
 

Variables

 SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
 
 parser = optparse.OptionParser()
 
 type
 
 help
 
 action
 
 options = parser.parse_args()[0]
 

Function Documentation

◆ SignBinary()

dart_codesign.SignBinary (   identity,
  binary 
)

Definition at line 19 of file dart_codesign.py.

19def SignBinary(identity, binary):
20 codesign_args = [
21 "--deep", "--force", "--verify", "--verbose", "--timestamp",
22 "--options", "runtime", "--sign", identity
23 ]
24
25 name = os.path.basename(binary)
26
27 # Check if we have a matching entitlements file and apply it.
28 # It would be simpler if we could specify it from outside but
29 # GN does not give us tools for doing that: executable target can't
30 # push arbitrary configuration down to the link tool where
31 # we would like to perform code signing.
32 entitlements_file = os.path.join(SCRIPT_DIR, "entitlements",
33 name + ".plist")
34 if os.path.exists(entitlements_file):
35 codesign_args += ["--entitlements", entitlements_file]
36 cmd = ["codesign"] + codesign_args + [binary]
37 result = subprocess.run(cmd, capture_output=True, encoding="utf8")
38 if result.returncode != 0:
39 print("failed to run: " + " ".join(cmd))
40 print(f"exit code: {result.returncode}")
41 print("stdout:")
42 print(result.stdout)
43 print("stdout:")
44 print(result.stderr)
45 raise Exception("failed to codesign")
46
47
void print(void *str)
Definition bridge.cpp:126

Variable Documentation

◆ action

dart_codesign.action

Definition at line 52 of file dart_codesign.py.

◆ help

dart_codesign.help

Definition at line 49 of file dart_codesign.py.

◆ options

dart_codesign.options = parser.parse_args()[0]

Definition at line 54 of file dart_codesign.py.

◆ parser

dart_codesign.parser = optparse.OptionParser()

Definition at line 48 of file dart_codesign.py.

◆ SCRIPT_DIR

dart_codesign.SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))

Definition at line 16 of file dart_codesign.py.

◆ type

dart_codesign.type

Definition at line 49 of file dart_codesign.py.