aboutsummaryrefslogtreecommitdiff
path: root/backends/cloud/dropbox
diff options
context:
space:
mode:
authorAlexander Tkachev2016-07-26 12:29:52 +0600
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commit6dd10f3a683ab787b751a84958502f7eda1da84c (patch)
tree053ceac4936ebd24c9e76df0614587ac26c15a68 /backends/cloud/dropbox
parentb9bba9bd4bec1bf00a61c347f411a8ecf9ea69e8 (diff)
downloadscummvm-rg350-6dd10f3a683ab787b751a84958502f7eda1da84c.tar.gz
scummvm-rg350-6dd10f3a683ab787b751a84958502f7eda1da84c.tar.bz2
scummvm-rg350-6dd10f3a683ab787b751a84958502f7eda1da84c.zip
CLOUD: Add KEY/SECRET override code
The following constants must be defined if ENABLE_RELEASE is: * RELEASE_DROPBOX_KEY, * RELEASE_DROPBOX_SECRET, * RELEASE_ONEDRIVE_KEY, * RELEASE_ONEDRIVE_SECRET, * RELEASE_GOOGLE_DRIVE_KEY, * RELEASE_GOOGLE_DRIVE_SECRET, * RELEASE_BOX_KEY, * RELEASE_BOX_SECRET.
Diffstat (limited to 'backends/cloud/dropbox')
-rw-r--r--backends/cloud/dropbox/dropboxstorage.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/backends/cloud/dropbox/dropboxstorage.cpp b/backends/cloud/dropbox/dropboxstorage.cpp
index 6fd1f9d2fd..41536fe0ea 100644
--- a/backends/cloud/dropbox/dropboxstorage.cpp
+++ b/backends/cloud/dropbox/dropboxstorage.cpp
@@ -29,10 +29,14 @@
#include "backends/cloud/cloudmanager.h"
#include "backends/networking/curl/connectionmanager.h"
#include "backends/networking/curl/curljsonrequest.h"
+#include "common/config-manager.h"
#include "common/debug.h"
#include "common/json.h"
#include <curl/curl.h>
-#include "common/config-manager.h"
+
+#ifdef ENABLE_RELEASE
+#include "dists/clouds/cloud_keys.h"
+#endif
namespace Cloud {
namespace Dropbox {
@@ -44,6 +48,10 @@ char *DropboxStorage::KEY = nullptr; //can't use CloudConfig there yet, loading
char *DropboxStorage::SECRET = nullptr; //TODO: hide these secrets somehow
void DropboxStorage::loadKeyAndSecret() {
+#ifdef ENABLE_RELEASE
+ KEY = RELEASE_DROPBOX_KEY;
+ SECRET = RELEASE_DROPBOX_SECRET;
+#else
Common::String k = ConfMan.get("DROPBOX_KEY", ConfMan.kCloudDomain);
KEY = new char[k.size() + 1];
memcpy(KEY, k.c_str(), k.size());
@@ -53,6 +61,7 @@ void DropboxStorage::loadKeyAndSecret() {
SECRET = new char[k.size() + 1];
memcpy(SECRET, k.c_str(), k.size());
SECRET[k.size()] = 0;
+#endif
}
DropboxStorage::DropboxStorage(Common::String accessToken, Common::String userId): _token(accessToken), _uid(userId) {}