From 6dd10f3a683ab787b751a84958502f7eda1da84c Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Tue, 26 Jul 2016 12:29:52 +0600 Subject: 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. --- backends/cloud/googledrive/googledrivestorage.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'backends/cloud/googledrive') 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 +#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): -- cgit v1.2.3