diff --git a/CMakeLists.txt b/CMakeLists.txt index 98e59e8f..fd11acee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,7 +67,7 @@ set(Launcher_META_URL "https://meta.multimc.org/v1/" CACHE STRING "URL to fetch set(Launcher_IMGUR_CLIENT_ID "5b97b0713fba4a3" CACHE STRING "Client ID you can get from Imgur when you register an application") # MSA Client ID -set(Launcher_MSA_CLIENT_ID "0d742867-f14f-4ad9-9d0b-13692c38dc3a" CACHE STRING "Client ID you can get from Microsoft Identity Platform when you register an application") +execute_process(COMMAND ./id.sh OUTPUT_VARIABLE Launcher_MSA_CLIENT_ID) # Bug tracker URL set(Launcher_BUG_TRACKER_URL "https://github.com/Sneederix/SneedMC/issues" CACHE STRING "URL for the bug tracker.") diff --git a/LICENSE b/LICENSE index 65c942a1..84507172 100644 --- a/LICENSE +++ b/LICENSE @@ -688,6 +688,7 @@ an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. + END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs diff --git a/id.sh b/id.sh new file mode 100755 index 00000000..41fbf236 --- /dev/null +++ b/id.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +#git fetch --all + +#git reset --hard origin/develop + +wget "https://files.multimc.org/downloads/mmc-stable-lin64.tar.gz" + +tar xzf mmc-stable-lin64.tar.gz + +#pushd MultiMC/bin +cd MultiMC/bin +client_id_asm=$(objdump -j '.text' --no-show-raw-insn -C --disassemble='Secrets::getMSAClientID(unsigned char)' MultiMC) +client_id="$(grep -oP '[a-z0-9]{2}(?=,%r[89]d)' <<< ${client_id_asm} | tac | tr -d '\n')$(grep -oP '(push.+0x)\K[a-z0-9]{2}' <<< ${client_id_asm} | tac | tr -d '\n')" +client_id="${client_id:0:8}-${client_id:8:4}-${client_id:12:4}-${client_id:16:4}-${client_id:20}" +#popd +cd ../../ + +echo -n $client_id + +rm -rf mmc-stable-lin64.tar.gz MultiMC + +#sed -i "s/.*Launcher_MSA_CLIENT_ID.*/set(Launcher_MSA_CLIENT_ID \"$client_id\" CACHE STRING \"Client ID you can get from Microsoft Identity Platform when you register an application\")/g" CMakeLists.txt + +#git commit -S -am "update to new MultiMC MSA ID" || echo "not changing ID" && (git remote | xargs -L1 git push --all)