mirror of
https://github.com/onionshare/onionshare.git
synced 2025-05-06 00:15:11 -04:00
Move get_binary_arches into common, and code sign every binary in the app bundle
This commit is contained in:
parent
c524afd87b
commit
0631d14d78
3 changed files with 45 additions and 49 deletions
|
@ -5,34 +5,7 @@ import click
|
|||
import subprocess
|
||||
|
||||
|
||||
def get_binary_arches(app_dir):
|
||||
universal = []
|
||||
silicon = []
|
||||
intel = []
|
||||
for dirpath, dirnames, filenames in os.walk(app_dir):
|
||||
for basename in filenames:
|
||||
filename = os.path.join(dirpath, basename)
|
||||
if os.path.isfile(filename):
|
||||
out = subprocess.check_output(["file", filename]).decode("utf-8")
|
||||
if (
|
||||
"Mach-O 64-bit executable" in out
|
||||
or "Mach-O 64-bit bundle" in out
|
||||
or "Mach-O 64-bit dynamically linked shared library" in out
|
||||
):
|
||||
arm64, x86 = False, False
|
||||
if "arm64" in out:
|
||||
arm64 = True
|
||||
if "x86_64" in out:
|
||||
x86 = True
|
||||
|
||||
if arm64 and x86:
|
||||
universal.append(filename)
|
||||
elif arm64:
|
||||
silicon.append(filename)
|
||||
elif x86:
|
||||
intel.append(filename)
|
||||
|
||||
return universal, silicon, intel
|
||||
from common import get_binary_arches
|
||||
|
||||
|
||||
@click.command()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue