Use ENV variables instead of secrets.properties for Cloud API keys
This commit is contained in:
parent
5b786014ff
commit
be22737d4f
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,5 +1,3 @@
|
||||
secrets.properties
|
||||
|
||||
###IntelliJ###
|
||||
|
||||
*.iml
|
||||
|
@ -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
|
||||
|
||||
|
@ -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, "")
|
||||
}
|
||||
|
@ -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, "")
|
||||
}
|
||||
|
@ -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" />
|
||||
|
||||
|
@ -1,3 +0,0 @@
|
||||
ONEDRIVE_API_KEY=
|
||||
DROPBOX_API_KEY=
|
||||
DROPBOX_API_KEY_DB=
|
Loading…
x
Reference in New Issue
Block a user