From 8e750e7a5d7a361c74fb8a3370b717977286babe Mon Sep 17 00:00:00 2001 From: Darien Martinez Date: Mon, 3 Dec 2018 01:23:29 -0500 Subject: [PATCH] Adding configuration on the manifest and the build.gradle in order to read the DJI KEY from the global gradle.properties. This has the advantage of not having to worry about pushing the key on the source code repo by mistake --- README.md | 7 ++----- app/build.gradle | 1 + app/src/main/AndroidManifest.xml | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 21ec6fd..e98619e 100644 --- a/README.md +++ b/README.md @@ -48,12 +48,9 @@ Note that if you are using QGroundControl on the same device as RosettaDrone, th 3. Sign up for the DJI Developer Program at https://developer.dji.com/mobile-sdk/ and create an Application key. The package name should be sq.rogue.rosettadrone. -4. Create a new file called keys.xml in the /values folder, and insert the following: +4. Create a new file `~/.gradle/gradle.properties` if you don't have one yet, and add the following line to it: ``` - - - INSERT KEY HERE - + DJI_API_KEY_ROSETTA_DRONE=INSERT KEY HERE ``` 5. Run **Build->Make Project** diff --git a/app/build.gradle b/app/build.gradle index 612686e..9cfd2ef 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,6 +10,7 @@ android { versionName "1.2.1" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" multiDexEnabled true + manifestPlaceholders = [DJIApiKey: project.properties['DJI_API_KEY_ROSETTA_DRONE']] } buildTypes { diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index dd8b249..ce8e840 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -52,7 +52,7 @@ + android:value="${DJIApiKey}"/>