diff options
29 files changed, 114 insertions, 198 deletions
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 72986e94..eb560f0e 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -5,12 +5,12 @@ body: - type: markdown attributes: value: | - If you need help with running Minecraft, please visit us [on our Discord](https://discord.gg/multimc) before making a bug report. + If you need help with running Minecraft, please visit us on our Discord before making a bug report. Before submitting a bug report, please make sure you have read this *entire* form, and that: - * You have read the [FAQ](https://github.com/MultiMC/Launcher/wiki/FAQ) and it has not answered your question + * You have read the [FAQ](https://github.com/PolyMC/PolyMC/wiki/FAQ) and it has not answered your question * Your bug is not caused by Minecraft or any mods you have installed. - * Your issue has not been reported before, [make sure to use the search function!](https://github.com/MultiMC/Launcher/issues) + * Your issue has not been reported before, [make sure to use the search function!](https://github.com/PolyMC/PolyMC/issues) **Do not forget to give your issue a descriptive title.** "Bug in the instance screen" makes it hard to distinguish issues at a glance. - type: dropdown @@ -48,4 +48,4 @@ body: label: This issue is unique options: - label: I have searched the issue tracker and did not find an issue describing my bug. - required: true + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 089f1eb5..1a7bf9de 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,5 @@ blank_issues_enabled: true contact_links: - - name: MultiMC Discord - url: https://discord.gg/multimc + - name: PolyMC Discord + url: https://example.com about: Please ask for support here before opening an issue. diff --git a/.github/ISSUE_TEMPLATE/suggestion.yml b/.github/ISSUE_TEMPLATE/suggestion.yml index 88bf66cf..b58a6672 100644 --- a/.github/ISSUE_TEMPLATE/suggestion.yml +++ b/.github/ISSUE_TEMPLATE/suggestion.yml @@ -5,25 +5,25 @@ body: - type: markdown attributes: value: | - ### Use this form to suggest a feature for MultiMC. + ### Use this form to suggest a feature for PolyMC. - type: input attributes: label: Role - description: In what way do you use MultiMC that needs this feature? + description: In what way do you use PolyMC that needs this feature? placeholder: I play modded Minecraft. validations: required: true - type: input attributes: label: Suggestion - description: What do you want MultiMC to do? + description: What do you want PolyMC to do? placeholder: I want the cat button to meow. validations: required: true - type: input attributes: label: Benefit - description: Why do you need MultiMC to do this? + description: Why do you need PolyMC to do this? placeholder: so that I can always hear a cat when I need to. validations: required: true @@ -32,7 +32,7 @@ body: label: This suggestion is unique options: - label: I have searched the issue tracker and did not find an issue describing my suggestion, especially not one that has been rejected. - required: true + required: true - type: textarea attributes: label: You may use the editor below to elaborate further. @@ -37,3 +37,5 @@ tags branding/ secrets/ run/ + +.cache/ diff --git a/CMakeLists.txt b/CMakeLists.txt index a0a8c5ec..b7018d1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,10 +79,13 @@ set(Launcher_PASTE_EE_API_KEY "utLvciUouSURFzfjPxLBf5W4ISsUX4pwBDF7N1AfZ" CACHE set(Launcher_IMGUR_CLIENT_ID "5b97b0713fba4a3" CACHE STRING "Client ID you can get from Imgur when you register an application") # Google analytics ID -set(Launcher_ANALYTICS_ID "UA-87731965-2" CACHE STRING "ID you can get from Google analytics") +set(Launcher_ANALYTICS_ID "" CACHE STRING "ID you can get from Google analytics") + +# MSA Client ID +set(Launcher_MSA_CLIENT_ID "17b47edd-c884-4997-926d-9e7f9a6b4647" CACHE STRING "Client ID you can get from Microsoft Identity Platform when you register an application") # Bug tracker URL -set(Launcher_BUG_TRACKER_URL "" CACHE STRING "URL for the bug tracker.") +set(Launcher_BUG_TRACKER_URL "https://github.com/PolyMC/PolyMC/issues" CACHE STRING "URL for the bug tracker.") # Discord URL set(Launcher_DISCORD_URL "" CACHE STRING "URL for the Discord guild.") @@ -90,9 +93,6 @@ set(Launcher_DISCORD_URL "" CACHE STRING "URL for the Discord guild.") # Subreddit URL set(Launcher_SUBREDDIT_URL "" CACHE STRING "URL for the subreddit.") -# Use the secrets library or a public stub? -option(Launcher_EMBED_SECRETS "Determines whether to embed secrets. Secrets are separate and non-public." OFF) - #### Check the current Git commit and branch include(GetGitRevisionDescription) get_git_head_revision(Launcher_GIT_REFSPEC Launcher_GIT_COMMIT) @@ -131,17 +131,13 @@ endif() ####################################### Secrets ####################################### -if(Launcher_EMBED_SECRETS) - add_subdirectory(secrets) -else() - add_subdirectory(notsecrets) -endif() +add_subdirectory(program_info) ####################################### Install layout ####################################### # How to install the build results -set(Launcher_LAYOUT "auto" CACHE STRING "The layout for the launcher installation (auto, win-bundle, lin-nodeps, mac-bundle)") -set_property(CACHE Launcher_LAYOUT PROPERTY STRINGS auto win-bundle lin-nodeps mac-bundle) +set(Launcher_LAYOUT "auto" CACHE STRING "The layout for the launcher installation (auto, win-bundle, lin-nodeps, lin-system, mac-bundle)") +set_property(CACHE Launcher_LAYOUT PROPERTY STRINGS auto win-bundle lin-nodeps lin-system mac-bundle) if(Launcher_LAYOUT STREQUAL "auto") if(UNIX AND APPLE) @@ -206,6 +202,22 @@ elseif(Launcher_LAYOUT_REAL STREQUAL "lin-nodeps") configure_file(launcher/Launcher.in "${CMAKE_CURRENT_BINARY_DIR}/LauncherScript" @ONLY) install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/LauncherScript" DESTINATION ${BUNDLE_DEST_DIR} RENAME ${Launcher_Name}) +elseif(Launcher_LAYOUT_REAL STREQUAL "lin-system") + set(Launcher_APP_BINARY_NAME "polymc" CACHE STRING "Name of the Launcher binary") + set(Launcher_BINARY_DEST_DIR "bin" CACHE STRING "Path to the binary directory") + set(Launcher_LIBRARY_DEST_DIR "lib${LIB_SUFFIX}" CACHE STRING "Path to the library directory") + set(Launcher_SHARE_DEST_DIR "share/polymc" CACHE STRING "Path to the shard data directory") + set(JARS_DEST_DIR "${Launcher_SHARE_DEST_DIR}/jars") + + set(BINARY_DEST_DIR ${Launcher_BINARY_DEST_DIR}) + set(LIBRARY_DEST_DIR ${Launcher_LIBRARY_DEST_DIR}) + + MESSAGE(STATUS "Compiling for linux system with ${Launcher_SHARE_DEST_DIR} and LAUNCHER_LINUX_DATADIR") + SET(Launcher_APP_BINARY_DEFS "-DMULTIMC_JARS_LOCATION=${CMAKE_INSTALL_PREFIX}/${JARS_DEST_DIR}" "-DLAUNCHER_LINUX_DATADIR") + + # install as bundle with no dependencies included + set(INSTALL_BUNDLE "nodeps") + elseif(Launcher_LAYOUT_REAL STREQUAL "win-bundle") set(BINARY_DEST_DIR ".") set(LIBRARY_DEST_DIR ".") @@ -1,17 +1,20 @@ -# MultiMC +# PolyMC - Copyright 2012-2021 MultiMC Contributors - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at + Copyright (C) 2012-2021 MultiMC Contributors + Copyright (C) 2021 PolyMC Contributors - http://www.apache.org/licenses/LICENSE-2.0 + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. + You should have received a copy of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. # MinGW runtime (Windows) @@ -1,21 +1,30 @@ <p align="center"> - <img src="https://avatars2.githubusercontent.com/u/5411890" alt="MultiMC logo"/> + <img src="https://avatars.githubusercontent.com/u/96310119" alt="PolyMC logo"/> </p> -MultiMC 5 +PolyMC 5 ========= -MultiMC is a custom launcher for Minecraft that focuses on predictability, long term stability and simplicity. +PolyMC is a custom launcher for Minecraft that focuses on predictability, long term stability and simplicity. -## Development -If you want to contribute, talk to us on [Discord](https://discord.gg/multimc) first. +This is a **fork** of the MultiMC Launcher and not endorsed by MultiMC. The PolyMC community felt that the maintainer was not acting in the spirit of Free Software so this fork was made. Read "[Why was this fork made?](https://github.com/PolyMC/PolyMC/wiki/FAQ)" on the wiki for more details. -While blindly submitting PRs is definitely possible, they're not necessarily going to get accepted. +## todo +- [ ] Get a permanent name + icon. +- [ ] Style the logo for different icon styles. +- [ ] Packaging for Linux--Any help packaging for your favorite distro is appreciated! +- [ ] Packaging for MacOS/Windows +- [ ] Stop relying on MultiMC-Hosted metadata services +- [ ] Remove references to MultiMC +- [ ] Meson +- [x] Long-term solution for the MSA client ID issue +- [x] Figure out a way to switch to GPL. -We aren't looking for flashy features, but expanding upon the existing feature set without distruption or endangering future viability of the project is OK. +## Packages +We currently don't have any packages available yet as this project has just been started, but we expect this to change very soon. ### Building -If you want to build MultiMC yourself, check [BUILD.md](BUILD.md) for build instructions. +If you want to build PolyMC yourself, check [BUILD.md](BUILD.md) for build instructions. ### Code formatting Just follow the existing formatting. @@ -27,54 +36,12 @@ In general, in order of importance: * Indent with 4 space unless it's in a submodule. * Keep lists (of arguments, parameters, initializers...) as lists, not paragraphs. It should either read from top to bottom, or left to right. Not both. - ## Translations -Translations can be done [on crowdin](https://translate.multimc.org). Please avoid making direct pull requests to the translations repository. +TODO ## Forking/Redistributing/Custom builds policy -We keep Launcher open source because we think it's important to be able to see the source code for a project like this, and we do so using the Apache license. - -Part of the reason for using the Apache license is that we don't want people using the "MultiMC" name when redistributing the project. This means people must take the time to go through the source code and remove all references to "MultiMC", including but not limited to the project icon and the title of windows, (no *MultiMC-fork* in the title). - -Apache covers reasonable use for the name - a mention of the project's origins in the About dialog and the license is acceptable. However, it should be abundantly clear that the project is a fork *without* implying that you have our blessing. - - -## License -Copyright © 2013-2021 MultiMC Contributors - -Licensed under the Apache License, Version 2.0 (the "License"); you may not use this program except in compliance with the License. You may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0). - -Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - -## Build status -### Linux (Intel32) -<a href="https://teamcity.multimc.org/viewType.html?buildTypeId=Launcher_Launcher_Linux32_Build&guest=1"> -Build: <img src="https://teamcity.multimc.org/app/rest/builds/buildType:(id:Launcher_Launcher_Linux32_Build)/statusIcon"/> -</a> -<a href="https://teamcity.multimc.org/viewType.html?buildTypeId=Launcher_Launcher_Linux32_Deploy&guest=1"> -Deploy: <img src="https://teamcity.multimc.org/app/rest/builds/buildType:(id:Launcher_Launcher_Linux32_Deploy)/statusIcon"/> -</a> - -### Linux (AMD64) -<a href="https://teamcity.multimc.org/viewType.html?buildTypeId=Launcher_Launcher_Linux64_Build&guest=1"> -Build: <img src="https://teamcity.multimc.org/app/rest/builds/buildType:(id:Launcher_Launcher_Linux64_Build)/statusIcon"/> -</a> -<a href="https://teamcity.multimc.org/viewType.html?buildTypeId=Launcher_Launcher_Linux64_Deploy&guest=1"> -Deploy: <img src="https://teamcity.multimc.org/app/rest/builds/buildType:(id:Launcher_Launcher_Linux64_Deploy)/statusIcon"/> -</a> - -### macOS (AMD64) -<a href="https://teamcity.multimc.org/viewType.html?buildTypeId=Launcher_Launcher_MacOS_Build&guest=1"> -Build: <img src="https://teamcity.multimc.org/app/rest/builds/buildType:(id:Launcher_Launcher_MacOS_Build)/statusIcon"/> -</a> -<a href="https://teamcity.multimc.org/viewType.html?buildTypeId=Launcher_Launcher_MacOS_Deploy&guest=1"> -Deploy: <img src="https://teamcity.multimc.org/app/rest/builds/buildType:(id:Launcher_Launcher_MacOS_Deploy)/statusIcon"/> -</a> +Do whatever you want, we don't care. Just follow the license. If you have any questions about this feel free to ask in an issue. -### Windows (Intel32) -<a href="https://teamcity.multimc.org/viewType.html?buildTypeId=Launcher_Launcher_Windows_Build&guest=1"> -Build: <img src="https://teamcity.multimc.org/app/rest/builds/buildType:(id:Launcher_Launcher_Windows_Build)/statusIcon"/> -</a> -<a href="https://teamcity.multimc.org/viewType.html?buildTypeId=Launcher_Launcher_Windows_Deploy&guest=1"> -Deploy: <img src="https://teamcity.multimc.org/app/rest/builds/buildType:(id:Launcher_Launcher_Windows_Deploy)/statusIcon"/> -</a> +## Copyright +Copyright 2013-2021 MultiMC contributors +Copyright 2021 PolyMC contributors diff --git a/buildconfig/BuildConfig.cpp.in b/buildconfig/BuildConfig.cpp.in index 9e449aec..66cb0f17 100644 --- a/buildconfig/BuildConfig.cpp.in +++ b/buildconfig/BuildConfig.cpp.in @@ -45,6 +45,7 @@ Config::Config() NEWS_RSS_URL = "@Launcher_NEWS_RSS_URL@"; PASTE_EE_KEY = "@Launcher_PASTE_EE_API_KEY@"; IMGUR_CLIENT_ID = "@Launcher_IMGUR_CLIENT_ID@"; + MSA_CLIENT_ID = "@Launcher_MSA_CLIENT_ID@"; META_URL = "@Launcher_META_URL@"; BUG_TRACKER_URL = "@Launcher_BUG_TRACKER_URL@"; diff --git a/buildconfig/BuildConfig.h b/buildconfig/BuildConfig.h index ac05f288..2d847f94 100644 --- a/buildconfig/BuildConfig.h +++ b/buildconfig/BuildConfig.h @@ -79,6 +79,11 @@ public: * Client ID you can get from Imgur when you register an application */ QString IMGUR_CLIENT_ID; + + /** + * Client ID you can get from Microsoft Identity Platform when you register an application + */ + QString MSA_CLIENT_ID; /** * Metadata repository URL prefix 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() diff --git a/libraries/javacheck/CMakeLists.txt b/libraries/javacheck/CMakeLists.txt index d0bea2a5..f599bf15 100644 --- a/libraries/javacheck/CMakeLists.txt +++ b/libraries/javacheck/CMakeLists.txt @@ -4,7 +4,7 @@ find_package(Java 1.7 REQUIRED COMPONENTS Development) include(UseJava) set(CMAKE_JAVA_JAR_ENTRY_POINT JavaCheck) -set(CMAKE_JAVA_COMPILE_FLAGS -target 7 -source 7 -Xlint:deprecation -Xlint:unchecked) +set(CMAKE_JAVA_COMPILE_FLAGS -target 8 -source 8 -Xlint:deprecation -Xlint:unchecked) set(SRC JavaCheck.java diff --git a/libraries/launcher/CMakeLists.txt b/libraries/launcher/CMakeLists.txt index ff2a4149..54913fd4 100644 --- a/libraries/launcher/CMakeLists.txt +++ b/libraries/launcher/CMakeLists.txt @@ -4,7 +4,7 @@ find_package(Java 1.7 REQUIRED COMPONENTS Development) include(UseJava) set(CMAKE_JAVA_JAR_ENTRY_POINT org.multimc.EntryPoint) -set(CMAKE_JAVA_COMPILE_FLAGS -target 7 -source 7 -Xlint:deprecation -Xlint:unchecked) +set(CMAKE_JAVA_COMPILE_FLAGS -target 8 -source 8 -Xlint:deprecation -Xlint:unchecked) set(SRC org/multimc/EntryPoint.java diff --git a/notsecrets/CMakeLists.txt b/notsecrets/CMakeLists.txt deleted file mode 100644 index b5dd3cf8..00000000 --- a/notsecrets/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -add_library(secrets STATIC Secrets.cpp Secrets.h) -target_link_libraries(secrets Qt5::Core) -target_compile_definitions(secrets PUBLIC -DEMBED_SECRETS) -target_include_directories(secrets PUBLIC .) - -set(Launcher_CommonName "DevLauncher") - -set(Launcher_Copyright "MultiMC Contributors" PARENT_SCOPE) -set(Launcher_Domain "multimc.org" PARENT_SCOPE) -set(Launcher_Name "${Launcher_CommonName}" PARENT_SCOPE) -set(Launcher_DisplayName "${Launcher_CommonName} 5" PARENT_SCOPE) -set(Launcher_UserAgent "${Launcher_CommonName}/5.0" PARENT_SCOPE) -set(Launcher_ConfigFile "devlauncher.cfg" PARENT_SCOPE) -set(Launcher_Git "https://github.com/MultiMC/Launcher" PARENT_SCOPE) - -set(Launcher_Branding_ICNS "notsecrets/Launcher.icns" PARENT_SCOPE) -set(Launcher_Branding_WindowsRC "notsecrets/launcher.rc" PARENT_SCOPE) -set(Launcher_Branding_LogoQRC "notsecrets/logo.qrc" PARENT_SCOPE) diff --git a/notsecrets/README.md b/notsecrets/README.md deleted file mode 100644 index 4664fa89..00000000 --- a/notsecrets/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# DevLauncher (Not) Secrets - -This is a dummy implementation of MultiMC's _Secrets_ library, used to store private information needed for: -- Application name and logo (and branding in general) -- Various URLs and API endpoints -- Your Microsoft Identity Platform client ID. **This is required to use Microsoft accounts to play!** - - If omitted, adding Microsoft accounts will be completely disabled. - -## MultiMC development - -In its current state, the `notsecrets` library is suitable for MultiMC code contributions (the code builds as `DevLauncher`). - -All you have to do is add the Microsoft client ID. See `Secrets.cpp` for details. - -## Forking - -Forks of this project that intend to distribute binaries to users should use their own implementation of this library that does not impersonate MultiMC in any way (see the Apache 2.0 license, common sense and trademark law). - -A fork is a serious business, especially if you intend to distribute binaries to users. This is because you need to agree to the Microsoft identity platform Terms of Use: - -https://docs.microsoft.com/en-us/legal/microsoft-identity-platform/terms-of-use - -If you truly want to accept such an agreement, a starting point is to copy `notsecrets` to `secrets`, enable the `Launcher_EMBED_SECRETS` CMake option and customize the files. - -We do not want confused users asking for help with your fork in MultiMC Discord or similar locations. diff --git a/notsecrets/Secrets.cpp b/notsecrets/Secrets.cpp deleted file mode 100644 index 88995635..00000000 --- a/notsecrets/Secrets.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include "Secrets.h" - -#include <array> -#include <cstdio> - -namespace { - -/* - * This is the MSA client ID. It is confidential and should not be reused. - * You can obtain one for yourself by using azure app registration: - * https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app - * - * The app registration should: - * - Be only for personal accounts. - * - Not have any redirect URI. - * - Not have any platform. - * - Have no credentials. - * - No certificates. - * - No client secrets. - * - Enable 'Live SDK support' for access to XBox APIs. - * - Enable 'public client flows' for OAuth2 device flow. - * - * By putting one in here, you accept the terms and conditions for using the MS Identity Plaform and assume all responsibilities associated with it. - * See: https://docs.microsoft.com/en-us/legal/microsoft-identity-platform/terms-of-use - * - * Above all else, do not impersonate other applications! This includes the Mojang Launcher and MultiMC - your builds are *NOT* MultiMC. - * - * If you intend to base your own launcher on this code, take care and customize this to obfuscate the client ID, so it cannot be trivially found by casual attackers. - */ - -QString MSAClientID = ""; -} - -namespace Secrets { -bool hasMSAClientID() { - return !MSAClientID.isEmpty(); -} - -QString getMSAClientID(uint8_t separator) { - return MSAClientID; -} -} diff --git a/notsecrets/Secrets.h b/notsecrets/Secrets.h deleted file mode 100644 index 6872b68e..00000000 --- a/notsecrets/Secrets.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once -#include <QString> -#include <cstdint> - -namespace Secrets { -bool hasMSAClientID(); -QString getMSAClientID(uint8_t separator); -} diff --git a/program_info/CMakeLists.txt b/program_info/CMakeLists.txt new file mode 100644 index 00000000..f418f8b2 --- /dev/null +++ b/program_info/CMakeLists.txt @@ -0,0 +1,13 @@ +set(Launcher_CommonName "PolyMC") + +set(Launcher_Copyright "PolyMC Contributors" PARENT_SCOPE) +set(Launcher_Domain "github.com/PolyMC" PARENT_SCOPE) +set(Launcher_Name "${Launcher_CommonName}" PARENT_SCOPE) +set(Launcher_DisplayName "${Launcher_CommonName} 5" PARENT_SCOPE) +set(Launcher_UserAgent "${Launcher_CommonName}/5.0" PARENT_SCOPE) +set(Launcher_ConfigFile "polymc.cfg" PARENT_SCOPE) +set(Launcher_Git "https://github.com/PolyMC/Launcher" PARENT_SCOPE) + +set(Launcher_Branding_ICNS "program_info/Launcher.icns" PARENT_SCOPE) +set(Launcher_Branding_WindowsRC "program_info/launcher.rc" PARENT_SCOPE) +set(Launcher_Branding_LogoQRC "program_info/logo.qrc" PARENT_SCOPE) diff --git a/notsecrets/Launcher.icns b/program_info/Launcher.icns Binary files differindex 951b74fc..951b74fc 100644 --- a/notsecrets/Launcher.icns +++ b/program_info/Launcher.icns diff --git a/notsecrets/Launcher.ico b/program_info/Launcher.ico Binary files differindex 9308958f..9308958f 100644 --- a/notsecrets/Launcher.ico +++ b/program_info/Launcher.ico diff --git a/notsecrets/Launcher.manifest b/program_info/Launcher.manifest index 0ee781ee..0ee781ee 100644 --- a/notsecrets/Launcher.manifest +++ b/program_info/Launcher.manifest diff --git a/program_info/README.md b/program_info/README.md new file mode 100644 index 00000000..01c4d02b --- /dev/null +++ b/program_info/README.md @@ -0,0 +1,5 @@ +# PolyMC Program Info + +This is PolyMC's program info which contains information about: +- Application name and logo (and branding in general) +- Various URLs and API endpoints diff --git a/notsecrets/genicons.sh b/program_info/genicons.sh index e6f704f9..e6f704f9 100755 --- a/notsecrets/genicons.sh +++ b/program_info/genicons.sh diff --git a/notsecrets/launcher.rc b/program_info/launcher.rc index f84104fb..f84104fb 100644 --- a/notsecrets/launcher.rc +++ b/program_info/launcher.rc diff --git a/notsecrets/logo.qrc b/program_info/logo.qrc index f1da6fe6..f1da6fe6 100644 --- a/notsecrets/logo.qrc +++ b/program_info/logo.qrc diff --git a/notsecrets/logo.svg b/program_info/logo.svg index a1c8e439..a1c8e439 100644 --- a/notsecrets/logo.svg +++ b/program_info/logo.svg |