Commit 472c26b5 authored by Bang Lee's avatar Bang Lee Committed by Commit Bot

Fix iOS codesign app id matching

Team identifier is the same with application id prefix for newer Apple
developer accounts. However Apple did allow creating multiple prefixes
in one account years ago.
More information: https://developer.apple.com/library/archive/technotes/tn2311/_index.html

Change-Id: Ie9bc6cd10eb131cdfbcf60e21570a1b950e919d1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2059830
Commit-Queue: Bang Lee <banl@microsoft.com>
Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#742476}
parent 0364d2de
...@@ -100,8 +100,8 @@ class ProvisioningProfile(object): ...@@ -100,8 +100,8 @@ class ProvisioningProfile(object):
return self._data.get('Entitlements', {}).get('application-identifier', '') return self._data.get('Entitlements', {}).get('application-identifier', '')
@property @property
def team_identifier(self): def application_identifier_prefix(self):
return self._data.get('TeamIdentifier', [''])[0] return self._data.get('ApplicationIdentifierPrefix', [''])[0]
@property @property
def entitlements(self): def entitlements(self):
...@@ -122,7 +122,7 @@ class ProvisioningProfile(object): ...@@ -122,7 +122,7 @@ class ProvisioningProfile(object):
with the corresponding bundle_identifier, False otherwise. with the corresponding bundle_identifier, False otherwise.
""" """
return fnmatch.fnmatch( return fnmatch.fnmatch(
'%s.%s' % (self.team_identifier, bundle_identifier), '%s.%s' % (self.application_identifier_prefix, bundle_identifier),
self.application_identifier_pattern) self.application_identifier_pattern)
def Install(self, installation_path): def Install(self, installation_path):
...@@ -266,7 +266,8 @@ def GenerateEntitlements(path, provisioning_profile, bundle_identifier): ...@@ -266,7 +266,8 @@ def GenerateEntitlements(path, provisioning_profile, bundle_identifier):
entitlements = Entitlements(path) entitlements = Entitlements(path)
if provisioning_profile: if provisioning_profile:
entitlements.LoadDefaults(provisioning_profile.entitlements) entitlements.LoadDefaults(provisioning_profile.entitlements)
app_identifier_prefix = provisioning_profile.team_identifier + '.' app_identifier_prefix = \
provisioning_profile.application_identifier_prefix + '.'
else: else:
app_identifier_prefix = '*.' app_identifier_prefix = '*.'
entitlements.ExpandVariables({ entitlements.ExpandVariables({
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment