From 77f220753f6403d4c556607e7ee60331d0c8049e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Tue, 29 Jan 2019 11:56:01 +0100 Subject: [PATCH] ios: dynamically load Dropbox API key Load it at build time from a "dropbox.key" file. The file should contain the API key in a single line. --- ios/app/app.xcodeproj/project.pbxproj | 19 +++++++++++++++++++ ios/sdk/src/Info.plist | 5 ----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/ios/app/app.xcodeproj/project.pbxproj b/ios/app/app.xcodeproj/project.pbxproj index af56763a5..24023ff97 100644 --- a/ios/app/app.xcodeproj/project.pbxproj +++ b/ios/app/app.xcodeproj/project.pbxproj @@ -151,6 +151,7 @@ 0BB7DA181EC9E695007AAE98 /* Adjust ATS */, DEC2069321CBBD6900072F03 /* Setup Fabric */, DE11877A21EE09640078D059 /* Setup Google reverse URL handler */, + DE4F6D6E22005C0400DE699E /* Setup Dropbox */, ); buildRules = ( ); @@ -298,6 +299,24 @@ shellPath = /bin/sh; shellScript = "INFO_PLIST=\"$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH\"\nREVERSED_CLIENT_ID=$(/usr/libexec/PlistBuddy -c \"Print :REVERSED_CLIENT_ID:\" $PROJECT_DIR/GoogleService-Info.plist)\n\n/usr/libexec/PlistBuddy -c \"Set :CFBundleURLTypes:1:CFBundleURLSchemes:0 $REVERSED_CLIENT_ID\" $INFO_PLIST\n"; }; + DE4F6D6E22005C0400DE699E /* Setup Dropbox */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Setup Dropbox"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "INFO_PLIST=\"$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH\"\nDROPBOX_KEY_FILE=\"$PROJECT_DIR/dropbox.key\"\n\nif [[ -f $DROPBOX_KEY_FILE ]]; then\n /usr/libexec/PlistBuddy -c \"Delete :LSApplicationQueriesSchemes\" $INFO_PLIST\n /usr/libexec/PlistBuddy -c \"Add :LSApplicationQueriesSchemes array\" $INFO_PLIST\n /usr/libexec/PlistBuddy -c \"Add :LSApplicationQueriesSchemes:0 string 'dbapi-2'\" $INFO_PLIST\n /usr/libexec/PlistBuddy -c \"Add :LSApplicationQueriesSchemes:1 string 'dbapi-8-emm'\" $INFO_PLIST\n\n DROPBOX_KEY=$(head -n 1 $DROPBOX_KEY_FILE)\n /usr/libexec/PlistBuddy -c \"Add :CFBundleURLTypes:2:CFBundleURLName string dropbox\" $INFO_PLIST\n /usr/libexec/PlistBuddy -c \"Add :CFBundleURLTypes:2:CFBundleURLSchemes array\" $INFO_PLIST\n /usr/libexec/PlistBuddy -c \"Add :CFBundleURLTypes:2:CFBundleURLSchemes:0 string $DROPBOX_KEY\" $INFO_PLIST\nfi\n"; + }; DEC2069321CBBD6900072F03 /* Setup Fabric */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; diff --git a/ios/sdk/src/Info.plist b/ios/sdk/src/Info.plist index b534be789..131e3ce92 100644 --- a/ios/sdk/src/Info.plist +++ b/ios/sdk/src/Info.plist @@ -18,11 +18,6 @@ 1.9.0 CFBundleVersion $(CURRENT_PROJECT_VERSION) - LSApplicationQueriesSchemes - - dbapi-2 - dbapi-8-emm - NSPrincipalClass