diff options
Diffstat (limited to 'launcher')
-rw-r--r-- | launcher/Application.cpp | 18 | ||||
-rw-r--r-- | launcher/Application.h | 2 | ||||
-rw-r--r-- | launcher/CMakeLists.txt | 2 | ||||
-rw-r--r-- | launcher/minecraft/auth/steps/MSAStep.cpp | 3 | ||||
-rw-r--r-- | launcher/ui/pages/global/AccountListPage.cpp | 4 |
5 files changed, 15 insertions, 14 deletions
diff --git a/launcher/Application.cpp b/launcher/Application.cpp index 9c965829..264bfff8 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -76,8 +76,6 @@ #include <ganalytics.h> #include <sys.h> -#include <Secrets.h> - #if defined Q_OS_WIN32 #ifndef WIN32_LEAN_AND_MEAN @@ -308,7 +306,13 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) } else { -#if defined(Q_OS_MAC) +#ifdef LAUNCHER_LINUX_DATADIR + QString xdgDataHome = QFile::decodeName(qgetenv("XDG_DATA_HOME")); + if (xdgDataHome.isEmpty()) + xdgDataHome = QDir::homePath() + QLatin1String("/.local/share"); + dataPath = xdgDataHome + "/polymc"; + adjustedBy += "XDG standard " + dataPath; +#elif defined(Q_OS_MAC) QDir foo(FS::PathCombine(applicationDirPath(), "../../Data")); dataPath = foo.absolutePath(); adjustedBy += "Fallback to special Mac location " + dataPath; @@ -533,6 +537,10 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) FS::updateTimestamp(m_rootPath); #endif +#ifdef MULTIMC_JARS_LOCATION + m_jarsPath = TOSTRING(MULTIMC_JARS_LOCATION); +#endif + qDebug() << BuildConfig.LAUNCHER_DISPLAYNAME << ", (c) 2013-2021 " << BuildConfig.LAUNCHER_COPYRIGHT; qDebug() << "Version : " << BuildConfig.printableVersionString(); qDebug() << "Git commit : " << BuildConfig.GIT_COMMIT; @@ -1558,10 +1566,6 @@ void Application::on_windowClose() } } -QString Application::msaClientId() const { - return Secrets::getMSAClientID('-'); -} - void Application::updateProxySettings(QString proxyTypeStr, QString addr, int port, QString user, QString password) { // Set the application proxy settings. diff --git a/launcher/Application.h b/launcher/Application.h index 1b2a2b60..982e22e3 100644 --- a/launcher/Application.h +++ b/launcher/Application.h @@ -104,8 +104,6 @@ public: return m_accounts; } - QString msaClientId() const; - Status status() const { return m_status; } diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt index 2dfc78b5..fceca8e2 100644 --- a/launcher/CMakeLists.txt +++ b/launcher/CMakeLists.txt @@ -935,7 +935,7 @@ target_link_libraries(Launcher_logic ganalytics ) -target_link_libraries(Launcher_logic secrets) +target_link_libraries(Launcher_logic) add_executable(${Launcher_Name} MACOSX_BUNDLE WIN32 main.cpp ${LAUNCHER_RCS}) target_link_libraries(${Launcher_Name} Launcher_logic) diff --git a/launcher/minecraft/auth/steps/MSAStep.cpp b/launcher/minecraft/auth/steps/MSAStep.cpp index be711f7e..bc10aa4e 100644 --- a/launcher/minecraft/auth/steps/MSAStep.cpp +++ b/launcher/minecraft/auth/steps/MSAStep.cpp @@ -2,6 +2,7 @@ #include <QNetworkRequest> +#include "BuildConfig.h" #include "minecraft/auth/AuthRequest.h" #include "minecraft/auth/Parsers.h" @@ -13,7 +14,7 @@ using Activity = Katabasis::Activity; MSAStep::MSAStep(AccountData* data, Action action) : AuthStep(data), m_action(action) { OAuth2::Options opts; opts.scope = "XboxLive.signin offline_access"; - opts.clientIdentifier = APPLICATION->msaClientId(); + opts.clientIdentifier = BuildConfig.MSA_CLIENT_ID; opts.authorizationUrl = "https://login.microsoftonline.com/consumers/oauth2/v2.0/devicecode"; opts.accessTokenUrl = "https://login.microsoftonline.com/consumers/oauth2/v2.0/token"; diff --git a/launcher/ui/pages/global/AccountListPage.cpp b/launcher/ui/pages/global/AccountListPage.cpp index d3eb2655..87fcac86 100644 --- a/launcher/ui/pages/global/AccountListPage.cpp +++ b/launcher/ui/pages/global/AccountListPage.cpp @@ -37,8 +37,6 @@ #include "BuildConfig.h" -#include "Secrets.h" - AccountListPage::AccountListPage(QWidget *parent) : QMainWindow(parent), ui(new Ui::AccountListPage) { @@ -74,7 +72,7 @@ AccountListPage::AccountListPage(QWidget *parent) updateButtonStates(); // Xbox authentication won't work without a client identifier, so disable the button if it is missing - ui->actionAddMicrosoft->setVisible(Secrets::hasMSAClientID()); + ui->actionAddMicrosoft->setVisible(BuildConfig.MSA_CLIENT_ID.size() != 0); } AccountListPage::~AccountListPage() |