Skip to content

Commit 0a6b203

Browse files
committed
Fix Android error restoring secrets.
1 parent d099e4d commit 0a6b203

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

scripts/restore_secrets.py

+14-8
Original file line numberDiff line numberDiff line change
@@ -152,21 +152,27 @@ def _patch_reverse_id(service_plist_path):
152152
print("Attempting to patch reverse id in Info.plist")
153153
with open(service_plist_path, "rb") as f:
154154
service_plist = plistlib.load(f)
155-
_patch_file(
156-
path=os.path.join(os.path.dirname(service_plist_path), "testapp", "Info.plist"),
157-
placeholder="REPLACE_WITH_REVERSED_CLIENT_ID",
158-
value=service_plist["REVERSED_CLIENT_ID"])
155+
try:
156+
_patch_file(
157+
path=os.path.join(os.path.dirname(service_plist_path), "testapp", "Info.plist"),
158+
placeholder="REPLACE_WITH_REVERSED_CLIENT_ID",
159+
value=service_plist["REVERSED_CLIENT_ID"])
160+
except KeyError as e:
161+
print("Warning: Couldn't patch %s in %s" % (e.args[0], service_plist_path))
159162

160163

161164
def _patch_bundle_id(service_plist_path):
162165
"""Patches the Info.plist file with the bundle id from the Service plist."""
163166
print("Attempting to patch bundle id in Info.plist")
164167
with open(service_plist_path, "rb") as f:
165168
service_plist = plistlib.load(f)
166-
_patch_file(
167-
path=os.path.join(os.path.dirname(service_plist_path), "testapp", "Info.plist"),
168-
placeholder="$(PRODUCT_BUNDLE_IDENTIFIER)",
169-
value=service_plist["BUNDLE_ID"])
169+
try:
170+
_patch_file(
171+
path=os.path.join(os.path.dirname(service_plist_path), "testapp", "Info.plist"),
172+
placeholder="$(PRODUCT_BUNDLE_IDENTIFIER)",
173+
value=service_plist["BUNDLE_ID"])
174+
except KeyError as e:
175+
print("Warning: Couldn't patch %s in %s" % (e.args[0], service_plist_path))
170176

171177

172178
def _patch_file(path, placeholder, value):

0 commit comments

Comments
 (0)