Revert "Merge "Adding flags and logic to sign updateable SEPolicy in APEX" am: 77c1dfa6d9 am: 5a0d81a0be am: 54e08307dc"

Test: mma and run sign_apex

This reverts commit 8fe9e3a2c7.

Reason for revert: Updateable SEPolicy is punted.

Change-Id: I28ae2afbb1083e215f4e0a27a9164133cd73dd76
Merged-In: I28ae2afbb1083e215f4e0a27a9164133cd73dd76
This commit is contained in:
Melisa Carranza Zúñiga
2022-04-13 16:23:45 +00:00
committed by Melisa Carranza Zuniga
parent 4449692fa9
commit 8e3198ace3
4 changed files with 18 additions and 132 deletions

View File

@@ -42,15 +42,6 @@ Usage: sign_apex [flags] input_apex_file output_apex_file
--sign_tool <sign_tool>
Optional flag that specifies a custom signing tool for the contents of the apex.
--sepolicy_key <key>
Optional flag that specifies the sepolicy signing key, defaults to payload_key.
--sepolicy_cert <cert>
Optional flag that specifies the sepolicy signing cert.
--fsverity_tool <path>
Optional flag that specifies the path to fsverity tool to sign SEPolicy, defaults to fsverity.
"""
import logging
@@ -64,8 +55,7 @@ logger = logging.getLogger(__name__)
def SignApexFile(avbtool, apex_file, payload_key, container_key, no_hashtree,
apk_keys=None, signing_args=None, codename_to_api_level_map=None, sign_tool=None,
sepolicy_key=None, sepolicy_cert=None, fsverity_tool=None):
apk_keys=None, signing_args=None, codename_to_api_level_map=None, sign_tool=None):
"""Signs the given apex file."""
with open(apex_file, 'rb') as input_fp:
apex_data = input_fp.read()
@@ -80,11 +70,7 @@ def SignApexFile(avbtool, apex_file, payload_key, container_key, no_hashtree,
no_hashtree=no_hashtree,
apk_keys=apk_keys,
signing_args=signing_args,
sign_tool=sign_tool,
is_sepolicy=apex_file.endswith("sepolicy.apex"),
sepolicy_key=sepolicy_key,
sepolicy_cert=sepolicy_cert,
fsverity_tool=fsverity_tool)
sign_tool=sign_tool)
def main(argv):
@@ -120,12 +106,6 @@ def main(argv):
options['extra_apks'].update({n: key})
elif o == '--sign_tool':
options['sign_tool'] = a
elif o == '--sepolicy_key':
options['sepolicy_key'] = a
elif o == '--sepolicy_cert':
options['sepolicy_cert'] = a
elif o == '--fsverity_tool':
options['fsverity_tool'] = a
else:
return False
return True
@@ -141,9 +121,6 @@ def main(argv):
'payload_key=',
'extra_apks=',
'sign_tool=',
'sepolicy_key=',
'sepolicy_cert=',
'fsverity_tool='
],
extra_option_handler=option_handler)
@@ -164,10 +141,7 @@ def main(argv):
signing_args=options.get('payload_extra_args'),
codename_to_api_level_map=options.get(
'codename_to_api_level_map', {}),
sign_tool=options.get('sign_tool', None),
sepolicy_key=options.get('sepolicy_key', None),
sepolicy_cert=options.get('sepolicy_cert', None),
fsverity_tool=options.get('fsverity_tool', None))
sign_tool=options.get('sign_tool', None))
shutil.copyfile(signed_apex, args[1])
logger.info("done.")