Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove entitlement files editing for associated domains from config script #307

Merged
merged 1 commit into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions OpenEdX.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,6 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ALLOW_ENTITLEMENTS_MODIFICATION = YES;
CODE_SIGN_ENTITLEMENTS = OpenEdX/OpenEdX.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
Expand Down Expand Up @@ -772,7 +771,6 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ALLOW_ENTITLEMENTS_MODIFICATION = YES;
CODE_SIGN_ENTITLEMENTS = OpenEdX/OpenEdX.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
Expand Down Expand Up @@ -867,7 +865,6 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ALLOW_ENTITLEMENTS_MODIFICATION = YES;
CODE_SIGN_ENTITLEMENTS = OpenEdX/OpenEdX.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
Expand Down Expand Up @@ -956,7 +953,6 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ALLOW_ENTITLEMENTS_MODIFICATION = YES;
CODE_SIGN_ENTITLEMENTS = OpenEdX/OpenEdX.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
Expand Down Expand Up @@ -1105,7 +1101,6 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ALLOW_ENTITLEMENTS_MODIFICATION = YES;
CODE_SIGN_ENTITLEMENTS = OpenEdX/OpenEdX.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
Expand Down Expand Up @@ -1140,7 +1135,6 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ALLOW_ENTITLEMENTS_MODIFICATION = YES;
CODE_SIGN_ENTITLEMENTS = OpenEdX/OpenEdX.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
Expand Down
26 changes: 2 additions & 24 deletions config_script/process_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ def get_bundle_identifier(self):

def get_info_plist_path(self):
return os.getenv('INFOPLIST_PATH')

def get_entitlements_plist_path(self):
return os.getenv('CODE_SIGN_ENTITLEMENTS')

def get_wrapper_name(self):
return os.getenv('WRAPPER_NAME')
Expand All @@ -42,15 +39,6 @@ def get_app_info_plist_path(self):
return os.path.join(built_products_path, info_plist_path)
else:
return None

def get_entitlements_path(self):
built_products_path = self.get_built_products_path()
entitlements_plist_path = self.get_entitlements_path()

if built_products_path and entitlements_plist_path:
return os.path.join(built_products_path, entitlements_plist_path)
else:
return None

def get_firebase_info_plist_path(self):
built_products_path = self.get_built_products_path()
Expand Down Expand Up @@ -204,7 +192,7 @@ def add_firebase_config(self, config, firebase_info_plist_path):
else:
print("Firebase config is empty. Skipping")

def add_branch_config(self, config, plist, entitlements):
def add_branch_config(self, config, plist):
branch = config.get('BRANCH', {})
enabled = branch.get('ENABLED')
uriScheme = branch.get('URI_SCHEME')
Expand All @@ -226,12 +214,6 @@ def add_branch_config(self, config, plist, entitlements):
prefix+".test-app.link",
prefix+"-alternate.test-app.link"
], plist)
self.add_custom_array("com.apple.developer.associated-domains", [
"applinks:"+prefix+".app.link",
"applinks:"+prefix+"-alternate.app.link",
"applinks:"+prefix+".test-app.link",
"applinks:"+prefix+"-alternate.test-app.link"
], entitlements)
self.add_url_scheme(scheme, plist, True)

def add_facebook_config(self, config, plist):
Expand Down Expand Up @@ -312,9 +294,6 @@ def get_current_config(configuration, scheme_mappings):
return None

def process_plist_files(configuration_manager, plist_manager, config):
entitlements_path = plist_manager.get_entitlements_plist_path()
entitlements_content = plist_manager.get_info_plist_contents(entitlements_path)

firebase_info_plist_path = plist_manager.get_firebase_config_path()
info_plist_path = plist_manager.get_app_info_plist_path()
info_plist_content = plist_manager.get_info_plist_contents(info_plist_path)
Expand All @@ -323,10 +302,9 @@ def process_plist_files(configuration_manager, plist_manager, config):
configuration_manager.add_facebook_config(config, info_plist_content)
configuration_manager.add_google_config(config, info_plist_content)
configuration_manager.add_microsoft_config(config, info_plist_content)
configuration_manager.add_branch_config(config, info_plist_content, entitlements_content)
configuration_manager.add_branch_config(config, info_plist_content)

configuration_manager.update_info_plist(info_plist_content, info_plist_path)
configuration_manager.update_info_plist(entitlements_content, entitlements_path)

bundle_config_path = plist_manager.get_bundle_config_path()
config_plist = plist_manager.yaml_to_plist()
Expand Down
Loading