Use ENV variables instead of secrets.properties for Cloud API keys

This commit is contained in:
Julian Raufelder 2021-01-11 18:12:10 +01:00
parent 5b786014ff
commit be22737d4f
No known key found for this signature in database
GPG Key ID: 17EE71F6634E381D
6 changed files with 5 additions and 14 deletions

2
.gitignore vendored
View File

@ -1,5 +1,3 @@
secrets.properties
###IntelliJ###
*.iml

View File

@ -28,7 +28,7 @@ git submodule init && git submodule update // (not necessary if cloned using --r
./gradlew assembleLicenseDebug
```
Before connecting to Onedrive or Dropbox you have to enter valid API keys in [secrets.properties](https://github.com/cryptomator/android/blob/develop/secrets.properties).
Before connecting to Onedrive or Dropbox you have to provide valid API keys using environment variables: `ONEDRIVE_API_KEY` or `DROPBOX_API_KEY`.
## License

View File

@ -116,7 +116,5 @@ configurations {
}
static def getApiKey(key) {
Properties props = new Properties()
props.load(new FileInputStream(new File('secrets.properties')))
return props[key]
return System.getenv().getOrDefault(key, "")
}

View File

@ -31,7 +31,7 @@ android {
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
buildConfigField "String", "DROPBOX_API_KEY", "\"" + getApiKey('DROPBOX_API_KEY') + "\""
manifestPlaceholders = [DROPBOX_API_KEY_DB: getApiKey('DROPBOX_API_KEY_DB')]
manifestPlaceholders = [DROPBOX_API_KEY: getApiKey('DROPBOX_API_KEY')]
}
compileOptions {
@ -188,7 +188,5 @@ androidExtensions {
}
static def getApiKey(key) {
Properties props = new Properties()
props.load(new FileInputStream(new File('secrets.properties')))
return props[key]
return System.getenv().getOrDefault(key, "")
}

View File

@ -87,7 +87,7 @@
android:configChanges="orientation|keyboard"
android:launchMode="singleTask">
<intent-filter>
<data android:scheme="${DROPBOX_API_KEY_DB}" />
<data android:scheme="db-${DROPBOX_API_KEY}" />
<action android:name="android.intent.action.VIEW" />

View File

@ -1,3 +0,0 @@
ONEDRIVE_API_KEY=
DROPBOX_API_KEY=
DROPBOX_API_KEY_DB=