瀏覽代碼

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.
master
Saúl Ibarra Corretgé 6 年之前
父節點
當前提交
77f220753f
共有 2 個檔案被更改,包括 19 行新增5 行删除
  1. 19
    0
      ios/app/app.xcodeproj/project.pbxproj
  2. 0
    5
      ios/sdk/src/Info.plist

+ 19
- 0
ios/app/app.xcodeproj/project.pbxproj 查看文件

151
 				0BB7DA181EC9E695007AAE98 /* Adjust ATS */,
151
 				0BB7DA181EC9E695007AAE98 /* Adjust ATS */,
152
 				DEC2069321CBBD6900072F03 /* Setup Fabric */,
152
 				DEC2069321CBBD6900072F03 /* Setup Fabric */,
153
 				DE11877A21EE09640078D059 /* Setup Google reverse URL handler */,
153
 				DE11877A21EE09640078D059 /* Setup Google reverse URL handler */,
154
+				DE4F6D6E22005C0400DE699E /* Setup Dropbox */,
154
 			);
155
 			);
155
 			buildRules = (
156
 			buildRules = (
156
 			);
157
 			);
298
 			shellPath = /bin/sh;
299
 			shellPath = /bin/sh;
299
 			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";
300
 			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";
300
 		};
301
 		};
302
+		DE4F6D6E22005C0400DE699E /* Setup Dropbox */ = {
303
+			isa = PBXShellScriptBuildPhase;
304
+			buildActionMask = 2147483647;
305
+			files = (
306
+			);
307
+			inputFileListPaths = (
308
+			);
309
+			inputPaths = (
310
+			);
311
+			name = "Setup Dropbox";
312
+			outputFileListPaths = (
313
+			);
314
+			outputPaths = (
315
+			);
316
+			runOnlyForDeploymentPostprocessing = 0;
317
+			shellPath = /bin/sh;
318
+			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";
319
+		};
301
 		DEC2069321CBBD6900072F03 /* Setup Fabric */ = {
320
 		DEC2069321CBBD6900072F03 /* Setup Fabric */ = {
302
 			isa = PBXShellScriptBuildPhase;
321
 			isa = PBXShellScriptBuildPhase;
303
 			buildActionMask = 2147483647;
322
 			buildActionMask = 2147483647;

+ 0
- 5
ios/sdk/src/Info.plist 查看文件

18
 	<string>1.9.0</string>
18
 	<string>1.9.0</string>
19
 	<key>CFBundleVersion</key>
19
 	<key>CFBundleVersion</key>
20
 	<string>$(CURRENT_PROJECT_VERSION)</string>
20
 	<string>$(CURRENT_PROJECT_VERSION)</string>
21
-	<key>LSApplicationQueriesSchemes</key>
22
-	<array>
23
-		<string>dbapi-2</string>
24
-		<string>dbapi-8-emm</string>
25
-	</array>
26
 	<key>NSPrincipalClass</key>
21
 	<key>NSPrincipalClass</key>
27
 	<string></string>
22
 	<string></string>
28
 </dict>
23
 </dict>

Loading…
取消
儲存