aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/cloud/box/boxstorage.cpp11
-rw-r--r--backends/cloud/dropbox/dropboxstorage.cpp11
-rw-r--r--backends/cloud/googledrive/googledrivestorage.cpp9
-rw-r--r--backends/cloud/onedrive/onedrivestorage.cpp11
4 files changed, 39 insertions, 3 deletions
diff --git a/backends/cloud/box/boxstorage.cpp b/backends/cloud/box/boxstorage.cpp
index c2c4c6278e..58a2541a74 100644
--- a/backends/cloud/box/boxstorage.cpp
+++ b/backends/cloud/box/boxstorage.cpp
@@ -29,10 +29,14 @@
#include "backends/networking/curl/connectionmanager.h"
#include "backends/networking/curl/curljsonrequest.h"
#include "backends/networking/curl/networkreadstream.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 Box {
@@ -46,6 +50,10 @@ char *BoxStorage::KEY = nullptr; //can't use CloudConfig there yet, loading it o
char *BoxStorage::SECRET = nullptr; //TODO: hide these secrets somehow
void BoxStorage::loadKeyAndSecret() {
+#ifdef ENABLE_RELEASE
+ KEY = RELEASE_BOX_KEY;
+ SECRET = RELEASE_BOX_SECRET;
+#else
Common::String k = ConfMan.get("BOX_KEY", ConfMan.kCloudDomain);
KEY = new char[k.size() + 1];
memcpy(KEY, k.c_str(), k.size());
@@ -55,6 +63,7 @@ void BoxStorage::loadKeyAndSecret() {
SECRET = new char[k.size() + 1];
memcpy(SECRET, k.c_str(), k.size());
SECRET[k.size()] = 0;
+#endif
}
BoxStorage::BoxStorage(Common::String accessToken, Common::String refreshToken):
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) {}
diff --git a/backends/cloud/googledrive/googledrivestorage.cpp b/backends/cloud/googledrive/googledrivestorage.cpp
index 7ae9dde3bd..d876883185 100644
--- a/backends/cloud/googledrive/googledrivestorage.cpp
+++ b/backends/cloud/googledrive/googledrivestorage.cpp
@@ -34,6 +34,10 @@
#include "common/json.h"
#include <curl/curl.h>
+#ifdef ENABLE_RELEASE
+#include "dists/clouds/cloud_keys.h"
+#endif
+
namespace Cloud {
namespace GoogleDrive {
@@ -46,6 +50,10 @@ char *GoogleDriveStorage::KEY = nullptr; //can't use CloudConfig there yet, load
char *GoogleDriveStorage::SECRET = nullptr; //TODO: hide these secrets somehow
void GoogleDriveStorage::loadKeyAndSecret() {
+#ifdef ENABLE_RELEASE
+ KEY = RELEASE_GOOGLE_DRIVE_KEY;
+ SECRET = RELEASE_GOOGLE_DRIVE_SECRET;
+#else
Common::String k = ConfMan.get("GOOGLE_DRIVE_KEY", ConfMan.kCloudDomain);
KEY = new char[k.size() + 1];
memcpy(KEY, k.c_str(), k.size());
@@ -55,6 +63,7 @@ void GoogleDriveStorage::loadKeyAndSecret() {
SECRET = new char[k.size() + 1];
memcpy(SECRET, k.c_str(), k.size());
SECRET[k.size()] = 0;
+#endif
}
GoogleDriveStorage::GoogleDriveStorage(Common::String accessToken, Common::String refreshToken):
diff --git a/backends/cloud/onedrive/onedrivestorage.cpp b/backends/cloud/onedrive/onedrivestorage.cpp
index 1008cab31f..458aaecf88 100644
--- a/backends/cloud/onedrive/onedrivestorage.cpp
+++ b/backends/cloud/onedrive/onedrivestorage.cpp
@@ -30,10 +30,14 @@
#include "backends/networking/curl/connectionmanager.h"
#include "backends/networking/curl/curljsonrequest.h"
#include "backends/networking/curl/networkreadstream.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 OneDrive {
@@ -46,6 +50,10 @@ char *OneDriveStorage::KEY = nullptr; //can't use CloudConfig there yet, loading
char *OneDriveStorage::SECRET = nullptr; //TODO: hide these secrets somehow
void OneDriveStorage::loadKeyAndSecret() {
+#ifdef ENABLE_RELEASE
+ KEY = RELEASE_ONEDRIVE_KEY;
+ SECRET = RELEASE_ONEDRIVE_SECRET;
+#else
Common::String k = ConfMan.get("ONEDRIVE_KEY", ConfMan.kCloudDomain);
KEY = new char[k.size() + 1];
memcpy(KEY, k.c_str(), k.size());
@@ -55,6 +63,7 @@ void OneDriveStorage::loadKeyAndSecret() {
SECRET = new char[k.size() + 1];
memcpy(SECRET, k.c_str(), k.size());
SECRET[k.size()] = 0;
+#endif
}
OneDriveStorage::OneDriveStorage(Common::String accessToken, Common::String userId, Common::String refreshToken):