Allow sha1

This commit is contained in:
Adam Treat 2023-04-26 09:44:26 -04:00
parent 8d421c1ff6
commit 0ce8c91240

View File

@ -16,8 +16,9 @@ import click
@click.command() @click.command()
@click.option('--input-dmg', required=True, help='Path to the input DMG file.') @click.option('--input-dmg', required=True, help='Path to the input DMG file.')
@click.option('--output-dmg', required=True, help='Path to the output signed DMG file.') @click.option('--output-dmg', required=True, help='Path to the output signed DMG file.')
@click.option('--signing-identity', required=True, help='Signing identity (Developer ID Installer).') @click.option('--sha1-hash', help='SHA-1 hash of the Developer ID Installer certificate')
def sign_dmg(input_dmg, output_dmg, signing_identity): @click.option('--signing-identity', help='Signing identity (Developer ID Installer).')
def sign_dmg(input_dmg: str, output_dmg: str, signing_identity: str, sha1_hash: Optional[str]) -> None:
# Mount the input DMG # Mount the input DMG
mount_point = tempfile.mkdtemp() mount_point = tempfile.mkdtemp()
subprocess.run(['hdiutil', 'attach', input_dmg, '-mountpoint', mount_point]) subprocess.run(['hdiutil', 'attach', input_dmg, '-mountpoint', mount_point])
@ -47,7 +48,7 @@ def sign_dmg(input_dmg, output_dmg, signing_identity):
'--verbose', '--verbose',
'--options', 'runtime', '--options', 'runtime',
'--timestamp', '--timestamp',
'--sign', signing_identity, '--sign', sha1_hash or signing_identity,
app_bundle app_bundle
], check=True) ], check=True)
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e: